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_
16 #pragma interface "radiobut.h"
19 #include "wx/control.h"
21 WXDLLEXPORT_DATA(extern const char*) wxRadioButtonNameStr
;
23 class WXDLLEXPORT wxRadioButton
: public wxControl
25 DECLARE_DYNAMIC_CLASS(wxRadioButton
)
29 ~wxRadioButton() { RemoveFromCycle(); }
31 inline wxRadioButton(wxWindow
*parent
, wxWindowID id
,
32 const wxString
& label
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
, long style
= 0,
35 const wxValidator
& validator
= wxDefaultValidator
,
36 const wxString
& name
= wxRadioButtonNameStr
)
38 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
41 bool Create(wxWindow
*parent
, wxWindowID id
,
42 const wxString
& label
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
, long style
= 0,
45 const wxValidator
& validator
= wxDefaultValidator
,
46 const wxString
& name
= wxRadioButtonNameStr
);
48 virtual void SetValue(bool val
);
49 virtual bool GetValue() const ;
51 void Command(wxCommandEvent
& event
);
54 virtual void ChangeFont(bool keepOriginalSize
= TRUE
);
55 virtual void ChangeBackgroundColour();
56 virtual void ChangeForegroundColour();
58 // *this function is an implementation detail*
59 // clears the selection in the readiobuttons in the cycle
60 // and returns the old selection (if any)
61 wxRadioButton
* ClearSelections();
63 wxRadioButton
* AddInCycle(wxRadioButton
* cycle
);
64 void RemoveFromCycle();
65 wxRadioButton
* NextInCycle() { return m_cycle
; }
67 wxRadioButton
*m_cycle
;
72 class WXDLLEXPORT wxBitmap
;
74 WXDLLEXPORT_DATA(extern const char*) wxBitmapRadioButtonNameStr
;
76 class WXDLLEXPORT wxBitmapRadioButton
: public wxRadioButton
78 DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton
)
80 wxBitmap
*theButtonBitmap
;
82 inline wxBitmapRadioButton() { theButtonBitmap
= NULL
; }
83 inline wxBitmapRadioButton(wxWindow
*parent
, wxWindowID id
,
84 const wxBitmap
*label
,
85 const wxPoint
& pos
= wxDefaultPosition
,
86 const wxSize
& size
= wxDefaultSize
, long style
= 0,
87 const wxValidator
& validator
= wxDefaultValidator
,
88 const wxString
& name
= wxBitmapRadioButtonNameStr
)
90 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
93 bool Create(wxWindow
*parent
, wxWindowID id
,
94 const wxBitmap
*label
,
95 const wxPoint
& pos
= wxDefaultPosition
,
96 const wxSize
& size
= wxDefaultSize
, long style
= 0,
97 const wxValidator
& validator
= wxDefaultValidator
,
98 const wxString
& name
= wxBitmapRadioButtonNameStr
);
100 virtual void SetLabel(const wxBitmap
*label
);
101 virtual void SetValue(bool val
) ;
102 virtual bool GetValue() const ;