From cc33bc3b4d00b0bc28784f8fbb8ae85126fbc293 Mon Sep 17 00:00:00 2001 From: spartanj Date: Wed, 29 Dec 2010 04:31:27 -0300 Subject: [PATCH] Some minor changes. --- src/test/ee.cpp | 34 ++++++++++----------- src/ui/cuicombobox.cpp | 12 +------- src/ui/cuicombobox.hpp | 2 -- src/ui/cuicontrol.cpp | 9 ++++++ src/ui/cuicontrol.hpp | 2 ++ src/ui/cuidragable.cpp | 62 ++++++++++++++++---------------------- src/ui/cuidragable.hpp | 15 +++------ src/ui/cuidropdownlist.cpp | 21 +++++++------ src/ui/cuidropdownlist.hpp | 2 ++ src/ui/cuigenericgrid.cpp | 37 ++++++++++++----------- src/ui/cuigenericgrid.hpp | 2 ++ src/ui/cuigridcell.cpp | 4 --- src/ui/cuilistbox.cpp | 25 ++++++++------- src/ui/cuilistbox.hpp | 2 -- src/ui/cuilistboxitem.cpp | 13 ++------ src/ui/cuilistboxitem.hpp | 2 -- src/ui/cuimanager.hpp | 2 -- src/ui/uihelper.hpp | 5 ++- 18 files changed, 114 insertions(+), 137 deletions(-) diff --git a/src/test/ee.cpp b/src/test/ee.cpp index a6ebf5d34..3dc131eec 100644 --- a/src/test/ee.cpp +++ b/src/test/ee.cpp @@ -370,7 +370,18 @@ void cEETest::OnFontLoaded( cResourceLoader * ObjLoaded ) { Con.Create( FF, true ); Con.IgnoreCharOnPrompt( 186 ); // L'º' + mBuda = L"El mono ve el pez en el agua y sufre. Piensa que su mundo es el único que existe, el mejor, el real. Sufre porque es bueno y tiene compasión, lo ve y piensa: \"Pobre se está ahogando no puede respirar\". Y lo saca, lo saca y se queda tranquilo, por fin lo salvé. Pero el pez se retuerce de dolor y muere. Por eso te mostré el sueño, es imposible meter el mar en tu cabeza, que es un balde."; + + cTimeElapsed TE; + cUIManager::instance()->Init(); CreateUI(); + cLog::instance()->Writef( "CreateUI time: %f", TE.ElapsedSinceStart() ); + + TTFB->ShrinkText( mBuda, 400 ); + mBudaTC.Create( TTFB, mBuda, eeColorA(255,255,255,255) ); + mEEText.Create( TTFB, L"Entropia Engine++\nCTRL + 1 = Screen 1 - CTRL + 2 = Screen 2\nCTRL + 3 = Screen 3" ); + mFBOText.Create( TTFB, L"This is a VBO\nInside of a FBO" ); + mInfoText.Create( FF, L"", eeColorA(255,255,255,150) ); EE->Display(); @@ -389,17 +400,15 @@ void cEETest::CreateShaders() { } void cEETest::CreateUI() { - cUIManager::instance()->Init(); - cUIControl::CreateParams Params( cUIManager::instance()->MainControl(), eeVector2i(0,0), eeSize( 530, 380 ), UI_FILL_BACKGROUND | UI_CLIP_ENABLE | UI_BORDER ); - cUIThemeManager::instance()->Add( cUITheme::LoadFromPath( MyPath + "data/aqua/", "aqua", "aqua" ) ); + //cUIThemeManager::instance()->Add( cUITheme::LoadFromPath( MyPath + "data/aqua/", "aqua", "aqua" ) ); CreateAquaTextureAtlas(); -/* + cTextureGroupLoader tgl( MyPath + "data/aquatg/aqua.etg" ); TF->GetByName( "data/aquatg/aqua.png" )->TextureFilter( TEX_FILTER_NEAREST ); cUIThemeManager::instance()->Add( cUITheme::LoadFromShapeGroup( cShapeGroupManager::instance()->GetByName( "aqua" ), "aqua", "aqua" ) ); -*/ + cUIThemeManager::instance()->DefaultEffectsEnabled( true ); cUIThemeManager::instance()->DefaultFont( TTF ); cUIThemeManager::instance()->DefaultTheme( "aqua" ); @@ -564,7 +573,7 @@ void cEETest::CreateUI() { mListBox->Visible( true ); mListBox->Enabled( true ); - Int32 wsize = 10000; + Int32 wsize = 100; if ( wsize ) { std::vector wstr(wsize); @@ -661,6 +670,7 @@ void cEETest::CreateUI() { cUITextEdit * TextEdit = eeNew( cUITextEdit, ( TEParams ) ); TextEdit->Visible( true ); TextEdit->Enabled( true ); + TextEdit->Text( mBuda ); cUIGenericGrid::CreateParams GridParams; GridParams.Parent( C ); @@ -684,7 +694,7 @@ void cEETest::CreateUI() { TxtGfxParams.Flags = UI_VALIGN_CENTER | UI_HALIGN_CENTER; TxtGfxParams.Shape = cGlobalShapeGroup::instance()->GetByName( "aqua_button_ok" ); - for ( Uint32 i = 0; i < 10; i++ ) { + for ( Uint32 i = 0; i < 100; i++ ) { cUIGridCell * Cell = eeNew( cUIGridCell, ( CellParams ) ); cUITextBox * TxtBox = eeNew( cUITextBox, ( TxtBoxParams ) ); cUITextInput * TxtInput = eeNew( cUITextInput, ( TxtInputParams ) ); @@ -702,16 +712,6 @@ void cEETest::CreateUI() { mGenGrid->CollumnWidth( 0, 50 ); mGenGrid->CollumnWidth( 1, 24 ); mGenGrid->CollumnWidth( 2, 100 ); - - mBuda = L"El mono ve el pez en el agua y sufre. Piensa que su mundo es el único que existe, el mejor, el real. Sufre porque es bueno y tiene compasión, lo ve y piensa: \"Pobre se está ahogando no puede respirar\". Y lo saca, lo saca y se queda tranquilo, por fin lo salvé. Pero el pez se retuerce de dolor y muere. Por eso te mostré el sueño, es imposible meter el mar en tu cabeza, que es un balde."; - - TextEdit->Text( mBuda ); - - TTFB->ShrinkText( mBuda, 400 ); - mBudaTC.Create( TTFB, mBuda, eeColorA(255,255,255,255) ); - mEEText.Create( TTFB, L"Entropia Engine++\nCTRL + 1 = Screen 1 - CTRL + 2 = Screen 2\nCTRL + 3 = Screen 3" ); - mFBOText.Create( TTFB, L"This is a VBO\nInside of a FBO" ); - mInfoText.Create( FF, L"", eeColorA(255,255,255,150) ); } void cEETest::ItemClick( const cUIEvent * Event ) { diff --git a/src/ui/cuicombobox.cpp b/src/ui/cuicombobox.cpp index 280d13a55..98cc3efe7 100644 --- a/src/ui/cuicombobox.cpp +++ b/src/ui/cuicombobox.cpp @@ -66,21 +66,11 @@ Uint32 cUIComboBox::OnMouseClick( const eeVector2i& Pos, const Uint32 Flags ) { cUITextInput::OnMouseClick( Pos, Flags ); if ( mListBox->Visible() ) { - mListBox->Enabled( false ); - mListBox->Visible( false ); + Hide(); } } return 1; } -void cUIComboBox::OnItemSelected( const cUIEvent * Event ) { - if ( mListBox->Visible() ) { - mListBox->Enabled( false ); - mListBox->Visible( false ); - } - - mTextBuffer.Buffer( mListBox->GetItemSelectedText() ); -} - }} diff --git a/src/ui/cuicombobox.hpp b/src/ui/cuicombobox.hpp index 7797f889b..f16baa1d7 100644 --- a/src/ui/cuicombobox.hpp +++ b/src/ui/cuicombobox.hpp @@ -15,8 +15,6 @@ class EE_API cUIComboBox : public cUIDropDownList { protected: cUIControl * mButton; - virtual void OnItemSelected( const cUIEvent * Event ); - void OnButtonClick( const cUIEvent * Event ); Uint32 OnMouseClick( const eeVector2i& Pos, const Uint32 Flags ); diff --git a/src/ui/cuicontrol.cpp b/src/ui/cuicontrol.cpp index a7be9ffd8..90e8d9db7 100644 --- a/src/ui/cuicontrol.cpp +++ b/src/ui/cuicontrol.cpp @@ -937,6 +937,15 @@ void cUIControl::WriteCtrlFlag( const Uint32& Pos, const Uint32& Val ) { Write32BitKey( &mControlFlags, Pos, Val ); } +void cUIControl::WriteFlag( const Uint32& Flag, const Uint32& Val ) { + if ( Val ) + mFlags |= Flag; + else { + if ( mFlags & Flag ) + mFlags &= ~Flag; + } +} + void cUIControl::ApplyDefaultTheme() { cUIThemeManager::instance()->ApplyDefaultTheme( this ); } diff --git a/src/ui/cuicontrol.hpp b/src/ui/cuicontrol.hpp index a8a708158..571a4c41b 100644 --- a/src/ui/cuicontrol.hpp +++ b/src/ui/cuicontrol.hpp @@ -343,6 +343,8 @@ class EE_API cUIControl { void WriteCtrlFlag( const Uint32& Pos, const Uint32& Val ); + void WriteFlag( const Uint32& Flag, const Uint32& Val ); + void ApplyDefaultTheme(); eeFloat Elapsed(); diff --git a/src/ui/cuidragable.cpp b/src/ui/cuidragable.cpp index a17038157..33215054b 100644 --- a/src/ui/cuidragable.cpp +++ b/src/ui/cuidragable.cpp @@ -1,11 +1,10 @@ #include "cuidragable.hpp" +#include "cuimanager.hpp" namespace EE { namespace UI { cUIDragable::cUIDragable( const cUIControl::CreateParams& Params ) : cUIControl( Params ), - mDragEnable( false ), - mDragging( false ), mDragButton( EE_BUTTON_LMASK ) { mType |= UI_TYPE_CONTROL_DRAGABLE; @@ -15,9 +14,9 @@ cUIDragable::~cUIDragable() { } Uint32 cUIDragable::OnMouseDown( const eeVector2i& Pos, const Uint32 Flags ) { - if ( !( cInput::instance()->LastPressTrigger() & mDragButton ) && ( Flags & mDragButton ) && mDragEnable && !mDragging ) { - mDragging = true; - mDragPoint = mDraggingPoint = Pos; + if ( !( cInput::instance()->LastPressTrigger() & mDragButton ) && ( Flags & mDragButton ) && DragEnable() && !Dragging() ) { + Dragging( true ); + mDragPoint = Pos; } cUIControl::OnMouseDown( Pos, Flags ); @@ -25,21 +24,14 @@ Uint32 cUIDragable::OnMouseDown( const eeVector2i& Pos, const Uint32 Flags ) { } Uint32 cUIDragable::OnMouseUp( const eeVector2i& Pos, const Uint32 Flags ) { - if ( mDragEnable && mDragging && ( Flags & mDragButton ) ) - mDragging = false; + if ( DragEnable() && Dragging() && ( Flags & mDragButton ) ) { + Dragging( false ); + } cUIControl::OnMouseUp( Pos, Flags ); return 1; } -bool cUIDragable::Dragging() const { - return mDragging; -} - -void cUIDragable::Dragging( const bool& dragging ) { - mDragging = dragging; -} - const eeVector2i& cUIDragable::DragPoint() const { return mDragPoint; } @@ -48,46 +40,44 @@ void cUIDragable::DragPoint( const eeVector2i& Point ) { mDragPoint = Point; } -const eeVector2i& cUIDragable::DraggingPoint() const { - return mDraggingPoint; -} - -void cUIDragable::DraggingPoint( const eeVector2i& Point ) { - mDraggingPoint = Point; -} - void cUIDragable::Update() { cUIControl::Update(); - if ( !mDragEnable ) + if ( !DragEnable() ) return; - if ( mDragging ) { + if ( Dragging() ) { if ( !( cInput::instance()->PressTrigger() & mDragButton ) ) { - mDragging = false; + Dragging( false ); return; } - eeVector2i Pos( cInput::instance()->GetMousePos() ); + eeVector2i Pos( cUIManager::instance()->GetMousePos() ); - if ( mDraggingPoint.x != Pos.x || mDraggingPoint.y != Pos.y ) { - mDragPoint = mDraggingPoint; - mDraggingPoint = Pos; + if ( mDragPoint != Pos ) { + mPos += -( mDragPoint - Pos ); - mPos += ( mDragPoint - mDraggingPoint ) * (eeInt)-1; + mDragPoint = Pos; OnPosChange(); - } else - mDragPoint = mDraggingPoint; + } } } -const bool& cUIDragable::DragEnable() const { - return mDragEnable; +bool cUIDragable::DragEnable() const { + return 0 != ( mFlags & UI_DRAG_ENABLE ); } void cUIDragable::DragEnable( const bool& enable ) { - mDragEnable = enable; + WriteFlag( UI_DRAG_ENABLE, true == enable ); +} + +bool cUIDragable::Dragging() const { + return 0 != ( mControlFlags & UI_CTRL_FLAG_DRAGGING ); +} + +void cUIDragable::Dragging( const bool& dragging ) { + WriteCtrlFlag( UI_CTRL_FLAG_DRAGGING_POS, true == dragging ); } void cUIDragable::DragButton( const Uint32& Button ) { diff --git a/src/ui/cuidragable.hpp b/src/ui/cuidragable.hpp index 02ae02322..9be9d5129 100644 --- a/src/ui/cuidragable.hpp +++ b/src/ui/cuidragable.hpp @@ -15,26 +15,21 @@ class EE_API cUIDragable : public cUIControl { const eeVector2i& DragPoint() const; void DragPoint( const eeVector2i& Point ); - const eeVector2i& DraggingPoint() const; - void DraggingPoint( const eeVector2i& Point ); - virtual void Update(); - const bool& DragEnable() const; + bool DragEnable() const; void DragEnable( const bool& enable ); void DragButton( const Uint32& Button ); const Uint32& DragButton() const; protected: - virtual ~cUIDragable(); + virtual ~cUIDragable(); - bool mDragEnable; - bool mDragging; - eeVector2i mDragPoint; - eeVector2i mDraggingPoint; - Uint32 mDragButton; + eeVector2i mDragPoint; + Uint32 mDragButton; virtual Uint32 OnMouseDown( const eeVector2i& Pos, const Uint32 Flags ); + virtual Uint32 OnMouseUp( const eeVector2i& Pos, const Uint32 Flags ); }; diff --git a/src/ui/cuidropdownlist.cpp b/src/ui/cuidropdownlist.cpp index f775880c1..525d4b3e5 100644 --- a/src/ui/cuidropdownlist.cpp +++ b/src/ui/cuidropdownlist.cpp @@ -27,10 +27,10 @@ cUIDropDownList::cUIDropDownList( cUIDropDownList::CreateParams& Params ) : ApplyDefaultTheme(); mListBox->AddEventListener( cUIEvent::EventOnComplexControlFocusLoss, cb::Make1( this, &cUIDropDownList::OnListBoxFocusLoss ) ); - mListBox->AddEventListener( cUIEvent::EventOnSelected, cb::Make1( this, &cUIDropDownList::OnItemSelected ) ); + mListBox->AddEventListener( cUIEvent::EventOnSelected , cb::Make1( this, &cUIDropDownList::OnItemSelected ) ); mListBox->AddEventListener( cUIEvent::EventOnItemClicked, cb::Make1( this, &cUIDropDownList::OnItemClicked ) ); mListBox->AddEventListener( cUIEvent::EventOnItemKeyDown, cb::Make1( this, &cUIDropDownList::OnItemKeyDown ) ); - mListBox->AddEventListener( cUIEvent::EventKeyDown, cb::Make1( this, &cUIDropDownList::OnItemKeyDown ) ); + mListBox->AddEventListener( cUIEvent::EventKeyDown , cb::Make1( this, &cUIDropDownList::OnItemKeyDown ) ); } cUIDropDownList::~cUIDropDownList() { @@ -93,7 +93,7 @@ void cUIDropDownList::OnItemKeyDown( const cUIEvent * Event ) { } void cUIDropDownList::OnListBoxFocusLoss( const cUIEvent * Event ) { - if ( cUIManager::instance()->FocusControl() != this ) { + if ( cUIManager::instance()->FocusControl() != this && !IsChild( cUIManager::instance()->FocusControl() ) ) { Hide(); } } @@ -104,7 +104,7 @@ void cUIDropDownList::OnItemClicked( const cUIEvent * Event ) { } void cUIDropDownList::OnItemSelected( const cUIEvent * Event ) { - mTextBuffer.Buffer( mListBox->GetItemSelectedText() ); + Text( mListBox->GetItemSelectedText() ); } void cUIDropDownList::Show() { @@ -129,12 +129,7 @@ void cUIDropDownList::Hide() { } void cUIDropDownList::Update() { - cUITextInput::Update(); - if ( mEnabled && mVisible ) { - if ( ( mControlFlags & UI_CTRL_FLAG_HAS_FOCUS ) ) - mListBox->ManageKeyboard(); - if ( IsMouseOver() ) { Uint32 Flags = cUIManager::instance()->GetInput()->ClickTrigger(); @@ -147,6 +142,14 @@ void cUIDropDownList::Update() { } } } + + cUITextInput::Update(); +} + +Uint32 cUIDropDownList::OnKeyDown( const cUIEventKey &Event ) { + mListBox->OnKeyDown( Event ); + + return 1; } }} diff --git a/src/ui/cuidropdownlist.hpp b/src/ui/cuidropdownlist.hpp index ef90e4515..2d8ceb3f3 100644 --- a/src/ui/cuidropdownlist.hpp +++ b/src/ui/cuidropdownlist.hpp @@ -54,6 +54,8 @@ class EE_API cUIDropDownList : public cUITextInput { virtual void OnItemClicked( const cUIEvent * Event ); virtual void OnItemKeyDown( const cUIEvent * Event ); + + Uint32 OnKeyDown( const cUIEventKey &Event ); }; }} diff --git a/src/ui/cuigenericgrid.cpp b/src/ui/cuigenericgrid.cpp index 3b10f8b4b..0cbb9e0d2 100644 --- a/src/ui/cuigenericgrid.cpp +++ b/src/ui/cuigenericgrid.cpp @@ -173,22 +173,8 @@ void cUIGenericGrid::UpdateVScroll() { ContainerResize(); } -void cUIGenericGrid::UpdateScroll( bool FromScrollChange ) { - if ( !mItems.size() ) - return; - - cUIGridCell * Item; - Uint32 i, RelPos = 0, RelPosMax; - Int32 ItemPos, ItemPosMax; - Int32 tHLastScroll = mHScrollInit; - - Uint32 VisibleItems = mContainer->Size().Height() / mRowHeight; - mItemsNotVisible = (Int32)mItems.size() - VisibleItems; - bool Clipped = 0 != mContainer->IsClipped(); - - UpdateVScroll(); - - if ( Clipped && ( UI_SCROLLBAR_AUTO == mHScrollMode || UI_SCROLLBAR_ALWAYS_ON == mHScrollMode ) ) { +void cUIGenericGrid::UpdateHScroll() { + if ( mContainer->IsClipped() && ( UI_SCROLLBAR_AUTO == mHScrollMode || UI_SCROLLBAR_ALWAYS_ON == mHScrollMode ) ) { if ( mContainer->Size().Width() < (Int32)mTotalWidth ) { mHScrollBar->Visible( true ); mHScrollBar->Enabled( true ); @@ -211,6 +197,24 @@ void cUIGenericGrid::UpdateScroll( bool FromScrollChange ) { } } } +} + +void cUIGenericGrid::UpdateScroll( bool FromScrollChange ) { + if ( !mItems.size() ) + return; + + cUIGridCell * Item; + Uint32 i, RelPos = 0, RelPosMax; + Int32 ItemPos, ItemPosMax; + Int32 tHLastScroll = mHScrollInit; + + Uint32 VisibleItems = mContainer->Size().Height() / mRowHeight; + mItemsNotVisible = (Int32)mItems.size() - VisibleItems; + bool Clipped = 0 != mContainer->IsClipped(); + + UpdateVScroll(); + + UpdateHScroll(); VisibleItems = mContainer->Size().Height() / mRowHeight; mItemsNotVisible = (Uint32)mItems.size() - VisibleItems; @@ -394,7 +398,6 @@ void cUIGenericGrid::UpdateCollumnsPos() { mTotalWidth = Pos; } - void cUIGenericGrid::OnAlphaChange() { cUIControlAnim::OnAlphaChange(); diff --git a/src/ui/cuigenericgrid.hpp b/src/ui/cuigenericgrid.hpp index ed85a8078..1f590bed2 100644 --- a/src/ui/cuigenericgrid.hpp +++ b/src/ui/cuigenericgrid.hpp @@ -130,6 +130,8 @@ class EE_API cUIGenericGrid : public cUIControlAnim { virtual Uint32 OnSelected(); void UpdateVScroll(); + + void UpdateHScroll(); }; }} diff --git a/src/ui/cuigridcell.cpp b/src/ui/cuigridcell.cpp index 01d62116f..c9e94e563 100644 --- a/src/ui/cuigridcell.cpp +++ b/src/ui/cuigridcell.cpp @@ -81,15 +81,11 @@ void cUIGridCell::Update() { if ( Flags & EE_BUTTONS_WUWD && MyParent->VerticalScrollBar()->Visible() ) MyParent->VerticalScrollBar()->Slider()->ManageClick( Flags ); } - - /*if ( ( mControlFlags & UI_CTRL_FLAG_HAS_FOCUS ) ) - LBParent->ManageKeyboard();*/ } cUIComplexControl::Update(); } - void cUIGridCell::Select() { cUIGenericGrid * MyParent = reinterpret_cast ( Parent()->Parent() ); diff --git a/src/ui/cuilistbox.cpp b/src/ui/cuilistbox.cpp index 98702d25b..f2b3f0880 100644 --- a/src/ui/cuilistbox.cpp +++ b/src/ui/cuilistbox.cpp @@ -104,6 +104,9 @@ cUIScrollBar * cUIListBox::HorizontalScrollBar() const { } void cUIListBox::AddListBoxItems( std::vector Texts ) { + mItems.reserve( mItems.size() + Texts.size() ); + mTexts.reserve( mTexts.size() + Texts.size() ); + for ( Uint32 i = 0; i < Texts.size(); i++ ) { AddListBoxItem( Texts[i] ); } @@ -791,27 +794,19 @@ void cUIListBox::SelectNext() { Uint32 cUIListBox::OnKeyDown( const cUIEventKey &Event ) { cUIControlAnim::OnKeyDown( Event ); - ManageKeyboard(); - - return 1; -} - -void cUIListBox::ManageKeyboard() { if ( !mSelected.size() || mFlags & UI_MULTI_SELECT ) - return; - - cInput * KM = cUIManager::instance()->GetInput(); + return 0; if ( eeGetTicks() - mLastTickMove > 100 ) { - if ( KM->IsKeyDown( KEY_DOWN ) ) { + if ( KEY_DOWN == Event.KeyCode() ) { mLastTickMove = eeGetTicks(); SelectNext(); - } else if ( KM->IsKeyDown( KEY_UP ) ) { + } else if ( KEY_UP == Event.KeyCode() ) { mLastTickMove = eeGetTicks(); SelectPrev(); - } else if ( KM->IsKeyDown( KEY_PAGEUP ) ) { + } else if ( KEY_PAGEUP == Event.KeyCode() ) { mLastTickMove = eeGetTicks(); if ( mSelected.front() != 0 ) { @@ -823,7 +818,7 @@ void cUIListBox::ManageKeyboard() { mItems[ 0 ]->Select(); } - } else if ( KM->IsKeyDown( KEY_PAGEDOWN ) ) { + } else if ( KEY_PAGEDOWN == Event.KeyCode() ) { mLastTickMove = eeGetTicks(); if ( mSelected.front() != Count() - 1 ) { @@ -837,6 +832,10 @@ void cUIListBox::ManageKeyboard() { } } } + + ItemKeyEvent( Event ); + + return 1; } Uint32 cUIListBox::OnMessage( const cUIMessage * Msg ) { diff --git a/src/ui/cuilistbox.hpp b/src/ui/cuilistbox.hpp index ea232359c..6eb379716 100644 --- a/src/ui/cuilistbox.hpp +++ b/src/ui/cuilistbox.hpp @@ -199,8 +199,6 @@ class EE_API cUIListBox : public cUIComplexControl { void FindMaxWidth(); - void ManageKeyboard(); - cUIListBoxItem * CreateListBoxItem( const std::wstring& Name ); void CreateItemIndex( const Uint32& i ); diff --git a/src/ui/cuilistboxitem.cpp b/src/ui/cuilistboxitem.cpp index 8d5247810..6ff03a008 100644 --- a/src/ui/cuilistboxitem.cpp +++ b/src/ui/cuilistboxitem.cpp @@ -32,12 +32,6 @@ Uint32 cUIListBoxItem::OnMouseClick( const eeVector2i& Pos, const Uint32 Flags ) return 1; } -Uint32 cUIListBoxItem::OnKeyDown( const cUIEventKey &Event ) { - reinterpret_cast ( Parent()->Parent() )->ItemKeyEvent( Event ); - - return 1; -} - void cUIListBoxItem::Select() { cUIListBox * LBParent = reinterpret_cast ( Parent()->Parent() ); @@ -72,8 +66,6 @@ void cUIListBoxItem::Select() { } void cUIListBoxItem::Update() { - cUITextBox::Update(); - if ( mEnabled && mVisible ) { cUIListBox * LBParent = reinterpret_cast ( Parent()->Parent() ); Uint32 Flags = cUIManager::instance()->GetInput()->ClickTrigger(); @@ -85,10 +77,9 @@ void cUIListBoxItem::Update() { if ( Flags & EE_BUTTONS_WUWD && LBParent->VerticalScrollBar()->Visible() ) LBParent->VerticalScrollBar()->Slider()->ManageClick( Flags ); } - - if ( ( mControlFlags & UI_CTRL_FLAG_HAS_FOCUS ) ) - LBParent->ManageKeyboard(); } + + cUITextBox::Update(); } Uint32 cUIListBoxItem::OnMouseExit( const eeVector2i& Pos, const Uint32 Flags ) { diff --git a/src/ui/cuilistboxitem.hpp b/src/ui/cuilistboxitem.hpp index 93b13b64a..68759123d 100644 --- a/src/ui/cuilistboxitem.hpp +++ b/src/ui/cuilistboxitem.hpp @@ -31,8 +31,6 @@ class EE_API cUIListBoxItem : public cUITextBox { virtual Uint32 OnMouseClick( const eeVector2i& Pos, const Uint32 Flags ); virtual Uint32 OnMouseExit( const eeVector2i& Pos, const Uint32 Flags ); - - virtual Uint32 OnKeyDown( const cUIEventKey &Event ); }; }} diff --git a/src/ui/cuimanager.hpp b/src/ui/cuimanager.hpp index 9d6f39df3..999b69753 100644 --- a/src/ui/cuimanager.hpp +++ b/src/ui/cuimanager.hpp @@ -51,9 +51,7 @@ class EE_API cUIManager : public tSingleton { cUIControl * mOverControl; cUIControl * mDownControl; bool mFirstPress; - eeFloat mElapsed; - Int32 mCbId; void InputCallback( EE_Event * Event ); diff --git a/src/ui/uihelper.hpp b/src/ui/uihelper.hpp index e2e2269ba..f5cc48991 100644 --- a/src/ui/uihelper.hpp +++ b/src/ui/uihelper.hpp @@ -19,6 +19,7 @@ enum UI_CONTROL_FLAGS_POS { UI_CTRL_FLAG_DISABLE_CHECK_CLOSE_CHILDS_POS = 6, UI_CTRL_FLAG_DISABLE_FADE_OUT_POS = 7, UI_CTRL_FLAG_MOUSEOVER_ME_OR_CHILD_POS = 8, + UI_CTRL_FLAG_DRAGGING_POS = 9, UI_CTRL_FLAG_FREE_USE_POS = 31 }; @@ -32,6 +33,7 @@ enum UI_CONTROL_FLAGS_VALUES { UI_CTRL_FLAG_DISABLE_CHECK_CLOSE_CHILDS = (1<