]> git.saurik.com Git - wxWidgets.git/commitdiff
respect wxBU_EXACTFIT
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Jul 2001 14:03:49 +0000 (14:03 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Jul 2001 14:03:49 +0000 (14:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/univ/themes/gtk.cpp
src/univ/themes/win32.cpp

index 785866b58ec2de22f95cff589a5bef9955e7a0b9..fe2695813a46f91a6824ab9f18a7b29e11c63006 100644 (file)
@@ -2282,14 +2282,17 @@ void wxGTKRenderer::AdjustSize(wxSize *size, const wxWindow *window)
 {
     if ( wxDynamicCast(window, wxButton) )
     {
-        // TODO: this is ad hoc...
-        size->x += 3*window->GetCharWidth();
-        wxCoord minBtnHeight = 18;
-        if ( size->y < minBtnHeight )
-            size->y = minBtnHeight;
-
-        // button border width
-        size->y += 4;
+        if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) )
+        {
+            // TODO: this is ad hoc...
+            size->x += 3*window->GetCharWidth();
+            wxCoord minBtnHeight = 18;
+            if ( size->y < minBtnHeight )
+                size->y = minBtnHeight;
+
+            // button border width
+            size->y += 4;
+        }
     }
     else if ( wxDynamicCast(window, wxScrollBar) )
     {
index 037c9cd2cc6e8f15b7736fa186cd42c61eaa1a2b..716bcc0ec997ef3ab623b257b6d5247c4d0e11f7 100644 (file)
@@ -255,6 +255,7 @@ public:
                                    const wxMenuGeometryInfo& geomInfo);
 #endif
     virtual void GetComboBitmaps(wxBitmap *bmpNormal,
+                                 wxBitmap *bmpFocus,
                                  wxBitmap *bmpPressed,
                                  wxBitmap *bmpDisabled);
 
@@ -2759,6 +2760,7 @@ wxWin32Renderer::GetMenuGeometry(wxWindow *WXUNUSED(win),
 // ----------------------------------------------------------------------------
 
 void wxWin32Renderer::GetComboBitmaps(wxBitmap *bmpNormal,
+                                      wxBitmap *bmpFocus,
                                       wxBitmap *bmpPressed,
                                       wxBitmap *bmpDisabled)
 {
@@ -3008,19 +3010,17 @@ void wxWin32Renderer::AdjustSize(wxSize *size, const wxWindow *window)
 #if wxUSE_BUTTON
     if ( wxDynamicCast(window, wxButton) )
     {
-        // TODO
-        size->x += 3*window->GetCharWidth();
-#if 0 // do allow creating small buttons if wanted
-        wxSize sizeDef = wxButton::GetDefaultSize();
-        if ( size->x < sizeDef.x )
-            size->x = sizeDef.x;
-#endif // 0
-
-        wxCoord heightBtn = (11*(window->GetCharHeight() + 8))/10;
-        if ( size->y < heightBtn - 8 )
-            size->y = heightBtn;
-        else
-            size->y += 9;
+        if ( !(window->GetWindowStyle() & wxBU_EXACTFIT) )
+        {
+            // TODO: don't harcode all this
+            size->x += 3*window->GetCharWidth();
+
+            wxCoord heightBtn = (11*(window->GetCharHeight() + 8))/10;
+            if ( size->y < heightBtn - 8 )
+                size->y = heightBtn;
+            else
+                size->y += 9;
+        }
 
         // no border width adjustments for buttons
         return;