]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/anybutton.cpp
avoid setting initial position if it was not specified, broken in r70734
[wxWidgets.git] / src / osx / carbon / anybutton.cpp
index 36a642a698ed8ba41c2e0629b44a502a8d166b55..0788b23c843c85c987e66c76a2f7f104a4cabb16 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxAnyButton
 // Author:      Stefan Csomor
 // Created:     1998-01-01 (extracted from button.cpp)
-// RCS-ID:      $Id: anybutton.cpp 67230 2011-03-18 14:20:12Z SC $
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -53,7 +52,17 @@ wxSize wxAnyButton::DoGetBestSize() const
     GetPeer()->GetBestRect( &bestsize ) ;
 
     int wBtn;
-    if ( EmptyRect( &bestsize ) || ( GetWindowStyle() & wxBU_EXACTFIT) )
+    if ( GetBitmapLabel().IsOk() )
+    {
+        sz.x = bestsize.right - bestsize.left ;
+        sz.y = bestsize.bottom - bestsize.top ;
+        sz.x  = sz.x  + MacGetLeftBorderSize() +
+        MacGetRightBorderSize();
+        sz.y = sz.y + MacGetTopBorderSize() +
+        MacGetBottomBorderSize();
+        wBtn = sz.x;
+    }
+    else if ( EmptyRect( &bestsize ) || ( GetWindowStyle() & wxBU_EXACTFIT) )
     {
         Point bounds;