1998-09-18 06:19:10 -04: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 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_RADIOBUT_H_
|
|
|
|
#define _WX_RADIOBUT_H_
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxRadioButton: public wxControl
|
|
|
|
{
|
1998-10-18 18:31:48 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
|
|
|
public:
|
|
|
|
wxRadioButton();
|
2002-08-06 15:54:46 -04:00
|
|
|
~wxRadioButton() { RemoveFromCycle(); }
|
|
|
|
|
1998-10-18 18:31:48 -04:00
|
|
|
inline wxRadioButton(wxWindow *parent, wxWindowID id,
|
2002-02-05 11:34:33 -05: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 18:31:48 -04:00
|
|
|
{
|
|
|
|
Create(parent, id, label, pos, size, style, validator, name);
|
|
|
|
}
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1998-10-18 18:31:48 -04:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
2002-02-05 11:34:33 -05: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 18:31:48 -04:00
|
|
|
virtual void SetValue(bool val);
|
|
|
|
virtual bool GetValue() const ;
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1998-10-18 18:31:48 -04:00
|
|
|
void Command(wxCommandEvent& event);
|
2002-02-05 11:34:33 -05:00
|
|
|
|
|
|
|
// Implementation
|
1998-10-21 17:43:20 -04:00
|
|
|
virtual void ChangeBackgroundColour();
|
2002-08-06 15:54:46 -04:00
|
|
|
|
|
|
|
// *this function is an implementation detail*
|
2003-08-13 17:34:21 -04:00
|
|
|
// clears the selection in the radiobuttons in the cycle
|
2002-08-06 15:54:46 -04: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 06:19:10 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2002-02-05 11:34:33 -05:00
|
|
|
// _WX_RADIOBUT_H_
|