Tree controls

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

User avatar
DrPain
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Mar 17, 2005 15:19

Tree controls

Postby DrPain » Sat Oct 15, 2005 12:07

I'm about to start working on a tree control, but wanted to verify that one doesn't already exist, or someone else isn't working on one.
My goal is to have each tree branch consist of two items: an image, and an edit box. It will look/act much like the tree in the Window Explorer left-pane.

Any comments or suggestions?

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: Tree controls

Postby martignasse » Sat Oct 15, 2005 15:04

cool,

you'll making happy people :)

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Re: Tree controls

Postby spannerman » Tue Oct 18, 2005 00:45

I have started working on a basic tree control, but dont have much to show right now. I wasnt planning for it to be a new CEGUI widget though - its too basic, only allow one leaf node per branch. I was going for something like what NFZ created for his resource editor.

Anyway, let us know how you get on - If your making a proper widget that will be added to the library then that would be great!

User avatar
DrPain
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Mar 17, 2005 15:19

Re: Tree controls

Postby DrPain » Tue Oct 18, 2005 13:58

I intend on making a proper widget for the library, but of course there's no guarantees I'll be successful.

User avatar
DrPain
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Mar 17, 2005 15:19

Re: Tree controls

Postby DrPain » Tue Oct 18, 2005 19:24

Making good progress.

Obligatory screenshot:
Image

Opening and closing the tree branches works great.
You can have as many levels as you like (barring out-of-memory conditions).
Any tree item can have an icon associated with it, or not.

The first tree item shown above (1a) and all its children have icons associated with them.
Tree items 1b and 1c do no have icons.

As I have it now, the icons are scaled to a square the size of the text height. Any comments regarding that?

Now to hook up all the necessary events, and do some more extensive testing.
Last edited by DrPain on Tue May 09, 2006 12:24, edited 1 time in total.

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

Re: Tree controls

Postby lindquist » Wed Oct 19, 2005 00:20

This looks very nice.
Could you tell a bit about your implementation ?
And is it 0.5 (CVS HEAD) compatible?

User avatar
DrPain
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Mar 17, 2005 15:19

Re: Tree controls

Postby DrPain » Wed Oct 19, 2005 20:23

I've started a wiki page to describe the Tree control: Tree control Wiki page

As for CVS compatiblity, I updated to CVS less than a month ago, so I'd say yes, it's probably compatible.
I'll re-update before submitting a patch to ensure it is.

Not too many comments so far, so either nobody needs a tree control, or what I've shown is acceptable to everyone. :D

So how should a patch be approached? Should I wait until all my desired features are done (drag and drop for one)? Or shall I submit the patch now and keep working on it?

User avatar
madlion
Just popping in
Just popping in
Posts: 6
Joined: Wed Aug 10, 2005 07:59

Re: Tree controls

Postby madlion » Wed Oct 19, 2005 20:39

DrPain wrote:
Not too many comments so far, so either nobody needs a tree control, or what I've shown is acceptable to everyone. :D

No comments because as you said what you show ist acceptable.
I think more comments will come if we can test it your self.

DrPain wrote:
So how should a patch be approached? Should I wait until all my desired features are done (drag and drop for one)? Or shall I submit the patch now and keep working on it?

I would prefer if you submit the patch and keep working on it. So other can test and make suggestions.

Good work! ^^

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Re: Tree controls

Postby spannerman » Thu Oct 20, 2005 00:40

Wow, that is looking great man!

Not too many comments so far, so either nobody needs a tree control, or what I've shown is acceptable to everyone. :D


First time Ive seen it since my last post here, and I must say Im impressed...from reading the wiki page you created its a lot more powerful than I was planning. Excellant stuff :)

As I have it now, the icons are scaled to a square the size of the text height. Any comments regarding that?


Exactly how I was doing it, I think that is fine. If people want more functionality they can submit a patch.

Thanks for releasing this widget DrPain, big respect 8)

User avatar
DrPain
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Mar 17, 2005 15:19

Re: Tree controls

Postby DrPain » Thu Oct 20, 2005 15:22

I think the tree control is fairly stable at this point, so I'll post a beta.

Tree Control Beta 10/20/2005

Unzip the file directly over your cegui_mk2 directory (put the ZIP file in the directory ABOVE cegui_mk2 and "unzip here" ). All the paths are saved, starting at cegui_mk2.

I've changed a few things to enable/enhance the use of the tree control:
1) Vanilla.imageset, vanilla.tga, Vanilla.looknfeel and VanillaSkin.scheme have been expanded to include sizing mouse cursors, +/- buttons for the tree, and tooltips.
2) CEGuiD3D9BaseApplication.h and CEGuiD3D9BaseApplication.cpp have been changed slightly to call injectTimePulse to enable tooltips in the samples.
3) CEGUI.sln now has the Sample_TreeDemo project included in it.

So if you've made changes to any of these files, you'll want to back them up before expanding the ZIP file.

Oh, one known problem at the moment. I sync'ed to CVS yesterday, and now the images for the scrollbars are missing. Even in the FalagardDemo1 sample. Anyone aware if that's a known issue?

I'm still actively working on this control, so if you have any requests/comments, now's the time to make them.

Feedback wanted!

User avatar
martignasse
Just can't stay away
Just can't stay away
Posts: 227
Joined: Thu Apr 14, 2005 08:10
Location: Lyon, FRANCE

Re: Tree controls

Postby martignasse » Thu Oct 20, 2005 21:23

hi,

Not tested yet but already can say you've made good job.

and good idea to make the wiki page in the same time.

keep up good work :pint:

PS
just an "artist point of view" from the screenshot :
the +/- icon look to be not excactly aligned/centered with the icon above
[img align=left]http://mfleurent.free.fr/CEGUI/icon.jpg[/img]

it's just to have something to say ;)

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Re: Tree controls

Postby spannerman » Thu Oct 20, 2005 22:38

Aaah cool...Id love to try it out right now, but I will first need to update to latest cegui cvs, unzip and recompile it all, so its not gonna happen tonight. Will let you know tomorrow though!

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

Re: Tree controls

Postby lindquist » Fri Oct 21, 2005 01:03

Hi again.
The work you've done is nice, I had a look over the source...

The "plan" for the future of CEGUI is along a somewhat different path though.
Currently I'm working on a "prototype" of a new listbox widget that is not implemented using "items". Instead it uses plain windows for content. These are inherited from ItemEntry which provides the interface to allow automatic layout.

The idea is that it should be possible to specify list content through XML layouts without having to modify the XML parser every time a new type of item is introduced, furthermore it allows for customization of the items via Falagard, which makes it possible to greatly personalize the items without any C++ code.

Currently the idea is to rewrite the list widgets to use this approach, and make the old ones deprecated. Its not likely they will exist in 1.0.

The widget you have written is a GREAT extension to the 0.4 widgetset and goes a long way in completing whats available.
But inclusion in 0.5 ? I'm not sure...

This is based on my conversations with CE on IRC. So I feel fairly confident that he feels the same way!

User avatar
DrPain
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Thu Mar 17, 2005 15:19

Re: Tree controls

Postby DrPain » Fri Oct 21, 2005 02:28

Good lord.
Why didn't you say something a week ago when I started this?

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

Re: Tree controls

Postby lindquist » Fri Oct 21, 2005 04:18

yes.. I know. And I should have.
It was the reason for asking about your implementation...

I hope it won't discourage you completely from continuing the good work. It's very nice to see new widgets being developed, which does'nt happen too often.

Maybe you could be talked into creating the "++" version ?

And btw. There has been a little talk about doing a 0.4.1 release. Personally I think this would be a great addition to that. This could make way to include it in 0.5 as well - even though marked deprecated.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests