本文整理汇总了C++中cegui::Window::isVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::isVisible方法的具体用法?C++ Window::isVisible怎么用?C++ Window::isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Window
的用法示例。
在下文中一共展示了Window::isVisible方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: IsChildWindowShow
// 子窗口是否已经打开了
BOOL CUIWindowItem::IsChildWindowShow(LPCTSTR szUIName) const
{
CEGUI::String strName(szUIName);
try
{
CEGUI::Window* pChild = CEGUI::WindowManager::getSingleton().getWindow(strName);
if( pChild )
return pChild->isVisible();
}
catch(...)
{
return FALSE;
}
return FALSE;
}
示例3: keyPressed
bool GameInputHandler::keyPressed(const OIS::KeyEvent &evt)
{
CEGUIInputHandler::keyPressed(evt);
handleCommonKeyboardEvents(evt);
if (game.getSubState() != SUBST_EDITOR)
return true;
OIS::KeyCode ch = evt.key;
if (ch == OIS::KC_P)
{
// Switch to player mode
game.createPlayer(camera->getDerivedPosition());
}
else if (ch == OIS::KC_I)
{
// Blend interface in/out
CEGUI::Window* guiPage = windowManager.getPage("Editor");
if (guiPage->isVisible())
guiPage->hide();
else
guiPage->show();
}
else if (ch == OIS::KC_M)
{
// Output camera position and orientation to log
/*string str = "INFO: position=\"" + StringConverter::toString(game.cameraNode->getPosition()) + "\"" +
" yawOrientation=\"" + StringConverter::toString(game.cameraYawNode->getOrientation()) + "\"" +
" pitchOrientation=\"" + StringConverter::toString(game.cameraPitchNode->getOrientation()) + "\"";
*/
string str = "INFO: position=\"" + StringConverter::toString(game.cameraNode->getPosition()) + "\"" +
" yaw=\"" + StringConverter::toString(game.cameraYawNode->getOrientation().getYaw(false)) + "\"" +
" pitch=\"" + StringConverter::toString(game.cameraPitchNode->getOrientation().getPitch(false)) + "\"" +
" roll=\"" + StringConverter::toString(game.cameraRollNode->getOrientation().getRoll(false)) + "\"";
LogManager::getSingleton().logMessage(str.c_str(), LML_CRITICAL);
}
else if (ch == OIS::KC_E)
{
// Place objects
game.spawnObject(CEGUI::EventArgs());
}
else if (evt.key == OIS::KC_O)
{
// Toggle polygon mode
camera->setPolygonMode((PolygonMode)((camera->getPolygonMode() % 3) + 1));
if (camera->getPolygonMode() == PM_SOLID)
vp->setClearEveryFrame(true, FBT_DEPTH);
else
vp->setClearEveryFrame(true, FBT_COLOUR | FBT_DEPTH);
}
if (objectManager.getEditObjects())
{
if (ch == OIS::KC_G)
objectManager.setEditMode(EDITMODE_GRAB);
else if (ch == OIS::KC_R)
objectManager.setEditMode(EDITMODE_ROTATE);
else if (ch == OIS::KC_T)
objectManager.setEditMode(EDITMODE_SCALE);
else if (ch == OIS::KC_X)
objectManager.setEditDirection(Vector3(1, 0, 0));
else if (ch == OIS::KC_Y)
objectManager.setEditDirection(Vector3(0, 1, 0));
else if (ch == OIS::KC_Z)
objectManager.setEditDirection(Vector3(0, 0, 1));
}
return true;
}
示例4: OnEscape
bool ClientGame::OnEscape(const CEGUI::EventArgs& args)
{
CEGUI::Window* inGameMenu = GetWindow("InGameMenu");
inGameMenu->setVisible(!inGameMenu->isVisible());
return true;
}