1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: radiobut.h
|
|
|
|
// Purpose: wxRadioButton class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_RADIOBUT_H_
|
|
|
|
#define _WX_RADIOBUT_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2002-01-17 18:54:14 -05:00
|
|
|
#pragma interface "radiobut.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxRadioButton: public wxControl
|
|
|
|
{
|
2002-01-17 18:54:14 -05:00
|
|
|
public:
|
|
|
|
// ctors and creation functions
|
2004-01-15 08:49:22 -05:00
|
|
|
wxRadioButton() { Init(); }
|
2002-01-17 18:54:14 -05:00
|
|
|
|
|
|
|
wxRadioButton(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2004-01-15 08:49:22 -05:00
|
|
|
const wxString& name = wxRadioButtonNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, label, pos, size, style, validator, name);
|
|
|
|
}
|
2002-01-17 18:54:14 -05:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxRadioButtonNameStr);
|
|
|
|
|
|
|
|
// implement the radio button interface
|
|
|
|
virtual void SetValue(bool value);
|
|
|
|
virtual bool GetValue() const;
|
|
|
|
|
|
|
|
// implementation only from now on
|
|
|
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
|
|
|
virtual void Command(wxCommandEvent& event);
|
2004-03-05 00:28:21 -05:00
|
|
|
virtual void ApplyParentThemeBackground(const wxColour& bg)
|
|
|
|
{ SetBackgroundColour(bg); }
|
|
|
|
|
2002-01-17 18:54:14 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2003-09-21 11:09:13 -04:00
|
|
|
// we need to store the state internally as the result of GetValue()
|
|
|
|
// sometimes gets out of sync in WM_COMMAND handler
|
|
|
|
bool m_isChecked;
|
2002-01-17 18:54:14 -05:00
|
|
|
|
2003-07-21 20:24:07 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_RADIOBUT_H_
|