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