1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/radiobox.cpp
3 // Purpose: wxRadioBox implementation
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by: Wlodzimierz ABX Skiba - native wxRadioBox implementation
8 // Copyright: (c) William Osborne, Wlodzimierz Skiba
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ===========================================================================
14 // ===========================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "radiobox.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
34 #include "wx/bitmap.h"
36 #include "wx/radiobox.h"
37 #include "wx/settings.h"
42 #include "wx/tooltip.h"
43 #endif // wxUSE_TOOLTIPS
45 // TODO: wxCONSTRUCTOR
46 #if 0 // wxUSE_EXTENDED_RTTI
47 WX_DEFINE_FLAGS( wxRadioBoxStyle
)
49 wxBEGIN_FLAGS( wxRadioBoxStyle
)
50 // new style border flags, we put them first to
51 // use them for streaming out
52 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
53 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
54 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
55 wxFLAGS_MEMBER(wxBORDER_RAISED
)
56 wxFLAGS_MEMBER(wxBORDER_STATIC
)
57 wxFLAGS_MEMBER(wxBORDER_NONE
)
59 // old style border flags
60 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
61 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
62 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
63 wxFLAGS_MEMBER(wxRAISED_BORDER
)
64 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
65 wxFLAGS_MEMBER(wxBORDER
)
67 // standard window styles
68 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
69 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
70 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
71 wxFLAGS_MEMBER(wxWANTS_CHARS
)
72 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
73 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
74 wxFLAGS_MEMBER(wxVSCROLL
)
75 wxFLAGS_MEMBER(wxHSCROLL
)
77 wxFLAGS_MEMBER(wxRA_SPECIFY_COLS
)
78 wxFLAGS_MEMBER(wxRA_HORIZONTAL
)
79 wxFLAGS_MEMBER(wxRA_SPECIFY_ROWS
)
80 wxFLAGS_MEMBER(wxRA_VERTICAL
)
82 wxEND_FLAGS( wxRadioBoxStyle
)
84 IMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioBox
, wxControl
,"wx/radiobox.h")
86 wxBEGIN_PROPERTIES_TABLE(wxRadioBox
)
87 wxEVENT_PROPERTY( Select
, wxEVT_COMMAND_RADIOBOX_SELECTED
, wxCommandEvent
)
88 wxPROPERTY_FLAGS( WindowStyle
, wxRadioBoxStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
89 wxEND_PROPERTIES_TABLE()
92 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox
, wxControl
)
103 // ===========================================================================
105 // ===========================================================================
107 // ---------------------------------------------------------------------------
109 // ---------------------------------------------------------------------------
111 int wxRadioBox::GetCount() const
116 int wxRadioBox::GetColumnCount() const
121 int wxRadioBox::GetRowCount() const
126 // returns the number of rows
127 int wxRadioBox::GetNumVer() const
132 // returns the number of columns
133 int wxRadioBox::GetNumHor() const
139 wxRadioBox::wxRadioBox()
143 bool wxRadioBox::Create(wxWindow
*parent
,
145 const wxString
& title
,
149 const wxString choices
[],
152 const wxValidator
& val
,
153 const wxString
& name
)
158 bool wxRadioBox::Create(wxWindow
*parent
,
160 const wxString
& title
,
163 const wxArrayString
& choices
,
166 const wxValidator
& val
,
167 const wxString
& name
)
172 wxRadioBox::~wxRadioBox()
176 void wxRadioBox::SetString(int item
, const wxString
& label
)
180 void wxRadioBox::SetSelection(int N
)
184 // Get single selection, for single choice list items
185 int wxRadioBox::GetSelection() const
190 // Find string for position
191 wxString
wxRadioBox::GetString(int item
) const
198 // ----------------------------------------------------------------------------
200 // ----------------------------------------------------------------------------
202 wxSize
wxRadioBox::GetMaxButtonSize() const
207 wxSize
wxRadioBox::GetTotalButtonSize(const wxSize
& sizeBtn
) const
212 wxSize
wxRadioBox::DoGetBestSize() const
217 // Restored old code.
218 void wxRadioBox::DoSetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
222 void wxRadioBox::SetFocus()
226 bool wxRadioBox::Show(bool show
)
231 // Enable a specific button
232 void wxRadioBox::Enable(int item
, bool enable
)
236 // Enable all controls
237 bool wxRadioBox::Enable(bool enable
)
242 // Show a specific button
243 void wxRadioBox::Show(int item
, bool show
)
247 void wxRadioBox::Command(wxCommandEvent
& event
)
251 void wxRadioBox::SendNotificationEvent()
255 bool wxRadioBox::SetFont(const wxFont
& font
)
260 #endif // wxUSE_RADIOBOX