Free-standing CloseButton?

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

Browser12
Not too shy to talk
Not too shy to talk
Posts: 42
Joined: Thu Jan 24, 2008 06:30
Location: UW-Madison
Contact:

Free-standing CloseButton?

Postby Browser12 » Tue May 24, 2011 02:30

Hey, I'd like to create a button in my GUI which looks like the CloseButton but is in all other aspects the same as a PushButton.
I'm sort of entirely lost in how exactly to go about doing this. I see that the FrameWindow uses a SystemButton, but that's not really what I want, is it?
Anyways, any tips on how to do this would be much appreciated!

(P.S. I've looked around, but if there's a current tutorial somewhere that I've missed on how to go create a custom widget from the ground up, including imageset stuff, I'd very much like to read it; I'll have to do stuff like this eventually anwyays; i'd like to learn about it.)

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

Re: Free-standing CloseButton?

Postby CrazyEddie » Tue May 24, 2011 07:42

The SystemButton is a made-up type, which - in some gui schemes - uses an alternate looknfeel (skin) to the regular button, in WindowsLook for example, this means the button is tagged as being a 'non-client' window, which affects positioning and clipping. Aside from this, it will behave in the same way as a regular PushButton in all ways, and is usable anywhere aside from the 'scary' name :lol:. Also, you can override / reset that "NonClient" property setting to "False" either in code or layout if you were to desire to use that in an unmodified form.

We lack a lot of advanced (and even a lot of very beginner) tutorials, and the area you're stepping into is somewhat an area that's not covered all that well - at least as the subject of a tutorial in it's own right.
This tutorial: http://www.cegui.org.uk/wiki/index.php/ ... EGUI_0.7.x creates a new window type along with existing WindowRenderer and datafiles (though I'll re-iterate that doing that is not the main subject of the tutorial).

Effectively it boils down to sublassing Window or some existing widget, maybe subclassing a WindowRenderer (though those in CEGUIBase, not FalagardWRBase which are not intended to be linked to directly), and registering those new classes with the system:

Code: Select all

CEGUI::WindowFactoryManager::addFactory<TplWindowFactory<MyCustomWindowClass> >();
CEGUI::WindowRendererManager::addFactory<TplWindowRendererFactory<MyCustomWindowRendererClass> >();

And adding appropriate lines in scheme files (or adding mappings in code).

The imageset and other data file stuff is a bit sparse, though falagard looknfeel is covered - by way of it's reference - in a lot more detail than most other data files used by CEGUI. There are - somewhat terse - references in the main docs for all the other data files too, and of course the existing files are all reasonable examples of these files in action. The fact that this approach can be extremely intimidating to new users is not totally lost on me, though I am merely pointing out what is (and indeed, what is not) available at the current time :) One approach could be to look at the example data files, and quote lines and/or (small) sections here and ask for explanation - perhaps with that info some kind soul could make a Wiki tutorial "for humans" :)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 13 guests