1 /* Monolith multi-column layout class.
2 * - by Richard W.M. Jones <rich@annexia.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 * $Id: ml_multicol_layout.h,v 1.3 2002/11/13 20:46:37 rich Exp $
21 #ifndef ML_MULTICOL_LAYOUT_H
22 #define ML_MULTICOL_LAYOUT_H
24 #include <ml_widget.h>
26 struct ml_multicol_layout;
27 typedef struct ml_multicol_layout *ml_multicol_layout;
29 /* Function: new_ml_multicol_layout - monolith multi-column layout widget
30 * Function: ml_multicol_layout_set_align
31 * Function: ml_multicol_layout_set_valign
32 * Function: ml_multicol_layout_set_class
33 * Function: ml_multicol_layout_set_header
34 * Function: ml_multicol_layout_pack
36 * The multi-column layout widget is a very simple type of layout widget
37 * suitable for forms and simple tabular data. The widget is initialised
38 * with the fixed number of columns, then each call to the pack method
39 * adds a widget at the next available free place. This layout widget
40 * creates more rows as required, unlike the table layout widget where
41 * rows must be created explicitly.
43 * Note: When creating a form, it is best to use the specialised version
44 * of multi-column layout, @code{ml_form_layout} (see
45 * @ref{new_ml_form_layout(3)}).
47 * @code{new_ml_multicol_layout} creates a new multi-column layout
48 * widget. The fixed number of columns is specified in the
49 * @code{nr_cols} parameter.
51 * The following properties can be changed on multi-column layouts (see
52 * @ref{ml_widget_set_property(3)}):
54 * @code{class}: The stylesheet class.
56 * @code{ml_multicol_layout_set_(valign|align|class|header)} sets the
57 * cell alignment, class or header flag for the NEXT cell (ie. you
58 * must call this function BEFORE calling the pack function). See
59 * @ref{ml_table_layout_set_valign(3)},
60 * @ref{ml_table_layout_set_align(3)},
61 * @ref{ml_table_layout_set_class(3)} and
62 * @ref{ml_table_layout_set_header(3)}.
64 * @code{ml_multicol_layout_pack} packs another widget at the next
65 * available free space, going left-to-right, top-to-bottom. An additional
66 * rows is created if required. To pack an empty cell, call this
67 * function with the widget parameter set to @code{NULL}.
69 extern ml_multicol_layout new_ml_multicol_layout (pool pool, int nr_cols);
70 extern void ml_multicol_layout_set_align (ml_multicol_layout, const char *align);
71 extern void ml_multicol_layout_set_valign (ml_multicol_layout, const char *valign);
72 extern void ml_multicol_layout_set_class (ml_multicol_layout, const char *clazz);
73 extern void ml_multicol_layout_set_header (ml_multicol_layout, int is_header);
74 extern void ml_multicol_layout_pack (ml_multicol_layout, ml_widget);
76 #endif /* ML_MULTICOL_LAYOUT_H */