本文整理汇总了C++中UIWindow::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ UIWindow::getId方法的具体用法?C++ UIWindow::getId怎么用?C++ UIWindow::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIWindow
的用法示例。
在下文中一共展示了UIWindow::getId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pop
void UI::pop ()
{
if (_noPushAllowed)
return;
if (_stack.size() == 1) {
UIPopupCallbackPtr c(new UIPopupOkCommandCallback(CMD_QUIT));
UI::get().popup(tr("Quit"), UIPOPUP_OK | UIPOPUP_CANCEL, c);
return;
}
UIWindow* window = *_stack.rbegin();
if (!window->onPop())
return;
info(LOG_CLIENT, "pop window " + window->getId());
System.track("popwindow", window->getId());
_stack.pop_back();
_stack.back()->onActive();
if (window->shouldDelete()) {
delete window;
}
}
示例2: push
UIWindow* UI::push (const std::string& windowID)
{
if (_noPushAllowed)
return nullptr;
if (!_stack.empty()) {
UIWindow* activeWindow = *_stack.rbegin();
if (activeWindow->getId() == windowID) {
// don't push the same window twice onto
// the stack just after each other
return activeWindow;
}
}
UIWindow* window = getWindow(windowID);
if (!window) {
error(LOG_CLIENT, "could not find window '" + windowID + "'");
return nullptr;
}
if (_stack.empty() && !window->isRoot())
return nullptr;
if (!window->onPush())
return nullptr;
info(LOG_CLIENT, "push window " + windowID);
System.track("pushwindow", window->getId());
if (!_stack.empty()) {
UIWindow* activeWindow = *_stack.rbegin();
activeWindow->onPushedOver();
}
_stack.push_back(window);
_stack.back()->onActive();
return window;
}
示例3: popMain
void UI::popMain ()
{
_noPushAllowed = true;
// don't pop the root window
while (_stack.size() > 1) {
UIWindow* window = *_stack.rbegin();
if (window->isMain())
break;
info(LOG_CLIENT, "pop window " + window->getId());
window->onPop();
_stack.pop_back();
_stack.back()->onActive();
if (window->shouldDelete()) {
delete window;
}
}
_noPushAllowed = false;
}