From 5d9ed7ca807c3bafdcdef8186261ca95cbc94b3f Mon Sep 17 00:00:00 2001 From: Kimmo Pekkola Date: Wed, 29 Jul 2009 12:33:02 +0000 Subject: [PATCH] Button state is reset correctly if the left mouse button is released outside the window. --- Library/MeterButton.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library/MeterButton.cpp b/Library/MeterButton.cpp index 9f42602c..42a07004 100644 --- a/Library/MeterButton.cpp +++ b/Library/MeterButton.cpp @@ -327,6 +327,12 @@ bool CMeterButton::MouseMove(POINT pos) } else { + // If the left button is not down anymore the cliked state needs to be set false + if ((GetKeyState(VK_LBUTTON) & 0x8000) == 0) + { + m_Clicked = false; + } + if (m_State == BUTTON_STATE_DOWN) { m_State = BUTTON_STATE_NORMAL;