#include "wx/button.h"
#include "wx/panel.h"
+#include "wx/stockitem.h"
#if !USE_SHARED_LIBRARY
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;
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") ) ;