1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/radiobut.cpp
3 // Purpose: wxRadioButton
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by: Wlodzimierz ABX Skiba - native wxRadioButton implementation
8 // Copyright: (c) William Osborne, Wlodzimierz Skiba
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
29 #include "wx/radiobut.h"
32 #include "wx/settings.h"
33 #include "wx/dcscreen.h"
38 // ============================================================================
39 // wxRadioButton implementation
40 // ============================================================================
42 // ----------------------------------------------------------------------------
43 // wxRadioButton creation
44 // ----------------------------------------------------------------------------
46 void wxRadioButton::Init()
48 m_radioStyle
= pushButtonCtl
;
52 bool wxRadioButton::Create(wxWindow
*parent
,
54 const wxString
& label
,
58 const wxValidator
& validator
,
61 // replace native push button with native checkbox
62 if ( style
& wxRB_USE_CHECKBOX
)
63 m_radioStyle
= checkboxCtl
;
65 if(!wxControl::Create(parent
, id
, pos
, size
, style
, validator
, name
))
68 return wxControl::PalmCreateControl(
69 // be sure only one of two possibilities was taken
70 m_radioStyle
== checkboxCtl
? checkboxCtl
: pushButtonCtl
,
78 void wxRadioButton::SetGroup(uint8_t group
)
83 // ----------------------------------------------------------------------------
84 // wxRadioButton functions
85 // ----------------------------------------------------------------------------
87 void wxRadioButton::SetValue(bool value
)
92 bool wxRadioButton::GetValue() const
94 return GetBoolValue();
97 // ----------------------------------------------------------------------------
98 // wxRadioButton event processing
99 // ----------------------------------------------------------------------------
101 bool wxRadioButton::SendClickEvent()
103 wxCommandEvent
event(wxEVT_COMMAND_RADIOBUTTON_SELECTED
, GetId());
104 event
.SetInt(GetValue());
105 event
.SetEventObject(this);
106 return ProcessCommand(event
);
109 void wxRadioButton::Command (wxCommandEvent
& event
)
113 // ----------------------------------------------------------------------------
114 // wxRadioButton geometry
115 // ----------------------------------------------------------------------------
117 wxSize
wxRadioButton::DoGetBestSize() const
122 #endif // wxUSE_RADIOBTN