1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxRadioBox class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MOTIF_RADIOBOX_H_
13 #define _WX_MOTIF_RADIOBOX_H_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "radiobox.h"
19 #ifndef wxWIDGET_ARRAY_DEFINED
20 #define wxWIDGET_ARRAY_DEFINED
22 #include "wx/dynarray.h"
23 WX_DEFINE_ARRAY_PTR(WXWidget
, wxWidgetArray
);
24 #endif // wxWIDGET_ARRAY_DEFINED
26 #include "wx/arrstr.h"
28 class WXDLLEXPORT wxRadioBox
: public wxControl
, public wxRadioBoxBase
31 wxRadioBox() { Init(); }
33 wxRadioBox(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
36 int n
= 0, const wxString choices
[] = NULL
,
37 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
38 const wxValidator
& val
= wxDefaultValidator
,
39 const wxString
& name
= wxRadioBoxNameStr
)
43 Create(parent
, id
, title
, pos
, size
, n
, choices
,
44 majorDim
, style
, val
, name
);
47 wxRadioBox(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
50 const wxArrayString
& choices
,
51 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
52 const wxValidator
& val
= wxDefaultValidator
,
53 const wxString
& name
= wxRadioBoxNameStr
)
57 Create(parent
, id
, title
, pos
, size
, choices
,
58 majorDim
, style
, val
, name
);
63 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
64 const wxPoint
& pos
= wxDefaultPosition
,
65 const wxSize
& size
= wxDefaultSize
,
66 int n
= 0, const wxString choices
[] = NULL
,
67 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
68 const wxValidator
& val
= wxDefaultValidator
,
69 const wxString
& name
= wxRadioBoxNameStr
);
71 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
74 const wxArrayString
& choices
,
75 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
76 const wxValidator
& val
= wxDefaultValidator
,
77 const wxString
& name
= wxRadioBoxNameStr
);
79 int FindString(const wxString
& s
) const;
80 void SetSelection(int N
);
81 int GetSelection() const;
83 void SetString(int item
, const wxString
& label
) ;
84 wxString
GetString(int item
) const;
85 virtual bool Enable(bool enable
= true);
86 virtual bool Enable(int item
, bool enable
= true);
87 virtual bool Show(int item
, bool show
= true);
88 virtual bool Show(bool show
= true);
90 virtual wxString
GetStringSelection() const;
91 virtual bool SetStringSelection(const wxString
& s
);
92 virtual int GetCount() const { return m_noItems
; } ;
93 void Command(wxCommandEvent
& event
);
95 int GetColumnCount() const;
96 int GetRowCount() const;
98 int GetNumberOfRowsOrCols() const { return m_noRowsOrCols
; }
99 void SetNumberOfRowsOrCols(int n
) { m_noRowsOrCols
= n
; }
102 virtual void ChangeFont(bool keepOriginalSize
= true);
103 virtual void ChangeBackgroundColour();
104 virtual void ChangeForegroundColour();
105 const wxWidgetArray
& GetRadioButtons() const { return m_radioButtons
; }
106 void SetSel(int i
) { m_selectedButton
= i
; }
107 virtual WXWidget
GetLabelWidget() const { return m_labelWidget
; }
110 virtual void DoSetSize(int x
, int y
,
111 int width
, int height
,
112 int sizeFlags
= wxSIZE_AUTO
);
117 int m_selectedButton
;
119 wxWidgetArray m_radioButtons
;
120 WXWidget m_labelWidget
;
121 wxArrayString m_radioButtonLabels
;
126 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
129 #endif // _WX_MOTIF_RADIOBOX_H_