1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cocoa/radiobut.mm
3 // Purpose: wxRadioButton
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #include "wx/radiobut.h"
16 #import <AppKit/NSButton.h>
17 #import <Foundation/NSString.h>
19 IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
20 // wxRadioButtonBase == wxControl
21 BEGIN_EVENT_TABLE(wxRadioButton, wxControl)
23 WX_IMPLEMENT_COCOA_OWNER(wxRadioButton,NSButton,NSControl,NSView)
25 bool wxRadioButton::Create(wxWindow *parent, wxWindowID winid,
26 const wxString& label,
30 const wxValidator& validator,
33 if(!CreateControl(parent,winid,pos,size,style,validator,name))
36 NSRect cocoaRect = NSMakeRect(10,10,20,20);
37 SetNSButton([[NSButton alloc] initWithFrame: cocoaRect]);
38 [m_cocoaNSView release];
39 [GetNSButton() setButtonType: NSRadioButton];
40 [GetNSButton() setTitle:[NSString stringWithCString: label.c_str()]];
41 [GetNSControl() sizeToFit];
44 m_parent->CocoaAddChild(this);
48 wxRadioButton::~wxRadioButton()
50 CocoaRemoveFromParent();
54 void wxRadioButton::SetValue(bool)
58 bool wxRadioButton::GetValue() const
63 void wxRadioButton::Cocoa_wxNSButtonAction(void)
65 wxLogDebug("wxRadioButton");