From 327a15854c1670c700e59f70a60c6b27b53299a6 Mon Sep 17 00:00:00 2001 From: Vladislav Khorev Date: Mon, 4 Nov 2013 06:16:25 +0000 Subject: [PATCH] fixing ui --- include/GUIManager/ButtonWidget.h | 1 + src/GUIManager/GUIManager.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/GUIManager/ButtonWidget.h b/include/GUIManager/ButtonWidget.h index 25e50c4..8a71ec0 100644 --- a/include/GUIManager/ButtonWidget.h +++ b/include/GUIManager/ButtonWidget.h @@ -25,6 +25,7 @@ public: virtual void OnTapDown(vec2 pos) { } virtual void OnTapUp(vec2 pos) { } virtual void OnTapUpAfterMove(vec2 pos) { } + virtual void OnTapUpAfterMoveOut(vec2 pos) { } virtual void OnMove(vec2 shift) { } virtual void OnMoveOut() { } virtual void OnKeyPress(int key) { } diff --git a/src/GUIManager/GUIManager.cpp b/src/GUIManager/GUIManager.cpp index 403d4af..ade271c 100644 --- a/src/GUIManager/GUIManager.cpp +++ b/src/GUIManager/GUIManager.cpp @@ -347,6 +347,21 @@ void TGUIManager::OnMouseUp(vec2 pos) //signalMap.push_back((i->SignalMap[CONST_CLICK_SIGNAL_NAME])); //Do not call signals here + if (! isTransparentForInput) + { + break; + } + } + + if (i->Widget->CheckClick(LastTapPos) && !i->Widget->CheckClick(pos)) + { + bool isTransparentForInput = i->Widget->IsTransparentForInput(); + i->Widget->OnTapUpAfterMoveOut(pos); + i->IsMouseDown = false; + + //signalMap.push_back((i->SignalMap[CONST_CLICK_SIGNAL_NAME])); + //Do not call signals here + if (! isTransparentForInput) { break; @@ -376,6 +391,8 @@ void TGUIManager::OnMove(vec2 shift) TotalShift += shift; + //LastTapPos += shift; + std::vector>> signalMap; for (i = WidgetArr.rbegin(); i != WidgetArr.rend(); ++i)