]> git.saurik.com Git - wxWidgets.git/blame - src/osx/carbon/checkbox.cpp
use WXSIZEOF(x) instead of sizeof(x)/sizeof(x[0]) (closes #10701)
[wxWidgets.git] / src / osx / carbon / checkbox.cpp
CommitLineData
489468fe 1/////////////////////////////////////////////////////////////////////////////
524c47aa 2// Name: src/osx/carbon/checkbox.cpp
489468fe
SC
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"
1f0c8f31 17#include "wx/osx/uma.h"
489468fe 18
524c47aa
SC
19wxWidgetImplType* wxWidgetImpl::CreateCheckBox( wxWindowMac* wxpeer,
20 wxWindowMac* parent,
a4fec5b4
SC
21 wxWindowID WXUNUSED(id),
22 const wxString& WXUNUSED(label),
524c47aa
SC
23 const wxPoint& pos,
24 const wxSize& size,
25 long style,
a4fec5b4 26 long WXUNUSED(extraStyle))
489468fe 27{
524c47aa
SC
28 Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
29 wxMacControl* peer = new wxMacControl(wxpeer) ;
489468fe 30
524c47aa
SC
31 verify_noerr( CreateCheckBoxControl(MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds ,
32 CFSTR("") , 0 , false , peer->GetControlRefAddr() ) );
489468fe
SC
33 SInt32 maxValue = 1 /* kControlCheckboxCheckedValue */;
34 if (style & wxCHK_3STATE)
35 maxValue = 2 /* kControlCheckboxMixedValue */;
36
524c47aa 37 peer->SetMaximum( maxValue ) ;
489468fe 38
524c47aa 39 return peer;
489468fe
SC
40}
41
42#endif