]>
Commit | Line | Data |
---|---|---|
9b6dbb09 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: radiobut.h | |
3 | // Purpose: wxRadioButton class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
65571936 | 9 | // Licence: wxWindows licence |
9b6dbb09 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_RADIOBUT_H_ | |
13 | #define _WX_RADIOBUT_H_ | |
14 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
9b6dbb09 JS |
16 | #pragma interface "radiobut.h" |
17 | #endif | |
18 | ||
9b6dbb09 JS |
19 | class WXDLLEXPORT wxRadioButton: public wxControl |
20 | { | |
a4294b78 | 21 | DECLARE_DYNAMIC_CLASS(wxRadioButton) |
a4294b78 JS |
22 | public: |
23 | wxRadioButton(); | |
f37907ff MB |
24 | ~wxRadioButton() { RemoveFromCycle(); } |
25 | ||
a4294b78 | 26 | inline wxRadioButton(wxWindow *parent, wxWindowID id, |
83df96d6 JS |
27 | const wxString& label, |
28 | const wxPoint& pos = wxDefaultPosition, | |
29 | const wxSize& size = wxDefaultSize, long style = 0, | |
30 | const wxValidator& validator = wxDefaultValidator, | |
31 | const wxString& name = wxRadioButtonNameStr) | |
a4294b78 JS |
32 | { |
33 | Create(parent, id, label, pos, size, style, validator, name); | |
34 | } | |
83df96d6 | 35 | |
a4294b78 | 36 | bool Create(wxWindow *parent, wxWindowID id, |
83df96d6 JS |
37 | const wxString& label, |
38 | const wxPoint& pos = wxDefaultPosition, | |
39 | const wxSize& size = wxDefaultSize, long style = 0, | |
40 | const wxValidator& validator = wxDefaultValidator, | |
41 | const wxString& name = wxRadioButtonNameStr); | |
42 | ||
a4294b78 JS |
43 | virtual void SetValue(bool val); |
44 | virtual bool GetValue() const ; | |
83df96d6 | 45 | |
a4294b78 | 46 | void Command(wxCommandEvent& event); |
83df96d6 JS |
47 | |
48 | // Implementation | |
0d57be45 | 49 | virtual void ChangeBackgroundColour(); |
f37907ff MB |
50 | |
51 | // *this function is an implementation detail* | |
f96b10c2 | 52 | // clears the selection in the radiobuttons in the cycle |
f37907ff MB |
53 | // and returns the old selection (if any) |
54 | wxRadioButton* ClearSelections(); | |
55 | private: | |
56 | wxRadioButton* AddInCycle(wxRadioButton* cycle); | |
57 | void RemoveFromCycle(); | |
58 | wxRadioButton* NextInCycle() { return m_cycle; } | |
59 | ||
60 | wxRadioButton *m_cycle; | |
9b6dbb09 JS |
61 | }; |
62 | ||
9b6dbb09 | 63 | #endif |
83df96d6 | 64 | // _WX_RADIOBUT_H_ |