1 /////////////////////////////////////////////////////////////////////////////
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "checkbox.h"
18 #include "wx/checkbox.h"
20 #if !USE_SHARED_LIBRARY
21 IMPLEMENT_DYNAMIC_CLASS(wxCheckBox
, wxControl
)
22 IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox
, wxCheckBox
)
25 #include "wx/mac/uma.h"
27 // Single check box item
28 bool wxCheckBox::Create(wxWindow
*parent
, wxWindowID id
, const wxString
& label
,
30 const wxSize
& size
, long style
,
31 const wxValidator
& validator
,
37 MacPreControlCreate( parent
, id
, label
, pos
, size
,style
, validator
, name
, &bounds
, title
) ;
39 m_macControl
= ::NewControl( parent
->GetMacRootWindow() , &bounds
, title
, false , 0 , 0 , 1,
40 kControlCheckBoxProc
, (long) this ) ;
42 MacPostControlCreate() ;
47 void wxCheckBox::SetValue(bool val
)
49 ::SetControlValue( m_macControl
, val
) ;
52 bool wxCheckBox::GetValue() const
54 return ::GetControlValue( m_macControl
) ;
57 void wxCheckBox::Command (wxCommandEvent
& event
)
59 SetValue ((event
.GetInt() != 0));
60 ProcessCommand (event
);
63 void wxCheckBox::MacHandleControlClick( ControlHandle control
, SInt16 controlpart
)
65 SetValue( !GetValue() ) ;
66 wxCommandEvent
event(wxEVT_COMMAND_CHECKBOX_CLICKED
, m_windowId
);
67 event
.SetInt(GetValue());
68 event
.SetEventObject(this);
69 ProcessCommand(event
);
73 bool wxBitmapCheckBox::Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*label
,
75 const wxSize
& size
, long style
,
76 const wxValidator
& validator
,
80 SetValidator(validator
);
81 m_windowStyle
= style
;
83 if (parent
) parent
->AddChild(this);
86 m_windowId
= NewControlId();
90 // TODO: Create the bitmap checkbox
95 void wxBitmapCheckBox::SetLabel(const wxBitmap
*bitmap
)
100 void wxBitmapCheckBox::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
102 wxControl::SetSize( x
, y
, width
, height
, sizeFlags
) ;
105 void wxBitmapCheckBox::SetValue(bool val
)
110 bool wxBitmapCheckBox::GetValue() const