]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/checkbox.cpp
1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "checkbox.h"
16 #include "wx/checkbox.h"
18 IMPLEMENT_DYNAMIC_CLASS(wxCheckBox
, wxControl
)
19 IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox
, wxCheckBox
)
21 #include <wx/mac/uma.h>
23 // Single check box item
24 bool wxCheckBox::Create(wxWindow
*parent
, wxWindowID id
, const wxString
& label
,
26 const wxSize
& size
, long style
,
27 const wxValidator
& validator
,
33 MacPreControlCreate( parent
, id
, label
, pos
, size
,style
, validator
, name
, &bounds
, title
) ;
35 m_macControl
= UMANewControl( parent
->GetMacRootWindow() , &bounds
, title
, true , 0 , 0 , 1,
36 kControlCheckBoxProc
, (long) this ) ;
38 MacPostControlCreate() ;
43 void wxCheckBox::SetValue(bool val
)
45 ::SetControlValue( m_macControl
, val
) ;
48 bool wxCheckBox::GetValue() const
50 return ::GetControlValue( m_macControl
) ;
53 void wxCheckBox::Command (wxCommandEvent
& event
)
55 SetValue ((event
.GetInt() != 0));
56 ProcessCommand (event
);
59 void wxCheckBox::MacHandleControlClick( ControlHandle control
, SInt16 controlpart
)
61 SetValue( !GetValue() ) ;
65 bool wxBitmapCheckBox::Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*label
,
67 const wxSize
& size
, long style
,
68 const wxValidator
& validator
,
72 SetValidator(validator
);
73 m_windowStyle
= style
;
75 if (parent
) parent
->AddChild(this);
78 m_windowId
= NewControlId();
82 // TODO: Create the bitmap checkbox
87 void wxBitmapCheckBox::SetLabel(const wxBitmap
*bitmap
)
92 void wxBitmapCheckBox::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
94 wxControl::SetSize( x
, y
, width
, height
, sizeFlags
) ;
97 void wxBitmapCheckBox::SetValue(bool val
)
102 bool wxBitmapCheckBox::GetValue() const