Use wxAnyButton's DoGetBestSize for toggle buttons

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-06-16 00:43:22 +00:00
parent bc927c9a8c
commit fc85e0db36
2 changed files with 0 additions and 28 deletions

View 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)
};

View 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