]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/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 #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
) ;
54 cycle
=this->NextInCycle();
57 cycle
->SetValue(false);
58 cycle
=cycle
->NextInCycle();
64 bool wxRadioButton::GetValue() const
66 return ::GetControlValue( m_macControl
) ;
69 void wxRadioButton::Command (wxCommandEvent
& event
)
71 SetValue ( (event
.GetInt() != 0) );
72 ProcessCommand (event
);
75 void wxRadioButton::MacHandleControlClick( ControlHandle control
, SInt16 controlpart
)
80 wxRadioButton
*wxRadioButton::AddInCycle(wxRadioButton
*cycle
)
82 wxRadioButton
*next
,*current
;
90 while ((next
=current
->m_cycle
)!=cycle
) current
=current
->m_cycle
;
92 current
->m_cycle
=this;