]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxAnyButton's DoGetBestSize for toggle buttons
authorRobin Dunn <robin@alldunn.com>
Thu, 16 Jun 2011 00:43:22 +0000 (00:43 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 16 Jun 2011 00:43:22 +0000 (00:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/tglbtn.h
src/osx/tglbtn_osx.cpp

index 0a03538cdc0284cee68d2d7517d1a1d578180e2d..b262d60a7ee1f90ec01eaff8b4de5634cbbbb08a 100644 (file)
@@ -47,7 +47,6 @@ public:
 
 protected:
     virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
-    virtual wxSize DoGetBestSize() const;
 
 private:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton)
@@ -79,9 +78,6 @@ public:
                 const wxValidator& validator = wxDefaultValidator,
                 const wxString& name = wxCheckBoxNameStr);
 
-protected:
-    virtual wxSize DoGetBestSize() const;
-
 private:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapToggleButton)
 };
index 8a5e348bdcecb4581fe121fc7a49d730e411d044..5eb31a43bca535a833d04f58b700b48a69691583 100644 (file)
@@ -76,18 +76,6 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
   return TRUE;
 }
 
-wxSize wxToggleButton::DoGetBestSize() const
-{
-    int wBtn = 70 ;
-    int hBtn = 20 ;
-
-    int lBtn = m_label.Length() * 8 + 12 ;
-    if (lBtn > wBtn)
-        wBtn = lBtn;
-
-    return wxSize ( wBtn , hBtn ) ;
-}
-
 void wxToggleButton::SetValue(bool val)
 {
     GetPeer()->SetValue( val ) ;
@@ -143,17 +131,5 @@ bool wxBitmapToggleButton::Create(wxWindow *parent, wxWindowID id,
     return TRUE;
 }
 
-wxSize wxBitmapToggleButton::DoGetBestSize() const
-{
-    if (!GetBitmap().IsOk())
-       return wxSize(20,20);
-
-    wxSize best;
-    best.x = GetBitmap().GetWidth() + 2 * m_marginX;
-    best.y = GetBitmap().GetHeight() + 2 * m_marginY;
-
-    return best;
-}
-
 #endif // wxUSE_TOGGLEBTN