本文整理汇总了C++中cegui::Window::fireEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::fireEvent方法的具体用法?C++ Window::fireEvent怎么用?C++ Window::fireEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Window
的用法示例。
在下文中一共展示了Window::fireEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TabbableWindow_KeyDown
bool Widget::TabbableWindow_KeyDown(const CEGUI::EventArgs& args)
{
const CEGUI::KeyEventArgs& keyEventArgs = static_cast<const CEGUI::KeyEventArgs&>(args);
if (keyEventArgs.scancode == CEGUI::Key::Tab)
{
//find the window in the list of tabbable windows
CEGUI::Window* activeWindow = mMainWindow->getActiveChild();
if (activeWindow) {
// WindowMap::iterator I = std::find(mTabOrder.begin(), mTabOrder.end(), activeWindow);
WindowMap::iterator I = mTabOrder.find(activeWindow);
if (I != mTabOrder.end()) {
I->second->activate();
//we don't want to process the event any more, in case something else will try to interpret the tab event to also change the focus
Input::getSingleton().suppressFurtherHandlingOfCurrentEvent();
return true;
}
}
} else if (keyEventArgs.scancode == CEGUI::Key::Return)
{
//iterate through all enter buttons, and if anyone is visible, activate it
for (WindowStore::iterator I = mEnterButtons.begin(); I != mEnterButtons.end(); ++I) {
if ((*I)->isVisible()) {
CEGUI::Window* window = *I;
WindowEventArgs args(window);
window->fireEvent(PushButton::EventClicked, args, PushButton::EventNamespace);
break;
}
}
}
return false;
}
示例2: createScorePopup
void HUDDemo::createScorePopup(const CEGUI::Vector2<float>& mousePos, int points)
{
CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window* popupWindow = winMgr.createWindow("HUDDemo/PopupLabel");
d_rootIngame->addChild(popupWindow);
popupWindow->setPosition(CEGUI::UVector2(cegui_absdim(mousePos.d_x), cegui_absdim(mousePos.d_y)));
popupWindow->setText(CEGUI::PropertyHelper<int>::toString(points));
popupWindow->setRiseOnClickEnabled(false);
popupWindow->subscribeEvent(AnimationInstance::EventAnimationEnded, Event::Subscriber(&HUDDemo::handleScorePopupAnimationEnded, this));
popupWindow->setPixelAligned(false);
popupWindow->setFont("DejaVuSans-14");
popupWindow->setPosition(popupWindow->getPosition() + CEGUI::UVector2(cegui_reldim(0.03f), cegui_reldim(-0.02f)));
if(points < 0)
popupWindow->setProperty("NormalTextColour", "FF880000");
else
{
popupWindow->setText( "+" + popupWindow->getText());
popupWindow->setProperty("NormalTextColour", "FF006600");
}
CEGUI::EventArgs args;
popupWindow->fireEvent("StartAnimation", args);
}
示例3: handleInnerButtonsLabelLeft
bool GameMenuDemo::handleInnerButtonsLabelLeft(const CEGUI::EventArgs& args)
{
const CEGUI::MouseEventArgs& mouseArgs = static_cast<const CEGUI::MouseEventArgs&>(args);
CEGUI::Window* iconWindow = getIconWindowFromLabel(mouseArgs.window);
CEGUI::EventArgs fireArgs;
iconWindow->fireEvent("StopRotate", fireArgs);
return false;
}