CEGUI events

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
SOMRoberto
Just popping in
Just popping in
Posts: 20
Joined: Sat Dec 31, 2005 21:08
Contact:

CEGUI events

Postby SOMRoberto » Fri Jan 13, 2006 17:09

I got a beginner problem. I write to cegui fonts layout etc /demo7/ and I implemented the Quit button event.
But it not do anything.
My code:
...
cegui->Initialize ();
cegui->GetLoggerPtr ()->setLoggingLevel(CEGUI::Informative);
cegui->GetSchemeManagerPtr ()->loadScheme("ice.scheme");
cegui->GetSystemPtr ()->setDefaultMouseCursor("ice", "MouseArrow");
cegui->GetFontManagerPtr ()->createFont("Vera", "/fonts/ttf/Vera.ttf", 10,
CEGUI::Default);
CEGUI::WindowManager* winMgr = cegui->GetWindowManagerPtr ();
cegui->GetSystemPtr ()->setGUISheet(winMgr->loadWindowLayout("ice.layout"));
....

void Demo7::initDemoEventWiring(void)
{
using namespace CEGUI;

WindowManager::getSingleton().getWindow("Demo7/Window1/Quit")->
subscribeEvent(PushButton::EventClicked, Event::Subscriber(&Demo7::HandleQuit, this));
}

bool Demo7::HandleQuit(const CEGUI::EventArgs& e)
{

-event-

return true;
}

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: CEGUI events

Postby lindquist » Fri Jan 13, 2006 17:29

It looks fine. what are you saying the problem is?

User avatar
SOMRoberto
Just popping in
Just popping in
Posts: 20
Joined: Sat Dec 31, 2005 21:08
Contact:

Re: CEGUI events

Postby SOMRoberto » Fri Jan 13, 2006 17:32

lindquist wrote:
It looks fine. what are you saying the problem is?


Hmm. This event not do anything. Is layout reading automatic muont the elements too?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: CEGUI events

Postby lindquist » Fri Jan 13, 2006 17:34

I'm sorry I don't understand your issue. What is it you're asking?

User avatar
SOMRoberto
Just popping in
Just popping in
Posts: 20
Joined: Sat Dec 31, 2005 21:08
Contact:

Re: CEGUI events

Postby SOMRoberto » Fri Jan 13, 2006 17:37

I see elements position in Layout file, but not declaration. My code is good?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: CEGUI events

Postby lindquist » Fri Jan 13, 2006 19:48

It's possible to define elements and their sizes etc. entirely from xml layouts, yes. You'll need to load the layout it self in code, but it's easy.

You could consider joining the #cegui IRC channel on irc.freenode.net - at least I am find it a little hard to understand exactly what you mean.

User avatar
SOMRoberto
Just popping in
Just popping in
Posts: 20
Joined: Sat Dec 31, 2005 21:08
Contact:

Re: CEGUI events

Postby SOMRoberto » Sat Jan 14, 2006 10:37

Just take the singleton and etc on mouse click event:

if (mouse->GetLastButton(0)) //left mouse button
{
using namespace CEGUI;
WindowManager::getSingleton().getWindow("Demo7/Window1/Quit")->
subscribeEvent(PushButton::EventClicked, Event::Subscriber(&TTViewer::HandleQuit, this));
}

U can using this code in Crystal Space engine. ;)


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests