本文整理汇总了C++中TabControl::getItemCount方法的典型用法代码示例。如果您正苦于以下问题:C++ TabControl::getItemCount方法的具体用法?C++ TabControl::getItemCount怎么用?C++ TabControl::getItemCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabControl
的用法示例。
在下文中一共展示了TabControl::getItemCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GuiShortcut
// Gui Shortcut alt-letters
//.......................................................................................
void CGui::GuiShortcut(WND_Types wnd, int tab, int subtab)
{
if (subtab == -1 && (!app->bGuiFocus || pSet->inMenu != wnd)) subtab = -2; // cancel subtab cycling
if (!app->bGuiFocus)
if (app->edMode != ED_PrvCam) {
app->bGuiFocus = !app->bGuiFocus; app->UpdVisGui(); }
//isFocGui = true;
pSet->isMain = false; pSet->inMenu = wnd;
TabPtr mWndTabs = 0;
std::vector<TabControl*>* subt = 0;
switch (wnd)
{ case WND_Track: mWndTabs = app->mWndTabsTrack; subt = &vSubTabsTrack; break;
case WND_Edit: mWndTabs = app->mWndTabsEdit; subt = &vSubTabsEdit; break;
case WND_Help: mWndTabs = app->mWndTabsHelp; subt = &vSubTabsHelp; break;
case WND_Options: mWndTabs = app->mWndTabsOpts; subt = &vSubTabsOpts; break;
}
if (wnd != WND_Edit)
app->mWndPick->setVisible(false);
toggleGui(false);
size_t t = mWndTabs->getIndexSelected();
mWndTabs->setIndexSelected(tab);
if (!subt) return;
TabControl* tc = (*subt)[tab]; if (!tc) return;
int cnt = tc->getItemCount();
if (t == tab && subtab == -1) // cycle subpages if same tab
{ if (app->shift)
tc->setIndexSelected( (tc->getIndexSelected()-1+cnt) % cnt );
else
tc->setIndexSelected( (tc->getIndexSelected()+1) % cnt );
}
if (subtab > -1)
tc->setIndexSelected( std::min(cnt-1, subtab) );
}
示例2: keyPressed
//.........这里部分代码省略.........
gui->toggleGui(true);
return true;
case key(F12): // screenshot
mWindow->writeContentsToTimestampedFile(PATHMANAGER::Screenshots() + "/", ".jpg");
return true;
// save, reload, update
case key(F4): SaveTrack(); return true;
case key(F5): LoadTrack(); return true;
case key(F8): UpdateTrack(); return true;
case key(F9): // blendmap
if (alt) gui->ckAutoBlendmap.Invert();
else bTerUpdBlend = true; return true;
// prev num tab (layers,grasses,models)
case key(1):
if (alt && !bRoad) { gui->NumTabNext(-1); return true; }
break;
// next num tab
case key(2):
if (alt && !bRoad) { gui->NumTabNext(1); return true; }
break;
case key(F2): // +-rt num
if (alt)
{ pSet->num_mini = (pSet->num_mini - 1 + RTs+2) % (RTs+2); UpdMiniVis(); }
else
if (bGuiFocus && tab && !pSet->isMain)
if (shift) // prev gui subtab
{
if (sub) { int num = sub->getItemCount();
sub->setIndexSelected( (sub->getIndexSelected() - 1 + num) % num ); }
}
else // prev gui tab
{ int num = tab->getItemCount()-1, i = tab->getIndexSelected();
if (i==iTab1) i = num; else --i;
tab->setIndexSelected(i); if (iTab1==1) gcom->tabMainMenu(tab,i);
}
break;
case key(F3): // tabs,sub
if (alt)
{ pSet->num_mini = (pSet->num_mini + 1) % (RTs+2); UpdMiniVis(); }
else
if (bGuiFocus && tab && !pSet->isMain)
if (shift) // next gui subtab
{
if (sub) { int num = sub->getItemCount();
sub->setIndexSelected( (sub->getIndexSelected() + 1) % num ); }
}
else // next gui tab
{ int num = tab->getItemCount()-1, i = tab->getIndexSelected();
if (i==num) i = iTab1; else ++i;
tab->setIndexSelected(i); if (iTab1==1) gcom->tabMainMenu(tab,i);
}
break;
case key(RETURN): // load track
if (bGuiFocus)
if (mWndTabsTrack->getIndexSelected() == 1 && !pSet->isMain && pSet->inMenu == WND_Track)
gui->btnNewGame(0);
break;