From d0960f6d3be27a47c2f4ba14542af6902c7e9ac7 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Sun, 28 Dec 2008 01:29:37 +0000 Subject: [PATCH] fix wxPowerEvent, wxRichTextEvent and wxWizardEvent so that they pass the runtime check for correct implementation of the Clone() function git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/power.h | 5 ++++- include/wx/wizard.h | 5 +++-- src/common/powercmn.cpp | 2 +- src/richtext/richtextctrl.cpp | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/wx/power.h b/include/wx/power.h index f1a23b9fe2..ccd04343ac 100644 --- a/include/wx/power.h +++ b/include/wx/power.h @@ -49,6 +49,9 @@ enum wxBatteryState class WXDLLIMPEXP_BASE wxPowerEvent : public wxEvent { public: + wxPowerEvent() // just for use by wxRTTI + : m_veto(false) { } + wxPowerEvent(wxEventType evtType) : wxEvent(wxID_NONE, evtType) { m_veto = false; @@ -67,7 +70,7 @@ public: private: bool m_veto; - DECLARE_ABSTRACT_CLASS(wxPowerEvent) + DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPowerEvent) }; extern WXDLLIMPEXP_BASE const wxEventType wxEVT_POWER_SUSPENDING; diff --git a/include/wx/wizard.h b/include/wx/wizard.h index ea570b31bc..1368e5e785 100644 --- a/include/wx/wizard.h +++ b/include/wx/wizard.h @@ -272,12 +272,13 @@ public: wxWizardPage* GetPage() const { return m_page; } + virtual wxEvent *Clone() const { return new wxWizardEvent(*this); } + private: bool m_direction; wxWizardPage* m_page; - DECLARE_DYNAMIC_CLASS(wxWizardEvent) - DECLARE_NO_COPY_CLASS(wxWizardEvent) + DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWizardEvent) }; // ---------------------------------------------------------------------------- diff --git a/src/common/powercmn.cpp b/src/common/powercmn.cpp index fa7eb03b20..578dbb2309 100644 --- a/src/common/powercmn.cpp +++ b/src/common/powercmn.cpp @@ -39,7 +39,7 @@ DEFINE_EVENT_TYPE(wxEVT_POWER_SUSPEND_CANCEL) DEFINE_EVENT_TYPE(wxEVT_POWER_RESUME) - IMPLEMENT_ABSTRACT_CLASS(wxPowerEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxPowerEvent, wxEvent) #endif // provide stubs for the systems not implementing these functions diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 199d8067db..d9cc795957 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -120,9 +120,9 @@ private: }; #endif -IMPLEMENT_CLASS( wxRichTextCtrl, wxControl ) +IMPLEMENT_DYNAMIC_CLASS( wxRichTextCtrl, wxControl ) -IMPLEMENT_CLASS( wxRichTextEvent, wxNotifyEvent ) +IMPLEMENT_DYNAMIC_CLASS( wxRichTextEvent, wxNotifyEvent ) BEGIN_EVENT_TABLE( wxRichTextCtrl, wxControl ) EVT_PAINT(wxRichTextCtrl::OnPaint) -- 2.45.2