]>
Commit | Line | Data |
---|---|---|
da0634c1 DE |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/cocoa/radiobut.h | |
3 | // Purpose: wxRadioButton class | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2003/03/18 | |
da0634c1 | 7 | // Copyright: (c) 2003 David Elliott |
1c4e8f38 | 8 | // Licence: wxWindows licence |
da0634c1 DE |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef __WX_COCOA_RADIOBUT_H__ | |
12 | #define __WX_COCOA_RADIOBUT_H__ | |
13 | ||
14 | #include "wx/cocoa/NSButton.h" | |
15 | ||
b5dbe15d | 16 | class WXDLLIMPEXP_FWD_CORE wxRadioButton; |
d0a5e34a | 17 | |
8da116cf | 18 | WX_DECLARE_EXPORTED_LIST(wxRadioButton, wxRadioButtonList); |
d0a5e34a | 19 | |
da0634c1 DE |
20 | // ======================================================================== |
21 | // wxRadioButton | |
22 | // ======================================================================== | |
53a2db12 | 23 | class WXDLLIMPEXP_CORE wxRadioButton: public wxControl, protected wxCocoaNSButton |
da0634c1 DE |
24 | { |
25 | DECLARE_DYNAMIC_CLASS(wxRadioButton) | |
26 | DECLARE_EVENT_TABLE() | |
27 | WX_DECLARE_COCOA_OWNER(NSButton,NSControl,NSView) | |
28 | // ------------------------------------------------------------------------ | |
29 | // initialization | |
30 | // ------------------------------------------------------------------------ | |
31 | public: | |
d0a5e34a | 32 | wxRadioButton() { m_radioMaster = NULL; } |
da0634c1 DE |
33 | wxRadioButton(wxWindow *parent, wxWindowID winid, |
34 | const wxString& label, | |
35 | const wxPoint& pos = wxDefaultPosition, | |
36 | const wxSize& size = wxDefaultSize, | |
37 | long style = 0, | |
38 | const wxValidator& validator = wxDefaultValidator, | |
39 | const wxString& name = wxRadioButtonNameStr) | |
40 | { | |
41 | Create(parent, winid, label, pos, size, style, validator, name); | |
42 | } | |
43 | ||
44 | bool Create(wxWindow *parent, wxWindowID winid, | |
45 | const wxString& label, | |
46 | const wxPoint& pos = wxDefaultPosition, | |
47 | const wxSize& size = wxDefaultSize, | |
48 | long style = 0, | |
49 | const wxValidator& validator = wxDefaultValidator, | |
50 | const wxString& name = wxRadioButtonNameStr); | |
51 | virtual ~wxRadioButton(); | |
52 | ||
53 | // ------------------------------------------------------------------------ | |
54 | // Cocoa callbacks | |
55 | // ------------------------------------------------------------------------ | |
56 | protected: | |
57 | virtual void Cocoa_wxNSButtonAction(void); | |
18359b19 DE |
58 | private: |
59 | void Cocoa_DeselectOtherButtonsInTheGroup(void); | |
da0634c1 DE |
60 | // ------------------------------------------------------------------------ |
61 | // Implementation | |
62 | // ------------------------------------------------------------------------ | |
63 | public: | |
64 | virtual void SetValue(bool); | |
65 | virtual bool GetValue() const; | |
3c0f8ed2 DE |
66 | virtual void SetLabel(const wxString& label); |
67 | virtual wxString GetLabel() const; | |
d0a5e34a DE |
68 | protected: |
69 | wxRadioButtonList m_radioSlaves; | |
70 | wxRadioButton *m_radioMaster; | |
da0634c1 DE |
71 | }; |
72 | ||
73 | #endif // __WX_COCOA_RADIOBUT_H__ |