diff --git a/docs/latex/wx/rect.tex b/docs/latex/wx/rect.tex index 3a55f65f9b..4ea50eb7d5 100644 --- a/docs/latex/wx/rect.tex +++ b/docs/latex/wx/rect.tex @@ -34,6 +34,10 @@ Creates a wxRect object from top-left and bottom-right points. Creates a wxRect object from position and size values. +\func{}{wxRect}{\param{const wxSize\&}{ size}} + +Creates a wxRect object from size values at the origin. + \membersection{wxRect::x}\label{wxrectx} \member{int}{x} diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 83858f5c85..7741ee467e 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -314,6 +314,7 @@ public: { } wxRect(const wxPoint& topLeft, const wxPoint& bottomRight); wxRect(const wxPoint& pos, const wxSize& size); + wxRect(const wxSize& size); // default copy ctor and assignment operators ok diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 8edaa3ecf2..58f901a085 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -125,6 +125,12 @@ wxRect::wxRect(const wxPoint& point, const wxSize& size) width = size.x; height = size.y; } +wxRect::wxRect(const wxSize& size) +{ + x = 0; y = 0; + width = size.x; height = size.y; +} + bool wxRect::operator==(const wxRect& rect) const { return ((x == rect.x) && @@ -854,7 +860,7 @@ wxFont *wxFontList::FindOrCreateFont(int pointSize, // a different font if we create it with empty facename, but it is // still better than never matching anything in the cache at all // in this case - if ( same && !facename.IsEmpty() ) + if ( same && !facename.empty() ) { const wxString& fontFace = font->GetFaceName(); diff --git a/src/univ/themes/gtk.cpp b/src/univ/themes/gtk.cpp index 098e4d0960..ec14525c64 100644 --- a/src/univ/themes/gtk.cpp +++ b/src/univ/themes/gtk.cpp @@ -2266,7 +2266,7 @@ void wxGTKRenderer::InitComboBitmaps() wxCONTROL_DISABLED, }; - wxRect rect(wxPoint(0, 0), sizeArrow); + wxRect rect(sizeArrow); wxMemoryDC dc; for ( n = ComboState_Normal; n < ComboState_Max; n++ )