本文整理汇总了C++中UserInterface::GetStackTop方法的典型用法代码示例。如果您正苦于以下问题:C++ UserInterface::GetStackTop方法的具体用法?C++ UserInterface::GetStackTop怎么用?C++ UserInterface::GetStackTop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInterface
的用法示例。
在下文中一共展示了UserInterface::GetStackTop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessMessage
//.........这里部分代码省略.........
return;
}
else if (msg.Contains("PushToStack(") || msg.Contains("PushUI(")){
// Fetch target.
List<String> params = msg.Tokenize("(),");
assert(params.Size() >= 2 && "Invalid amount of arguments to PushToStack UI command!");
if (params.Size() < 2)
{
LogMain("Bad arguments in message: "+msg, ERROR);
return;
}
PushUI(params[1]);
return;
}
else if (msg.Contains("PopFromStack(") || msg.Contains("PopUI("))
{
// std::cout<<"\nPopFromStack/PopUI received.";
// Fetch target.
List<String> params = msg.Tokenize("(),");
assert(params.Size() >= 2 && "Invalid amount of arguments to PopFromStack UI command!");
if (params.Size() < 2){
std::cout<<"\nToo few parameters.";
return;
}
String uiName = params[1];
if (uiName == "this")
uiName = message->element->name;
PopUI(uiName);
return;
}
else if (msg == "Back")
{
UserInterface * ui = RelevantUI();
UIElement * stackTop = ui->GetStackTop();
Graphics.QueueMessage(new GMPopUI(stackTop->name, ui));
return;
}
else if (msg.Contains("begin_input(") ||
msg.Contains("BeginInput("))
{
String elementName = msg.Tokenize("()")[1];
UIElement * element;
if (elementName == "this")
element = message->element;
else
element = StateMan.ActiveState()->GetUI()->GetElementByName(elementName);
if (!element)
return;
assert(element->demandInputFocus);
((UIInput*)element)->BeginInput();
return;
/*
UserInterface * ui = StateMan.ActiveState()->GetUI();
UIElement * element = message->element;
if (!element){
std::cout<<"\nNo active element, fetching hover element.";
element = ui->GetHoverElement();
}
if (element != NULL){
// assert(element->onTrigger);
if (!element->onTrigger)
std::cout<<"\nBegnning input for element without onTrigger specified!";
InputMan.SetActiveUIInputElement(element);
InputMan.EnterTextInputMode(element->onTrigger);
}
else