]> git.saurik.com Git - wxWidgets.git/commitdiff
undid last change to wxBitmapButton::GetBestSize(), in fact it doesn't make sense...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 28 Oct 2004 22:43:14 +0000 (22:43 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 28 Oct 2004 22:43:14 +0000 (22:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/bbutton.tex
src/msw/bmpbuttn.cpp

index afc990aefc45aefae6d00a0e561ebe7022909863..b6f69b02f0f3716439b1e9795e6858ba5c1af845 100644 (file)
@@ -232,7 +232,6 @@ wxMSW:
 
 - fixed enhanced metafiles loading from files (Andreas Goebel)
 - wxRadioButtons no longer have to be consecutive in a group
-- fixed wxBU_EXACTFIT handling in wxBitmapButton
 
 
 2.5.3
index c66953f69ae6c5e4de1509e2157f635411dc532b..3aed0a9138e638f49f4e7ae4f1ba059a39bc0b6d 100644 (file)
@@ -36,6 +36,10 @@ provided bitmaps. WIN32 only.}
 \twocolitem{\windowstyle{wxBU\_BOTTOM}}{Aligns the bitmap label to the bottom of the button. WIN32 only.}
 \end{twocollist}
 
+Note that \windowstyle{wxBU\_EXACTFIT} supported by 
+\helpref{wxButton}{wxbutton} is \emph{not} used by this class as bitmap buttons
+don't have any minimal standard size by default.
+
 See also \helpref{window styles overview}{windowstyles}.
 
 \wxheading{Event handling}
index af0014cf671e8f0627c46b0bea3bc240b67e6d11..e1be21611f2270c55b891b3106919f67fcb30a17 100644 (file)
@@ -492,26 +492,14 @@ void wxBitmapButton::SetDefault()
 
 wxSize wxBitmapButton::DoGetBestSize() const
 {
-    wxSize best;
-    if (m_bmpNormal.Ok())
+    if ( m_bmpNormal.Ok() )
     {
-        best.x = m_bmpNormal.GetWidth() + 2*m_marginX;
-        best.y = m_bmpNormal.GetHeight() + 2*m_marginY;
+        return wxSize(m_bmpNormal.GetWidth() + 2*m_marginX,
+                      m_bmpNormal.GetHeight() + 2*m_marginY);
     }
 
-    // all buttons have at least the standard size unless the user explicitly
-    // wants them to be of smaller size and used wxBU_EXACTFIT style when
-    // creating the button
-    if ( !HasFlag(wxBU_EXACTFIT) )
-    {
-        wxSize sz = GetDefaultSize();
-        if ( best.x < sz.x )
-            best.x = sz.x;
-        if ( best.y < sz.y )
-            best.y = sz.y;
-    }
-
-    return best;
+    // no idea what our best size should be, defer to the base class
+    return wxBitmapButtonBase::DoGetBestSize();
 }
 
 #endif // wxUSE_BMPBUTTON