]>
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 | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_RADIOBUT_H_ | |
13 | #define _WX_RADIOBUT_H_ | |
14 | ||
3399051e | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
9b6dbb09 JS |
16 | #pragma interface "radiobut.h" |
17 | #endif | |
18 | ||
19 | #include "wx/control.h" | |
20 | ||
21 | WXDLLEXPORT_DATA(extern const char*) wxRadioButtonNameStr; | |
22 | ||
23 | class WXDLLEXPORT wxRadioButton: public wxControl | |
24 | { | |
a4294b78 JS |
25 | DECLARE_DYNAMIC_CLASS(wxRadioButton) |
26 | protected: | |
27 | public: | |
28 | wxRadioButton(); | |
f37907ff MB |
29 | ~wxRadioButton() { RemoveFromCycle(); } |
30 | ||
a4294b78 | 31 | inline wxRadioButton(wxWindow *parent, wxWindowID id, |
83df96d6 JS |
32 | const wxString& label, |
33 | const wxPoint& pos = wxDefaultPosition, | |
34 | const wxSize& size = wxDefaultSize, long style = 0, | |
35 | const wxValidator& validator = wxDefaultValidator, | |
36 | const wxString& name = wxRadioButtonNameStr) | |
a4294b78 JS |
37 | { |
38 | Create(parent, id, label, pos, size, style, validator, name); | |
39 | } | |
83df96d6 | 40 | |
a4294b78 | 41 | bool Create(wxWindow *parent, wxWindowID id, |
83df96d6 JS |
42 | const wxString& label, |
43 | const wxPoint& pos = wxDefaultPosition, | |
44 | const wxSize& size = wxDefaultSize, long style = 0, | |
45 | const wxValidator& validator = wxDefaultValidator, | |
46 | const wxString& name = wxRadioButtonNameStr); | |
47 | ||
a4294b78 JS |
48 | virtual void SetValue(bool val); |
49 | virtual bool GetValue() const ; | |
83df96d6 | 50 | |
a4294b78 | 51 | void Command(wxCommandEvent& event); |
83df96d6 JS |
52 | |
53 | // Implementation | |
4b5f3fe6 | 54 | virtual void ChangeFont(bool keepOriginalSize = TRUE); |
0d57be45 JS |
55 | virtual void ChangeBackgroundColour(); |
56 | virtual void ChangeForegroundColour(); | |
f37907ff MB |
57 | |
58 | // *this function is an implementation detail* | |
59 | // clears the selection in the readiobuttons in the cycle | |
60 | // and returns the old selection (if any) | |
61 | wxRadioButton* ClearSelections(); | |
62 | private: | |
63 | wxRadioButton* AddInCycle(wxRadioButton* cycle); | |
64 | void RemoveFromCycle(); | |
65 | wxRadioButton* NextInCycle() { return m_cycle; } | |
66 | ||
67 | wxRadioButton *m_cycle; | |
9b6dbb09 JS |
68 | }; |
69 | ||
70 | // Not implemented | |
71 | #if 0 | |
72 | class WXDLLEXPORT wxBitmap ; | |
73 | ||
74 | WXDLLEXPORT_DATA(extern const char*) wxBitmapRadioButtonNameStr; | |
75 | ||
76 | class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton | |
77 | { | |
83df96d6 JS |
78 | DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton) |
79 | protected: | |
80 | wxBitmap *theButtonBitmap; | |
81 | public: | |
82 | inline wxBitmapRadioButton() { theButtonBitmap = NULL; } | |
83 | inline wxBitmapRadioButton(wxWindow *parent, wxWindowID id, | |
84 | const wxBitmap *label, | |
85 | const wxPoint& pos = wxDefaultPosition, | |
86 | const wxSize& size = wxDefaultSize, long style = 0, | |
87 | const wxValidator& validator = wxDefaultValidator, | |
88 | const wxString& name = wxBitmapRadioButtonNameStr) | |
89 | { | |
90 | Create(parent, id, label, pos, size, style, validator, name); | |
91 | } | |
92 | ||
93 | bool Create(wxWindow *parent, wxWindowID id, | |
94 | const wxBitmap *label, | |
95 | const wxPoint& pos = wxDefaultPosition, | |
96 | const wxSize& size = wxDefaultSize, long style = 0, | |
97 | const wxValidator& validator = wxDefaultValidator, | |
98 | const wxString& name = wxBitmapRadioButtonNameStr); | |
99 | ||
100 | virtual void SetLabel(const wxBitmap *label); | |
101 | virtual void SetValue(bool val) ; | |
102 | virtual bool GetValue() const ; | |
9b6dbb09 JS |
103 | }; |
104 | #endif | |
105 | ||
106 | #endif | |
83df96d6 | 107 | // _WX_RADIOBUT_H_ |