]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wxBitmapButton initial best size determination in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Aug 2010 18:58:06 +0000 (18:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Aug 2010 18:58:06 +0000 (18:58 +0000)
This was broken during wxButton/wxBitmapButton merge and wxBitmapButton was
not created with the correct initial size if the default size was specified
when creating it any longer. Fix this by calling SetInitialSize() once again
after setting the bitmap.

See #12323.

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

docs/changes.txt
src/msw/bmpbuttn.cpp

index 9aa667e0be19e6e87a0dd9e03cf39f9cbf3a1c34..f43e582e4420fb8accd33bfa6f081130e5b61fef 100644 (file)
@@ -407,6 +407,7 @@ MSW:
 
 - Fix Cygwin 1.7 build (David Gangola).
 - Allow using wxDC::DrawText() with multiline texts.
+- Fix wxBitmapButton best size determination broken in 2.9.1.
 
 All (GUI):
 
index aea2db8f61a597910ac594920a4a9e41a5992045..217b1aec6393490e1b79ef23a1991729d54cc579 100644 (file)
@@ -136,6 +136,13 @@ bool wxBitmapButton::Create(wxWindow *parent,
 
     SetBitmapLabel(bitmap);
 
+    if ( !size.IsFullySpecified() )
+    {
+        // As our bitmap has just changed, our best size has changed as well so
+        // reset the initial size using the new value.
+        SetInitialSize(size);
+    }
+
     return true;
 }