1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxRadioBox class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_RADIOBOX_H_
13 #define _WX_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(WXWidget
, wxWidgetArray
);
26 #include "wx/arrstr.h"
28 class WXDLLEXPORT wxRadioBox
: public wxControl
, public wxRadioBoxBase
30 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
33 wxRadioBox() { Init(); }
35 wxRadioBox(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
36 const wxPoint
& pos
= wxDefaultPosition
,
37 const wxSize
& size
= wxDefaultSize
,
38 int n
= 0, const wxString choices
[] = NULL
,
39 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
40 const wxValidator
& val
= wxDefaultValidator
,
41 const wxString
& name
= wxRadioBoxNameStr
)
45 Create(parent
, id
, title
, pos
, size
, n
, choices
,
46 majorDim
, style
, val
, name
);
51 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& title
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
54 int n
= 0, const wxString choices
[] = NULL
,
55 int majorDim
= 0, long style
= wxRA_HORIZONTAL
,
56 const wxValidator
& val
= wxDefaultValidator
,
57 const wxString
& name
= wxRadioBoxNameStr
);
59 int FindString(const wxString
& s
) const;
60 void SetSelection(int N
);
61 int GetSelection() const;
63 void SetString(int item
, const wxString
& label
) ;
64 wxString
GetString(int item
) const;
65 virtual bool Enable(bool enable
= TRUE
);
66 void Enable(int item
, bool enable
);
67 void Show(int item
, bool show
) ;
68 virtual bool Show(bool show
= TRUE
) ;
70 virtual wxString
GetStringSelection() const;
71 virtual bool SetStringSelection(const wxString
& s
);
72 virtual int GetCount() const { return m_noItems
; } ;
73 void Command(wxCommandEvent
& event
);
75 int GetColumnCount() const;
76 int GetRowCount() const;
78 int GetNumberOfRowsOrCols() const { return m_noRowsOrCols
; }
79 void SetNumberOfRowsOrCols(int n
) { m_noRowsOrCols
= n
; }
82 virtual void ChangeFont(bool keepOriginalSize
= TRUE
);
83 virtual void ChangeBackgroundColour();
84 virtual void ChangeForegroundColour();
85 const wxWidgetArray
& GetRadioButtons() const { return m_radioButtons
; }
86 void SetSel(int i
) { m_selectedButton
= i
; }
87 virtual WXWidget
GetLabelWidget() const { return m_labelWidget
; }
98 wxWidgetArray m_radioButtons
;
99 WXWidget m_labelWidget
;
100 wxArrayString m_radioButtonLabels
;
102 virtual void DoSetSize(int x
, int y
,
103 int width
, int height
,
104 int sizeFlags
= wxSIZE_AUTO
);