1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "checkbox.h"
16 #include "wx/checkbox.h"
18 #if !USE_SHARED_LIBRARY
19 IMPLEMENT_DYNAMIC_CLASS(wxCheckBox
, wxControl
)
20 IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox
, wxCheckBox
)
23 #include <wx/mac/uma.h>
25 // Single check box item
26 bool wxCheckBox::Create(wxWindow
*parent
, wxWindowID id
, const wxString
& label
,
28 const wxSize
& size
, long style
,
29 const wxValidator
& validator
,
35 MacPreControlCreate( parent
, id
, label
, pos
, size
,style
, validator
, name
, &bounds
, title
) ;
37 m_macControl
= UMANewControl( parent
->GetMacRootWindow() , &bounds
, title
, true , 0 , 0 , 1,
38 kControlCheckBoxProc
, (long) this ) ;
40 MacPostControlCreate() ;
45 void wxCheckBox::SetValue(bool val
)
47 ::SetControlValue( m_macControl
, val
) ;
50 bool wxCheckBox::GetValue() const
52 return ::GetControlValue( m_macControl
) ;
55 void wxCheckBox::Command (wxCommandEvent
& event
)
57 SetValue ((event
.GetInt() != 0));
58 ProcessCommand (event
);
61 void wxCheckBox::MacHandleControlClick( ControlHandle control
, SInt16 controlpart
)
63 SetValue( !GetValue() ) ;
64 wxCommandEvent
event(wxEVT_COMMAND_CHECKBOX_CLICKED
, m_windowId
);
65 event
.SetInt(GetValue());
66 event
.SetEventObject(this);
67 ProcessCommand(event
);
71 bool wxBitmapCheckBox::Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*label
,
73 const wxSize
& size
, long style
,
74 const wxValidator
& validator
,
78 SetValidator(validator
);
79 m_windowStyle
= style
;
81 if (parent
) parent
->AddChild(this);
84 m_windowId
= NewControlId();
88 // TODO: Create the bitmap checkbox
93 void wxBitmapCheckBox::SetLabel(const wxBitmap
*bitmap
)
98 void wxBitmapCheckBox::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
100 wxControl::SetSize( x
, y
, width
, height
, sizeFlags
) ;
103 void wxBitmapCheckBox::SetValue(bool val
)
108 bool wxBitmapCheckBox::GetValue() const