Make wxRadioButtonBase a plain class, not template
Use a dirty hack to accommodate wxUniv by deriving wxRadioButtonBase from wxCheckBox, rather than wxControl, there. This is not pretty, but should be addressed by refactoring wxUniv code and in the meanwhile all the other ports don't have to bother with using a template class unnecessarily.
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
// wxRadioButton
|
// wxRadioButton
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase<wxControl>
|
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxRadioButton() { }
|
wxRadioButton() { }
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
// wxRadioButton
|
// wxRadioButton
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase<wxControl>
|
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxRadioButton() { }
|
wxRadioButton() { }
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#ifndef _WX_RADIOBUT_H_
|
#ifndef _WX_RADIOBUT_H_
|
||||||
#define _WX_RADIOBUT_H_
|
#define _WX_RADIOBUT_H_
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase<wxControl>
|
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase
|
||||||
{
|
{
|
||||||
wxDECLARE_DYNAMIC_CLASS(wxRadioButton);
|
wxDECLARE_DYNAMIC_CLASS(wxRadioButton);
|
||||||
public:
|
public:
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "wx/msw/ownerdrawnbutton.h"
|
#include "wx/msw/ownerdrawnbutton.h"
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxRadioButton : public wxRadioButtonBase< wxMSWOwnerDrawnButton<wxControl> >
|
class WXDLLIMPEXP_CORE wxRadioButton : public wxMSWOwnerDrawnButton<wxRadioButtonBase>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// ctors and creation functions
|
// ctors and creation functions
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#ifndef _WX_RADIOBUT_H_
|
#ifndef _WX_RADIOBUT_H_
|
||||||
#define _WX_RADIOBUT_H_
|
#define _WX_RADIOBUT_H_
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase<wxControl>
|
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase
|
||||||
{
|
{
|
||||||
wxDECLARE_DYNAMIC_CLASS(wxRadioButton);
|
wxDECLARE_DYNAMIC_CLASS(wxRadioButton);
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
class QRadioButton;
|
class QRadioButton;
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxRadioButton : public wxRadioButtonBase<wxControl>
|
class WXDLLIMPEXP_CORE wxRadioButton : public wxRadioButtonBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxRadioButton();
|
wxRadioButton();
|
||||||
|
@@ -27,14 +27,21 @@ namespace wxPrivate
|
|||||||
WXDLLIMPEXP_CORE wxRadioButton* wxGetLastButtonInGroup(const wxRadioButton *btn);
|
WXDLLIMPEXP_CORE wxRadioButton* wxGetLastButtonInGroup(const wxRadioButton *btn);
|
||||||
} // namespace wxPrivate
|
} // namespace wxPrivate
|
||||||
|
|
||||||
// Unlike most of the other wxXXXBase classes, this one needs to be a template
|
// TODO: In wxUniv, wxRadioButton must derive from wxCheckBox as it reuses
|
||||||
// as wxRadioButton derives from different classes in different ports.
|
// much of its code. This should be fixed by refactoring wxCheckBox to allow
|
||||||
template <class W>
|
// this class to reuse its functionality without inheriting from it, but for
|
||||||
class wxRadioButtonBase : public W
|
// now use this hack to allow the existing code to compile.
|
||||||
|
#ifdef __WXUNIVERSAL__
|
||||||
|
#include "wx/checkbox.h"
|
||||||
|
|
||||||
|
typedef wxCheckBox wxRadioButtonBaseBase;
|
||||||
|
#else
|
||||||
|
typedef wxControl wxRadioButtonBaseBase;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_CORE wxRadioButtonBase : public wxRadioButtonBaseBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef W BaseWindowClass;
|
|
||||||
|
|
||||||
wxRadioButtonBase() { }
|
wxRadioButtonBase() { }
|
||||||
|
|
||||||
// Methods to be implemented by the derived classes:
|
// Methods to be implemented by the derived classes:
|
||||||
@@ -64,7 +71,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxRadioButtonBase, W);
|
wxDECLARE_NO_COPY_CLASS(wxRadioButtonBase);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxRadioButtonNameStr[];
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxRadioButtonNameStr[];
|
||||||
|
@@ -11,13 +11,11 @@
|
|||||||
#ifndef _WX_UNIV_RADIOBUT_H_
|
#ifndef _WX_UNIV_RADIOBUT_H_
|
||||||
#define _WX_UNIV_RADIOBUT_H_
|
#define _WX_UNIV_RADIOBUT_H_
|
||||||
|
|
||||||
#include "wx/checkbox.h"
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxRadioButton
|
// wxRadioButton
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_CORE wxRadioButton : public wxRadioButtonBase<wxCheckBox>
|
class WXDLLIMPEXP_CORE wxRadioButton : public wxRadioButtonBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// constructors
|
// constructors
|
||||||
|
Reference in New Issue
Block a user