1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxRadioButton
5 // Modified by: JS Lair (99/11/15) adding the cyclic groupe notion for radiobox
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "radiobut.h"
16 #include "wx/radiobut.h"
18 #if !USE_SHARED_LIBRARY
19 IMPLEMENT_DYNAMIC_CLASS(wxRadioButton
, wxControl
)
22 #include <wx/mac/uma.h>
24 bool wxRadioButton::Create(wxWindow
*parent
, wxWindowID id
,
25 const wxString
& label
,
27 const wxSize
& size
, long style
,
28 const wxValidator
& validator
,
36 MacPreControlCreate( parent
, id
, label
, pos
, size
,style
, validator
, name
, &bounds
, title
) ;
38 m_macControl
= UMANewControl( parent
->GetMacRootWindow() , &bounds
, title
, true , 0 , 0 , 1,
39 kControlRadioButtonProc
, (long) this ) ;
41 MacPostControlCreate() ;
46 void wxRadioButton::SetValue(bool val
)
51 ::SetControlValue( m_macControl
, val
) ;
55 cycle
=this->NextInCycle();
58 cycle
->SetValue(false);
59 cycle
=cycle
->NextInCycle();
65 bool wxRadioButton::GetValue() const
67 return ::GetControlValue( m_macControl
) ;
70 void wxRadioButton::Command (wxCommandEvent
& event
)
72 SetValue ( (event
.GetInt() != 0) );
73 ProcessCommand (event
);
76 void wxRadioButton::MacHandleControlClick( ControlHandle control
, SInt16 controlpart
)
79 wxCommandEvent
event(wxEVT_COMMAND_RADIOBUTTON_SELECTED
, m_windowId
);
80 event
.SetEventObject(this);
81 ProcessCommand(event
);
84 wxRadioButton
*wxRadioButton::AddInCycle(wxRadioButton
*cycle
)
86 wxRadioButton
*next
,*current
;
94 while ((next
=current
->m_cycle
)!=cycle
) current
=current
->m_cycle
;
96 current
->m_cycle
=this;