1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-20 00:14:35 +00:00
|
|
|
// Name: wx/msw/radiobut.h
|
1998-05-20 14:12:05 +00:00
|
|
|
// Purpose: wxRadioButton class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_RADIOBUT_H_
|
|
|
|
#define _WX_RADIOBUT_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2014-05-04 22:13:28 +00:00
|
|
|
#include "wx/msw/ownerdrawnbutton.h"
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxRadioButton : public wxMSWOwnerDrawnButton<wxControl>
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
2002-01-17 23:54:14 +00:00
|
|
|
public:
|
|
|
|
// ctors and creation functions
|
2004-01-15 13:49:22 +00:00
|
|
|
wxRadioButton() { Init(); }
|
2002-01-17 23:54:14 +00: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 13:49:22 +00:00
|
|
|
const wxString& name = wxRadioButtonNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, label, pos, size, style, validator, name);
|
|
|
|
}
|
2002-01-17 23:54:14 +00: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);
|
2014-05-04 22:13:12 +00:00
|
|
|
|
2005-04-10 15:23:08 +00:00
|
|
|
virtual bool HasTransparentBackground() { return true; }
|
2002-01-17 23:54:14 +00:00
|
|
|
|
2006-09-10 23:08:13 +00:00
|
|
|
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
|
|
|
|
|
2002-01-17 23:54:14 +00:00
|
|
|
protected:
|
2007-11-14 14:44:13 +00:00
|
|
|
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
|
2002-01-17 23:54:14 +00:00
|
|
|
virtual wxSize DoGetBestSize() const;
|
2014-05-04 22:13:12 +00:00
|
|
|
|
2014-05-04 22:13:28 +00:00
|
|
|
// Implement wxMSWOwnerDrawnButtonBase methods.
|
|
|
|
virtual int MSWGetButtonStyle() const wxOVERRIDE;
|
2014-05-04 22:13:39 +00:00
|
|
|
virtual void MSWOnButtonResetOwnerDrawn() wxOVERRIDE;
|
2014-05-04 22:13:28 +00:00
|
|
|
virtual int MSWGetButtonCheckedFlag() const wxOVERRIDE;
|
|
|
|
virtual void
|
|
|
|
MSWDrawButtonBitmap(wxDC& dc, const wxRect& rect, int flags) wxOVERRIDE;
|
|
|
|
|
2002-01-17 23:54:14 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2014-05-04 22:13:12 +00:00
|
|
|
|
2003-09-21 15:09:13 +00: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 23:54:14 +00:00
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxRadioButton);
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2014-05-07 13:10:17 +00:00
|
|
|
#endif // _WX_RADIOBUT_H_
|