]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/checkbox.cpp
Fix after removal of PRIOR/NEXT in common headers (duplicates change in GTK2 sources).
[wxWidgets.git] / src / palmos / checkbox.cpp
CommitLineData
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
ffecfa5a
JS
20// For compilers that support precompilation, includes "wx.h".
21#include "wx/wxprec.h"
22
23#ifdef __BORLANDC__
24 #pragma hdrstop
25#endif
26
27#if wxUSE_CHECKBOX
28
29#ifndef WX_PRECOMP
30 #include "wx/checkbox.h"
31 #include "wx/brush.h"
32 #include "wx/dcscreen.h"
33 #include "wx/settings.h"
34#endif
35
20bc5ad8
WS
36#include <Control.h>
37
ffecfa5a
JS
38// ============================================================================
39// implementation
40// ============================================================================
41
42#if wxUSE_EXTENDED_RTTI
43WX_DEFINE_FLAGS( wxCheckBoxStyle )
44
45wxBEGIN_FLAGS( wxCheckBoxStyle )
46 // new style border flags, we put them first to
47 // use them for streaming out
48 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
49 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
50 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
51 wxFLAGS_MEMBER(wxBORDER_RAISED)
52 wxFLAGS_MEMBER(wxBORDER_STATIC)
53 wxFLAGS_MEMBER(wxBORDER_NONE)
e2731512 54
ffecfa5a
JS
55 // old style border flags
56 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
57 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
58 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
59 wxFLAGS_MEMBER(wxRAISED_BORDER)
60 wxFLAGS_MEMBER(wxSTATIC_BORDER)
61 wxFLAGS_MEMBER(wxNO_BORDER)
62
63 // standard window styles
64 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
65 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
66 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
67 wxFLAGS_MEMBER(wxWANTS_CHARS)
68 wxFLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE)
69 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
70 wxFLAGS_MEMBER(wxVSCROLL)
71 wxFLAGS_MEMBER(wxHSCROLL)
72
73wxEND_FLAGS( wxCheckBoxStyle )
74
75IMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckBox, wxControl,"wx/checkbox.h")
76
77wxBEGIN_PROPERTIES_TABLE(wxCheckBox)
78 wxEVENT_PROPERTY( Click , wxEVT_COMMAND_CHECKBOX_CLICKED , wxCommandEvent )
79
80 wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
81 wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
82 wxPROPERTY( Value ,bool, SetValue, GetValue, EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
83 wxPROPERTY_FLAGS( WindowStyle , wxCheckBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
84wxEND_PROPERTIES_TABLE()
85
86wxBEGIN_HANDLERS_TABLE(wxCheckBox)
87wxEND_HANDLERS_TABLE()
88
e2731512 89wxCONSTRUCTOR_6( wxCheckBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
ffecfa5a
JS
90#else
91IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
92#endif
93
94
95// ----------------------------------------------------------------------------
96// wxCheckBox
97// ----------------------------------------------------------------------------
98
ffecfa5a
JS
99bool wxCheckBox::Create(wxWindow *parent,
100 wxWindowID id,
101 const wxString& label,
102 const wxPoint& pos,
103 const wxSize& size, long style,
104 const wxValidator& validator,
105 const wxString& name)
106{
a152561c
WS
107 if(!wxControl::Create(parent, id, pos, size, style, validator, name))
108 return false;
109
110 return wxControl::PalmCreateControl(checkboxCtl, label, pos, size);
ffecfa5a
JS
111}
112
113wxSize wxCheckBox::DoGetBestSize() const
114{
115 return wxSize(0,0);
116}
117
118void wxCheckBox::SetValue(bool val)
119{
ba889513 120 SetBoolValue(val);
ffecfa5a
JS
121}
122
123bool wxCheckBox::GetValue() const
124{
ba889513 125 return GetBoolValue();
ffecfa5a
JS
126}
127
a152561c
WS
128bool wxCheckBox::SendClickEvent()
129{
130 wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, GetId());
131 event.SetInt(GetValue());
132 event.SetEventObject(this);
133 return ProcessCommand(event);
134}
135
ffecfa5a
JS
136void wxCheckBox::Command(wxCommandEvent& event)
137{
138}
139
ffecfa5a
JS
140void wxCheckBox::DoSet3StateValue(wxCheckBoxState state)
141{
142}
143
144wxCheckBoxState wxCheckBox::DoGet3StateValue() const
145{
146 return (wxCheckBoxState) 0;
147}
148
149#endif // wxUSE_CHECKBOX