Index: trunk/doc/developer/dad/widgets.html =================================================================== --- trunk/doc/developer/dad/widgets.html (revision 21010) +++ trunk/doc/developer/dad/widgets.html (revision 21011) @@ -44,7 +44,7 @@

The user can choose one value out of an ordered list of strings. The list is passed as a NULL terminalte char * array. The value -of the enum is an integer index into that array. +of the enum is an integer index into that array, 0 being the first string.

Typical GUI implementation is a combo box, without text editing. @@ -64,7 +64,7 @@

PCB_DAD_REAL(table, label)

-Ask for a double precision floating point value, between a minval +Ask for a REAL (double precision floating point value), between a minval and a maxval.

Typical GUI implementation is a text entry, often upgraded with small buttons @@ -87,12 +87,53 @@ The value is a dynamically allocated string.

PCB_DAD_BUTTON(table, text)

+

+A push button the user can click on. text is not allocated or copied +(shall be a static const string or allocated/free'd by the user). +

+There is no value, the only interface is the change callback. + +

PCB_DAD_PROGRESS(table)

+

+Present a progress bar which is not an user input. value is a +REAL value between 0.0 and 1.0. When the code changes the value, the +GUI makes sure the dialog box is drawn and flushed, because typical use +is in a busy loop calculation. +

PCB_DAD_TREE(table, cols, first_col_is_tree, opt_header)

-

PCB_DAD_PREVIEW(table, expose_cb, mouse_cb, free_cb, initial_view_box, user_ctx_)

+

+Present a tree-table with cols columns of text objects. When +first_col_is_tree is 1, the first column works as a tree, with +indentation and/or tree graphics and logics for collapsing/expanding subtrees. +If opt_header is not NULL, it is a NULL terminated static const +array of header strings describing the table header to be displayed, in as +many strings as cols specified. +

+A special cases: +

+ +
case parameters +
plain flat list cols=1, first_col_is_tree=0 +
tree-only cols=1, first_col_is_tree=1 +
table-only cols>1, first_col_is_tree=0 +
+

+Manipulating the data and the view are both done using + special tree-table macros. +

PCB_DAD_PREVIEW(table, expose_cb, mouse_cb, free_cb, initial_view_box, user_ctx)

+

+Present a drawing area with callbacks to the host code to handle drawing: + +
argument meaning +
expose_cb called when (parts of) the preview needs to be redrawn +
mouse_cb called on mouse events +
free_cb called before the widget is destroyed +
initial_view_box set the initial zoom/pan to match the view box specified in drawing units +
user_ctx opaque pointer that is passed to every callback +
-

Layout widgets

@@ -106,14 +147,44 @@
-

PCB_DAD_BEGIN_HBOX(table)

-

PCB_DAD_BEGIN_VBOX(table)

+

PCB_DAD_BEGIN_HBOX(table) and PCB_DAD_BEGIN_VBOX(table)

+

+Arrange children widgets in a horizontal or vertical row. +

PCB_DAD_BEGIN_HPANE(table)

+

+Expect exactly two child widgets. Arrange them horizontally, with +a widget in between them that allows the user to change the space allocation +between the sides. +

PCB_DAD_BEGIN_VPANE(table)

+

+Expect exactly two child widgets. Arrange them vertically, with +a widget in between them that allows the user to change the space allocation +between the sides. +

PCB_DAD_BEGIN_TABLE(table, cols)

+

+Place children widgets in a table with cols columns. Widgets are +placed by filling up rows first. If there are not enough widget to finish +the last row, rightmost columns are left empty. +

+The table is homogenous, which means the cell size is the same for all cells +and is either determined by the size of the smallest cell content or if +the table fills in a larger widget space than its minimal size, then cell +space is evenly distributed. +

PCB_DAD_BEGIN_TABBED(table, tabs)

+

+Creates a "tabbed notebook": each child widget ends up on a new +page, there is only one page shown at a time and there is a GUI way +to switch page (the tab). The list of tab names is passed as tabs, +as a NULL terminalte char * array. The number of tab names must match +the number of children widgets. The value +of is an integer index into that array, 0 being the first tab. +

Property sets

#define PCB_DAD_COMPFLAG(table, val) PCB_DAD_SET_ATTR_FIELD(table, pcb_hatt_flags, val | (table[table ## _len-1].pcb_hatt_flags & PCB_HATF_TREE_COL))