- m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , "\p" , true , 0 , 0 , 1,
- kControlPushButtonProc , (long) this ) ;
- wxASSERT_MSG( (ControlRef) m_macControl != NULL , wxT("No valid mac control") ) ;
-
- MacPostControlCreate(pos,size) ;
-
- return TRUE;
+ m_peer = new wxMacControl(this) ;
+ if ( id == wxID_HELP )
+ {
+ ControlButtonContentInfo info ;
+ info.contentType = kControlContentIconRef ;
+ GetIconRef(kOnSystemDisk, kSystemIconsCreator, kHelpIcon, &info.u.iconRef);
+ verify_noerr ( CreateRoundButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , kControlRoundButtonNormalSize ,
+ &info , m_peer->GetControlRefAddr() ) );
+ }
+ else if ( label.Find('\n' ) == wxNOT_FOUND && label.Find('\r' ) == wxNOT_FOUND)
+ {
+#if TARGET_API_MAC_OSX
+ // Button height is static in Mac, can't be changed, so we need to force it here
+ if ( GetWindowVariant() == wxWINDOW_VARIANT_NORMAL || GetWindowVariant() == wxWINDOW_VARIANT_LARGE )
+ {
+ bounds.bottom = bounds.top + 20 ;
+ m_maxHeight = 20 ;
+ }
+ else if ( GetWindowVariant() == wxWINDOW_VARIANT_SMALL )
+ {
+ bounds.bottom = bounds.top + 17 ;
+ m_maxHeight = 17 ;
+ }
+ else if ( GetWindowVariant() == wxWINDOW_VARIANT_MINI )
+ {
+ bounds.bottom = bounds.top + 15 ;
+ m_maxHeight = 15 ;
+ }
+#endif
+
+ verify_noerr ( CreatePushButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") , m_peer->GetControlRefAddr() ) );
+ }
+ else
+ {
+ ControlButtonContentInfo info ;
+ info.contentType = kControlNoContent ;
+ verify_noerr(CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds, CFSTR(""),
+ kControlBevelButtonLargeBevel , kControlBehaviorPushbutton , &info , 0 , 0 , 0 , m_peer->GetControlRefAddr() ) );
+ }
+
+ wxASSERT_MSG( m_peer != NULL && m_peer->Ok() , wxT("No valid Mac control") ) ;
+
+ MacPostControlCreate(pos, size) ;
+
+ return true;