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