]>
Commit | Line | Data |
---|---|---|
ffecfa5a | 1 | ///////////////////////////////////////////////////////////////////////////// |
e2731512 | 2 | // Name: src/palmos/checkbox.cpp |
ffecfa5a | 3 | // Purpose: wxCheckBox |
e2731512 | 4 | // Author: William Osborne - minimal working wxPalmOS port |
bdb54365 | 5 | // Modified by: Wlodzimierz ABX Skiba - native implementation |
ffecfa5a | 6 | // Created: 10/13/04 |
e2731512 | 7 | // RCS-ID: $Id$ |
bdb54365 | 8 | // Copyright: (c) William Osborne, Wlodzimierz Skiba |
ffecfa5a JS |
9 | // Licence: wxWindows licence |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | // ============================================================================ | |
13 | // declarations | |
14 | // ============================================================================ | |
15 | ||
16 | // ---------------------------------------------------------------------------- | |
17 | // headers | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
20 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
21 | #pragma implementation "checkbox.h" | |
22 | #endif | |
23 | ||
24 | // For compilers that support precompilation, includes "wx.h". | |
25 | #include "wx/wxprec.h" | |
26 | ||
27 | #ifdef __BORLANDC__ | |
28 | #pragma hdrstop | |
29 | #endif | |
30 | ||
31 | #if wxUSE_CHECKBOX | |
32 | ||
33 | #ifndef WX_PRECOMP | |
34 | #include "wx/checkbox.h" | |
35 | #include "wx/brush.h" | |
36 | #include "wx/dcscreen.h" | |
37 | #include "wx/settings.h" | |
38 | #endif | |
39 | ||
20bc5ad8 WS |
40 | #include <Control.h> |
41 | ||
ffecfa5a JS |
42 | // ============================================================================ |
43 | // implementation | |
44 | // ============================================================================ | |
45 | ||
46 | #if wxUSE_EXTENDED_RTTI | |
47 | WX_DEFINE_FLAGS( wxCheckBoxStyle ) | |
48 | ||
49 | wxBEGIN_FLAGS( wxCheckBoxStyle ) | |
50 | // new style border flags, we put them first to | |
51 | // use them for streaming out | |
52 | wxFLAGS_MEMBER(wxBORDER_SIMPLE) | |
53 | wxFLAGS_MEMBER(wxBORDER_SUNKEN) | |
54 | wxFLAGS_MEMBER(wxBORDER_DOUBLE) | |
55 | wxFLAGS_MEMBER(wxBORDER_RAISED) | |
56 | wxFLAGS_MEMBER(wxBORDER_STATIC) | |
57 | wxFLAGS_MEMBER(wxBORDER_NONE) | |
e2731512 | 58 | |
ffecfa5a JS |
59 | // old style border flags |
60 | wxFLAGS_MEMBER(wxSIMPLE_BORDER) | |
61 | wxFLAGS_MEMBER(wxSUNKEN_BORDER) | |
62 | wxFLAGS_MEMBER(wxDOUBLE_BORDER) | |
63 | wxFLAGS_MEMBER(wxRAISED_BORDER) | |
64 | wxFLAGS_MEMBER(wxSTATIC_BORDER) | |
65 | wxFLAGS_MEMBER(wxNO_BORDER) | |
66 | ||
67 | // standard window styles | |
68 | wxFLAGS_MEMBER(wxTAB_TRAVERSAL) | |
69 | wxFLAGS_MEMBER(wxCLIP_CHILDREN) | |
70 | wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) | |
71 | wxFLAGS_MEMBER(wxWANTS_CHARS) | |
72 | wxFLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE) | |
73 | wxFLAGS_MEMBER(wxALWAYS_SHOW_SB ) | |
74 | wxFLAGS_MEMBER(wxVSCROLL) | |
75 | wxFLAGS_MEMBER(wxHSCROLL) | |
76 | ||
77 | wxEND_FLAGS( wxCheckBoxStyle ) | |
78 | ||
79 | IMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckBox, wxControl,"wx/checkbox.h") | |
80 | ||
81 | wxBEGIN_PROPERTIES_TABLE(wxCheckBox) | |
82 | wxEVENT_PROPERTY( Click , wxEVT_COMMAND_CHECKBOX_CLICKED , wxCommandEvent ) | |
83 | ||
84 | wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
85 | wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
86 | wxPROPERTY( Value ,bool, SetValue, GetValue, EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) | |
87 | wxPROPERTY_FLAGS( WindowStyle , wxCheckBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style | |
88 | wxEND_PROPERTIES_TABLE() | |
89 | ||
90 | wxBEGIN_HANDLERS_TABLE(wxCheckBox) | |
91 | wxEND_HANDLERS_TABLE() | |
92 | ||
e2731512 | 93 | wxCONSTRUCTOR_6( wxCheckBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle ) |
ffecfa5a JS |
94 | #else |
95 | IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) | |
96 | #endif | |
97 | ||
98 | ||
99 | // ---------------------------------------------------------------------------- | |
100 | // wxCheckBox | |
101 | // ---------------------------------------------------------------------------- | |
102 | ||
ffecfa5a JS |
103 | bool wxCheckBox::Create(wxWindow *parent, |
104 | wxWindowID id, | |
105 | const wxString& label, | |
106 | const wxPoint& pos, | |
107 | const wxSize& size, long style, | |
108 | const wxValidator& validator, | |
109 | const wxString& name) | |
110 | { | |
a152561c WS |
111 | if(!wxControl::Create(parent, id, pos, size, style, validator, name)) |
112 | return false; | |
113 | ||
114 | return wxControl::PalmCreateControl(checkboxCtl, label, pos, size); | |
ffecfa5a JS |
115 | } |
116 | ||
117 | wxSize wxCheckBox::DoGetBestSize() const | |
118 | { | |
119 | return wxSize(0,0); | |
120 | } | |
121 | ||
122 | void wxCheckBox::SetValue(bool val) | |
123 | { | |
ba889513 | 124 | SetBoolValue(val); |
ffecfa5a JS |
125 | } |
126 | ||
127 | bool wxCheckBox::GetValue() const | |
128 | { | |
ba889513 | 129 | return GetBoolValue(); |
ffecfa5a JS |
130 | } |
131 | ||
a152561c WS |
132 | bool wxCheckBox::SendClickEvent() |
133 | { | |
134 | wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, GetId()); | |
135 | event.SetInt(GetValue()); | |
136 | event.SetEventObject(this); | |
137 | return ProcessCommand(event); | |
138 | } | |
139 | ||
ffecfa5a JS |
140 | void wxCheckBox::Command(wxCommandEvent& event) |
141 | { | |
142 | } | |
143 | ||
ffecfa5a JS |
144 | void wxCheckBox::DoSet3StateValue(wxCheckBoxState state) |
145 | { | |
146 | } | |
147 | ||
148 | wxCheckBoxState wxCheckBox::DoGet3StateValue() const | |
149 | { | |
150 | return (wxCheckBoxState) 0; | |
151 | } | |
152 | ||
153 | #endif // wxUSE_CHECKBOX |