]>
Commit | Line | Data |
---|---|---|
1 | /////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/univ/radiobut.h | |
3 | // Purpose: wxRadioButton declaration | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 10.09.00 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) | |
9 | // Licence: wxWindows licence | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_UNIV_RADIOBUT_H_ | |
13 | #define _WX_UNIV_RADIOBUT_H_ | |
14 | ||
15 | #include "wx/checkbox.h" | |
16 | ||
17 | // ---------------------------------------------------------------------------- | |
18 | // wxRadioButton | |
19 | // ---------------------------------------------------------------------------- | |
20 | ||
21 | class WXDLLIMPEXP_CORE wxRadioButton : public wxCheckBox | |
22 | { | |
23 | public: | |
24 | // constructors | |
25 | wxRadioButton() { Init(); } | |
26 | ||
27 | wxRadioButton(wxWindow *parent, | |
28 | wxWindowID id, | |
29 | const wxString& label, | |
30 | const wxPoint& pos = wxDefaultPosition, | |
31 | const wxSize& size = wxDefaultSize, | |
32 | long style = 0, | |
33 | const wxValidator& validator = wxDefaultValidator, | |
34 | const wxString& name = wxRadioButtonNameStr) | |
35 | { | |
36 | Init(); | |
37 | ||
38 | Create(parent, id, label, pos, size, style, validator, name); | |
39 | } | |
40 | ||
41 | bool Create(wxWindow *parent, | |
42 | wxWindowID id, | |
43 | const wxString& label, | |
44 | const wxPoint& pos = wxDefaultPosition, | |
45 | const wxSize& size = wxDefaultSize, | |
46 | long style = 0, | |
47 | const wxValidator& validator = wxDefaultValidator, | |
48 | const wxString& name = wxRadioButtonNameStr); | |
49 | ||
50 | // override some base class methods | |
51 | virtual void ChangeValue(bool value); | |
52 | ||
53 | protected: | |
54 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } | |
55 | ||
56 | // implement our own drawing | |
57 | virtual void DoDraw(wxControlRenderer *renderer); | |
58 | ||
59 | // we use the radio button bitmaps for size calculation | |
60 | virtual wxSize GetBitmapSize() const; | |
61 | ||
62 | // the radio button can only be cleared using this method, not | |
63 | // ChangeValue() above - and it is protected as it can only be called by | |
64 | // another radiobutton | |
65 | void ClearValue(); | |
66 | ||
67 | // called when the radio button becomes checked: we clear all the buttons | |
68 | // in the same group with us here | |
69 | virtual void OnCheck(); | |
70 | ||
71 | // send event about radio button selection | |
72 | virtual void SendEvent(); | |
73 | ||
74 | private: | |
75 | DECLARE_DYNAMIC_CLASS(wxRadioButton) | |
76 | }; | |
77 | ||
78 | #endif // _WX_UNIV_RADIOBUT_H_ |