當前位置: 首頁>>代碼示例>>C++>>正文


C++ AddSubMenu函數代碼示例

本文整理匯總了C++中AddSubMenu函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddSubMenu函數的具體用法?C++ AddSubMenu怎麽用?C++ AddSubMenu使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AddSubMenu函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: switch

		eOSState starter::show_menu()
		{
			m_display = m_nextDisplay;
			m_nextDisplay = display::none;
			job& pending = manager::get_pending();

			switch (m_display)
			{
			case display::recordings:
				return AddSubMenu(new menu::recordings);

			case display::job:
                if(menu::recordings::startedFromRecordigs)
                {
                    return AddSubMenu(new menu::recordings);
                }
                else
                {
				    return AddSubMenu(new menu::job_editor);
                }

			case display::options:
				return AddSubMenu(new job_options_editor( pending ) );

			case display::status:
				return AddSubMenu(new menu::status);

			default:
				return osBack;
			}
		}
開發者ID:suborb,項目名稱:reelvdr,代碼行數:31,代碼來源:menubase.c

示例2: Get

eOSState cMenuSetupTimers::ProcessKey(eKeys Key)
{
    eOSState state = cMenuSetupSubMenu::ProcessKey(Key);

    const char* ItemText = Get(Current())->Text();
    int iOnDefRecDir = 0;
    int iOnDefTimerCheck = 0;
    if (!HasSubMenu())
    {
	if (strstr(ItemText, tr("Default recording dir")) == ItemText)
	    iOnDefRecDir = 1;
	else if (strstr(ItemText, tr("Default timer check method")) == ItemText)
	    iOnDefTimerCheck = 1;
    }
    SetHelpKeys();

    if (state == osUnknown) {
	switch (Key) {
	  case kBlue:
	      if (!HasSubMenu())
	      {
		  if (iOnDefRecDir == 1)
		      state = AddSubMenu(new cMenuDirSelect(data->defrecdir));
		  if (iOnDefTimerCheck == 1)
		      state = AddSubMenu(new cMenuDefTimerCheckMethod());
	      }
	      break;
	    case kOk:
		return osBack;
	    default: break;
	}
    }

    return state;
}
開發者ID:suborb,項目名稱:reelvdr,代碼行數:35,代碼來源:epgsearchsetup.c

示例3: switch

eOSState cMenuSetupSc::ProcessKey(eKeys Key)
{
  eOSState state = cOsdMenu::ProcessKey(Key);
  switch(state) {
    case osUser4:
      if(Feature.SmartCard()) {
        cScInfoItem *ii=dynamic_cast<cScInfoItem *>(Get(Current()));
        if(ii) return(AddSubMenu(new cMenuInfoCard(ii->Ident())));
        }
      state=osContinue;
      break;

    case osUser7:
      state=osContinue;
      if(Interface->Confirm(tr("Really flush ECM cache?"))) {
        state=osEnd;
        }
      break;

    case osUser8:
      return AddSubMenu(new cMenuInfoSc);

    case osUser6:
      return AddSubMenu(new cMenuLogSys);

    case osUser5:
      return AddSubMenu(new cMenuSysOpts);

    case osUser9:
      state=osContinue;
      if(!cGlobal::Active(true)) {
        if(Interface->Confirm(tr("Really reload files?"))) {
          Store();
          cSoftCAM::Load(cfgdir);
          state=osEnd;
          }
        }
      else 
        Skins.Message(mtError,tr("Active! Can't reload files now"));
      break;

    case osContinue:
      if(NORMALKEY(Key)==kUp || NORMALKEY(Key)==kDown) {
        cOsdItem *item=Get(Current());
        if(item) item->ProcessKey(kNone);
        }
      break;

    case osUnknown:
      if(Key==kOk) { Store(); state=osBack; }
      break;

    default:
      break;
    }
  return state;
}
開發者ID:mrfloppy82,項目名稱:descrambler,代碼行數:57,代碼來源:sc.c

示例4: Get

eOSState cMenuFavouritesFunction::ProcessKey(eKeys Key)
{
    eOSState state = cOsdMenu::ProcessKey(Key);

    const char* text = Get(Current())?Get(Current())->Text():NULL;
    if (state == osUnknown) {
        switch(Key) {
        case kOk:
            state = osContinue;
            if (text) {
                printf("Got text : '%s'\n", text);

                if (strstr(text, tr("Delete channel"))) {
                    printf("Deleting channel\n");
                    if (Interface->Confirm(tr("Delete channel from favourites?"), 3)) {
                        if (DelFavChannel(channel)) {
                            Skins.Message(mtInfo, tr("Channel deleted"));
                            state = osRefreshPage;
                        } else
                            Skins.Message(mtError, tr("Deletion of channel failed"));
                    } else
                        Skins.Message(mtInfo, tr("Delete cancelled"));

                } else if (strstr(text, tr("Delete folder"))) {
                    if (Interface->Confirm(tr("Delete folder and all its channels?"), 3)) {
                        // delete all channels in folder including folder
                        if (DelFavFolder(channel)) {
                            Skins.Message(mtInfo, tr("Folder and its contents deleted"));
                            state = osRefreshPage;
                        } else
                            Skins.Message(mtError, tr("Deletion of folder failed"));
                    } else
                        Skins.Message(mtInfo, tr("Delete cancelled"));

                } else if (strstr(text, tr("Rename folder")))
                    return AddSubMenu(new cMenuRenameFavFolder(channel));
                else if (strstr(text, tr("Move folder")))
                    return AddSubMenu(new cMenuMoveFavFolder(channel));
                else if (strstr(text, tr("Move channel")))
                    return AddSubMenu(new cMenuMoveChannelInFavBouquet(channel));
                else if (strstr(text, tr("CI-slot assignment for folder")))
                    return AddSubMenu(new cOsdMenuCISlot(channel->Name(), true));
                else if (strstr(text, tr("CI-slot assignment for channel")))
                    return AddSubMenu(new cOsdMenuCISlot(channel->Name(), true, channel));
            }

            break;

        default:
            break;
        } // switch
    } //if

    return state;
}
開發者ID:suborb,項目名稱:reelvdr,代碼行數:55,代碼來源:favourites.c

示例5: switch

eOSState cAlbumList::ProcessKey(eKeys Key) {
        eOSState state = cOsdMenu::ProcessKey(Key);
        if (state != osUnknown ) 
                return state;

        cPlayList *List;
        cPlayListItem *Item;
        switch (Key) {
                case kOk:
                        MENUDEB("Current %d GetItem %p\n",Current(),playList->GetItem(Current()));
                        Item=playList->GetItem(Current());
                        List=dynamic_cast<cPlayList*>(Item);
                        MENUDEB("Item %p\n",Item);

                        if (List) {
                                cAlbumList *Menu=new cAlbumList(List);
                                return AddSubMenu(Menu);
                        }  else {
                                // skip to current track
                                playList->SetCurrIdx(
                                                playList->GetIndexByItem(Item));
                                state = PLAY_CURR_FILE;
                        };
                        break;
                case kBack:
                        state= osBack;
                        break;
                case kBlue:
                        state= osEnd;
                        break;
                case kRed:
                        return AddSubMenu(new cPlOptionsMenu(playList));
                        break;
                case kYellow:
                        MENUDEB("Del current %d: %s\n",
                                        Current(),
                                        playList->GetItem(Current())->GetName() );
                        playList->RemoveItem(
                                        playList->GetItem(Current()));
                        MENUDEB("Remove finished\n");
                        Del(Current());
                        Display();
                        state=osContinue;
                        break;

                default:    
                        break;
        }

        return state;
}
開發者ID:BackupTheBerlios,項目名稱:softdevice,代碼行數:51,代碼來源:PlayListMenu.c

示例6: Set

eOSState cMenuSetupSearchtimers::ProcessKey(eKeys Key)
{
    int iTemp_useSearchTimers = data->useSearchTimers;
    int iTemp_checkEPGHours = data->checkEPGHours;

    int iOnSearchTemplates = 0;
    int iOnBlacklists = 0;
    int iOnChannelGroups = 0;

    eOSState state = cMenuSetupSubMenu::ProcessKey(Key);

    if (iTemp_useSearchTimers != data->useSearchTimers ||
	iTemp_checkEPGHours != data->checkEPGHours)
    {
	Set();
	Display();
    }

    const char* ItemText = Get(Current())->Text();
    if (!HasSubMenu())
    {
	if (strstr(ItemText, tr("Search templates")) == ItemText)
	    iOnSearchTemplates = 1;
	else if (strstr(ItemText, tr("Blacklists")) == ItemText)
	    iOnBlacklists = 1;
	if (strstr(ItemText, tr("Channel groups")) == ItemText)
	    iOnChannelGroups = 1;
    }
    SetHelpKeys();

    if (state == osUnknown) {
	switch (Key) {
	    case kBlue:
		if (!HasSubMenu())
		{
		    if (iOnSearchTemplates == 1)
			state = AddSubMenu(new cMenuEPGSearchTemplate(NULL, NULL, false));
		    else if (iOnBlacklists == 1)
			state = AddSubMenu(new cMenuBlacklists);
		    else if (iOnChannelGroups == 1)
			state = AddSubMenu(new cMenuChannelGroups);
		}
		break;
	    case kOk:
		return osBack;
	    default: break;
	}
    }
    return state;
}
開發者ID:jowi24,項目名稱:vdr-epgsearch,代碼行數:50,代碼來源:epgsearchsetup.c

示例7: GetTab

// --- cMenuSearchMain ---------------------------------------------------------
cMenuSearchMain::cMenuSearchMain(void)
:cOsdMenu("", GetTab(1), GetTab(2), GetTab(3), GetTab(4), GetTab(5))
{
#if VDRVERSNUM >= 10728
  SetMenuCategory(mcSchedule);
#endif
  helpKeys = -1;
  otherChannel = 0;
  toggleKeys = 0;
  shiftTime = 0;
  InWhatsOnMenu = false;
  InFavoritesMenu = false;
  cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
  schedules = cSchedules::Schedules(schedulesLock);
  if (channel) {
    cMenuWhatsOnSearch::SetCurrentChannel(channel->Number());
    if (EPGSearchConfig.StartMenu == 0 || forceMenu != 0)
      PrepareSchedule(channel);
    SetHelpKeys();
    cMenuWhatsOnSearch::currentShowMode = showNow;
    //    timeb tnow;
    //ftime(&tnow);
    //isyslog("duration epgs sched:  %d", tnow.millitm - gl_time.millitm + ((tnow.millitm - gl_time.millitm<0)?1000:0));

  }
  if ((EPGSearchConfig.StartMenu == 1 || forceMenu == 1) && forceMenu != 2)
    {
      InWhatsOnMenu = true;
      AddSubMenu(new cMenuWhatsOnSearch(schedules, cDevice::CurrentChannel()));
    }
  if (forceMenu == 3)
      ShowSummary();
}
開發者ID:jowi24,項目名稱:vdr-epgsearch,代碼行數:34,代碼來源:menu_main.c

示例8: switch

eOSState cMenuAnnounceList::ProcessKey(eKeys Key)
{
    eOSState state = cMenuSearchResultsForList::ProcessKey(Key);
    if (state == osUnknown)
    {
        switch (Key) {
        case kBlue:
        {
            cMenuSearchResultsItem *item = (cMenuSearchResultsItem *)Get(Current());
            if (item)
            {
                if (!HasSubMenu())
                    return AddSubMenu(new cMenuAnnounceDetails(item->event, item->search));
                else if (!showsDetails)
                    return Switch();
                else
                    return osContinue;
            }
        }
        break;
        default:
            break;
        }
    }
    return state;
}
開發者ID:flensrocker,項目名稱:vdr-plugin-epgsearch,代碼行數:26,代碼來源:menu_announcelist.c

示例9: debug1

eOSState cSatipPluginSetup::ShowInfo(void)
{
  debug1("%s", __PRETTY_FUNCTION__);
  if (HasSubMenu() || Count() == 0)
     return osContinue;

  return AddSubMenu(new cSatipMenuInfo());
}
開發者ID:rofafor,項目名稱:vdr-plugin-satip,代碼行數:8,代碼來源:setup.c

示例10: GetCurrent

eOSState cMenuBrowseFiles::Info(void)
{
  if (GetCurrent() && !GetCurrent()->IsDir()) {
    cString filename = cString::sprintf("%s/%s", *m_CurrentDir, GetCurrent()->Name());
    return AddSubMenu(new cMetainfoMenu(filename));
  }
  return osContinue;
}
開發者ID:flensrocker,項目名稱:vdr-plugin-xineliboutput,代碼行數:8,代碼來源:menu.c

示例11: AddSubMenu

BOOL CMyMenuBar::RestoreOriginalstate () {
  if (!CMFCMenuBar::RestoreOriginalState()) {
    return FALSE;
  }

  AddSubMenu ();
  return TRUE;
}
開發者ID:jhlee8804,項目名稱:MFC-Feature-Pack,代碼行數:8,代碼來源:MyMenuBar.cpp

示例12: AddSubMenu

eOSState cMenuEpgTimers::Edit(void)
{
  if (HasSubMenu() || Count() == 0)
     return osContinue;

  cMenuSwitchTimerItem *item = dynamic_cast<cMenuSwitchTimerItem*> (Get(Current()));
  if (item && item->switchTimer)
      return AddSubMenu(new cMenuMyEditTimer(item->switchTimer, false));

  cTimer *timer = CurrentTimer();

  if (!timer) return osContinue; // nothing to edit here

  isyslog("editing timer %s", *timer->ToDescr());
  return AddSubMenu(new cMenuMyEditTimer(timer, false, NULL));

}
開發者ID:suborb,項目名稱:reelvdr,代碼行數:17,代碼來源:menu_epgtimers.c

示例13: CurrentTimer

eOSState cMenuEpgTimers::Info(void)
{
  if (HasSubMenu() || Count() == 0)
     return osContinue;
  cTimer *ti = CurrentTimer();
  if (ti && ti->Event())
     return AddSubMenu(new cMenuEvent(ti->Event()));
  return osContinue;
}
開發者ID:suborb,項目名稱:reelvdr,代碼行數:9,代碼來源:menu_epgtimers.c

示例14: ProcessInstallationStatus

eOSState cSkindesignerSkinSetup::ProcessKey(eKeys Key) {
    eOSState state = ProcessInstallationStatus();
    if (state == osEnd)
        return osEnd;
    state = cOsdMenu::ProcessKey(Key);
    if (state == osUnknown) {
        switch (Key) {
            case kOk: {
                cOsdItem *current = Get(Current());
                cSkinSetupSubMenu *subMenuItem = dynamic_cast<cSkinSetupSubMenu*>(current);
                if (subMenuItem) {
                    state = AddSubMenu(new cSkindesignerSkinSetup(skin, subMenuItem->GetName(), subMenuItem->GetDisplayText()));
                    break;
                } else {
                    return osBack;
                }
            }
            case kRed: {
                string versionNeeded = "";
                bool versionOk = config.CheckVersion(skin, versionNeeded);
                if (!versionOk) {
                    cString error = cString::sprintf("%s %s %s %s %s", 
                                                     tr("Skin Designer"),
                                                     tr("version"), 
                                                     versionNeeded.c_str(),
                                                     tr("or higher"),
                                                     tr("needed"));
                    Skins.Message(mtError, *error);
                    break;
                }
                bool gitAvailable = StartUpdate(skin);
                if (gitAvailable) {
                    Skins.Message(mtStatus, *cString::sprintf("%s ...", tr("Updating Skin from Git")));
                } else {
                    Skins.Message(mtStatus, tr("No Git Repsoitory available"));
                }
                break;
            }
            // KEY YELLOW
            case kYellow: {
                if (config.SkinActive(skin)) {
                    Skins.Message(mtError, tr("Skin is running and can't be deleted"));
                } else if (Interface->Confirm(*cString::sprintf("%s?", tr("Really delete skin")))) {
                    config.DeleteSkin(skin);
                    Skins.Message(mtStatus, tr("Skin deleted"));
                    cCondWait::SleepMs(1000);
                    return osEnd;
                }
                state = osContinue;
                break;
            }
            default:
                break;
        }
    }
    return state;
}
開發者ID:flensrocker,項目名稱:vdr-plugin-skindesigner,代碼行數:57,代碼來源:setup.c

示例15: CurrentSwitchTimer

eOSState cMenuSwitchTimers::Summary(void)
{
    if (HasSubMenu() || Count() == 0)
	return osContinue;
    cSwitchTimer *curSwitchTimer = CurrentSwitchTimer();
    if (curSwitchTimer && !isempty(curSwitchTimer->event->Description()))
	return AddSubMenu(new cMenuText(tr("Summary"), curSwitchTimer->event->Description()));
    return osContinue;
}
開發者ID:suborb,項目名稱:reelvdr,代碼行數:9,代碼來源:menu_switchtimers.c


注:本文中的AddSubMenu函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。