1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        src/osx/carbon/checkbox.cpp
3 // Purpose:     wxCheckBox
4 // Author:      Stefan Csomor
5 // Modified by:
6 // Created:     04/01/98
7 // Copyright:   (c) Stefan Csomor
8 // Licence:       wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10 
11 #include "wx/wxprec.h"
12 
13 #if wxUSE_CHECKBOX
14 
15 #include "wx/checkbox.h"
16 #include "wx/osx/uma.h"
17 
CreateCheckBox(wxWindowMac * wxpeer,wxWindowMac * parent,wxWindowID WXUNUSED (id),const wxString & WXUNUSED (label),const wxPoint & pos,const wxSize & size,long style,long WXUNUSED (extraStyle))18 wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
19                                     wxWindowMac* parent,
20                                     wxWindowID WXUNUSED(id),
21                                     const wxString& WXUNUSED(label),
22                                     const wxPoint& pos,
23                                     const wxSize& size,
24                                     long style,
25                                     long WXUNUSED(extraStyle))
26 {
27     Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
28     wxMacControl* peer = new wxMacControl(wxpeer) ;
29 
30     verify_noerr( CreateCheckBoxControl(MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds ,
31         CFSTR("") , 0 , false , peer->GetControlRefAddr() ) );
32     SInt32 maxValue = 1 /* kControlCheckboxCheckedValue */;
33     if (style & wxCHK_3STATE)
34         maxValue = 2 /* kControlCheckboxMixedValue */;
35 
36     peer->SetMaximum( maxValue ) ;
37 
38     return peer;
39 }
40 
41 #endif
42