1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxRadioButton class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_RADIOBUT_H_
13 #define _WX_RADIOBUT_H_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "radiobut.h"
19 class WXDLLEXPORT wxRadioButton
: public wxControl
21 DECLARE_DYNAMIC_CLASS(wxRadioButton
)
24 ~wxRadioButton() { RemoveFromCycle(); }
26 inline wxRadioButton(wxWindow
*parent
, wxWindowID id
,
27 const wxString
& label
,
28 const wxPoint
& pos
= wxDefaultPosition
,
29 const wxSize
& size
= wxDefaultSize
, long style
= 0,
30 const wxValidator
& validator
= wxDefaultValidator
,
31 const wxString
& name
= wxRadioButtonNameStr
)
33 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
36 bool Create(wxWindow
*parent
, wxWindowID id
,
37 const wxString
& label
,
38 const wxPoint
& pos
= wxDefaultPosition
,
39 const wxSize
& size
= wxDefaultSize
, long style
= 0,
40 const wxValidator
& validator
= wxDefaultValidator
,
41 const wxString
& name
= wxRadioButtonNameStr
);
43 virtual void SetValue(bool val
);
44 virtual bool GetValue() const ;
46 void Command(wxCommandEvent
& event
);
49 virtual void ChangeBackgroundColour();
51 // *this function is an implementation detail*
52 // clears the selection in the radiobuttons in the cycle
53 // and returns the old selection (if any)
54 wxRadioButton
* ClearSelections();
56 wxRadioButton
* AddInCycle(wxRadioButton
* cycle
);
57 void RemoveFromCycle();
58 wxRadioButton
* NextInCycle() { return m_cycle
; }
60 wxRadioButton
*m_cycle
;