Close button doesn't work in demo Sample_ScrollablePaneDemo?

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

Sairon
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Sun Dec 07, 2008 01:11

Close button doesn't work in demo Sample_ScrollablePaneDemo?

Postby Sairon » Sat Dec 20, 2008 19:25

Hi,

I'm playing around with the Windows Look scheme and the close buttons doesn't seem to be working. I'm thinking I have to implement this myself on a callback, but it doesn't seem to be working in the demo either ScrollablePaneDemo either, which leads me to believe that it's perhaps not intentional.

Also, it would be neat with a demo which simply instanciates all the different widgets there is in some manner, both so that one can look at the source and see how they're used ( even if this often is at least fairly straight forward ), but also to see what they are. I'm currently looking for a simple drop down list but don't know what it's named in CEGUI.

Sairon
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Sun Dec 07, 2008 01:11

Postby Sairon » Sat Dec 20, 2008 19:53

I'll throw in another quick question :P

ListBox::addItem() wants ListboxItem, which doesn't inherit from Window. So if I manually create a ListboxTextItem it won't be styled at all, in fact it's not even showing up even if it's added ( this is probably because it doesn't have its properties set ). The interesting thing here though is if one takes a look at WindowsLook.scheme. You then have:

<FalagardMapping WindowType="WindowsLook/Listbox" TargetType="CEGUI/Listbox" Renderer="Falagard/Listbox" LookNFeel="WindowsLook/Listbox" />

Which is the ListBox template from which I create my ListBox. Further down in the same file there's:

<FalagardMapping WindowType="WindowsLook/ListboxItem" TargetType="CEGUI/ItemEntry" Renderer="Falagard/ItemEntry" LookNFeel="WindowsLook/ListboxItem" />

However, it targets ItemEntry and can't be used with ListBox at all ( ItemEntry isn't a ListboxItem ). Am I missing something?

dmail
Quite a regular
Quite a regular
Posts: 46
Joined: Mon Nov 27, 2006 16:49

Postby dmail » Sun Dec 21, 2008 13:57

I'm currently looking for a simple drop down list but don't know what it's named in CEGUI.

Combobox

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Sun Dec 21, 2008 15:20

Hi,

in order to listen to the close button, you need to subscribe to "FrameWindow::EventCloseClicked". For example the DragDropDemo does listen to this event.

There is a WidgetGalore page on the wiki, which features a demo layout + sources: http://www.cegui.org.uk/wiki/index.php/WidgetGalore

I must confess that i have not verified this code to the latest Cegui build, but i think that it still works.

About the lists: the part behind the "Renderer=" is 'just' how it gets rendered. From a widget point of view, you only need the "WindowType=" part. ListBox items are indeed no true windows, but it has methods for colouring and styling.

It you look at certain samples, for example the FontDemo, you will notice something like:

Code: Select all

class MyListItem : public ListboxTextItem


which specializes a list item, and can be customized. This apprauch is also used in sample7 and a few others. The reason that you don't see the items is most likely because the text colour equals the listbox background color.

HTH!
Check out my released snake game using Cegui!

Sairon
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Sun Dec 07, 2008 01:11

Postby Sairon » Sun Dec 21, 2008 20:53

Cool. thanks! :)

I have another small question, is there any way to let the widgets auto size? For example, if I create a ComboBox, I'd like it to size itself to its "optimal" size ( in this case, the height would probably be arrowed button to open the drop down ). Same goes for auto sizing to fit content. Seems like the default size of widgets are 0,0?

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Sun Dec 21, 2008 21:29

Hi,

no problem :) I'm affraight that auto-sizing is not available. A widget's default size is indeed 0,0. Like MFC and wxWidgets, you have to provide a size. You just need to play around with values to come up with a nice gui. You could use the layout editor for that.

HTH.
Check out my released snake game using Cegui!

Sairon
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Sun Dec 07, 2008 01:11

Postby Sairon » Tue Dec 23, 2008 11:18

scriptkid wrote:Hi,

no problem :) I'm affraight that auto-sizing is not available. A widget's default size is indeed 0,0. Like MFC and wxWidgets, you have to provide a size. You just need to play around with values to come up with a nice gui. You could use the layout editor for that.

HTH.


Ah, thanks for the help :)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 7 guests