]>
Commit | Line | Data |
---|---|---|
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 | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_RADIOBUT_H_ | |
13 | #define _WX_RADIOBUT_H_ | |
14 | ||
15 | #if defined(__GNUG__) && !defined(__APPLE__) | |
16 | #pragma interface "radiobut.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/control.h" | |
20 | ||
21 | class WXDLLEXPORT wxRadioButton: public wxControl | |
22 | { | |
23 | DECLARE_DYNAMIC_CLASS(wxRadioButton) | |
24 | protected: | |
25 | public: | |
26 | wxRadioButton(); | |
27 | ~wxRadioButton() { RemoveFromCycle(); } | |
28 | ||
29 | inline wxRadioButton(wxWindow *parent, wxWindowID id, | |
30 | const wxString& label, | |
31 | const wxPoint& pos = wxDefaultPosition, | |
32 | const wxSize& size = wxDefaultSize, long style = 0, | |
33 | const wxValidator& validator = wxDefaultValidator, | |
34 | const wxString& name = wxRadioButtonNameStr) | |
35 | { | |
36 | Create(parent, id, label, pos, size, style, validator, name); | |
37 | } | |
38 | ||
39 | bool Create(wxWindow *parent, wxWindowID id, | |
40 | const wxString& label, | |
41 | const wxPoint& pos = wxDefaultPosition, | |
42 | const wxSize& size = wxDefaultSize, long style = 0, | |
43 | const wxValidator& validator = wxDefaultValidator, | |
44 | const wxString& name = wxRadioButtonNameStr); | |
45 | ||
46 | virtual void SetValue(bool val); | |
47 | virtual bool GetValue() const ; | |
48 | ||
49 | void Command(wxCommandEvent& event); | |
50 | ||
51 | // Implementation | |
52 | virtual void ChangeFont(bool keepOriginalSize = TRUE); | |
53 | virtual void ChangeBackgroundColour(); | |
54 | virtual void ChangeForegroundColour(); | |
55 | ||
56 | // *this function is an implementation detail* | |
57 | // clears the selection in the readiobuttons in the cycle | |
58 | // and returns the old selection (if any) | |
59 | wxRadioButton* ClearSelections(); | |
60 | private: | |
61 | wxRadioButton* AddInCycle(wxRadioButton* cycle); | |
62 | void RemoveFromCycle(); | |
63 | wxRadioButton* NextInCycle() { return m_cycle; } | |
64 | ||
65 | wxRadioButton *m_cycle; | |
66 | }; | |
67 | ||
68 | #endif | |
69 | // _WX_RADIOBUT_H_ |