]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/radiobox.h
Avoid ICE with MinGW 2.95.3.
[wxWidgets.git] / include / wx / motif / radiobox.h
CommitLineData
9b6dbb09
JS
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
65571936 9// Licence: wxWindows licence
9b6dbb09
JS
10/////////////////////////////////////////////////////////////////////////////
11
4b4f6e0f
VZ
12#ifndef _WX_MOTIF_RADIOBOX_H_
13#define _WX_MOTIF_RADIOBOX_H_
9b6dbb09 14
12028905 15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
4b4f6e0f 16 #pragma interface "radiobox.h"
9b6dbb09
JS
17#endif
18
3bdb8629
MB
19#ifndef wxWIDGET_ARRAY_DEFINED
20 #define wxWIDGET_ARRAY_DEFINED
9b6dbb09 21
3bdb8629 22 #include "wx/dynarray.h"
4b4f6e0f
VZ
23 WX_DEFINE_ARRAY_PTR(WXWidget, wxWidgetArray);
24#endif // wxWIDGET_ARRAY_DEFINED
3bdb8629
MB
25
26#include "wx/arrstr.h"
9b6dbb09 27
18128cbb 28class WXDLLEXPORT wxRadioBox : public wxControl, public wxRadioBoxBase
9b6dbb09 29{
9b6dbb09 30public:
3bdb8629 31 wxRadioBox() { Init(); }
6b0d8a01 32
bfc6fde4 33 wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
3bdb8629
MB
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 int n = 0, const wxString choices[] = NULL,
37 int majorDim = 0, long style = wxRA_HORIZONTAL,
38 const wxValidator& val = wxDefaultValidator,
39 const wxString& name = wxRadioBoxNameStr)
bfc6fde4 40 {
3bdb8629
MB
41 Init();
42
43 Create(parent, id, title, pos, size, n, choices,
44 majorDim, style, val, name);
bfc6fde4 45 }
6b0d8a01 46
584ad2a3
MB
47 wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
48 const wxPoint& pos,
49 const wxSize& size,
50 const wxArrayString& choices,
51 int majorDim = 0, long style = wxRA_HORIZONTAL,
52 const wxValidator& val = wxDefaultValidator,
53 const wxString& name = wxRadioBoxNameStr)
54 {
55 Init();
56
57 Create(parent, id, title, pos, size, choices,
58 majorDim, style, val, name);
59 }
60
bfc6fde4 61 ~wxRadioBox();
6b0d8a01 62
bfc6fde4 63 bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
3bdb8629
MB
64 const wxPoint& pos = wxDefaultPosition,
65 const wxSize& size = wxDefaultSize,
66 int n = 0, const wxString choices[] = NULL,
67 int majorDim = 0, long style = wxRA_HORIZONTAL,
68 const wxValidator& val = wxDefaultValidator,
69 const wxString& name = wxRadioBoxNameStr);
6b0d8a01 70
584ad2a3
MB
71 bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
72 const wxPoint& pos,
73 const wxSize& size,
74 const wxArrayString& choices,
75 int majorDim = 0, long style = wxRA_HORIZONTAL,
76 const wxValidator& val = wxDefaultValidator,
77 const wxString& name = wxRadioBoxNameStr);
78
bfc6fde4
VZ
79 int FindString(const wxString& s) const;
80 void SetSelection(int N);
81 int GetSelection() const;
6b0d8a01 82
18128cbb
MB
83 void SetString(int item, const wxString& label) ;
84 wxString GetString(int item) const;
96be256b 85 virtual bool Enable(bool enable = true);
1a87edf2 86 virtual bool Enable(int item, bool enable = true);
789f6795
WS
87 virtual bool Show(int item, bool show = true);
88 virtual bool Show(bool show = true);
6b0d8a01 89
bfc6fde4
VZ
90 virtual wxString GetStringSelection() const;
91 virtual bool SetStringSelection(const wxString& s);
3c85ada9 92 virtual int GetCount() const { return m_noItems; } ;
bfc6fde4 93 void Command(wxCommandEvent& event);
6b0d8a01 94
18128cbb
MB
95 int GetColumnCount() const;
96 int GetRowCount() const;
97
bfc6fde4
VZ
98 int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
99 void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
6b0d8a01 100
bfc6fde4 101 // Implementation
96be256b 102 virtual void ChangeFont(bool keepOriginalSize = true);
bfc6fde4
VZ
103 virtual void ChangeBackgroundColour();
104 virtual void ChangeForegroundColour();
3bdb8629 105 const wxWidgetArray& GetRadioButtons() const { return m_radioButtons; }
3dd709d8
MB
106 void SetSel(int i) { m_selectedButton = i; }
107 virtual WXWidget GetLabelWidget() const { return m_labelWidget; }
6b0d8a01 108
9b6dbb09 109protected:
4b4f6e0f
VZ
110 virtual void DoSetSize(int x, int y,
111 int width, int height,
112 int sizeFlags = wxSIZE_AUTO);
113
2ad99bc1 114 int m_majorDim;
bfc6fde4
VZ
115 int m_noItems;
116 int m_noRowsOrCols;
117 int m_selectedButton;
6b0d8a01 118
3bdb8629 119 wxWidgetArray m_radioButtons;
3dd709d8 120 WXWidget m_labelWidget;
3bdb8629 121 wxArrayString m_radioButtonLabels;
6b0d8a01 122
4b4f6e0f
VZ
123private:
124 void Init();
125
4b4f6e0f 126 DECLARE_DYNAMIC_CLASS(wxRadioBox)
9b6dbb09
JS
127};
128
4b4f6e0f
VZ
129#endif // _WX_MOTIF_RADIOBOX_H_
130