netocris
01-08-2007 14:59:07
I'm new in QuickGUI, and i'm experiment and i liked. but i'm with some problems.
i try make one application whit a simple menu. this principal menu have the follow bottons: singleplayer, multiplayer, option menu and exit.
the option menu botton will open a second window with options that permit switch option of video, sound, ...
My problem occours when i try create one 3rd window. when i lunch the application appears the next exception:
OGRE EXCEPTION(4:ItemIdentityException): OverlayElement with name DefaultWindow0.ChildrenContainer alreadu exists. in OverlayManager::createOverlayElement at
d:\ogrenew\ogremain\src\pgrepverlaymanager.cpp (line 548)
my code is:
void EstadoMenu::iniciar()
{
//ficheiro de log
log = Ogre::LogManager::getSingleton().createLog("estadoMenu.log");
(...)
mRoot = Ogre::Root::getSingletonPtr();
mSceneMgr = mRoot->createSceneManager( Ogre::ST_GENERIC );
mCamera = mSceneMgr->createCamera( "MenuCamera" );
mViewport = mRoot->getAutoCreatedWindow()->addViewport( mCamera );
...
//Create video option (option like video mode, resolution,...)
this->criarMenuVideo();
//create option menu (option like video, sound, commands, ...)
this->criarMenuOpcoes();
//create the principal menu (Button singleplayer, multiplayer, option menu and exit )
this->criarMenu();
//initializate sound
}
if i cancel the creation of this 3rd window this exception not occours.
//Create video option (option like video mode, resolution,...)
//this->criarMenuVideo();
//create option menu (option like video, sound, commands, ...)
this->criarMenuOpcoes();
//create the principal menu (Button singleplayer, multiplayer, option menu and exit )
this->criarMenu();
my create video function is:
void EstadoMenu::criarMenuVideo( void )
{
log->logMessage("**** CRIAR MENU VIDEO ****");
//-------------
// Definir Skin
//-------------
log->logMessage("*** A criar Sheet: lostSheet_video ...");
//mSheet_options = GUIManager::getSingletonPtr()->createSheet("lostSheet_options", "qgui.background");
this->mSheet_video = GUIManager::getSingletonPtr()->createSheet("lostSheet_video", "qgui.background");
GUIManager::getSingletonPtr()->setActiveSheet(this->mSheet_video);
log->logMessage("*** Concluido!");
//-----------------------
// Criar janela "Video"
//-----------------------
log->logMessage("*** A criar janela: Video Options ...");
this->videoJanela = this->mSheet_video->createWindow(Ogre::Vector4(0.2,0.2,0.6,0.6));
this->videoJanela->setTitleBarHeight(0.05);
this->videoJanela->hideTitlebar();
log->logMessage("*** Concluido!");
//----------------------------------
// Criar botao Voltar Menu Options
//----------------------------------
log->logMessage("*** A criar botao: Back ...");
this->voltarMenuOptions = this->videoJanela->createButton(Ogre::Vector4(0.55, 0.9, 0.2, 0.06));
this->voltarMenuOptions->setText("Back");
this->voltarMenuOptions->addEventHandler(Widget::QGUI_EVENT_MOUSE_BUTTON_UP, &EstadoMenu::evtHndlr_BackToOptionsMenu, this);
log->logMessage("*** Concluido!");
log->logMessage("**** FIM DE CRIAR MENU VIDEO ******");
}
my create Option menu funtion is:
void EstadoMenu::criarMenuOpcoes(void)
{
log->logMessage("**** CRIAR MENU OPTIONS ***");
//-------------
// Definir Skin
//-------------
log->logMessage("*** A criar Sheet: lostSheet_options ...");
this->mSheet_options = GUIManager::getSingletonPtr()->createSheet("lostSheet_options", "qgui.background");
GUIManager::getSingletonPtr()->setActiveSheet(this->mSheet_options);
log->logMessage("*** Concluido!");
//-----------------------
// Criar janela "Options"
//-----------------------
log->logMessage("*** A criar janela: Options ...");
this->opcoesJanela = this->mSheet_options->createWindow(Ogre::Vector4(0.2,0.2,0.6,0.6));
//this->opcoesJanela->setText("Options");
this->opcoesJanela->setTitleBarHeight(0.05);
this->opcoesJanela->hideTitlebar();
log->logMessage("*** Concluido!");
//$$$$$$ VIDEO OPTION $$$$$$$
..
//$$$$$$ VIDEO OPTION $$$$$$$
//$$$$$ SOUND OPTION $$$$$$$$
...
//$$$$$ SOUND OPTION $$$$$$$$
//------------------------------
// Criar botao VideoOptionAdvanced
//------------------------------
log->logMessage("*** A criar botao: VideoOptionAdvanced...");
this->salvarOpcoesButton = this->opcoesJanela->createButton(Ogre::Vector4(0.25, 0.90, 0.2, 0.06));
this->salvarOpcoesButton->setText("VideoOptionAdvanced");
this->salvarOpcoesButton->addEventHandler(Widget::QGUI_EVENT_MOUSE_BUTTON_UP, &EstadoMenu::evtHndlr_VideoOptionsMenu, this);
log->logMessage("*** Concluido!");
(...)
log->logMessage("******************* FIM DE CRIAR MENU OPTIONS ***********************");
}
what it´s badly with my code????
i try make one application whit a simple menu. this principal menu have the follow bottons: singleplayer, multiplayer, option menu and exit.
the option menu botton will open a second window with options that permit switch option of video, sound, ...
My problem occours when i try create one 3rd window. when i lunch the application appears the next exception:
OGRE EXCEPTION(4:ItemIdentityException): OverlayElement with name DefaultWindow0.ChildrenContainer alreadu exists. in OverlayManager::createOverlayElement at
d:\ogrenew\ogremain\src\pgrepverlaymanager.cpp (line 548)
my code is:
void EstadoMenu::iniciar()
{
//ficheiro de log
log = Ogre::LogManager::getSingleton().createLog("estadoMenu.log");
(...)
mRoot = Ogre::Root::getSingletonPtr();
mSceneMgr = mRoot->createSceneManager( Ogre::ST_GENERIC );
mCamera = mSceneMgr->createCamera( "MenuCamera" );
mViewport = mRoot->getAutoCreatedWindow()->addViewport( mCamera );
...
//Create video option (option like video mode, resolution,...)
this->criarMenuVideo();
//create option menu (option like video, sound, commands, ...)
this->criarMenuOpcoes();
//create the principal menu (Button singleplayer, multiplayer, option menu and exit )
this->criarMenu();
//initializate sound
}
if i cancel the creation of this 3rd window this exception not occours.
//Create video option (option like video mode, resolution,...)
//this->criarMenuVideo();
//create option menu (option like video, sound, commands, ...)
this->criarMenuOpcoes();
//create the principal menu (Button singleplayer, multiplayer, option menu and exit )
this->criarMenu();
my create video function is:
void EstadoMenu::criarMenuVideo( void )
{
log->logMessage("**** CRIAR MENU VIDEO ****");
//-------------
// Definir Skin
//-------------
log->logMessage("*** A criar Sheet: lostSheet_video ...");
//mSheet_options = GUIManager::getSingletonPtr()->createSheet("lostSheet_options", "qgui.background");
this->mSheet_video = GUIManager::getSingletonPtr()->createSheet("lostSheet_video", "qgui.background");
GUIManager::getSingletonPtr()->setActiveSheet(this->mSheet_video);
log->logMessage("*** Concluido!");
//-----------------------
// Criar janela "Video"
//-----------------------
log->logMessage("*** A criar janela: Video Options ...");
this->videoJanela = this->mSheet_video->createWindow(Ogre::Vector4(0.2,0.2,0.6,0.6));
this->videoJanela->setTitleBarHeight(0.05);
this->videoJanela->hideTitlebar();
log->logMessage("*** Concluido!");
//----------------------------------
// Criar botao Voltar Menu Options
//----------------------------------
log->logMessage("*** A criar botao: Back ...");
this->voltarMenuOptions = this->videoJanela->createButton(Ogre::Vector4(0.55, 0.9, 0.2, 0.06));
this->voltarMenuOptions->setText("Back");
this->voltarMenuOptions->addEventHandler(Widget::QGUI_EVENT_MOUSE_BUTTON_UP, &EstadoMenu::evtHndlr_BackToOptionsMenu, this);
log->logMessage("*** Concluido!");
log->logMessage("**** FIM DE CRIAR MENU VIDEO ******");
}
my create Option menu funtion is:
void EstadoMenu::criarMenuOpcoes(void)
{
log->logMessage("**** CRIAR MENU OPTIONS ***");
//-------------
// Definir Skin
//-------------
log->logMessage("*** A criar Sheet: lostSheet_options ...");
this->mSheet_options = GUIManager::getSingletonPtr()->createSheet("lostSheet_options", "qgui.background");
GUIManager::getSingletonPtr()->setActiveSheet(this->mSheet_options);
log->logMessage("*** Concluido!");
//-----------------------
// Criar janela "Options"
//-----------------------
log->logMessage("*** A criar janela: Options ...");
this->opcoesJanela = this->mSheet_options->createWindow(Ogre::Vector4(0.2,0.2,0.6,0.6));
//this->opcoesJanela->setText("Options");
this->opcoesJanela->setTitleBarHeight(0.05);
this->opcoesJanela->hideTitlebar();
log->logMessage("*** Concluido!");
//$$$$$$ VIDEO OPTION $$$$$$$
..
//$$$$$$ VIDEO OPTION $$$$$$$
//$$$$$ SOUND OPTION $$$$$$$$
...
//$$$$$ SOUND OPTION $$$$$$$$
//------------------------------
// Criar botao VideoOptionAdvanced
//------------------------------
log->logMessage("*** A criar botao: VideoOptionAdvanced...");
this->salvarOpcoesButton = this->opcoesJanela->createButton(Ogre::Vector4(0.25, 0.90, 0.2, 0.06));
this->salvarOpcoesButton->setText("VideoOptionAdvanced");
this->salvarOpcoesButton->addEventHandler(Widget::QGUI_EVENT_MOUSE_BUTTON_UP, &EstadoMenu::evtHndlr_VideoOptionsMenu, this);
log->logMessage("*** Concluido!");
(...)
log->logMessage("******************* FIM DE CRIAR MENU OPTIONS ***********************");
}
what it´s badly with my code????