]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: radiobox.h | |
3 | // Purpose: wxRadioBox class | |
a31a5f85 | 4 | // Author: Stefan Csomor |
0dbd6262 | 5 | // Modified by: |
a31a5f85 | 6 | // Created: 1998-01-01 |
0dbd6262 | 7 | // RCS-ID: $Id$ |
a31a5f85 | 8 | // Copyright: (c) Stefan Csomor |
e40298d5 | 9 | // Licence: wxWindows licence |
0dbd6262 SC |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_RADIOBOX_H_ | |
13 | #define _WX_RADIOBOX_H_ | |
14 | ||
af49c4b8 | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
0dbd6262 SC |
16 | #pragma interface "radiobox.h" |
17 | #endif | |
18 | ||
0dbd6262 | 19 | // List box item |
584bede0 | 20 | class WXDLLEXPORT wxBitmap ; |
1395ff56 | 21 | |
584bede0 | 22 | class WXDLLEXPORT wxRadioButton ; |
0dbd6262 | 23 | |
584bede0 | 24 | class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase |
0dbd6262 | 25 | { |
e40298d5 | 26 | DECLARE_DYNAMIC_CLASS(wxRadioBox) |
0dbd6262 | 27 | public: |
1395ff56 | 28 | // Constructors & destructor |
e40298d5 JS |
29 | wxRadioBox(); |
30 | inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, | |
1395ff56 UJ |
31 | const wxPoint& pos = wxDefaultPosition, 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, const wxString& name = wxRadioBoxNameStr) | |
e40298d5 JS |
35 | { |
36 | Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name); | |
37 | } | |
38 | ~wxRadioBox(); | |
39 | bool Create(wxWindow *parent, wxWindowID id, const wxString& title, | |
1395ff56 UJ |
40 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
41 | int n = 0, const wxString choices[] = NULL, | |
42 | int majorDim = 0, long style = wxRA_HORIZONTAL, | |
43 | const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); | |
44 | ||
45 | // Specific functions (in wxWindows2 reference) | |
e40298d5 JS |
46 | virtual void SetSelection(int item); |
47 | virtual int GetSelection() const; | |
90b959ae | 48 | |
e40298d5 JS |
49 | inline virtual int GetCount() const { return m_noItems; } ; |
50 | ||
51 | virtual wxString GetString(int item) const; | |
52 | virtual void SetString(int item, const wxString& label) ; | |
53 | ||
54 | virtual void Enable(int item, bool enable); | |
55 | virtual void Show(int item, bool show) ; | |
90b959ae SC |
56 | |
57 | virtual int GetColumnCount() const ; | |
58 | virtual int GetRowCount() const ; | |
59 | ||
60 | ||
e40298d5 JS |
61 | virtual bool Enable(bool enable = TRUE); |
62 | virtual wxString GetLabel() const; | |
63 | virtual void SetLabel(const wxString& label) ; | |
64 | virtual bool Show(bool show = TRUE); | |
1395ff56 UJ |
65 | |
66 | // Other external functions | |
e40298d5 JS |
67 | void Command(wxCommandEvent& event); |
68 | void SetFocus(); | |
1395ff56 UJ |
69 | |
70 | // Other variable access functions | |
e40298d5 JS |
71 | inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; } |
72 | inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; } | |
0dbd6262 | 73 | |
e40298d5 | 74 | void OnRadioButton( wxCommandEvent& event ) ; |
0dbd6262 | 75 | protected: |
e40298d5 JS |
76 | wxRadioButton *m_radioButtonCycle; |
77 | ||
78 | int m_majorDim ; | |
79 | int m_noItems; | |
80 | int m_noRowsOrCols; | |
1395ff56 UJ |
81 | |
82 | // Internal functions | |
9453cf2b | 83 | virtual wxSize DoGetBestSize() const ; |
e40298d5 | 84 | virtual void DoSetSize(int x, int y, |
519cb848 SC |
85 | int width, int height, |
86 | int sizeFlags = wxSIZE_AUTO); | |
1395ff56 | 87 | |
cf1a9b45 | 88 | DECLARE_EVENT_TABLE() |
0dbd6262 SC |
89 | }; |
90 | ||
91 | #endif | |
92 | // _WX_RADIOBOX_H_ |