1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/radiobox.h
3 // Purpose: wxRadioBox class
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MOTIF_RADIOBOX_H_
12 #define _WX_MOTIF_RADIOBOX_H_
14 #ifndef wxWIDGET_ARRAY_DEFINED
15 #define wxWIDGET_ARRAY_DEFINED
17 #include "wx/dynarray.h"
18 WX_DEFINE_ARRAY_PTR(WXWidget
, wxWidgetArray
);
19 #endif // wxWIDGET_ARRAY_DEFINED
21 #include "wx/arrstr.h"
23 class WXDLLIMPEXP_CORE wxRadioBox
: public wxControl
, public wxRadioBoxBase
26 wxRadioBox() { Init(); }
28 wxRadioBox(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
31 int n
= 0, const wxString choices
[] = NULL
,
32 int majorDim
= 0, long style
= wxRA_SPECIFY_COLS
,
33 const wxValidator
& val
= wxDefaultValidator
,
34 const wxString
& name
= wxRadioBoxNameStr
)
38 Create(parent
, id
, title
, pos
, size
, n
, choices
,
39 majorDim
, style
, val
, name
);
42 wxRadioBox(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
45 const wxArrayString
& choices
,
46 int majorDim
= 0, long style
= wxRA_SPECIFY_COLS
,
47 const wxValidator
& val
= wxDefaultValidator
,
48 const wxString
& name
= wxRadioBoxNameStr
)
52 Create(parent
, id
, title
, pos
, size
, choices
,
53 majorDim
, style
, val
, name
);
56 virtual ~wxRadioBox();
58 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
59 const wxPoint
& pos
= wxDefaultPosition
,
60 const wxSize
& size
= wxDefaultSize
,
61 int n
= 0, const wxString choices
[] = NULL
,
62 int majorDim
= 0, long style
= wxRA_SPECIFY_COLS
,
63 const wxValidator
& val
= wxDefaultValidator
,
64 const wxString
& name
= wxRadioBoxNameStr
);
66 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
69 const wxArrayString
& choices
,
70 int majorDim
= 0, long style
= wxRA_SPECIFY_COLS
,
71 const wxValidator
& val
= wxDefaultValidator
,
72 const wxString
& name
= wxRadioBoxNameStr
);
75 virtual bool Enable(bool enable
= true);
76 virtual bool Enable(unsigned int item
, bool enable
= true);
77 virtual bool IsItemEnabled(unsigned int WXUNUSED(n
)) const
84 virtual bool Show(bool show
= true);
85 virtual bool Show(unsigned int item
, bool show
= true);
86 virtual bool IsItemShown(unsigned int WXUNUSED(n
)) const
92 virtual void SetSelection(int n
);
93 int GetSelection() const;
95 virtual void SetString(unsigned int item
, const wxString
& label
);
96 virtual wxString
GetString(unsigned int item
) const;
98 virtual wxString
GetStringSelection() const;
99 virtual bool SetStringSelection(const wxString
& s
);
100 virtual unsigned int GetCount() const { return m_noItems
; } ;
101 void Command(wxCommandEvent
& event
);
103 int GetNumberOfRowsOrCols() const { return m_noRowsOrCols
; }
104 void SetNumberOfRowsOrCols(int n
) { m_noRowsOrCols
= n
; }
107 virtual void ChangeFont(bool keepOriginalSize
= true);
108 virtual void ChangeBackgroundColour();
109 virtual void ChangeForegroundColour();
110 const wxWidgetArray
& GetRadioButtons() const { return m_radioButtons
; }
111 void SetSel(int i
) { m_selectedButton
= i
; }
112 virtual WXWidget
GetLabelWidget() const { return m_labelWidget
; }
115 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_NONE
; }
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_