fix wxSashEvent, wxFindDialogEvent, wxSplitterEvent to implement Clone() correctly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -142,6 +142,8 @@ class WXDLLIMPEXP_CORE wxFindDialogEvent : public wxCommandEvent
|
||||
public:
|
||||
wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
|
||||
: wxCommandEvent(commandType, id) { }
|
||||
wxFindDialogEvent(const wxFindDialogEvent& event)
|
||||
: wxCommandEvent(event), m_strReplace(event.m_strReplace) { }
|
||||
|
||||
int GetFlags() const { return GetInt(); }
|
||||
wxString GetFindString() const { return GetString(); }
|
||||
@@ -155,10 +157,12 @@ public:
|
||||
void SetFindString(const wxString& str) { SetString(str); }
|
||||
void SetReplaceString(const wxString& str) { m_strReplace = str; }
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxFindDialogEvent(*this); }
|
||||
|
||||
private:
|
||||
wxString m_strReplace;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxFindDialogEvent)
|
||||
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFindDialogEvent)
|
||||
};
|
||||
|
||||
extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_FIND;
|
||||
|
@@ -221,6 +221,12 @@ public:
|
||||
m_edge = edge;
|
||||
}
|
||||
|
||||
wxSashEvent(const wxSashEvent& event)
|
||||
: wxCommandEvent(event),
|
||||
m_edge(event.m_edge),
|
||||
m_dragRect(event.m_dragRect),
|
||||
m_dragStatus(event.m_dragStatus) { }
|
||||
|
||||
void SetEdge(wxSashEdgePosition edge) { m_edge = edge; }
|
||||
wxSashEdgePosition GetEdge() const { return m_edge; }
|
||||
|
||||
@@ -233,13 +239,15 @@ public:
|
||||
void SetDragStatus(wxSashDragStatus status) { m_dragStatus = status; }
|
||||
wxSashDragStatus GetDragStatus() const { return m_dragStatus; }
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxSashEvent(*this); }
|
||||
|
||||
private:
|
||||
wxSashEdgePosition m_edge;
|
||||
wxRect m_dragRect;
|
||||
wxSashDragStatus m_dragStatus;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxSashEvent)
|
||||
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSashEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxSashEventFunction)(wxSashEvent&);
|
||||
|
@@ -322,6 +322,8 @@ public:
|
||||
SetEventObject(splitter);
|
||||
if (splitter) m_id = splitter->GetId();
|
||||
}
|
||||
wxSplitterEvent(const wxSplitterEvent& event)
|
||||
: wxNotifyEvent(event), m_data(event.m_data) { }
|
||||
|
||||
// SASH_POS_CHANGED methods
|
||||
|
||||
@@ -366,6 +368,8 @@ public:
|
||||
return m_data.pt.y;
|
||||
}
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxSplitterEvent(*this); }
|
||||
|
||||
private:
|
||||
friend class WXDLLIMPEXP_FWD_CORE wxSplitterWindow;
|
||||
|
||||
@@ -380,7 +384,7 @@ private:
|
||||
} pt; // position of double click for DCLICK event
|
||||
} m_data;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxSplitterEvent)
|
||||
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSplitterEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
|
||||
|
Reference in New Issue
Block a user