void SystemTrayMenu::init() { mVKListMenu = new QMenu(gettext("Virtual Keyboard"), this); mSkinMenu = new QMenu(gettext("Skin"), this); mMozcHiraganaMenu = new QMenu(gettext("Mozc Edit mode"), this); mMozcToolMenu = new QMenu(gettext("Mozc Tool"), this); QObject::connect(this, SIGNAL(aboutToHide()), this, SLOT(clearMenu())); QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(triggerUpdateVKListMenu())); QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(truggerUpdateMozcHiraganaMenu())); QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(truggerUpdateMozcToolMenu())); QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(triggerUpdateIMListMenu())); QObject::connect(this, SIGNAL(triggered(QAction*)), this, SLOT(menuItemOnClick(QAction *))); QObject::connect(mAgent, SIGNAL(execMenu(const QList<KimpanelProperty>)), this, SLOT(execMenu(const QList<KimpanelProperty>))); QObject::connect(mAgent, SIGNAL(registerProperties(const QList<KimpanelProperty>)), this, SLOT(registerProperties(const QList<KimpanelProperty>))); QObject::connect(mAgent, SIGNAL(updateProperty(KimpanelProperty)), this, SLOT(updateProperty(KimpanelProperty))); updateMainMenu(); }
void SideScroller::Update(float elapsed) { switch (state) { case STATE_MAIN_MENU: updateMainMenu(elapsed); break; case STATE_GAME_LEVEL: updateGameLevel(elapsed); break; } }
void SystemTrayMenu::execMenu(const QList<KimpanelProperty> &prop_list) { QList<KimpanelProperty>::const_iterator iter = prop_list.begin(); if (isIMList(iter->key)) mIMList = prop_list; else if (isVKList(iter->key)) mVKList = prop_list; else if (isMozcHiraganaList(iter->key)) mMozcHiraganaList=prop_list; else if (isMozcToolList(iter->key)) mMozcToolList = prop_list; else{ for (iter = prop_list.begin(); iter != prop_list.end(); ++ iter) { // qDebug() << QString("execMenuCallback(1:%1 2:%2 3:%3 4:%4 5:%5 6:%6)").arg(iter->key) // .arg(iter->label).arg(iter->icon).arg(iter->tip).arg(iter->state).arg(iter->menu); } } updateMainMenu(); }
void mainMenu() { int done; int keyn; Uint8 *keys; done = 0; do { ResetBuffer(); Updateskybox(); done = updateMainMenu(); DrawMessages(); DrawMouse(); NextFrame(); SDL_PumpEvents(); keys = SDL_GetKeyState(&keyn); if(keys[SDLK_ESCAPE])exit(1); }while(!done); }
void GameEngine::update(sf::Time &elapsedTime) { handleEvents(elapsedTime); switch (data.state) { case CLOSING: return; case MAIN_MENU: updateMainMenu(elapsedTime); break; case RUNNING: updateGame(elapsedTime); break; default: break; } }