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() ) ;
62 wxCommandEvent
event(wxEVT_COMMAND_CHECKBOX_CLICKED
, m_windowId
);
63 event
.SetInt(GetValue());
64 event
.SetEventObject(this);
65 ProcessCommand(event
);
69 bool wxBitmapCheckBox::Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*label
,
71 const wxSize
& size
, long style
,
72 const wxValidator
& validator
,
76 SetValidator(validator
);
77 m_windowStyle
= style
;
79 if (parent
) parent
->AddChild(this);
82 m_windowId
= NewControlId();
86 // TODO: Create the bitmap checkbox
91 void wxBitmapCheckBox::SetLabel(const wxBitmap
*bitmap
)
96 void wxBitmapCheckBox::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
98 wxControl::SetSize( x
, y
, width
, height
, sizeFlags
) ;
101 void wxBitmapCheckBox::SetValue(bool val
)
106 bool wxBitmapCheckBox::GetValue() const