From 7f6f2d5cc5fcead74127d77edcaf678d5a38522a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 25 Oct 2017 19:46:52 +0300 Subject: we don't send messages to disabled buttons --- src/mir_core/src/CCtrlButton.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mir_core/src/CCtrlButton.cpp b/src/mir_core/src/CCtrlButton.cpp index 0ed43e8466..94f07e77f7 100644 --- a/src/mir_core/src/CCtrlButton.cpp +++ b/src/mir_core/src/CCtrlButton.cpp @@ -38,7 +38,8 @@ BOOL CCtrlButton::OnCommand(HWND, WORD, WORD idCode) void CCtrlButton::Click() { - ::SendMessage(m_parentWnd->GetHwnd(), WM_COMMAND, MAKELONG(m_idCtrl, BN_CLICKED), 0); + if (Enabled()) + ::SendMessage(m_parentWnd->GetHwnd(), WM_COMMAND, MAKELONG(m_idCtrl, BN_CLICKED), 0); } bool CCtrlButton::IsPushed() const @@ -48,5 +49,6 @@ bool CCtrlButton::IsPushed() const void CCtrlButton::Push(bool bPushed) { - ::SendMessage(m_hwnd, BM_SETCHECK, (bPushed) ? BST_CHECKED : BST_UNCHECKED, 0); + if (Enabled()) + ::SendMessage(m_hwnd, BM_SETCHECK, (bPushed) ? BST_CHECKED : BST_UNCHECKED, 0); } -- cgit v1.2.3