1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/tglbtn.cpp
3 // Purpose: Definition of the wxToggleButton class, which implements a
5 // Author: William Osborne - minimal working wxPalmOS port
6 // Modified by: Wlodzimierz ABX Skiba - native implementation
9 // Copyright: (c) William Osborne, Wlodzimierz Skiba
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 // ============================================================================
15 // ============================================================================
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
21 #include "wx/wxprec.h"
30 #include "wx/button.h"
32 #include "wx/dcscreen.h"
33 #include "wx/settings.h"
38 #include "wx/tglbtn.h"
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 IMPLEMENT_DYNAMIC_CLASS(wxToggleButton
, wxControl
)
45 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
)
47 // ============================================================================
49 // ============================================================================
51 // ----------------------------------------------------------------------------
53 // ----------------------------------------------------------------------------
55 // Single check box item
56 bool wxToggleButton::Create(wxWindow
*parent
, wxWindowID id
,
57 const wxString
& label
,
59 const wxSize
& size
, long style
,
60 const wxValidator
& validator
,
63 if(!wxControl::Create(parent
, id
, pos
, size
, style
, validator
, name
))
66 return wxControl::PalmCreateControl(pushButtonCtl
, label
, pos
, size
);
69 wxBorder
wxToggleButton::GetDefaultBorder() const
74 wxSize
wxToggleButton::DoGetBestSize() const
79 void wxToggleButton::SetValue(bool val
)
84 bool wxToggleButton::GetValue() const
86 return GetBoolValue();
89 bool wxToggleButton::SendClickEvent()
91 wxCommandEvent
event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
, GetId());
92 event
.SetInt(GetValue());
93 event
.SetEventObject(this);
94 return ProcessCommand(event
);
97 void wxToggleButton::Command(wxCommandEvent
& event
)
101 #endif // wxUSE_TOGGLEBTN