]>
Commit | Line | Data |
---|---|---|
6762286d SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/mac/carbon/radiobox.h | |
3 | // Purpose: wxRadioBox class | |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Stefan Csomor | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_RADIOBOX_H_ | |
13 | #define _WX_RADIOBOX_H_ | |
14 | ||
15 | // List box item | |
16 | class WXDLLIMPEXP_FWD_CORE wxBitmap ; | |
17 | ||
18 | class WXDLLIMPEXP_FWD_CORE wxRadioButton ; | |
19 | ||
20 | class WXDLLIMPEXP_CORE wxRadioBox: public wxControl, public wxRadioBoxBase | |
21 | { | |
22 | DECLARE_DYNAMIC_CLASS(wxRadioBox) | |
23 | public: | |
24 | // Constructors & destructor | |
25 | wxRadioBox(); | |
26 | inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, | |
27 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
28 | int n = 0, const wxString choices[] = NULL, | |
3998c74b | 29 | int majorDim = 0, long style = wxRA_SPECIFY_COLS, |
6762286d SC |
30 | const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr) |
31 | { | |
32 | Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name); | |
33 | } | |
34 | inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, | |
35 | const wxPoint& pos, const wxSize& size, | |
36 | const wxArrayString& choices, | |
3998c74b | 37 | int majorDim = 0, long style = wxRA_SPECIFY_COLS, |
6762286d SC |
38 | const wxValidator& val = wxDefaultValidator, |
39 | const wxString& name = wxRadioBoxNameStr) | |
40 | { | |
41 | Create(parent, id, title, pos, size, choices, | |
42 | majorDim, style, val, name); | |
43 | } | |
44 | virtual ~wxRadioBox(); | |
45 | bool Create(wxWindow *parent, wxWindowID id, const wxString& title, | |
46 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
47 | int n = 0, const wxString choices[] = NULL, | |
3998c74b | 48 | int majorDim = 0, long style = wxRA_SPECIFY_COLS, |
6762286d SC |
49 | const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); |
50 | bool Create(wxWindow *parent, wxWindowID id, const wxString& title, | |
51 | const wxPoint& pos, const wxSize& size, | |
52 | const wxArrayString& choices, | |
3998c74b | 53 | int majorDim = 0, long style = wxRA_SPECIFY_COLS, |
6762286d SC |
54 | const wxValidator& val = wxDefaultValidator, |
55 | const wxString& name = wxRadioBoxNameStr); | |
56 | ||
57 | // Enabling | |
58 | virtual bool Enable(bool enable = true); | |
59 | virtual bool Enable(unsigned int item, bool enable = true); | |
60 | virtual bool IsItemEnabled(unsigned int item) const; | |
61 | ||
62 | // Showing | |
63 | virtual bool Show(bool show = true); | |
64 | virtual bool Show(unsigned int item, bool show = true); | |
65 | virtual bool IsItemShown(unsigned int item) const; | |
66 | ||
67 | // Specific functions (in wxWidgets2 reference) | |
68 | virtual void SetSelection(int item); | |
69 | virtual int GetSelection() const; | |
70 | ||
71 | virtual unsigned int GetCount() const { return m_noItems; } | |
72 | ||
73 | virtual wxString GetString(unsigned int item) const; | |
74 | virtual void SetString(unsigned int item, const wxString& label); | |
75 | ||
76 | virtual wxString GetLabel() const; | |
77 | virtual void SetLabel(const wxString& label) ; | |
78 | ||
79 | // protect native font of box | |
80 | virtual bool SetFont( const wxFont &font ); | |
81 | // Other external functions | |
82 | void Command(wxCommandEvent& event); | |
83 | void SetFocus(); | |
84 | ||
85 | // Other variable access functions | |
86 | inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; } | |
87 | inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; } | |
88 | ||
89 | void OnRadioButton( wxCommandEvent& event ) ; | |
90 | ||
91 | protected: | |
92 | wxRadioButton *m_radioButtonCycle; | |
93 | ||
94 | unsigned int m_noItems; | |
95 | int m_noRowsOrCols; | |
96 | ||
97 | // Internal functions | |
98 | virtual wxSize DoGetBestSize() const ; | |
99 | virtual void DoSetSize(int x, int y, | |
100 | int width, int height, | |
101 | int sizeFlags = wxSIZE_AUTO); | |
102 | ||
103 | DECLARE_EVENT_TABLE() | |
104 | }; | |
105 | ||
5c6eb3a8 | 106 | #endif |
6762286d | 107 | // _WX_RADIOBOX_H_ |