]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/radiobut.h
Add wxActivateEvent::GetActivationReason().
[wxWidgets.git] / include / wx / cocoa / radiobut.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/radiobut.h
3 // Purpose: wxRadioButton class
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2003/03/18
7 // Copyright: (c) 2003 David Elliott
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef __WX_COCOA_RADIOBUT_H__
12 #define __WX_COCOA_RADIOBUT_H__
13
14 #include "wx/cocoa/NSButton.h"
15
16 class WXDLLIMPEXP_FWD_CORE wxRadioButton;
17
18 WX_DECLARE_EXPORTED_LIST(wxRadioButton, wxRadioButtonList);
19
20 // ========================================================================
21 // wxRadioButton
22 // ========================================================================
23 class WXDLLIMPEXP_CORE wxRadioButton: public wxControl, protected wxCocoaNSButton
24 {
25 DECLARE_DYNAMIC_CLASS(wxRadioButton)
26 DECLARE_EVENT_TABLE()
27 WX_DECLARE_COCOA_OWNER(NSButton,NSControl,NSView)
28 // ------------------------------------------------------------------------
29 // initialization
30 // ------------------------------------------------------------------------
31 public:
32 wxRadioButton() { m_radioMaster = NULL; }
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);
58 private:
59 void Cocoa_DeselectOtherButtonsInTheGroup(void);
60 // ------------------------------------------------------------------------
61 // Implementation
62 // ------------------------------------------------------------------------
63 public:
64 virtual void SetValue(bool);
65 virtual bool GetValue() const;
66 virtual void SetLabel(const wxString& label);
67 virtual wxString GetLabel() const;
68 protected:
69 wxRadioButtonList m_radioSlaves;
70 wxRadioButton *m_radioMaster;
71 };
72
73 #endif // __WX_COCOA_RADIOBUT_H__