]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement GetMinSize for wxMotif wxButton. Helps solfing sizing
authorMattia Barbon <mbarbon@cpan.org>
Sun, 28 Aug 2005 07:51:59 +0000 (07:51 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Sun, 28 Aug 2005 07:51:59 +0000 (07:51 +0000)
problems in generic common dialogs.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/motif/button.h
src/motif/button.cpp

index dc2feeb89d1839730ea8f9be98083b45d5d68cb9..20978e6ae0a6595118af1a73ec90b3ed7ad1acd7 100644 (file)
@@ -49,7 +49,9 @@ public:
     // Implementation
 private:
     virtual wxSize DoGetBestSize() const;
+    virtual wxSize GetMinSize() const;
     wxSize OldGetBestSize() const;
+    wxSize OldGetMinSize() const;
     void SetDefaultShadowThicknessAndResize();
 };
 
index 56494fcfeefb9531b37f306d01e61b023dbcd3d0..65349d549d56be552a271c5cbd8a7a43d4d05c35 100644 (file)
@@ -123,6 +123,7 @@ void wxButton::SetDefaultShadowThicknessAndResize()
     if( best != actual )
         SetSize( best );
 #endif
+    InvalidateBestSize();
 }
 
 
@@ -182,6 +183,19 @@ wxSize wxButton::DoGetBestSize() const
     return best;
 }
 
+wxSize wxButton::GetMinSize() const
+{
+    if( wxMotifLargeButtons() )
+        return OldGetMinSize();
+
+    return DoGetBestSize();
+}
+
+wxSize wxButton::OldGetMinSize() const
+{
+    return OldGetBestSize();
+}
+
 wxSize wxButton::OldGetBestSize() const
 {
     Dimension xmargin, ymargin, highlight, shadow, defThickness;
@@ -199,6 +213,7 @@ wxSize wxButton::OldGetBestSize() const
 
     int margin = highlight * 2 +
         ( defThickness ? ( ( shadow + defThickness ) * 4 ) : ( shadow * 2 ) );
+
     wxSize best( x + xmargin * 2 + margin,
                  y + ymargin * 2 + margin );