Page 1 of 1

cegui Event handlers Not liking it it

Posted: Tue Sep 19, 2006 15:57
by danharibo
My code:
//Start a new game
wmgr.getWindow((CEGUI::utf8*)"Next")->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&sufApp::Setup_Physics_and_game, this));

Don't work to good,

handler
.\src\suf.cpp(140) : error C2661: 'CEGUI::SubscriberTemplate<Ret,Args>::SubscriberTemplate' : no overloaded function takes 2 arguments
with
[
Ret=bool,
Args=const CEGUI::EventArgs &
]


but just up a bit on the same file is a woring perfect event
anyhelp?

Posted: Tue Sep 19, 2006 17:13
by spannerman
Hi danharibo, please give some more details and state the problem clearly. It seems English isnt your first language, so dont worry about spelling and grammar, but your post doesnt make much sense as it is, so try answer these questions:

Don't work to good,


Please post exactly what it is your trying to do and whats happening.

handler


Did you mean to post the event handler, but forgot? This code (Setup_Physics_and_game), at least the method decleration, would be useful to see.

but just up a bit on the same file is a woring perfect event


I take it by "woring" you mean working. So are you saying here that you have another subscribed event in the same cpp file that is getting handled correctly?

Posted: Tue Sep 19, 2006 17:26
by danharibo
English is my first language but my typing Sucs so here is What i meant:
I have an event handler That is supposed to Setup a button blah blah blah...
And this code here:

Code: Select all

void sufApp::setupEventHandlers2(void)
{
   CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
   //Start a new game
   wmgr.getWindow((CEGUI::utf8*)"Next")->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&sufApp::Setup_Physics_and_game, this));
 
}

Causes this error:
.\src\suf.cpp(140) : error C2661: 'CEGUI::SubscriberTemplate<Ret,Args>::SubscriberTemplate' : no overloaded function takes 2 arguments
with
[
Ret=bool,
Args=const CEGUI::EventArgs &
]

And Setup_physics_an...

Code: Select all

void sufApp::Setup_Physics_and_game()
{
   //Set the game mode
   gamemode = "IN_GAME";
   
   //Switch Mouse mode from CEGUI to OGRE
   switchMouseMode();
   
   //Destroy all GEGUI windows :)
   CEGUI::WindowManager::getSingleton().destroyAllWindows();
   
   //Player Collision blah blah blah
   player_coll = new OgreNewt::CollisionPrimitives::Capsule(mWorld ,Ogre::Real(2),Ogre::Real(4));
   player_out = new OgreNewt::Body(mWorld,player_coll);
   
   //Get CEGUI wmgr
   CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
   //create CEGUI Windows for CEGUI things
   CEGUI::Window* myRoot = wmgr.createWindow("DefaultWindow", "root");
   CEGUI::System::getSingleton().setGUISheet(myRoot);
}

That better? :)

Posted: Tue Sep 19, 2006 17:58
by CrazyEddie
Hi

As suggested by the error, this:

Code: Select all

void sufApp::Setup_Physics_and_game()


Needs to be

Code: Select all

bool sufApp::Setup_Physics_and_game(const CEGUI::EventArgs & args)


HTH

CE