[Bf-committers] UI layout engine

Alexander Ewering blender at instinctive.de
Mon Nov 26 17:48:23 CET 2007


On Mon, 26 Nov 2007, Shaul Kedem wrote:

> first , thank you for waking up this ML
>
> second, I think it should be done as well, but at what depth? creating
> a full rasterising engine is very complex, but maybe an external xml
> format to define panels and UI ?

Thank you for not dissing what I've said just because it's me in the first
place ;)

My (and probably EVERY other coder's!) primary concern with the current system
is not the fact that the coordinates are stored inside source files, but the
fact that specifying coordinates is even NECESSARY!

As I mentioned, when you code new stuff for Blender (in my case, for my 2D
fork of Blender), you almost are afraid of needing an UI for it because it
means 2 hours of button-coordinate-trial-and-error.

There should be at least a simpler, higher-level interface to creating UIs,
something like:

- A horizontal row of buttons:

- uiBlockBeginHRow(uiBlock *block, short xco, short yco, short butheight, short total_width);
- uiBut...() like usual (but WITHOUT explicit coordinates!);
- uiBlockEndRow();

- A vertical row of buttons:

- uiBlockBeginVRow(uiBlock *block, short xco, short yco, short butwidth, short total_height);

- A grid of buttons:

- uiBlockBeginGrid(uiBlock *block, short xco, short yco, short number_of_rows, short total_width);

Of course, xco, yco and the widths should be in *percentages*, not in
pixels; the percentages being relative to the *container* (mostly, that will
be the panel). Speaking of that, a way to define arbitrary containers (like
a <div> in HTML) to render buttons relative to:

- uiBlockBeginContainer(uiBlock *block, short xco, short yco, short
total_width, short total_height);

etc... just a few spontaneous thoughts. The coder simply must be freed from
the burden of being a painter and an arithmetic genius.

Alexander Ewering


[ i n s t i n c t i v e . ]   http://www.instinctive.de

Zur Waldeshoehe 6                    Tel.: 02393-220558
59846 Sundern                         Fax: 02393-220559
Germany                xx-mail: xx-mail.com/instinctive


More information about the Bf-committers mailing list