1 /////////////////////////////////////////////////////////////////////////////
2 // Name: palmos/checkbox.cpp
4 // Author: William Osborne
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "checkbox.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
34 #include "wx/checkbox.h"
36 #include "wx/dcscreen.h"
37 #include "wx/settings.h"
40 #include "wx/palmos/private.h"
43 #define BST_UNCHECKED 0x0000
47 #define BST_CHECKED 0x0001
50 #ifndef BST_INDETERMINATE
51 #define BST_INDETERMINATE 0x0002
54 // ============================================================================
56 // ============================================================================
58 #if wxUSE_EXTENDED_RTTI
59 WX_DEFINE_FLAGS( wxCheckBoxStyle
)
61 wxBEGIN_FLAGS( wxCheckBoxStyle
)
62 // new style border flags, we put them first to
63 // use them for streaming out
64 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
65 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
66 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
67 wxFLAGS_MEMBER(wxBORDER_RAISED
)
68 wxFLAGS_MEMBER(wxBORDER_STATIC
)
69 wxFLAGS_MEMBER(wxBORDER_NONE
)
71 // old style border flags
72 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
73 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
74 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
75 wxFLAGS_MEMBER(wxRAISED_BORDER
)
76 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
77 wxFLAGS_MEMBER(wxNO_BORDER
)
79 // standard window styles
80 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
81 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
82 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
83 wxFLAGS_MEMBER(wxWANTS_CHARS
)
84 wxFLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE
)
85 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
86 wxFLAGS_MEMBER(wxVSCROLL
)
87 wxFLAGS_MEMBER(wxHSCROLL
)
89 wxEND_FLAGS( wxCheckBoxStyle
)
91 IMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckBox
, wxControl
,"wx/checkbox.h")
93 wxBEGIN_PROPERTIES_TABLE(wxCheckBox
)
94 wxEVENT_PROPERTY( Click
, wxEVT_COMMAND_CHECKBOX_CLICKED
, wxCommandEvent
)
96 wxPROPERTY( Font
, wxFont
, SetFont
, GetFont
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
97 wxPROPERTY( Label
,wxString
, SetLabel
, GetLabel
, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
98 wxPROPERTY( Value
,bool, SetValue
, GetValue
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
99 wxPROPERTY_FLAGS( WindowStyle
, wxCheckBoxStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
100 wxEND_PROPERTIES_TABLE()
102 wxBEGIN_HANDLERS_TABLE(wxCheckBox
)
103 wxEND_HANDLERS_TABLE()
105 wxCONSTRUCTOR_6( wxCheckBox
, wxWindow
* , Parent
, wxWindowID
, Id
, wxString
, Label
, wxPoint
, Position
, wxSize
, Size
, long , WindowStyle
)
107 IMPLEMENT_DYNAMIC_CLASS(wxCheckBox
, wxControl
)
111 // ----------------------------------------------------------------------------
113 // ----------------------------------------------------------------------------
115 bool wxCheckBox::MSWCommand(WXUINT
WXUNUSED(param
), WXWORD
WXUNUSED(id
))
120 bool wxCheckBox::Create(wxWindow
*parent
,
122 const wxString
& label
,
124 const wxSize
& size
, long style
,
125 const wxValidator
& validator
,
126 const wxString
& name
)
131 void wxCheckBox::SetLabel(const wxString
& label
)
135 wxSize
wxCheckBox::DoGetBestSize() const
140 void wxCheckBox::SetValue(bool val
)
144 bool wxCheckBox::GetValue() const
149 void wxCheckBox::Command(wxCommandEvent
& event
)
153 wxCOMPILE_TIME_ASSERT(wxCHK_UNCHECKED
== BST_UNCHECKED
154 && wxCHK_CHECKED
== BST_CHECKED
155 && wxCHK_UNDETERMINED
== BST_INDETERMINATE
, EnumValuesIncorrect
);
157 void wxCheckBox::DoSet3StateValue(wxCheckBoxState state
)
161 wxCheckBoxState
wxCheckBox::DoGet3StateValue() const
163 return (wxCheckBoxState
) 0;
166 #endif // wxUSE_CHECKBOX