Hierarchical widgets, take 2

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4766
Joined: 09 Sep 2007 05:03
Location: home

Hierarchical widgets, take 2

Post by Alberth »

Some of you may remember Hierarchical widgets, my first attempt to improve the widgets. It was not accepted since the patch was too big to understand.

I found another way to start working on this problem, and have another go at it.
Attached you will find a document describing the changes. Also, to give you an idea of how it will change, I attached the patch for the intro screen.

The whole patch is at http://bugs.openttd.org/task/1905 (comment date: Saturday, 07 March 2009, 18:51 GMT).
Besides the actual code changes, there are patches for 3 more windows (news type 0, news history, and vehicle list windows)

Feedback is welcome!
Attachments
nwidgets.pdf
nested widgets documentation file
(126.22 KiB) Downloaded 394 times
06_intro_window_parts.patch
patch for the intro screen window
(6.53 KiB) Downloaded 127 times
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: Hierarchical widgets, take 2

Post by Wolf01 »

Lol, that looks like the system I used for my own project, but I'm too bad at coding so I think I'm not able to fully implement it.
I implemented this only on the menu and the scrollbar, I'm trying to gather my forces to try to extend this method to all the forms (especially to the title bar) and I can assure that is more flexible and automatised than the current OTTD implementation
The main problem I have is to build them dynamically runtime with events :P
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4766
Joined: 09 Sep 2007 05:03
Location: home

Re: Hierarchical widgets, take 2

Post by Alberth »

A small update:

I have added nested widget tree replacements for the vehicle group window and the network server window to the FlySpray entry.
The latter needed some additional hacking as it does heavy custom resize trickery.

Also updated the default settings for the nested widgets a bit.


Last but not least, I have made a Dump() method that outputs a compact overview of a window. Great for debugging.
Not sure whether this belongs in trunk, so I'll post it here.
Attachments
10y_debug_nwidgets.patch
Additional 'Dump' method for outputting the nested widget tree.
(4.39 KiB) Downloaded 130 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 8 guests