From 97f80dd9e5737bb65cdd2b745c864e9c3b7ab433 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 16 Jan 2021 16:39:56 +0300 Subject: glory, glory, halleluya: perversive manual call of OnChange() event inside OnInitDialog isn't needed anymore --- src/mir_core/src/CCtrlBase.cpp | 10 ++++++---- src/mir_core/src/CCtrlCheck.cpp | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/src/CCtrlBase.cpp b/src/mir_core/src/CCtrlBase.cpp index 3c1c08db87..50d3366454 100644 --- a/src/mir_core/src/CCtrlBase.cpp +++ b/src/mir_core/src/CCtrlBase.cpp @@ -89,12 +89,14 @@ bool CCtrlBase::Enabled() const void CCtrlBase::NotifyChange() { - if (!m_parentWnd || !m_parentWnd->IsInitialized()) + if (!m_parentWnd) return; - m_bChanged = true; - if (!m_bSilent) - m_parentWnd->NotifyChange(); + if (m_parentWnd->IsInitialized()) { + m_bChanged = true; + if (!m_bSilent) + m_parentWnd->NotifyChange(); + } OnChange(this); } diff --git a/src/mir_core/src/CCtrlCheck.cpp b/src/mir_core/src/CCtrlCheck.cpp index 9c50db8849..6c94fa20cc 100644 --- a/src/mir_core/src/CCtrlCheck.cpp +++ b/src/mir_core/src/CCtrlCheck.cpp @@ -58,6 +58,7 @@ int CCtrlCheck::GetState() void CCtrlCheck::SetState(int state) { ::SendMessage(m_hwnd, BM_SETCHECK, state, 0); + OnChange(this); } bool CCtrlCheck::IsChecked() -- cgit v1.2.3