X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1169a91932273bc84c23ed9dbd0a2da064d59d66..5fc01d1326a34223746546326a7f616df8bfa991:/src/mac/carbon/checkbox.cpp diff --git a/src/mac/carbon/checkbox.cpp b/src/mac/carbon/checkbox.cpp index e9248b9993..72993d6081 100644 --- a/src/mac/carbon/checkbox.cpp +++ b/src/mac/carbon/checkbox.cpp @@ -24,10 +24,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox) #include "wx/mac/uma.h" -wxCheckBoxBase::wxCheckBoxBase() -{ -} - // Single check box item bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, @@ -35,13 +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; - 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) @@ -49,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; } @@ -89,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() ; }