diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.cpp b/RetroFE/Source/Graphics/Component/ScrollingList.cpp index 34d2785..fd5f7e3 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingList.cpp +++ b/RetroFE/Source/Graphics/Component/ScrollingList.cpp @@ -51,7 +51,7 @@ ScrollingList::ScrollingList(Configuration &c, , spriteList_(NULL) , scrollPoints_(NULL) , tweenPoints_(NULL) - , focus_(true) + , focus_(false) , itemIndex_(0) , componentIndex_(0) , selectedOffsetIndex_(0) @@ -381,6 +381,30 @@ void ScrollingList::freeGraphicsMemory() deallocateSpritePoints(); } +void ScrollingList::triggerEnterEvent() +{ + focus_ = true; + notifyAllRequested_ = true; + + for(unsigned int i = 0; i < components_.size(); ++i) + { + Component *c = components_.at(i); + if(c) c->triggerEvent( "enter" ); + } +} + +void ScrollingList::triggerExitEvent() +{ + focus_ = false; + notifyAllRequested_ = true; + + for(unsigned int i = 0; i < components_.size(); ++i) + { + Component *c = components_.at(i); + if(c) c->triggerEvent( "exit" ); + } +} + void ScrollingList::triggerMenuEnterEvent( int menuIndex ) { focus_ = true; diff --git a/RetroFE/Source/Graphics/Component/ScrollingList.h b/RetroFE/Source/Graphics/Component/ScrollingList.h index 6c97004..4c92204 100644 --- a/RetroFE/Source/Graphics/Component/ScrollingList.h +++ b/RetroFE/Source/Graphics/Component/ScrollingList.h @@ -53,6 +53,8 @@ public: ScrollingList(const ScrollingList ©); virtual ~ScrollingList(); + void triggerEnterEvent(); + void triggerExitEvent(); void triggerMenuEnterEvent(int menuIndex = -1); void triggerMenuExitEvent(int menuIndex = -1); diff --git a/RetroFE/Source/Graphics/Page.cpp b/RetroFE/Source/Graphics/Page.cpp index e9b6aef..e5cbd26 100644 --- a/RetroFE/Source/Graphics/Page.cpp +++ b/RetroFE/Source/Graphics/Page.cpp @@ -235,6 +235,7 @@ void Page::start() { ScrollingList *menu = *it; menu->triggerEvent( "enter" ); + menu->triggerEnterEvent(); } if(loadSoundChunk_) @@ -263,6 +264,7 @@ void Page::stop() { ScrollingList *menu = *it; menu->triggerEvent( "exit" ); + menu->triggerExitEvent(); } if(unloadSoundChunk_)