Fix fields initialization in wxCommandEvent copy ctor.

Neither m_isCommandEvent nor, worse, m_propagationLevel was set correctly for
wxCommandEvent objects constructed using copy ctor -- and hence Clone(). This
means that such events were not propagated upwards the window hierarchy, quite
possibly resulting in mysterious bugs.

Fix this now by initializing these fields in both the normal and copy ctors.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-12-05 22:17:52 +00:00
parent 693abd284f
commit 62763ad541
2 changed files with 18 additions and 12 deletions

View File

@@ -423,17 +423,6 @@ wxEvent& wxEvent::operator=(const wxEvent& src)
// wxCommandEvent
// ----------------------------------------------------------------------------
wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId)
: wxEvent(theId, commandType)
{
m_clientData = NULL;
m_clientObject = NULL;
m_isCommandEvent = true;
// the command events are propagated upwards by default
m_propagationLevel = wxEVENT_PROPAGATE_MAX;
}
wxString wxCommandEvent::GetString() const
{
// This is part of the hack retrieving the event string from the control