X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b4354db179f5b9f3107cc532bb5232deccab90d0..35f95708e3aee076d779ba31c6b871afb5c50daf:/src/osx/tglbtn_osx.cpp diff --git a/src/osx/tglbtn_osx.cpp b/src/osx/tglbtn_osx.cpp index 8a5e348bdc..abb3c193d6 100644 --- a/src/osx/tglbtn_osx.cpp +++ b/src/osx/tglbtn_osx.cpp @@ -31,7 +31,7 @@ // ---------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl) -wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ); +wxDEFINE_EVENT( wxEVT_TOGGLEBUTTON, wxCommandEvent ); // ============================================================================ // implementation @@ -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 ) ; @@ -106,7 +94,7 @@ void wxToggleButton::Command(wxCommandEvent & event) 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); @@ -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