summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-10-12 20:46:15 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-10-12 20:46:15 +0300
commitc6fc071ab53a4993162438568b0c1a5e2deb31d4 (patch)
tree8365920542b53c96360640e3d4e15e6f9c3c5dd6 /src/mir_core
parent5bd197fb7b3245793e2f555339c3b2425d6b590d (diff)
CDlgBase::m_bExiting - new flag
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/ui_utils.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp
index ddc1088705..ff4de03f6c 100644
--- a/src/mir_core/src/ui_utils.cpp
+++ b/src/mir_core/src/ui_utils.cpp
@@ -163,12 +163,15 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
if (idCode == BN_CLICKED) {
// close dialog automatically if 'Cancel' button is pressed
- if (idCtrl == IDCANCEL && (m_autoClose & CLOSE_ON_CANCEL))
+ if (idCtrl == IDCANCEL && (m_autoClose & CLOSE_ON_CANCEL)) {
+ m_bExiting = true;
PostMessage(m_hwnd, WM_CLOSE, 0, 0);
+ }
// close dialog automatically if 'OK' button is pressed
if (idCtrl == IDOK && (m_autoClose & CLOSE_ON_OK)) {
// validate dialog data first
+ m_bExiting = true;
m_lresult = TRUE;
NotifyControls(&CCtrlBase::OnApply);
OnApply();
@@ -176,6 +179,8 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
// everything ok? good, let's close it
if (m_lresult == TRUE)
PostMessage(m_hwnd, WM_CLOSE, 0, 0);
+ else
+ m_bExiting = false;
}
}
}
@@ -214,6 +219,7 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
return FALSE;
case WM_CLOSE:
+ m_bExiting = true;
m_lresult = FALSE;
OnClose();
if (!m_lresult) {
@@ -225,6 +231,7 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
return TRUE;
case WM_DESTROY:
+ m_bExiting = true;
OnDestroy();
NotifyControls(&CCtrlBase::OnDestroy);
{