1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
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
,
34 if ( !wxCheckBoxBase::Create(parent
, id
, pos
, size
, style
, validator
, name
) )
40 MacPreControlCreate( parent
, id
, label
, pos
, size
,style
, validator
, name
, &bounds
, title
) ;
42 m_macControl
= ::NewControl( MAC_WXHWND(parent
->MacGetRootWindow()) , &bounds
, title
, false , 0 , 0 , 1,
43 kControlCheckBoxProc
, (long) this ) ;
45 MacPostControlCreate() ;
50 void wxCheckBox::SetValue(bool val
)
52 ::SetControl32BitValue( (ControlHandle
) m_macControl
, val
) ;
56 bool wxCheckBox::GetValue() const
58 return ::GetControl32BitValue( (ControlHandle
) m_macControl
) ;
61 void wxCheckBox::Command (wxCommandEvent
& event
)
63 SetValue ((event
.GetInt() != 0));
64 ProcessCommand (event
);
67 void wxCheckBox::MacHandleControlClick( WXWidget
WXUNUSED(control
), wxInt16
WXUNUSED(controlpart
) , bool WXUNUSED(mouseStillDown
) )
69 SetValue( !GetValue() ) ;
70 wxCommandEvent
event(wxEVT_COMMAND_CHECKBOX_CLICKED
, m_windowId
);
71 event
.SetInt(GetValue());
72 event
.SetEventObject(this);
73 ProcessCommand(event
);
77 bool wxBitmapCheckBox::Create(wxWindow
*parent
, wxWindowID id
,
78 const wxBitmap
*label
,
80 const wxSize
& size
, long style
,
81 const wxValidator
& validator
,
85 SetValidator(validator
);
86 m_windowStyle
= style
;
88 if (parent
) parent
->AddChild(this);
91 m_windowId
= NewControlId();
95 // TODO: Create the bitmap checkbox
100 void wxBitmapCheckBox::SetLabel(const wxBitmap
*bitmap
)
103 wxFAIL_MSG(wxT("wxBitmapCheckBox::SetLabel() not yet implemented"));
106 void wxBitmapCheckBox::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
108 wxControl::SetSize( x
, y
, width
, height
, sizeFlags
) ;
111 void wxBitmapCheckBox::SetValue(bool val
)
114 wxFAIL_MSG(wxT("wxBitmapCheckBox::SetValue() not yet implemented"));
117 bool wxBitmapCheckBox::GetValue() const
120 wxFAIL_MSG(wxT("wxBitmapCheckBox::GetValue() not yet implemented"));