]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/radiobox.h
added fix for MSL under Win32 (by Steve Hartwell)
[wxWidgets.git] / include / wx / motif / radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: 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_RADIOBOX_H_
13 #define _WX_RADIOBOX_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "radiobox.h"
17 #endif
18
19 #ifndef wxWIDGET_ARRAY_DEFINED
20 #define wxWIDGET_ARRAY_DEFINED
21
22 #include "wx/dynarray.h"
23 WX_DEFINE_ARRAY(WXWidget, wxWidgetArray);
24 #endif
25
26 #include "wx/arrstr.h"
27
28 class WXDLLEXPORT wxRadioBox : public wxControl, public wxRadioBoxBase
29 {
30 DECLARE_DYNAMIC_CLASS(wxRadioBox)
31
32 public:
33 wxRadioBox() { Init(); }
34
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)
42 {
43 Init();
44
45 Create(parent, id, title, pos, size, n, choices,
46 majorDim, style, val, name);
47 }
48
49 wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
50 const wxPoint& pos,
51 const wxSize& size,
52 const wxArrayString& choices,
53 int majorDim = 0, long style = wxRA_HORIZONTAL,
54 const wxValidator& val = wxDefaultValidator,
55 const wxString& name = wxRadioBoxNameStr)
56 {
57 Init();
58
59 Create(parent, id, title, pos, size, choices,
60 majorDim, style, val, name);
61 }
62
63 ~wxRadioBox();
64
65 bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
66 const wxPoint& pos = wxDefaultPosition,
67 const wxSize& size = wxDefaultSize,
68 int n = 0, const wxString choices[] = NULL,
69 int majorDim = 0, long style = wxRA_HORIZONTAL,
70 const wxValidator& val = wxDefaultValidator,
71 const wxString& name = wxRadioBoxNameStr);
72
73 bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
74 const wxPoint& pos,
75 const wxSize& size,
76 const wxArrayString& choices,
77 int majorDim = 0, long style = wxRA_HORIZONTAL,
78 const wxValidator& val = wxDefaultValidator,
79 const wxString& name = wxRadioBoxNameStr);
80
81 int FindString(const wxString& s) const;
82 void SetSelection(int N);
83 int GetSelection() const;
84
85 void SetString(int item, const wxString& label) ;
86 wxString GetString(int item) const;
87 virtual bool Enable(bool enable = TRUE);
88 void Enable(int item, bool enable);
89 void Show(int item, bool show) ;
90 virtual bool Show(bool show = TRUE) ;
91
92 virtual wxString GetStringSelection() const;
93 virtual bool SetStringSelection(const wxString& s);
94 virtual int GetCount() const { return m_noItems; } ;
95 void Command(wxCommandEvent& event);
96
97 int GetColumnCount() const;
98 int GetRowCount() const;
99
100 int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
101 void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
102
103 // Implementation
104 virtual void ChangeFont(bool keepOriginalSize = TRUE);
105 virtual void ChangeBackgroundColour();
106 virtual void ChangeForegroundColour();
107 const wxWidgetArray& GetRadioButtons() const { return m_radioButtons; }
108 void SetSel(int i) { m_selectedButton = i; }
109 virtual WXWidget GetLabelWidget() const { return m_labelWidget; }
110
111 private:
112 void Init();
113
114 protected:
115 int m_majorDim;
116 int m_noItems;
117 int m_noRowsOrCols;
118 int m_selectedButton;
119
120 wxWidgetArray m_radioButtons;
121 WXWidget m_labelWidget;
122 wxArrayString m_radioButtonLabels;
123
124 virtual void DoSetSize(int x, int y,
125 int width, int height,
126 int sizeFlags = wxSIZE_AUTO);
127 };
128
129 #endif
130 // _WX_RADIOBOX_H_