Need some help implementing a specific window

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

asafy3
Just popping in
Just popping in
Posts: 6
Joined: Fri Oct 23, 2009 11:41

Need some help implementing a specific window

Postby asafy3 » Wed Nov 25, 2009 10:54

Hey everyone,

First of all, as a followup to my post about a month ago, I got to say that I'm in love with the system. After getting over the initial "shock" and after I started working with the actual Looknfeel files and the actual C++ coding of CEGUI, I am at awe at how easy everything is coming together (almost everything, hence my question :) ), and how elaborate the library really is.

To my question: I have been requested by our UI art director to create a fairly simple window, but I'm not sure how to go about doing it.

Here's the window's mock up as presented to me:

Image

I have no problem setting the window title and back button, and I already created a window much like the right window, so no problems there.

However.. The left window is a bit of a problem for me. I need to create a window, with a scroll bar that responds to the amount of text objects in the table itself. In addition, the top 4 labels (Name, Size, Minerals, Climate) will sort the text objects in the table. The items in the table are injected from a List, and I'm not entirely sure which widget is best used for that.

My questions are:

1) How do I hook up the actual vertical scroll bar to respond and activate the text objects? Ideally, it's size will be affected by the number of planets.

2) I need to group up 4 static text boxes for each entity (For example: Alpha1, 6, Normal, Ideal all represent the same planet) since they need to move altogether when a different sorting method is activated. I thought about making the planet Name (Alpha1) as the parent static text item, and the rest of the fields (6, normal, ideal) as it's children, but I'm not sure it's wise.

3) What is the best method to create the sorting algorithm? I assume it is tightly related to how I define the actual planet entity.

I promise a beer to the person that can conjure up a solution!

Cheers, :pint:

ianstangoe
Quite a regular
Quite a regular
Posts: 79
Joined: Wed Jan 09, 2008 11:06

Re: Need some help implementing a specific window

Postby ianstangoe » Wed Nov 25, 2009 12:27

Take a look at demo7, it seems to have exactly the kind of window your looking for, it even includes sorting by field type :wink:

asafy3
Just popping in
Just popping in
Posts: 6
Joined: Fri Oct 23, 2009 11:41

Re: Need some help implementing a specific window

Postby asafy3 » Wed Nov 25, 2009 19:42

Hey Ian,

Thanks - Following the example in Demo7 I was able to get an up and running multi column list window, but I have a small question that I just couldn't find an answer to: Is there any way to set the height of each row?

Any help will be appreciated. :)

ianstangoe
Quite a regular
Quite a regular
Posts: 79
Joined: Wed Jan 09, 2008 11:06

Re: Need some help implementing a specific window

Postby ianstangoe » Fri Nov 27, 2009 14:18

To be honest I've not looked at the code but I assume there are properties you can set on the window to adjust height/width and various others, or it may be something you can tweak in the looknfeel file.

asafy3
Just popping in
Just popping in
Posts: 6
Joined: Fri Oct 23, 2009 11:41

Re: Need some help implementing a specific window

Postby asafy3 » Fri Nov 27, 2009 15:21

Yep, I looked in both. The code part seems to only allow changing the textual elements within the item, such as font and actual text, and the LooknFeel file seems to have no effect.

Is it possible that this is caused because I'm using a ListboxTextItem and not just a ListboxItem - Reason I'm using a textItem is because I couldn't initialize a regular ListboxItem.

This might be the root of the problem, since the only LooknFeel widget I have that's slightly similar is a ListboxItem, not a ListboxTextItem.

Here's the code I use to inject new items to the list:

Code: Select all

CEGUI::ListboxTextItem* Item = new CEGUI::ListboxTextItem("");
PlanetList->setItem(Item, 0, i);

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Need some help implementing a specific window

Postby Jamarr » Fri Nov 27, 2009 16:59

As far as I am aware the MultiColumnList requires the use of ListboxItem objects, which are not falagard/window based; meaning you cannot modify them via the .looknfeel file. I would assume that these objects auto-size based on the size of the font associated with them, so you should be able to manipulate their height by increasing the font-size. If you want to increase their height without increase the font-size, then you will likely have to derive a custom class from ListboxItem (or ListboxTextItem) with which you can modify the height yourself.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests