mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-23 23:28:52 +01:00
Added support for onEnter/onExit to the scrolling lists.
This commit is contained in:
parent
e711049acb
commit
0c2b2e56f2
@ -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;
|
||||
|
||||
@ -53,6 +53,8 @@ public:
|
||||
|
||||
ScrollingList(const ScrollingList ©);
|
||||
virtual ~ScrollingList();
|
||||
void triggerEnterEvent();
|
||||
void triggerExitEvent();
|
||||
void triggerMenuEnterEvent(int menuIndex = -1);
|
||||
void triggerMenuExitEvent(int menuIndex = -1);
|
||||
|
||||
|
||||
@ -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_)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user