]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/radiobut.cpp
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 IMPLEMENT_DYNAMIC_CLASS(wxRadioButton
, wxControl
)
20 #include <wx/mac/uma.h>
22 bool wxRadioButton::Create(wxWindow
*parent
, wxWindowID id
,
23 const wxString
& label
,
25 const wxSize
& size
, long style
,
26 const wxValidator
& validator
,
34 MacPreControlCreate( parent
, id
, label
, pos
, size
,style
, validator
, name
, &bounds
, title
) ;
36 m_macControl
= UMANewControl( parent
->GetMacRootWindow() , &bounds
, title
, true , 0 , 0 , 1,
37 kControlRadioButtonProc
, (long) this ) ;
39 MacPostControlCreate() ;
44 void wxRadioButton::SetValue(bool val
)
49 ::SetControlValue( m_macControl
, val
) ;
52 cycle
=this->NextInCycle();
55 cycle
->SetValue(false);
56 cycle
=cycle
->NextInCycle();
62 bool wxRadioButton::GetValue() const
64 return ::GetControlValue( m_macControl
) ;
67 void wxRadioButton::Command (wxCommandEvent
& event
)
69 SetValue ( (event
.GetInt() != 0) );
70 ProcessCommand (event
);
73 void wxRadioButton::MacHandleControlClick( ControlHandle control
, SInt16 controlpart
)
78 wxRadioButton
*wxRadioButton::AddInCycle(wxRadioButton
*cycle
)
80 wxRadioButton
*next
,*current
;
88 while ((next
=current
->m_cycle
)!=cycle
) current
=current
->m_cycle
;
90 current
->m_cycle
=this;