Page 1 of 1

Getting input from objects, and adding images to others

Posted: Tue Feb 28, 2006 19:35
by sipickles
Hi,

I have succeeded in getting this CEGUI thing drawing from a very basic layout file.

How do I add images to the objects like buttons especially?

More crucially, how do I get my DX9 app to register input in textboxes and buttons?

Many Thanks

Simon

Posted: Thu Mar 02, 2006 02:19
by lindquist
For the input stuff this wiki page might be interesting:
http://www.cegui.org.uk/wiki/index.php/ ... EGUI_utf32

For the buttons, you can set it via the property system:
http://cegui.org.uk/api_reference/names ... rties.html

HTH

Posted: Thu Mar 02, 2006 18:50
by sipickles
Thanks but I just have buttons which dont do anything and an editbox I can't fill in!

Shame this article is incomplete:

"The Beginner Guide to Injecting Inputs"

Sounds like what I am after :)

I tried this:

// load window contents from external xml file!
m_root = m_windowMgr->loadWindowLayout("../datafiles/layouts/loginWindow.layout");
m_system->setGUISheet(m_root);

PushButton* LoginButton = (PushButton*)m_windowMgr->getWindow("LoginButton");

LoginButton->subscribeEvent(PushButton::EventClicked, Event::subscribe(&cCEGUI::HandleLoginButton), this) );


But I get all sorts of compile errors:

cCEGUI.cpp(71) : error C2352: 'CEGUI::Event::subscribe' : illegal call of non-static member function
e:\C\CEGUI\CEGUI SDK for Visual C++ .NET 2003\include\CEGUIEvent.h(290) : see declaration of 'CEGUI::Event::subscribe'


ANy ideas?

Thanks!

Si

Posted: Sun Mar 05, 2006 15:40
by CrazyEddie
hi,

your subscribe call is a little messed up ;)

your code is:

Code: Select all

 LoginButton->subscribeEvent(PushButton::EventClicked, Event::subscribe(&cCEGUI::HandleLoginButton), this) );


and it should be something like:

Code: Select all

 LoginButton->subscribeEvent(PushButton::EventClicked, Event::Subscriber(&cCEGUI::HandleLoginButton, this) );


i.e a typo on the class name and the 'this' argument must be within the Event::Subscriber constructor call.

HTH

CE.