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