]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't reset the best size to wxDefaultSize unless we have a bitmap, otherwise
authorJulian Smart <julian@anthemion.co.uk>
Wed, 25 Oct 2006 09:03:45 +0000 (09:03 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 25 Oct 2006 09:03:45 +0000 (09:03 +0000)
an explicit size is ignored

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

src/univ/button.cpp

index 39ac1eb1b84006aaa5ac22e51dd8f5cbbeb829d0..f04966be286c83a4632741964eeb9bf3938f5b55 100644 (file)
@@ -126,8 +126,11 @@ bool wxButton::Create(wxWindow *parent,
         return false;
 
     SetLabel(label);
         return false;
 
     SetLabel(label);
-    SetImageLabel(bitmap);
-    // SetBestSize(size); -- called by SetImageLabel()
+
+    if (bitmap.Ok())
+        SetImageLabel(bitmap); // SetBestSize called by SetImageLabel()
+    else
+        SetBestSize(size);
 
     CreateInputHandler(wxINP_HANDLER_BUTTON);
 
 
     CreateInputHandler(wxINP_HANDLER_BUTTON);