Add the same margin to wxBitmapToggleButton as to wxBitmapButton

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2009-01-08 13:56:03 +00:00
parent 844cada162
commit 11a449ac9b
2 changed files with 12 additions and 2 deletions

View File

@@ -51,6 +51,9 @@ public:
private:
wxBitmap m_bitmap;
int m_marginX,
m_marginY;
protected:
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
virtual wxSize DoGetBestSize() const;

View File

@@ -115,6 +115,9 @@ bool wxBitmapToggleButton::Create(wxWindow *parent, wxWindowID id,
m_bitmap = label;
m_marginX =
m_marginY = wxDEFAULT_BUTTON_MARGIN;
if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
return false;
@@ -129,8 +132,12 @@ wxSize wxBitmapToggleButton::DoGetBestSize() const
{
if (!m_bitmap.IsOk())
return wxSize(20,20);
return wxSize ( m_bitmap.GetWidth()+6, m_bitmap.GetHeight()+6 ) ;
wxSize best;
best.x = m_bitmap.GetWidth() + 2 * m_marginX;
best.y = m_bitmap.GetHeight() + 2 * m_marginY;
return best;
}
void wxBitmapToggleButton::SetValue(bool val)