]>
Commit | Line | Data |
---|---|---|
ffecfa5a | 1 | ///////////////////////////////////////////////////////////////////////////// |
e1d63b79 | 2 | // Name: wx/palmos/radiobut.h |
ffecfa5a | 3 | // Purpose: wxRadioButton class |
e1d63b79 | 4 | // Author: William Osborne - minimal working wxPalmOS port |
808e3bce | 5 | // Modified by: Wlodzimierz ABX Skiba - native wxRadioButton implementation |
ffecfa5a | 6 | // Created: 10/13/04 |
e1d63b79 | 7 | // RCS-ID: $Id$ |
808e3bce | 8 | // Copyright: (c) William Osborne, Wlodzimierz Skiba |
ffecfa5a JS |
9 | // Licence: wxWindows licence |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_RADIOBUT_H_ | |
13 | #define _WX_RADIOBUT_H_ | |
14 | ||
15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
16 | #pragma interface "radiobut.h" | |
17 | #endif | |
18 | ||
19 | class WXDLLEXPORT wxRadioButton: public wxControl | |
20 | { | |
21 | public: | |
22 | // ctors and creation functions | |
23 | wxRadioButton() { Init(); } | |
24 | ||
25 | wxRadioButton(wxWindow *parent, | |
26 | wxWindowID id, | |
27 | const wxString& label, | |
28 | const wxPoint& pos = wxDefaultPosition, | |
29 | const wxSize& size = wxDefaultSize, | |
30 | long style = 0, | |
31 | const wxValidator& validator = wxDefaultValidator, | |
32 | const wxString& name = wxRadioButtonNameStr) | |
33 | { | |
34 | Init(); | |
35 | ||
36 | Create(parent, id, label, pos, size, style, validator, name); | |
37 | } | |
38 | ||
39 | bool Create(wxWindow *parent, | |
40 | wxWindowID id, | |
41 | const wxString& label, | |
42 | const wxPoint& pos = wxDefaultPosition, | |
43 | const wxSize& size = wxDefaultSize, | |
44 | long style = 0, | |
45 | const wxValidator& validator = wxDefaultValidator, | |
46 | const wxString& name = wxRadioButtonNameStr); | |
47 | ||
48 | // implement the radio button interface | |
49 | virtual void SetValue(bool value); | |
50 | virtual bool GetValue() const; | |
51 | ||
52 | // implementation only from now on | |
ffecfa5a | 53 | virtual void Command(wxCommandEvent& event); |
8be10866 | 54 | void SetGroup(uint8_t group); |
a152561c WS |
55 | |
56 | // send a notification event, return true if processed | |
57 | bool SendClickEvent(); | |
58 | ||
ffecfa5a JS |
59 | virtual void ApplyParentThemeBackground(const wxColour& bg) |
60 | { SetBackgroundColour(bg); } | |
61 | ||
62 | ||
63 | protected: | |
64 | virtual wxSize DoGetBestSize() const; | |
65 | ||
66 | private: | |
67 | // common part of all ctors | |
68 | void Init(); | |
69 | ||
8be10866 WS |
70 | uint8_t m_groupID; |
71 | ||
a152561c WS |
72 | // pushButtonCtl or checkboxCtl |
73 | ControlStyleType m_radioStyle; | |
ffecfa5a JS |
74 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton) |
75 | }; | |
76 | ||
77 | #endif | |
78 | // _WX_RADIOBUT_H_ |