Fix inheritance hierarchy of wxDatePickerCtrlGeneric too

This is very similar to 8a64b6acea (Fix inheritance hierarchy of
wxTimePickerCtrlGeneric, 2020-11-04) and is done for the same reasons
(avoid having to somehow implement MSW-specific virtual methods of the
native controls base class in the generic version) and suffers from the
same drawback (there is no common base class for the native and generic
version any more).

See https://github.com/wxWidgets/wxWidgets/pull/2109
This commit is contained in:
Vadim Zeitlin
2020-11-13 01:19:52 +01:00
parent cf4c6fca84
commit d319e70a7c
3 changed files with 51 additions and 14 deletions

View File

@@ -44,7 +44,10 @@ enum
// wxDatePickerCtrl: allow the user to enter the date
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxDatePickerCtrlBase : public wxDateTimePickerCtrl
// The template argument must be a class deriving from wxDateTimePickerCtrlBase
// (i.e. in practice either this class itself or wxDateTimePickerCtrl).
template <typename Base>
class WXDLLIMPEXP_ADV wxDatePickerCtrlCommonBase : public Base
{
public:
/*
@@ -75,6 +78,10 @@ public:
virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const = 0;
};
// This class is defined mostly for compatibility and is used as the base class
// by native wxDatePickerCtrl implementations.
typedef wxDatePickerCtrlCommonBase<wxDateTimePickerCtrl> wxDatePickerCtrlBase;
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/datectrl.h"