From d2a159caa397c919efba666f1889c969fca5cf7f Mon Sep 17 00:00:00 2001 From: spartanj Date: Sun, 9 Jan 2011 19:37:03 -0300 Subject: [PATCH] A couple of quick fixes for the UI. --- src/ui/cuidragable.cpp | 2 +- src/ui/cuimanager.cpp | 4 ++++ src/ui/cuimanager.hpp | 2 ++ src/ui/cuiwindow.cpp | 7 +++++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ui/cuidragable.cpp b/src/ui/cuidragable.cpp index 33215054b..b4c2d7f8a 100644 --- a/src/ui/cuidragable.cpp +++ b/src/ui/cuidragable.cpp @@ -14,7 +14,7 @@ cUIDragable::~cUIDragable() { } Uint32 cUIDragable::OnMouseDown( const eeVector2i& Pos, const Uint32 Flags ) { - if ( !( cInput::instance()->LastPressTrigger() & mDragButton ) && ( Flags & mDragButton ) && DragEnable() && !Dragging() ) { + if ( !( cUIManager::instance()->LastPressTrigger() & mDragButton ) && ( Flags & mDragButton ) && DragEnable() && !Dragging() ) { Dragging( true ); mDragPoint = Pos; } diff --git a/src/ui/cuimanager.cpp b/src/ui/cuimanager.cpp index 49f82a3e3..7b6ec51c7 100644 --- a/src/ui/cuimanager.cpp +++ b/src/ui/cuimanager.cpp @@ -211,4 +211,8 @@ const Uint32& cUIManager::PressTrigger() const { return mKM->PressTrigger(); } +const Uint32& cUIManager::LastPressTrigger() const { + return mKM->LastPressTrigger(); +} + }} diff --git a/src/ui/cuimanager.hpp b/src/ui/cuimanager.hpp index cbd371c2c..296fdd3ea 100644 --- a/src/ui/cuimanager.hpp +++ b/src/ui/cuimanager.hpp @@ -43,6 +43,8 @@ class EE_API cUIManager : public tSingleton { cInput * GetInput() const; const Uint32& PressTrigger() const; + + const Uint32& LastPressTrigger() const; protected: cEngine * mEE; cInput * mKM; diff --git a/src/ui/cuiwindow.cpp b/src/ui/cuiwindow.cpp index 3a47d1017..9999d5f33 100644 --- a/src/ui/cuiwindow.cpp +++ b/src/ui/cuiwindow.cpp @@ -283,9 +283,12 @@ Uint32 cUIWindow::OnMessage( const cUIMessage * Msg ) { return cUIComplexControl::OnMessage( Msg ); } - void cUIWindow::DoResize ( const cUIMessage * Msg ) { - if ( !( mWinFlags & UI_WIN_RESIZEABLE ) || !( Msg->Flags() & EE_BUTTON_LMASK ) || RESIZE_NONE != mResizeType ) + if ( !( mWinFlags & UI_WIN_RESIZEABLE ) || + !( Msg->Flags() & EE_BUTTON_LMASK ) || + RESIZE_NONE != mResizeType || + ( cUIManager::instance()->LastPressTrigger() & EE_BUTTON_LMASK ) + ) return; DecideResizeType( Msg->Sender() );