From 2850ab6bedae183847fd1facbd15bf36facf57a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Tue, 1 Oct 2013 18:19:52 -0300 Subject: [PATCH] Experimental changes, WARNING. --- src/eepp/ui/cuigfx.cpp | 2 ++ src/eepp/ui/cuimanager.cpp | 9 ++++++--- src/test/eetest.cpp | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/eepp/ui/cuigfx.cpp b/src/eepp/ui/cuigfx.cpp index a64ff70d6..20238f2f7 100644 --- a/src/eepp/ui/cuigfx.cpp +++ b/src/eepp/ui/cuigfx.cpp @@ -87,6 +87,8 @@ void cUIGfx::Draw() { mSubTexture->Offset( oOff ); } else { + AutoAlign(); + DrawSubTexture(); } } diff --git a/src/eepp/ui/cuimanager.cpp b/src/eepp/ui/cuimanager.cpp index 3574e451e..4901eb8c1 100644 --- a/src/eepp/ui/cuimanager.cpp +++ b/src/eepp/ui/cuimanager.cpp @@ -205,6 +205,9 @@ void cUIManager::Update() { } if ( mKM->PressTrigger() ) { + /*if ( !wasDraggingControl && mOverControl != mFocusControl ) + FocusControl( mOverControl );*/ + if ( NULL != mOverControl ) { mOverControl->OnMouseDown( mKM->GetMousePos(), mKM->PressTrigger() ); SendMsg( mOverControl, cUIMessage::MsgMouseDown, mKM->PressTrigger() ); @@ -221,13 +224,13 @@ void cUIManager::Update() { if ( mKM->ReleaseTrigger() ) { if ( NULL != mFocusControl ) { if ( !wasDraggingControl ) { - if ( mOverControl != mFocusControl ) - FocusControl( mOverControl ); + if ( mOverControl != mFocusControl ) + FocusControl( mOverControl ); mFocusControl->OnMouseUp( mKM->GetMousePos(), mKM->ReleaseTrigger() ); SendMsg( mFocusControl, cUIMessage::MsgMouseUp, mKM->ReleaseTrigger() ); - if ( mDownControl == mOverControl && mKM->ClickTrigger() ) { + if ( mKM->ClickTrigger() ) { // mDownControl == mOverControl && SendMsg( mFocusControl, cUIMessage::MsgClick, mKM->ClickTrigger() ); mFocusControl->OnMouseClick( mKM->GetMousePos(), mKM->ClickTrigger() ); diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index 6a28ac18c..ee4df8c7c 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -252,7 +252,7 @@ void cEETest::CreateUI() { eePRINTL( "Texture Atlas Loading Time: %4.3f ms.", TE.Elapsed().AsMilliseconds() ); - cUIManager::instance()->Init(); //UI_MANAGER_HIGHLIGHT_FOCUS | UI_MANAGER_HIGHLIGHT_OVER + cUIManager::instance()->Init(UI_MANAGER_HIGHLIGHT_FOCUS); //UI_MANAGER_HIGHLIGHT_FOCUS | UI_MANAGER_HIGHLIGHT_OVER //mTheme = cUITheme::LoadFromPath( eeNew( cUIDefaultTheme, ( "uitheme", "uitheme" ) ), MyPath + "uitheme/" ); @@ -427,7 +427,7 @@ void cEETest::CreateUI() { DDLParams.Parent( C ); DDLParams.PosSet( 20, 55 ); DDLParams.Size = eeSize( 100, 21 ); - DDLParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT; + DDLParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_TOUCH_DRAG_ENABLED; cUIDropDownList * mDropDownList = eeNew( cUIDropDownList, ( DDLParams ) ); mDropDownList->Visible( true ); mDropDownList->Enabled( true ); @@ -449,7 +449,7 @@ void cEETest::CreateUI() { ComboParams.Parent( C ); ComboParams.PosSet( 20, 80 ); ComboParams.Size = eeSize( 100, 1 ); - ComboParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_AUTO_SIZE; + ComboParams.Flags = UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_VALIGN_CENTER | UI_HALIGN_LEFT | UI_AUTO_SIZE | UI_TOUCH_DRAG_ENABLED; cUIComboBox * mComboBox = eeNew( cUIComboBox, ( ComboParams ) ); mComboBox->Visible( true ); mComboBox->Enabled( true );