1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/radiobut.h
3 // Purpose: wxRadioButton class
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __WX_COCOA_RADIOBUT_H__
13 #define __WX_COCOA_RADIOBUT_H__
15 #include "wx/cocoa/NSButton.h"
17 class WXDLLIMPEXP_FWD_CORE wxRadioButton
;
19 WX_DECLARE_LIST(wxRadioButton
, wxRadioButtonList
);
21 // ========================================================================
23 // ========================================================================
24 class WXDLLEXPORT wxRadioButton
: public wxControl
, protected wxCocoaNSButton
26 DECLARE_DYNAMIC_CLASS(wxRadioButton
)
28 WX_DECLARE_COCOA_OWNER(NSButton
,NSControl
,NSView
)
29 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
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
,
39 const wxValidator
& validator
= wxDefaultValidator
,
40 const wxString
& name
= wxRadioButtonNameStr
)
42 Create(parent
, winid
, label
, pos
, size
, style
, validator
, name
);
45 bool Create(wxWindow
*parent
, wxWindowID winid
,
46 const wxString
& label
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
50 const wxValidator
& validator
= wxDefaultValidator
,
51 const wxString
& name
= wxRadioButtonNameStr
);
52 virtual ~wxRadioButton();
54 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
58 virtual void Cocoa_wxNSButtonAction(void);
60 void Cocoa_DeselectOtherButtonsInTheGroup(void);
61 // ------------------------------------------------------------------------
63 // ------------------------------------------------------------------------
65 virtual void SetValue(bool);
66 virtual bool GetValue() const;
67 virtual void SetLabel(const wxString
& label
);
68 virtual wxString
GetLabel() const;
70 wxRadioButtonList m_radioSlaves
;
71 wxRadioButton
*m_radioMaster
;
74 #endif // __WX_COCOA_RADIOBUT_H__