X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c9ceb4820f5b58f69c7d3c7c6dd969c873b63b2..5fc01d1326a34223746546326a7f616df8bfa991:/src/mac/carbon/checkbox.cpp?ds=sidebyside diff --git a/src/mac/carbon/checkbox.cpp b/src/mac/carbon/checkbox.cpp index dbf5b7d4e2..72993d6081 100644 --- a/src/mac/carbon/checkbox.cpp +++ b/src/mac/carbon/checkbox.cpp @@ -31,15 +31,12 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxValidator& validator, const wxString& name) { + m_macIsUserPane = FALSE ; + if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) ) return false; - m_style = style; - - Rect bounds ; - Str255 title ; - - MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; + m_label = label ; SInt16 maxValue = 1 /* kControlCheckboxCheckedValue */; if (style & wxCHK_3STATE) @@ -47,10 +44,12 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, maxValue = 2 /* kControlCheckboxMixedValue */; } - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , maxValue, + + Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; + m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , "\p" , true , 0 , 0 , maxValue, kControlCheckBoxProc , (long) this ) ; - MacPostControlCreate() ; + MacPostControlCreate(pos,size) ; return TRUE; } @@ -87,12 +86,12 @@ void wxCheckBox::Command (wxCommandEvent & event) wxCheckBoxState wxCheckBox::DoGet3StateValue() const { - return (wxCheckBoxState) ::GetControl32BitValue( (ControlHandle) m_macControl ); + return (wxCheckBoxState) ::GetControl32BitValue( (ControlRef) m_macControl ); } void wxCheckBox::DoSet3StateValue(wxCheckBoxState val) { - ::SetControl32BitValue( (ControlHandle) m_macControl , (int) val) ; + ::SetControl32BitValue( (ControlRef) m_macControl , (int) val) ; MacRedrawControl() ; }