1 /////////////////////////////////////////////////////////////////////////////
2 // Name: palmos/radiobox.cpp
3 // Purpose: wxRadioBox implementation
4 // Author: William Osborne
8 // Copyright: (c) William Osborne
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"
41 #include "wx/palmos/private.h"
44 #include "wx/tooltip.h"
45 #endif // wxUSE_TOOLTIPS
47 // TODO: wxCONSTRUCTOR
48 #if 0 // wxUSE_EXTENDED_RTTI
49 WX_DEFINE_FLAGS( wxRadioBoxStyle
)
51 wxBEGIN_FLAGS( wxRadioBoxStyle
)
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
)
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
)
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
)
79 wxFLAGS_MEMBER(wxRA_SPECIFY_COLS
)
80 wxFLAGS_MEMBER(wxRA_HORIZONTAL
)
81 wxFLAGS_MEMBER(wxRA_SPECIFY_ROWS
)
82 wxFLAGS_MEMBER(wxRA_VERTICAL
)
84 wxEND_FLAGS( wxRadioBoxStyle
)
86 IMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioBox
, wxControl
,"wx/radiobox.h")
88 wxBEGIN_PROPERTIES_TABLE(wxRadioBox
)
89 wxEVENT_PROPERTY( Select
, wxEVT_COMMAND_RADIOBOX_SELECTED
, wxCommandEvent
)
90 wxPROPERTY_FLAGS( WindowStyle
, wxRadioBoxStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
91 wxEND_PROPERTIES_TABLE()
94 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox
, wxControl
)
105 #define RADIOBTN_PARENT_IS_RADIOBOX 0
107 // ---------------------------------------------------------------------------
109 // ---------------------------------------------------------------------------
111 // ---------------------------------------------------------------------------
113 // ---------------------------------------------------------------------------
115 // the pointer to standard radio button wnd proc
116 static WXFARPROC s_wndprocRadioBtn
= (WXFARPROC
)NULL
;
118 // ===========================================================================
120 // ===========================================================================
122 // ---------------------------------------------------------------------------
124 // ---------------------------------------------------------------------------
126 int wxRadioBox::GetCount() const
131 int wxRadioBox::GetColumnCount() const
136 int wxRadioBox::GetRowCount() const
141 // returns the number of rows
142 int wxRadioBox::GetNumVer() const
147 // returns the number of columns
148 int wxRadioBox::GetNumHor() const
153 bool wxRadioBox::MSWCommand(WXUINT cmd
, WXWORD id
)
159 wxRadioBox::wxRadioBox()
163 bool wxRadioBox::Create(wxWindow
*parent
,
165 const wxString
& title
,
169 const wxString choices
[],
172 const wxValidator
& val
,
173 const wxString
& name
)
178 bool wxRadioBox::Create(wxWindow
*parent
,
180 const wxString
& title
,
183 const wxArrayString
& choices
,
186 const wxValidator
& val
,
187 const wxString
& name
)
192 wxRadioBox::~wxRadioBox()
196 void wxRadioBox::SetString(int item
, const wxString
& label
)
200 void wxRadioBox::SetSelection(int N
)
204 // Get single selection, for single choice list items
205 int wxRadioBox::GetSelection() const
210 // Find string for position
211 wxString
wxRadioBox::GetString(int item
) const
218 // ----------------------------------------------------------------------------
220 // ----------------------------------------------------------------------------
222 wxSize
wxRadioBox::GetMaxButtonSize() const
227 wxSize
wxRadioBox::GetTotalButtonSize(const wxSize
& sizeBtn
) const
232 wxSize
wxRadioBox::DoGetBestSize() const
237 // Restored old code.
238 void wxRadioBox::DoSetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
242 void wxRadioBox::GetSize(int *width
, int *height
) const
246 void wxRadioBox::GetPosition(int *x
, int *y
) const
250 void wxRadioBox::SetFocus()
254 bool wxRadioBox::Show(bool show
)
259 // Enable a specific button
260 void wxRadioBox::Enable(int item
, bool enable
)
264 // Enable all controls
265 bool wxRadioBox::Enable(bool enable
)
270 // Show a specific button
271 void wxRadioBox::Show(int item
, bool show
)
275 bool wxRadioBox::ContainsHWND(WXHWND hWnd
) const
280 void wxRadioBox::Command(wxCommandEvent
& event
)
284 void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn
)
288 void wxRadioBox::SendNotificationEvent()
292 bool wxRadioBox::SetFont(const wxFont
& font
)
297 // ----------------------------------------------------------------------------
299 // ----------------------------------------------------------------------------
301 WXLRESULT
wxRadioBox::MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
)
306 WXHBRUSH
wxRadioBox::OnCtlColor(WXHDC pDC
, WXHWND
WXUNUSED(pWnd
), WXUINT
WXUNUSED(nCtlColor
),
312 WXUINT
WXUNUSED(message
),
313 WXWPARAM
WXUNUSED(wParam
),
314 WXLPARAM
WXUNUSED(lParam
)
321 #endif // wxUSE_RADIOBOX