X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2646f485163f410baaad5bcf49028c604a352d19..db28a493dd741599370357dc56f88037a2767ec9:/src/mac/classic/button.cpp?ds=sidebyside diff --git a/src/mac/classic/button.cpp b/src/mac/classic/button.cpp index 82e4e34c5f..681d761703 100644 --- a/src/mac/classic/button.cpp +++ b/src/mac/classic/button.cpp @@ -9,18 +9,13 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "button.h" -#endif - #include "wx/defs.h" #include "wx/button.h" #include "wx/panel.h" +#include "wx/stockitem.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl) -#endif #include "wx/mac/uma.h" // Button @@ -28,12 +23,16 @@ IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl) static const int kMacOSXHorizontalBorder = 2 ; static const int kMacOSXVerticalBorder = 4 ; -bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, +bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& lbl, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { + wxString label(lbl); + if (label.empty() && wxIsStockID(id)) + label = wxGetStockLabel(id); + if ( !wxButtonBase::Create(parent, id, pos, size, style, validator, name) ) return false; @@ -48,7 +47,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, + m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, kControlPushButtonProc , (long) this ) ; wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;