m_label = label ;
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
- m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , "\p" , true , 0 , 0 , 1,
- kControlPushButtonProc , (long) this ) ;
+ if ( label.Find('\n' ) == wxNOT_FOUND && label.Find('\r' ) == wxNOT_FOUND)
+ {
+ verify_noerr ( CreatePushButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") , (ControlRef*) &m_macControl ) ) ;
+ }
+ else
+ {
+ ControlButtonContentInfo info ;
+ info.contentType = kControlNoContent ;
+ verify_noerr(CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds,CFSTR(""),
+ kControlBevelButtonLargeBevel , kControlBehaviorPushbutton , &info , 0 , 0 , 0 , (ControlRef*) &m_macControl ) ) ;
+ }
wxASSERT_MSG( (ControlRef) m_macControl != NULL , wxT("No valid mac control") ) ;
MacPostControlCreate(pos,size) ;
ProcessCommand (event);
}
-void wxButton::MacHandleControlClick( WXWidget WXUNUSED(control) , wxInt16 controlpart , bool WXUNUSED(mouseStillDown) )
+wxInt32 wxButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) )
{
- if ( controlpart != kControlNoPart )
- {
- wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId );
- event.SetEventObject(this);
- ProcessCommand(event);
- }
+ wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId );
+ event.SetEventObject(this);
+ ProcessCommand(event);
+ return noErr ;
}