Alessan
30-10-2008 20:59:31
Hi,
I am testing MyGUI for my project, all was works fine until i get this problem with Messages.
The problem is that i can't see the message widget but if i press in middel of screen the delegated function works.
I use the default core skin, font, etc.
i can login and change to next gamestate.
i can quit the game if i push in the middel of screen (invisible message widget).
Any idea what is the problem?
I am testing MyGUI for my project, all was works fine until i get this problem with Messages.
The problem is that i can't see the message widget but if i press in middel of screen the delegated function works.
I use the default core skin, font, etc.
i can login and change to next gamestate.
i can quit the game if i push in the middel of screen (invisible message widget).
Any idea what is the problem?
//--------------------------------------------------------------------------------
void LoginState::enter()
{
//sNetworkManager.disconnect();
printf("enter: loginstate.\n");
configureGUI();
}
//--------------------------------------------------------------------------------
void LoginState::handleBtQuit(MyGUI::WidgetPtr _sender)
{
MyGUI::MessagePtr pGUIMsg = MyGUI::Message::createMessage(Ogre::String("aaaaa"),Ogre::String("Salir"), true,
MyGUI::Message::IconWarning | MyGUI::Message::Ok);
pGUIMsg->eventMessageBoxEnd = MyGUI::newDelegate(this, &LoginState::notifyMessageBoxEnd);
}
//--------------------------------------------------------------------------------
void LoginState::handleBtLogin(MyGUI::WidgetPtr _sender)
{
MyGUI::EditPtr edusername = MyGUI::WidgetManager::getInstance().findWidget<MyGUI::Edit>("edLogin");
MyGUI::EditPtr edpassword = MyGUI::WidgetManager::getInstance().findWidget<MyGUI::Edit>("edPassword");
string username = edusername->getCaption();
string password = edpassword->getCaption();
if(!sNetworkManager.Conected)
{
sNetworkManager.connect();
}
if(sNetworkManager.Conected)
sMsgHandler.SendLoginRequest(username, password);
}
//--------------------------------------------------------------------------------
void LoginState::configureGUI(void)
{
MyGUI::VectorWidgetPtr VWP = MyGUI::LayoutManager::getInstance().loadLayout("loginGUI.layout");
MyGUI::ButtonPtr btLogin = MyGUI::WidgetManager::getInstance().findWidget<MyGUI::Button>("btLogin");
btLogin->eventMouseButtonClick = MyGUI::newDelegate(this, &LoginState::handleBtLogin);
MyGUI::ButtonPtr btQuit = MyGUI::WidgetManager::getInstance().findWidget<MyGUI::Button>("btQuit");
btQuit->eventMouseButtonClick = MyGUI::newDelegate(this, &LoginState::handleBtQuit);
}
//--------------------------------------------------------------------------------
void LoginState::notifyMessageBoxEnd(MyGUI::WidgetPtr _sender, MyGUI::Message::ViewInfo _button)
{
if (_button == MyGUI::Message::Ok)
{
this->requestShutdown();
}
}
//--------------------------------------------------------------------------------