Files
Upsilon/apps/apps_container.cpp
Romain Goyet 753a4a7cb5 [Ion] Move to C++
Change-Id: Id75fca5e92a3fdf18258015bcda7cd70297b0fdb
2016-08-23 16:30:15 +02:00

35 lines
668 B
C++

#include "apps_container.h"
AppsContainer::AppsContainer() :
Container(),
m_activeAppIndex(0)
{
}
bool AppsContainer::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::Event::F1) {
m_activeAppIndex++;
if (m_activeAppIndex >= (int)(AppId::Count)) {
m_activeAppIndex = 0;
}
switchTo((AppId)m_activeAppIndex);
return true;
}
return false;
}
void AppsContainer::switchTo(AppId appId) {
Container::switchTo(appWithId(appId));
}
App * AppsContainer::appWithId(AppId appId) {
App * apps[] = {
&m_graphApp,
&m_probabilityApp,
#if USE_PIC_VIEW_APP
&m_picViewApp,
#endif
};
return apps[(int)appId];
};