]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wxCalendarEvent and wxTextUrlEvent event classes implementing Clone() correctly...
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sat, 27 Dec 2008 14:23:38 +0000 (14:23 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sat, 27 Dec 2008 14:23:38 +0000 (14:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/calctrl.h
include/wx/textctrl.h

index e94354010eac8e479f1db9d2482a0c47d859b7bb..549f85f253b87791fca4d9b37846fb6c18644474 100644 (file)
@@ -160,17 +160,19 @@ public:
     wxCalendarEvent() : m_wday(wxDateTime::Inv_WeekDay)  { }
     wxCalendarEvent(wxWindow *win, const wxDateTime& dt, wxEventType type)
         : wxDateEvent(win, dt, type),
-          m_wday(wxDateTime::Inv_WeekDay)
-    {
-    }
+          m_wday(wxDateTime::Inv_WeekDay) { }
+    wxCalendarEvent(const wxCalendarEvent& event)
+        : wxDateEvent(event), m_wday(event.m_wday) { }
 
     void SetWeekDay(const wxDateTime::WeekDay wd) { m_wday = wd; }
     wxDateTime::WeekDay GetWeekDay() const { return m_wday; }
 
+    virtual wxEvent *Clone() const { return new wxCalendarEvent(*this); }
+
 private:
     wxDateTime::WeekDay m_wday;
 
-    DECLARE_DYNAMIC_CLASS_NO_COPY(wxCalendarEvent)
+    DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCalendarEvent)
 };
 
 // ----------------------------------------------------------------------------
index fa14d7a4a1ea14ebc8441ad11084bb3598ab25ff..74b3944339f71a44d7b74d8de40bc1adacb8b6dd 100644 (file)
@@ -729,9 +729,14 @@ class WXDLLIMPEXP_CORE wxTextUrlEvent : public wxCommandEvent
 public:
     wxTextUrlEvent(int winid, const wxMouseEvent& evtMouse,
                    long start, long end)
-        : wxCommandEvent(wxEVT_COMMAND_TEXT_URL, winid)
-        , m_evtMouse(evtMouse), m_start(start), m_end(end)
+        : wxCommandEvent(wxEVT_COMMAND_TEXT_URL, winid),
+          m_evtMouse(evtMouse), m_start(start), m_end(end)
         { }
+    wxTextUrlEvent(const wxTextUrlEvent& event)
+        : wxCommandEvent(event),
+          m_evtMouse(event.m_evtMouse),
+          m_start(event.m_start),
+          m_end(event.m_end) { }
 
     // get the mouse event which happend over the URL
     const wxMouseEvent& GetMouseEvent() const { return m_evtMouse; }
@@ -742,6 +747,8 @@ public:
     // get the end of the URL
     long GetURLEnd() const { return m_end; }
 
+    virtual wxEvent *Clone() const { return new wxTextUrlEvent(*this); }
+
 protected:
     // the corresponding mouse event
     wxMouseEvent m_evtMouse;
@@ -751,7 +758,7 @@ protected:
          m_end;
 
 private:
-    DECLARE_DYNAMIC_CLASS_NO_COPY(wxTextUrlEvent)
+    DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxTextUrlEvent)
 
 public:
     // for wxWin RTTI only, don't use