]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/radiobut.cpp
Fixed a long-standing issue where wxSlider controls with a hardcoded size would mispl...
[wxWidgets.git] / src / palmos / radiobut.cpp
CommitLineData
ffecfa5a 1/////////////////////////////////////////////////////////////////////////////
e2731512 2// Name: src/palmos/radiobut.cpp
ffecfa5a 3// Purpose: wxRadioButton
e2731512 4// Author: William Osborne - minimal working wxPalmOS port
808e3bce 5// Modified by: Wlodzimierz ABX Skiba - native wxRadioButton implementation
ffecfa5a 6// Created: 10/13/04
e2731512 7// RCS-ID: $Id$
808e3bce 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
20#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "radiobut.h"
22#endif
23
24// For compilers that support precompilation, includes "wx.h".
25#include "wx/wxprec.h"
26
27#ifdef __BORLANDC__
28 #pragma hdrstop
29#endif
30
31#if wxUSE_RADIOBTN
32
33#ifndef WX_PRECOMP
34 #include "wx/radiobut.h"
35 #include "wx/settings.h"
36 #include "wx/dcscreen.h"
37#endif
38
ffecfa5a
JS
39// ============================================================================
40// wxRadioButton implementation
41// ============================================================================
42
43// ----------------------------------------------------------------------------
44// wxRadioButton creation
45// ----------------------------------------------------------------------------
46
47
48#if wxUSE_EXTENDED_RTTI
49WX_DEFINE_FLAGS( wxRadioButtonStyle )
50
51wxBEGIN_FLAGS( wxRadioButtonStyle )
52 // new style border flags, we put them first to
53 // use them for streaming out
54 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
55 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
56 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
57 wxFLAGS_MEMBER(wxBORDER_RAISED)
58 wxFLAGS_MEMBER(wxBORDER_STATIC)
59 wxFLAGS_MEMBER(wxBORDER_NONE)
e2731512 60
ffecfa5a
JS
61 // old style border flags
62 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
63 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
64 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
65 wxFLAGS_MEMBER(wxRAISED_BORDER)
66 wxFLAGS_MEMBER(wxSTATIC_BORDER)
67 wxFLAGS_MEMBER(wxBORDER)
68
69 // standard window styles
70 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
71 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
72 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
73 wxFLAGS_MEMBER(wxWANTS_CHARS)
74 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
75 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
76 wxFLAGS_MEMBER(wxVSCROLL)
77 wxFLAGS_MEMBER(wxHSCROLL)
78
79 wxFLAGS_MEMBER(wxRB_GROUP)
80
81wxEND_FLAGS( wxRadioButtonStyle )
82
83IMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioButton, wxControl,"wx/radiobut.h")
84
85wxBEGIN_PROPERTIES_TABLE(wxRadioButton)
86 wxEVENT_PROPERTY( Click , wxEVT_COMMAND_RADIOBUTTON_SELECTED , wxCommandEvent )
87 wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
88 wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
89 wxPROPERTY( Value ,bool, SetValue, GetValue, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
90 wxPROPERTY_FLAGS( WindowStyle , wxRadioButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
91wxEND_PROPERTIES_TABLE()
92
93wxBEGIN_HANDLERS_TABLE(wxRadioButton)
94wxEND_HANDLERS_TABLE()
95
e2731512 96wxCONSTRUCTOR_6( wxRadioButton , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
ffecfa5a
JS
97
98#else
99IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
100#endif
101
102
103void wxRadioButton::Init()
104{
105}
106
107bool wxRadioButton::Create(wxWindow *parent,
108 wxWindowID id,
109 const wxString& label,
110 const wxPoint& pos,
111 const wxSize& size,
112 long style,
113 const wxValidator& validator,
114 const wxString& name)
115{
808e3bce
WS
116 wxControl::PalmCreateControl(pushButtonCtl, parent, id, label, pos, size);
117 return true;
ffecfa5a
JS
118}
119
120// ----------------------------------------------------------------------------
121// wxRadioButton functions
122// ----------------------------------------------------------------------------
123
124void wxRadioButton::SetValue(bool value)
125{
808e3bce 126 SetBoolValue(value);
ffecfa5a
JS
127}
128
129bool wxRadioButton::GetValue() const
130{
808e3bce 131 return GetBoolValue();
ffecfa5a
JS
132}
133
134// ----------------------------------------------------------------------------
135// wxRadioButton event processing
136// ----------------------------------------------------------------------------
137
138void wxRadioButton::Command (wxCommandEvent& event)
139{
140}
141
ffecfa5a
JS
142// ----------------------------------------------------------------------------
143// wxRadioButton geometry
144// ----------------------------------------------------------------------------
145
146wxSize wxRadioButton::DoGetBestSize() const
147{
148 return wxSize(0,0);
149}
150
151#endif // wxUSE_RADIOBTN
152