How can i get the focus window type??

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
jasom_liu
Just popping in
Just popping in
Posts: 14
Joined: Mon Mar 07, 2005 08:00

How can i get the focus window type??

Postby jasom_liu » Wed Jun 08, 2005 07:07

When a window is activated ,I want to get the focus window's type so i can do some special operation in various windowtype. But i can't find a good function or API to get the window's type . Do anybody have some good ideas?

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

Re: How can i get the focus window type??

Postby lindquist » Wed Jun 08, 2005 17:02

When I was working on menus etc. I needed this functionality too...
So if you're on CVS HEAD, use the CEGUI::Window::testClassName function.
It takes a string as its only parameter fx: "StaticText", and returns true if the window tested is - or was inherited from - the CEGUI::StaticText element.

If you're not on CVS HEAD, you'll have to come up with something else. Perhaps dedicate the userid/data to that information.

HTH

edit: I guess if you're satisfied with look dependent values, you could use the windowtype ex. "WindowsLook/Button"


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 6 guests