]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/palmos/radiobut.cpp
Italian translation corrections from Roberto Boriotti.
[wxWidgets.git] / src / palmos / radiobut.cpp
... / ...
CommitLineData
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
6// Created: 10/13/04
7// RCS-ID: $Id$
8// Copyright: (c) William Osborne, Wlodzimierz Skiba
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12// ============================================================================
13// declarations
14// ============================================================================
15
16// ----------------------------------------------------------------------------
17// headers
18// ----------------------------------------------------------------------------
19
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_RADIOBTN
28
29#include "wx/radiobut.h"
30
31#ifndef WX_PRECOMP
32 #include "wx/settings.h"
33 #include "wx/dcscreen.h"
34#endif
35
36#include <Control.h>
37
38// ============================================================================
39// wxRadioButton implementation
40// ============================================================================
41
42// ----------------------------------------------------------------------------
43// wxRadioButton creation
44// ----------------------------------------------------------------------------
45
46void wxRadioButton::Init()
47{
48 m_radioStyle = pushButtonCtl;
49 m_groupID = 0;
50}
51
52bool wxRadioButton::Create(wxWindow *parent,
53 wxWindowID id,
54 const wxString& label,
55 const wxPoint& pos,
56 const wxSize& size,
57 long style,
58 const wxValidator& validator,
59 const wxString& name)
60{
61 // replace native push button with native checkbox
62 if ( style & wxRB_USE_CHECKBOX )
63 m_radioStyle = checkboxCtl;
64
65 if(!wxControl::Create(parent, id, pos, size, style, validator, name))
66 return false;
67
68 return wxControl::PalmCreateControl(
69 // be sure only one of two possibilities was taken
70 m_radioStyle == checkboxCtl ? checkboxCtl : pushButtonCtl,
71 label,
72 pos,
73 size,
74 m_groupID
75 );
76}
77
78void wxRadioButton::SetGroup(uint8_t group)
79{
80 m_groupID = group;
81}
82
83// ----------------------------------------------------------------------------
84// wxRadioButton functions
85// ----------------------------------------------------------------------------
86
87void wxRadioButton::SetValue(bool value)
88{
89 SetBoolValue(value);
90}
91
92bool wxRadioButton::GetValue() const
93{
94 return GetBoolValue();
95}
96
97// ----------------------------------------------------------------------------
98// wxRadioButton event processing
99// ----------------------------------------------------------------------------
100
101bool wxRadioButton::SendClickEvent()
102{
103 wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, GetId());
104 event.SetInt(GetValue());
105 event.SetEventObject(this);
106 return ProcessCommand(event);
107}
108
109void wxRadioButton::Command (wxCommandEvent& event)
110{
111}
112
113// ----------------------------------------------------------------------------
114// wxRadioButton geometry
115// ----------------------------------------------------------------------------
116
117wxSize wxRadioButton::DoGetBestSize() const
118{
119 return wxSize(0,0);
120}
121
122#endif // wxUSE_RADIOBTN
123