当前位置: 首页>>代码示例>>C++>>正文


C++ Window::getChild方法代码示例

本文整理汇总了C++中cegui::Window::getChild方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::getChild方法的具体用法?C++ Window::getChild怎么用?C++ Window::getChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cegui::Window的用法示例。


在下文中一共展示了Window::getChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: handleDSActivation

bool GUIManager::handleDSActivation ( CEGUI::EventArgs const & e )
{
  CEGUI::Window *tab =
    static_cast<CEGUI::WindowEventArgs const &>(e).window->getParent();
  CEGUI::Listbox *lb = static_cast<CEGUI::Listbox *>(tab->getChild(0));
  ListboxItem *item = static_cast<ListboxItem *>(lb->getFirstSelectedItem());
  if (item != NULL) {
    DataManager *dm = static_cast<DataManager *>(item->getUserData());
    CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(tab->getChild(2));
    std::vector<unsigned int> const & dims = dm->getDimensions();
    unsigned int dim = dims[int(sb->getScrollPosition()*(dims.size()-1))];
    float scrollPos = sb->getScrollPosition();
    dm->activate(dim);
    // Enable global scrollbar
    CEGUI::WindowManager & wm = CEGUI::WindowManager::getSingleton();
    sb = static_cast<CEGUI::Scrollbar *>(wm.getWindow("Sheet/DimensionSlider"));
    sb->enable();
    CEGUI::WindowEventArgs w(sb);
    sb->fireEvent(CEGUI::Scrollbar::EventScrollPositionChanged, w);
    // Set the global scrollbar to the right position.
    sb->setScrollPosition(scrollPos);
    CEGUI::Window *desc = wm.getWindow("Sheet/DimensionText");
    desc->show();
  }
  // TODO handle else-error
  return true;
}
开发者ID:Nvveen,项目名称:Revolution,代码行数:27,代码来源:GUIManager.cpp

示例2: Record

void
EndState::enter ()
{
  _root = Ogre::Root::getSingletonPtr();
  _sceneMgr = _root->getSceneManager("SceneManager");
  _camera = _sceneMgr->getCamera("IntroCamera");
  _viewport = _root->getAutoCreatedWindow()->getViewport(0);
  _pSoundFXManager = SoundFXManager::getSingletonPtr();
  _simpleEffect = _pSoundFXManager->load("gameover.ogg");
  _simpleEffect->play();
  _exitGame = _save = false;

  _rec = new Record();
    //CEGUI
  CEGUI::System::getSingleton().getDefaultGUIContext().getMouseCursor().show();
  _sheet = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow","Menu");

  //Config Window
  CEGUI::Window* configWin = CEGUI::WindowManager::getSingleton().loadLayoutFromFile("end.layout");
  CEGUI::Window* mark = configWin->getChild("MarkValue");
  mark->setText(Ogre::StringConverter::toString(_score));
  _nick = configWin->getChild("Nick");
  _nick->subscribeEvent(CEGUI::Window::EventMouseButtonDown,
			CEGUI::Event::Subscriber(&EndState::clear, this));
  CEGUI::Window* menuButton = configWin->getChild("MenuButton");
  menuButton->subscribeEvent(CEGUI::PushButton::EventClicked,
  CEGUI::Event::Subscriber(&EndState::save, this));
  CEGUI::Window* exitButton = configWin->getChild("ExitButton");
  exitButton->subscribeEvent(CEGUI::PushButton::EventClicked,
  CEGUI::Event::Subscriber(&EndState::quit, this));

  //Attaching buttons
  _sheet->addChild(configWin);
  CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(_sheet);
}
开发者ID:RiballoJose,项目名称:Get-the-Cup,代码行数:35,代码来源:EndState.cpp

示例3: showMenuCegui

void MenuState::showMenuCegui()
{
	//Sheet
	CEGUI::Window* _ceguiSheet = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow","menu_principal");


	//Config Window
	CEGUI::Window* menuWin = CEGUI::WindowManager::getSingleton().loadLayoutFromFile("menu_principal.layout");

	// NEW GAME
	CEGUI::Window* newGameButton = menuWin->getChild("btn_new_game");
	newGameButton->subscribeEvent( CEGUI::PushButton::EventClicked,
							   	   CEGUI::Event::Subscriber(&MenuState::newGame, this));
	// RECORDS
	CEGUI::Window* recordsButton = menuWin->getChild("btn_records");
	recordsButton->subscribeEvent( CEGUI::PushButton::EventClicked,
							   	   CEGUI::Event::Subscriber(&MenuState::records, this));

	// CREDITS
	CEGUI::Window* creditsButton = menuWin->getChild("btn_credits");
	creditsButton->subscribeEvent( CEGUI::PushButton::EventClicked,
							   	   CEGUI::Event::Subscriber(&MenuState::credits, this));
	// QUIT
	CEGUI::Window* exitButton = menuWin->getChild("btn_quit");
	exitButton->subscribeEvent(CEGUI::PushButton::EventClicked,
							   CEGUI::Event::Subscriber(&MenuState::quit, this));

	//Attaching buttons
	_ceguiSheet->addChild(menuWin);
	CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(_ceguiSheet);


}
开发者ID:Breikdans,项目名称:HundirLaFlota,代码行数:33,代码来源:MenuState.cpp

示例4: createGUI

void NextLevelState::createGUI()
{
  //CEGUI
  _sheet = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow","Menu");

  //Config Window
  CEGUI::Window* configWin = CEGUI::WindowManager::getSingleton().loadLayoutFromFile("next.layout");
  CEGUI::Window* playButton = configWin->getChild("PlayButton");
  playButton->subscribeEvent(CEGUI::PushButton::EventClicked,
  CEGUI::Event::Subscriber(&NextLevelState::play, this));
  /*CEGUI::Window* saveButton = configWin->getChild("SaveButton");
  saveButton->subscribeEvent(CEGUI::PushButton::EventClicked,
  CEGUI::Event::Subscriber(&NextLevelState::save, this));
  CEGUI::Window* loadButton = configWin->getChild("LoadButton");
  loadButton->subscribeEvent(CEGUI::PushButton::EventClicked,
  CEGUI::Event::Subscriber(&NextLevelState::load, this));*/
  CEGUI::Window* helpButton = configWin->getChild("HelpButton");
  helpButton->subscribeEvent(CEGUI::PushButton::EventClicked,
  CEGUI::Event::Subscriber(&NextLevelState::help, this));
  CEGUI::Window* menuButton = configWin->getChild("MenuButton");
  menuButton->subscribeEvent(CEGUI::PushButton::EventClicked,
  CEGUI::Event::Subscriber(&NextLevelState::menu, this));
  CEGUI::Window* exitButton = configWin->getChild("ExitButton");
  exitButton->subscribeEvent(CEGUI::PushButton::EventClicked,
  CEGUI::Event::Subscriber(&NextLevelState::quit, this));

  //Attaching buttons
  _sheet->addChild(configWin);
  CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(_sheet);
}
开发者ID:RiballoJose,项目名称:Get-the-Cup,代码行数:30,代码来源:NextLevelState.cpp

示例5: set_visible

void vis_settings_panel_impl::set_visible(bool visible)
{
    CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext();
    CEGUI::Window* root = context.getRootWindow();

	if(root->getChild(btn_exit_name)) root->getChild(btn_exit_name)->setVisible(visible);
    if(root->getChild(setting_dlg))root->getChild(setting_dlg)->setVisible(visible);
}
开发者ID:yaroslav-tarasov,项目名称:test_osg,代码行数:8,代码来源:vis_settings_panel_impl.cpp

示例6: onBoundingBoxSpinnerChanged

  bool onBoundingBoxSpinnerChanged(const CEGUI::EventArgs &args) {
    using namespace CEGUI;
    m_Exit.setBoundingBox(CBoundingBox2d(Ogre::Vector2(dynamic_cast<Spinner*>(m_pContentRegion->getChild("posx"))->getCurrentValue(),
					dynamic_cast<Spinner*>(m_pContentRegion->getChild("posy"))->getCurrentValue()),
			  Ogre::Vector2(dynamic_cast<Spinner*>(m_pContentRegion->getChild("sizex"))->getCurrentValue(),
					dynamic_cast<Spinner*>(m_pContentRegion->getChild("sizey"))->getCurrentValue())));
    return true;
  }
开发者ID:ChWick,项目名称:Mencus,代码行数:8,代码来源:EditBoxExit.hpp

示例7: load

/*bool NextLevelState::save(const CEGUI::EventArgs &e)
{
  return true;
}
bool NextLevelState::load(const CEGUI::EventArgs &e)
{
  return true;
  }*/
bool NextLevelState::help(const CEGUI::EventArgs &e)
{
  CEGUI::Window* configWin = CEGUI::WindowManager::getSingleton().loadLayoutFromFile("help.layout");
  _help = CEGUI::WindowManager::getSingleton().createWindow("DefaultWindow","Menu");
  CEGUI::Window* helpText = configWin->getChild("HelpText");
  helpText->setText("El objetivo de Get the Cup es llevar a tu\nequipo hasta lo mas alto, y para ello\ndeberas guiar su escudo a traves de niveles y plataformas\nEn ellos encontraras obstaculos y rivales\nque querran impedir tus exitos. Tendras\nque evitarlos!Puedes controlar a tu\npersonaje con las siguientes teclas:");
  CEGUI::Window* exitButton = configWin->getChild("ExitButton");
  exitButton->subscribeEvent(CEGUI::PushButton::EventClicked,
  CEGUI::Event::Subscriber(&NextLevelState::back, this));
  _help->addChild(configWin);
  CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(_help);
  return true;
}
开发者ID:RiballoJose,项目名称:Get-the-Cup,代码行数:21,代码来源:NextLevelState.cpp

示例8: buildGUI

void MenuState::buildGUI()
{
	OgreFramework::getSingletonPtr()->m_pGUISystem->setDefaultMouseCursor((CEGUI::utf8*)"TaharezLook", (CEGUI::utf8*)"MouseArrow"); 
  CEGUI::MouseCursor::getSingleton().setImage("TaharezLook", "MouseArrow"); 
	const OIS::MouseState state = OgreFramework::getSingletonPtr()->m_pMouse->getMouseState();
	CEGUI::Point mousePos = CEGUI::MouseCursor::getSingleton().getPosition(); 
	CEGUI::System::getSingleton().injectMouseMove(state.X.abs-mousePos.d_x,state.Y.abs-mousePos.d_y);

	CEGUI::Window* pMainWnd = CEGUI::WindowManager::getSingleton().getWindow("AOF_GUI");
  OgreFramework::getSingletonPtr()->m_pGUISystem->setGUISheet(pMainWnd);

	CEGUI::PushButton* button = (CEGUI::PushButton*)pMainWnd->getChild("ExitButton");
	button->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&MenuState::onExitButton, this));
	button = (CEGUI::PushButton*)pMainWnd->getChild("EnterButton");
	button->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&MenuState::onEnterButton, this));
}
开发者ID:flair2005,项目名称:RemoteRenderer,代码行数:16,代码来源:MenuState.cpp

示例9: _TryAttachButtonHandler

 void CeguiScreenBase::_TryAttachButtonHandler(const CEGUI::Window& i_window, const CEGUI::String& i_name_path, CEGUI::uint i_id, bool i_command_button)
   {
   try
     {
     // Connect
     CEGUI::Window* p_connect_button = i_window.getChild(i_name_path);
     if (p_connect_button != nullptr)
       {
       p_connect_button->setID(i_id);
       if (i_command_button)
         {
         p_connect_button->subscribeEvent(CEGUI::PushButton::EventClicked,
           CEGUI::Event::Subscriber(&CeguiScreenBase::CommandButtonPressedHandler, static_cast<CeguiScreenBase*>(this)));
         }
       else
         {
         p_connect_button->subscribeEvent(CEGUI::PushButton::EventClicked,
           CEGUI::Event::Subscriber(&CeguiScreenBase::ButtonPressedHandler, static_cast<CeguiScreenBase*>(this)));
         }
       }
     }
   catch (CEGUI::UnknownObjectException&)
     {
     assert(false);
     }
   }
开发者ID:TraurigeNarr,项目名称:Slavs,代码行数:26,代码来源:CeguiScreenBase.cpp

示例10: OnPageOpen

void LoginEvent::OnPageOpen(GamePage *pPage)
{
    CEGUI::Window *pLoginWindow = pPage->GetPageWindow();
    //设置账号编辑框并得到焦点
    CEGUI::Editbox *pIDEdit = static_cast<CEGUI::Editbox*>(pLoginWindow->getChild("LoginPage/Account"));
	/////////////////////////////////////////////////
	// zhaohang  2010/3/29 
	// 
	//读cdkey
	ifstream stream2;
	stream2.open("setup/cdkey.ini"); 
	if (stream2.is_open())
	{
		bool bRememberCdkey=false;
		stream2 >> bRememberCdkey;
		if (bRememberCdkey)
		{
			string str;
			stream2 >> str;
			pIDEdit->setText(str.c_str());

			//m_pRememberCdkey->SetSelected(true);
		}
		stream2.close();
	}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:25,代码来源:LoginEvent.cpp

示例11: OnPageLoad

void CREvent::OnPageLoad(GamePage *pPage)
{
	pPage->LoadPageWindow();
	CEGUI::Window *pPageWin = pPage->GetPageWindow();
	CEGUI::PushButton* pCreateBtn = static_cast<CEGUI::PushButton*>(pPageWin->getChild("CreateRole"));
	pCreateBtn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&CREvent::OnCreateRoleBtn, this));
	CEGUI::PushButton* pGoBackBtn = static_cast<CEGUI::PushButton*>(pPageWin->getChildRecursive("BackToSelRol"));
	pGoBackBtn->subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&CREvent::GoBackBtn,this));
	SetCreateRoleInitProperty(pPageWin);
	m_bRoleLeftRotate = false;    //向左旋转
	m_bRoleRightRotate = false;   //向右旋转
	if (m_SelectSence == NULL)
	{
		m_SelectSence = new GameScene();
		m_SelectSence->CreateSence("model/interface/selectchar/map",
			"model/interface/selectchar/map/camera_end",
			"model/interface/selectchar/map/envcreature",
			"model/interface/selectchar/map/enveffect");
	}
	CRFile* prfile = rfOpen("data/CreateRolePos.ini");
	if (prfile)
	{
		stringstream stream;
		prfile->ReadToStream(stream);
		rfClose(prfile);
		stream >> s_RolePos[0]  >> s_RolePos[1]  >> s_RolePos[2]  >> s_RolePos[3];
	}
	if(m_pPlayer == NULL)
		m_pPlayer = new CPlayer;
	m_pPlayer->SetGraphicsID(CREvent::GetSelectSex()+1);
	LoadFaceHairIni();
	m_pPlayer->SetDisplayModel();
	m_pPlayer->SetDisplayModelGroup();
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:34,代码来源:CreateRoleEvent.cpp

示例12: handleClose

bool CEGUIDrawable::handleClose( const CEGUI::EventArgs& e )
{
    CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext();
    CEGUI::Window* root = context.getRootWindow();
    root->getChild("DemoWindow")->setVisible(false);
    return true;
}
开发者ID:wangfeilong321,项目名称:test_osg,代码行数:7,代码来源:CEGUIDrawable.cpp

示例13: visible

bool time_panel_impl::visible()
{
    CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext();
    CEGUI::Window* root = context.getRootWindow();
    return root->getChild(label_name)->isVisible();
    return true;
}
开发者ID:yaroslav-tarasov,项目名称:test_osg,代码行数:7,代码来源:time_panel_impl.cpp

示例14: set_visible

void time_panel_impl::set_visible(bool visible)
{
    CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext();
    CEGUI::Window* root = context.getRootWindow();
    root->getChild(label_name)->setVisible(visible);

}
开发者ID:yaroslav-tarasov,项目名称:test_osg,代码行数:7,代码来源:time_panel_impl.cpp

示例15: handleDSSelection

bool GUIManager::handleDSSelection ( CEGUI::EventArgs const & e )
{
  CEGUI::Window *tab =
    static_cast<CEGUI::WindowEventArgs const &>(e).window->getParent();
  CEGUI::Listbox *lb = static_cast<CEGUI::Listbox *>(tab->getChild(0));
  CEGUI::Scrollbar *sb = static_cast<CEGUI::Scrollbar *>(tab->getChild(2));
  DataManager *dm = static_cast<DataManager *>(
      lb->getFirstSelectedItem()->getUserData());
  _selectedDM = dm;
  std::vector<unsigned int> const & dim = dm->getDimensions();
  sb->setStepSize(1.0/float(dim.size()-1));
  sb->enable();
  CEGUI::WindowEventArgs w(sb);
  sb->fireEvent(CEGUI::Scrollbar::EventScrollPositionChanged, w);
  return true;
}
开发者ID:Nvveen,项目名称:Revolution,代码行数:16,代码来源:GUIManager.cpp


注:本文中的cegui::Window::getChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。