本文整理汇总了C++中UserInterface::GetElementByName方法的典型用法代码示例。如果您正苦于以下问题:C++ UserInterface::GetElementByName方法的具体用法?C++ UserInterface::GetElementByName怎么用?C++ UserInterface::GetElementByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInterface
的用法示例。
在下文中一共展示了UserInterface::GetElementByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessMessage
//.........这里部分代码省略.........
mainWindow->Destroy();
}
}
else if (msg.Contains("MaximizeWindow("))
{
String windowName = msg.Tokenize("()")[1];
AppWindow * window = WindowMan.GetWindowByName(windowName);
if (window)
{
if (!window->IsFullScreen())
window->ToggleFullScreen();
}
}
else if (msg.Contains("INTERPRET_CONSOLE_COMMAND(this)"))
{
String command = message->element->text;
Message * newMes = new Message(MessageType::CONSOLE_COMMAND);
newMes->msg = command;
MesMan.QueueMessage(newMes);
return;
}
else if (msg == "TogglePause(this)"){
UIElement * e = message->element;
if (e->type != UIType::VIDEO)
return;
UIVideo * video = (UIVideo*) e;
video->TogglePause();
}
else if (msg.Contains("UIProceed("))
{
String name = msg.Tokenize("()")[1];
UserInterface * ui = RelevantUI();
UIElement * e = ui->GetElementByName(name);
if (!e)
return;
e->Proceed();
return;
}
else if (msg.Contains("UITextureInput("))
{
String name = msg.Tokenize("()")[1];
UserInterface * ui = RelevantUI();
UIElement * e = ui->GetElementByName(name);
if (e->type != UIType::TEXTURE_INPUT)
return;
UITextureInput * ti = (UITextureInput*) e;
TextureMessage * m = new TextureMessage(ti->action, ti->GetTextureSource());
MesMan.QueueMessage(m);
return;
}
else if (msg.Contains("UIStringInput("))
{
/// Obsolete?
/*
String name = msg.Tokenize("()")[1];
UserInterface * ui = RelevantUI();
if (!ui)
return;
UIElement * e = ui->GetElementByName(name);
if (e->type != UIType::STRING_INPUT)
return;
UIStringInput * si = (UIStringInput*)e;
SetStringMessage * m = new SetStringMessage(si->action, si->GetValue());
MesMan.QueueMessage(m);
*/