Getting input from objects, and adding images to others

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Getting input from objects, and adding images to others

Postby sipickles » Tue Feb 28, 2006 19:35

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

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

Postby lindquist » Thu Mar 02, 2006 02:19

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

User avatar
sipickles
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Fri Feb 24, 2006 19:41
Location: Enfield, UK

Postby sipickles » Thu Mar 02, 2006 18:50

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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sun Mar 05, 2006 15:40

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 26 guests