本文整理汇总了C++中cegui::Window::activate方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::activate方法的具体用法?C++ Window::activate怎么用?C++ Window::activate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Window
的用法示例。
在下文中一共展示了Window::activate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnEventKeyDown
bool TabNavigation::OnEventKeyDown(const CEGUI::EventArgs& e)
{
const CEGUI::KeyEventArgs& args = static_cast<const CEGUI::KeyEventArgs&>(e);
if (args.scancode == CEGUI::Key::Tab) // Tab or Shift+Tab
{
WidgetList::iterator itCurrent = Containers::find(mTabOrder.begin(), mTabOrder.end(), args.window);
OC_ASSERT(itCurrent != mTabOrder.end());
WidgetList::iterator itFocus = itCurrent;
CEGUI::Window* newWidget = 0;
do
{
if (args.sysKeys & CEGUI::Shift)
{
// Set previous
if (itFocus == mTabOrder.begin())
itFocus = mTabOrder.end();
--itFocus;
}
else
{
// Set next
++itFocus;
if (itFocus == mTabOrder.end())
itFocus = mTabOrder.begin();
}
newWidget = *itFocus;
}
while ((!newWidget->isVisible() || newWidget->isDisabled() || newWidget->getProperty("ReadOnly") == "True" ) && itFocus != itCurrent);
newWidget->activate();
// Make sure active widget will be visible
if (mScrollablePane)
{
CEGUI::Window* w = newWidget;
CEGUI::Vector2 widgetOffset(0, 0);
do
{
widgetOffset += w->getPosition().asAbsolute(w->getParentPixelSize());
w = w->getParent();
}
while (w != mScrollablePane && w != 0);
float32 scrollViewTop = mScrollablePane->getContentPaneArea().getSize().d_height * mScrollablePane->getVerticalScrollPosition();
float32 scrollViewBottom = scrollViewTop + mScrollablePane->getClipRect().getHeight();
if (widgetOffset.d_y < scrollViewTop || widgetOffset.d_y + newWidget->getPixelSize().d_height > scrollViewBottom)
{
// We need to scroll
mScrollablePane->setVerticalScrollPosition(widgetOffset.d_y / mScrollablePane->getContentPaneArea().getSize().d_height);
}
}
return true;
}
return false;
}
示例2: onBattleEnd
void GameCoordinator::onBattleEnd(int winnerPlayer)
{
CEGUI::System::getSingleton().getGUISheet()->deactivate();
CEGUI::Window* menu = CEGUI::System::getSingleton().getGUISheet()->getChildRecursive("Game/Menu");
CEGUI::Window* end_text = CEGUI::System::getSingleton().getGUISheet()->getChildRecursive("Game/End");
menu->activate();
end_text->setVisible(true);
if (winnerPlayer == 0)
end_text->setText(utf8ToCeguiString(GameSettingsSingleton.getLanguage().textForCode("game.won")));
else if (winnerPlayer == 1)
end_text->setText(utf8ToCeguiString(GameSettingsSingleton.getLanguage().textForCode("game.lost")));
else
end_text->setText(utf8ToCeguiString(GameSettingsSingleton.getLanguage().textForCode("game.quit")));
}
示例3: Open
bool GoodsViewerPage::Open()
{
CEGUI::Window *pPage = GetPageWindow();
if (pPage)
{
pPage->setVisible(true);
pPage->activate();
pPage->setAlwaysOnTop(true);
}
else
{
CEGUI::InvalidRequestException("GoodsViewerPage Open Failed!");
return false;
}
return true;
}