]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/radiobox.h
fixed compilation breakage in 1.24 commit
[wxWidgets.git] / include / wx / motif / radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/radiobox.h
3 // Purpose: wxRadioBox class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MOTIF_RADIOBOX_H_
13 #define _WX_MOTIF_RADIOBOX_H_
14
15 #ifndef wxWIDGET_ARRAY_DEFINED
16 #define wxWIDGET_ARRAY_DEFINED
17
18 #include "wx/dynarray.h"
19 WX_DEFINE_ARRAY_PTR(WXWidget, wxWidgetArray);
20 #endif // wxWIDGET_ARRAY_DEFINED
21
22 #include "wx/arrstr.h"
23
24 class WXDLLEXPORT wxRadioBox : public wxControl, public wxRadioBoxBase
25 {
26 public:
27 wxRadioBox() { Init(); }
28
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)
36 {
37 Init();
38
39 Create(parent, id, title, pos, size, n, choices,
40 majorDim, style, val, name);
41 }
42
43 wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
44 const wxPoint& pos,
45 const wxSize& size,
46 const wxArrayString& choices,
47 int majorDim = 0, long style = wxRA_HORIZONTAL,
48 const wxValidator& val = wxDefaultValidator,
49 const wxString& name = wxRadioBoxNameStr)
50 {
51 Init();
52
53 Create(parent, id, title, pos, size, choices,
54 majorDim, style, val, name);
55 }
56
57 ~wxRadioBox();
58
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);
66
67 bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
68 const wxPoint& pos,
69 const wxSize& size,
70 const wxArrayString& choices,
71 int majorDim = 0, long style = wxRA_HORIZONTAL,
72 const wxValidator& val = wxDefaultValidator,
73 const wxString& name = wxRadioBoxNameStr);
74
75 void SetSelection(int N);
76 int GetSelection() const;
77
78 void SetString(int item, const wxString& label) ;
79 wxString GetString(int item) const;
80 virtual bool Enable(bool enable = true);
81 virtual bool Enable(int item, bool enable = true);
82 virtual bool Show(int item, bool show = true);
83 virtual bool Show(bool show = true);
84
85 virtual wxString GetStringSelection() const;
86 virtual bool SetStringSelection(const wxString& s);
87 virtual int GetCount() const { return m_noItems; } ;
88 void Command(wxCommandEvent& event);
89
90 int GetColumnCount() const;
91 int GetRowCount() const;
92
93 int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
94 void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
95
96 // Implementation
97 virtual void ChangeFont(bool keepOriginalSize = true);
98 virtual void ChangeBackgroundColour();
99 virtual void ChangeForegroundColour();
100 const wxWidgetArray& GetRadioButtons() const { return m_radioButtons; }
101 void SetSel(int i) { m_selectedButton = i; }
102 virtual WXWidget GetLabelWidget() const { return m_labelWidget; }
103
104 protected:
105 virtual void DoSetSize(int x, int y,
106 int width, int height,
107 int sizeFlags = wxSIZE_AUTO);
108
109 int m_majorDim;
110 int m_noItems;
111 int m_noRowsOrCols;
112 int m_selectedButton;
113
114 wxWidgetArray m_radioButtons;
115 WXWidget m_labelWidget;
116 wxArrayString m_radioButtonLabels;
117
118 private:
119 void Init();
120
121 DECLARE_DYNAMIC_CLASS(wxRadioBox)
122 };
123
124 #endif // _WX_MOTIF_RADIOBOX_H_