]>
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 #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() ) ;
67 bool wxBitmapCheckBox::Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*label
,
69 const wxSize
& size
, long style
,
70 const wxValidator
& validator
,
74 SetValidator(validator
);
75 m_windowStyle
= style
;
77 if (parent
) parent
->AddChild(this);
80 m_windowId
= NewControlId();
84 // TODO: Create the bitmap checkbox
89 void wxBitmapCheckBox::SetLabel(const wxBitmap
*bitmap
)
94 void wxBitmapCheckBox::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
96 wxControl::SetSize( x
, y
, width
, height
, sizeFlags
) ;
99 void wxBitmapCheckBox::SetValue(bool val
)
104 bool wxBitmapCheckBox::GetValue() const