]> git.saurik.com Git - wxWidgets.git/commitdiff
Simplify wxRect construction at the wxPoint(0,0) with given size.
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 5 Nov 2004 19:54:29 +0000 (19:54 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 5 Nov 2004 19:54:29 +0000 (19:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/rect.tex
include/wx/gdicmn.h
src/common/gdicmn.cpp
src/univ/themes/gtk.cpp

index 3a55f65f9b4703c679772ef29d5cbed6839bd460..4ea50eb7d54129f5b76734f93ecf586fead9bfb4 100644 (file)
@@ -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}
index 83858f5c855a56eac71d56a8883386037c001854..7741ee467e5d4276b39d9acd9cfd46ff12ed75f4 100644 (file)
@@ -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
 
index 8edaa3ecf2781160687ab685d7d2e4417e02665e..58f901a085e271587d47d4f55ee8dc2899705b16 100644 (file)
@@ -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();
 
index 098e4d0960409c34fbe6f7da8eea87630c0ea95c..ec14525c64a6082df14a96a7c35695ee71022391 100644 (file)
@@ -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++ )