1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: radiobut.h
|
|
|
|
// Purpose: wxRadioButton class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_RADIOBUT_H_
|
|
|
|
#define _WX_RADIOBUT_H_
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxRadioButton: public wxControl
|
|
|
|
{
|
1998-10-18 22:31:48 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
|
|
|
public:
|
|
|
|
wxRadioButton();
|
2002-08-06 19:54:46 +00:00
|
|
|
~wxRadioButton() { RemoveFromCycle(); }
|
|
|
|
|
1998-10-18 22:31:48 +00:00
|
|
|
inline wxRadioButton(wxWindow *parent, wxWindowID id,
|
2002-02-05 16:34:33 +00:00
|
|
|
const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioButtonNameStr)
|
1998-10-18 22:31:48 +00:00
|
|
|
{
|
|
|
|
Create(parent, id, label, pos, size, style, validator, name);
|
|
|
|
}
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1998-10-18 22:31:48 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
2002-02-05 16:34:33 +00:00
|
|
|
const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioButtonNameStr);
|
|
|
|
|
1998-10-18 22:31:48 +00:00
|
|
|
virtual void SetValue(bool val);
|
|
|
|
virtual bool GetValue() const ;
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1998-10-18 22:31:48 +00:00
|
|
|
void Command(wxCommandEvent& event);
|
2002-02-05 16:34:33 +00:00
|
|
|
|
|
|
|
// Implementation
|
1998-10-21 21:43:20 +00:00
|
|
|
virtual void ChangeBackgroundColour();
|
2002-08-06 19:54:46 +00:00
|
|
|
|
|
|
|
// *this function is an implementation detail*
|
2003-08-13 21:34:21 +00:00
|
|
|
// clears the selection in the radiobuttons in the cycle
|
2002-08-06 19:54:46 +00:00
|
|
|
// and returns the old selection (if any)
|
|
|
|
wxRadioButton* ClearSelections();
|
|
|
|
private:
|
|
|
|
wxRadioButton* AddInCycle(wxRadioButton* cycle);
|
|
|
|
void RemoveFromCycle();
|
|
|
|
wxRadioButton* NextInCycle() { return m_cycle; }
|
|
|
|
|
|
|
|
wxRadioButton *m_cycle;
|
1998-09-18 10:19:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2002-02-05 16:34:33 +00:00
|
|
|
// _WX_RADIOBUT_H_
|