From 311a0a8b2ee4691abd05e964a7b9f4a9ad0fbda8 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Fri, 1 Jan 2016 18:00:51 +0000 Subject: [PATCH] Check if application is running normally before sending events. --- source/contacteditor/frmContactEditor-Events.cpp | 16 ++++++++++------ source/contacteditor/frmContactEditor.cpp | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/source/contacteditor/frmContactEditor-Events.cpp b/source/contacteditor/frmContactEditor-Events.cpp index 239db34..b8f47df 100644 --- a/source/contacteditor/frmContactEditor-Events.cpp +++ b/source/contacteditor/frmContactEditor-Events.cpp @@ -98,12 +98,16 @@ void frmContactEditor::UpdateName( wxCommandEvent &event ){ WindowData *WData = new WindowData; - WData->DataType = 1; - WData->WindowPointer = this; - WData->WindowID = ContactEditorUID; + if (StartupEditMode == FALSE){ - wxCommandEvent editevent(WINDOW_EDIT); - editevent.SetClientData(WData); - wxPostEvent(GetParent(), editevent); + WData->DataType = 1; + WData->WindowPointer = this; + WData->WindowID = ContactEditorUID; + + wxCommandEvent editevent(WINDOW_EDIT); + editevent.SetClientData(WData); + wxPostEvent(GetParent(), editevent); + + } } \ No newline at end of file diff --git a/source/contacteditor/frmContactEditor.cpp b/source/contacteditor/frmContactEditor.cpp index 2dbb7a2..ad79abc 100644 --- a/source/contacteditor/frmContactEditor.cpp +++ b/source/contacteditor/frmContactEditor.cpp @@ -120,13 +120,17 @@ void frmContactEditor::CloseWindow( wxCloseEvent& event ) WindowData *WData = new WindowData; - WData->DataType = 1; - WData->WindowPointer = this; - WData->WindowID = ContactEditorUID; + if (StartupEditMode == FALSE){ - wxCommandEvent delevent(WINDOW_CLOSE); - delevent.SetClientData(WData); - wxPostEvent(GetParent(), delevent); + WData->DataType = 1; + WData->WindowPointer = this; + WData->WindowID = ContactEditorUID; + + wxCommandEvent delevent(WINDOW_CLOSE); + delevent.SetClientData(WData); + wxPostEvent(GetParent(), delevent); + + } Destroy(); -- 2.39.5