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
9 // Copyright: (c) William Osborne
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 // ============================================================================
15 // ============================================================================
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
21 #include "wx/wxprec.h"
27 #include "wx/tglbtn.h"
32 #include "wx/button.h"
34 #include "wx/dcscreen.h"
35 #include "wx/settings.h"
40 #include "wx/palmos/private.h"
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
46 IMPLEMENT_DYNAMIC_CLASS(wxToggleButton
, wxControl
)
47 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
)
49 #define BUTTON_HEIGHT_FROM_CHAR_HEIGHT(cy) (11*EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)/10)
51 // ============================================================================
53 // ============================================================================
55 // ----------------------------------------------------------------------------
57 // ----------------------------------------------------------------------------
59 bool wxToggleButton::MSWCommand(WXUINT
WXUNUSED(param
), WXWORD
WXUNUSED(id
))
61 wxCommandEvent
event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED
, m_windowId
);
62 event
.SetInt(GetValue());
63 event
.SetEventObject(this);
64 ProcessCommand(event
);
68 // Single check box item
69 bool wxToggleButton::Create(wxWindow
*parent
, wxWindowID id
,
70 const wxString
& label
,
72 const wxSize
& size
, long style
,
73 const wxValidator
& validator
,
79 wxBorder
wxToggleButton::GetDefaultBorder() const
84 WXDWORD
wxToggleButton::MSWGetStyle(long style
, WXDWORD
*exstyle
) const
89 void wxToggleButton::SetLabel(const wxString
& label
)
93 wxSize
wxToggleButton::DoGetBestSize() const
98 void wxToggleButton::SetValue(bool val
)
103 #define BST_CHECKED 0x0001
106 bool wxToggleButton::GetValue() const
111 void wxToggleButton::Command(wxCommandEvent
& event
)
115 #endif // wxUSE_TOGGLEBTN