1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/radiobox.h
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 #ifndef wxWIDGET_ARRAY_DEFINED
16 #define wxWIDGET_ARRAY_DEFINED
18 #include "wx/dynarray.h"
19 WX_DEFINE_ARRAY_PTR(WXWidget
, wxWidgetArray
);
20 #endif // wxWIDGET_ARRAY_DEFINED
22 #include "wx/arrstr.h"
24 class WXDLLEXPORT wxRadioBox
: public wxControl
, public wxRadioBoxBase
27 wxRadioBox() { Init(); }
29 wxRadioBox(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
32 int n
= 0, const wxString choices
[] = NULL
,
33 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
34 const wxValidator
& val
= wxDefaultValidator
,
35 const wxString
& name
= wxRadioBoxNameStr
)
39 Create(parent
, id
, title
, pos
, size
, n
, choices
,
40 majorDim
, style
, val
, name
);
43 wxRadioBox(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
46 const wxArrayString
& choices
,
47 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
48 const wxValidator
& val
= wxDefaultValidator
,
49 const wxString
& name
= wxRadioBoxNameStr
)
53 Create(parent
, id
, title
, pos
, size
, choices
,
54 majorDim
, style
, val
, name
);
59 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
60 const wxPoint
& pos
= wxDefaultPosition
,
61 const wxSize
& size
= wxDefaultSize
,
62 int n
= 0, const wxString choices
[] = NULL
,
63 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
64 const wxValidator
& val
= wxDefaultValidator
,
65 const wxString
& name
= wxRadioBoxNameStr
);
67 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
70 const wxArrayString
& choices
,
71 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
72 const wxValidator
& val
= wxDefaultValidator
,
73 const wxString
& name
= wxRadioBoxNameStr
);
76 virtual bool Enable(bool enable
= true);
77 virtual bool Enable(unsigned int item
, bool enable
= true);
78 virtual bool IsItemEnabled(unsigned int WXUNUSED(n
)) const
85 virtual bool Show(bool show
= true);
86 virtual bool Show(unsigned int item
, bool show
= true);
87 virtual bool IsItemShown(unsigned int WXUNUSED(n
)) const
93 virtual void SetSelection(int n
);
94 int GetSelection() const;
96 virtual void SetString(unsigned int item
, const wxString
& label
);
97 virtual wxString
GetString(unsigned int item
) const;
99 virtual wxString
GetStringSelection() const;
100 virtual bool SetStringSelection(const wxString
& s
);
101 virtual unsigned int GetCount() const { return m_noItems
; } ;
102 void Command(wxCommandEvent
& event
);
104 int GetNumberOfRowsOrCols() const { return m_noRowsOrCols
; }
105 void SetNumberOfRowsOrCols(int n
) { m_noRowsOrCols
= n
; }
108 virtual void ChangeFont(bool keepOriginalSize
= true);
109 virtual void ChangeBackgroundColour();
110 virtual void ChangeForegroundColour();
111 const wxWidgetArray
& GetRadioButtons() const { return m_radioButtons
; }
112 void SetSel(int i
) { m_selectedButton
= i
; }
113 virtual WXWidget
GetLabelWidget() const { return m_labelWidget
; }
116 virtual void DoSetSize(int x
, int y
,
117 int width
, int height
,
118 int sizeFlags
= wxSIZE_AUTO
);
120 unsigned int m_noItems
;
122 int m_selectedButton
;
124 wxWidgetArray m_radioButtons
;
125 WXWidget m_labelWidget
;
126 wxArrayString m_radioButtonLabels
;
131 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
134 #endif // _WX_MOTIF_RADIOBOX_H_