// ----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl)
-wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent );
+wxDEFINE_EVENT( wxEVT_TOGGLEBUTTON, wxCommandEvent );
// ============================================================================
// implementation
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 ) ;
bool wxToggleButton::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
- wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, m_windowId);
+ wxCommandEvent event(wxEVT_TOGGLEBUTTON, m_windowId);
event.SetInt(GetValue());
event.SetEventObject(this);
ProcessCommand(event);
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