]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/radiobut.h
Add support for custom attributes to wxOSX/Cocoa wxDataViewCustomRenderer.
[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 // RCS-ID: $Id$
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __WX_COCOA_RADIOBUT_H__
13 #define __WX_COCOA_RADIOBUT_H__
14
15 #include "wx/cocoa/NSButton.h"
16
17 class WXDLLIMPEXP_FWD_CORE wxRadioButton;
18
19 WX_DECLARE_EXPORTED_LIST(wxRadioButton, wxRadioButtonList);
20
21 // ========================================================================
22 // wxRadioButton
23 // ========================================================================
24 class WXDLLIMPEXP_CORE wxRadioButton: public wxControl, protected wxCocoaNSButton
25 {
26 DECLARE_DYNAMIC_CLASS(wxRadioButton)
27 DECLARE_EVENT_TABLE()
28 WX_DECLARE_COCOA_OWNER(NSButton,NSControl,NSView)
29 // ------------------------------------------------------------------------
30 // initialization
31 // ------------------------------------------------------------------------
32 public:
33 wxRadioButton() { m_radioMaster = NULL; }
34 wxRadioButton(wxWindow *parent, wxWindowID winid,
35 const wxString& label,
36 const wxPoint& pos = wxDefaultPosition,
37 const wxSize& size = wxDefaultSize,
38 long style = 0,
39 const wxValidator& validator = wxDefaultValidator,
40 const wxString& name = wxRadioButtonNameStr)
41 {
42 Create(parent, winid, label, pos, size, style, validator, name);
43 }
44
45 bool Create(wxWindow *parent, wxWindowID winid,
46 const wxString& label,
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& size = wxDefaultSize,
49 long style = 0,
50 const wxValidator& validator = wxDefaultValidator,
51 const wxString& name = wxRadioButtonNameStr);
52 virtual ~wxRadioButton();
53
54 // ------------------------------------------------------------------------
55 // Cocoa callbacks
56 // ------------------------------------------------------------------------
57 protected:
58 virtual void Cocoa_wxNSButtonAction(void);
59 private:
60 void Cocoa_DeselectOtherButtonsInTheGroup(void);
61 // ------------------------------------------------------------------------
62 // Implementation
63 // ------------------------------------------------------------------------
64 public:
65 virtual void SetValue(bool);
66 virtual bool GetValue() const;
67 virtual void SetLabel(const wxString& label);
68 virtual wxString GetLabel() const;
69 protected:
70 wxRadioButtonList m_radioSlaves;
71 wxRadioButton *m_radioMaster;
72 };
73
74 #endif // __WX_COCOA_RADIOBUT_H__