]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/radiobut.h
moved wxWindow::GetBestSize implementation into DoGetBestSize
[wxWidgets.git] / include / wx / motif / radiobut.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: radiobut.h
3 // Purpose: wxRadioButton class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_RADIOBUT_H_
13 #define _WX_RADIOBUT_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "radiobut.h"
17 #endif
18
19 class WXDLLEXPORT wxRadioButton: public wxControl
20 {
21 DECLARE_DYNAMIC_CLASS(wxRadioButton)
22 public:
23 wxRadioButton();
24 ~wxRadioButton() { RemoveFromCycle(); }
25
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)
32 {
33 Create(parent, id, label, pos, size, style, validator, name);
34 }
35
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);
42
43 virtual void SetValue(bool val);
44 virtual bool GetValue() const ;
45
46 void Command(wxCommandEvent& event);
47
48 // Implementation
49 virtual void ChangeBackgroundColour();
50
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();
55 private:
56 wxRadioButton* AddInCycle(wxRadioButton* cycle);
57 void RemoveFromCycle();
58 wxRadioButton* NextInCycle() { return m_cycle; }
59
60 wxRadioButton *m_cycle;
61 };
62
63 #endif
64 // _WX_RADIOBUT_H_