Add to git.
[monolith.git] / src / ml_form_layout.h
1 /* Monolith form layout class.
2  * - by Richard W.M. Jones <rich@annexia.org>
3  *
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.
8  *
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.
13  *
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.
17  *
18  * $Id: ml_form_layout.h,v 1.1 2002/11/13 20:46:37 rich Exp $
19  */
20
21 #ifndef ML_FORM_LAYOUT_H
22 #define ML_FORM_LAYOUT_H
23
24 #include <ml_widget.h>
25
26 struct ml_form_layout;
27 typedef struct ml_form_layout *ml_form_layout;
28
29 /* Function: new_ml_form_layout - monolith form layout widget
30  * Function: ml_form_layout_pack
31  * Function: ml_form_layout_pack_help
32  *
33  * This is the monolith form layout widget. It is used to provide a
34  * very easy way to lay out forms. It contains two columns: the left
35  * hand column contains the field names, and the right hand column
36  * contains the form input widgets.
37  *
38  * It is a specialised version of @code{ml_multicol_layout}, which is
39  * itself a specialised version of @code{ml_table_layout}.
40  *
41  * @code{new_ml_form_layout} creates a new form layout widget.
42  *
43  * The following properties can be changed on form layouts (see
44  * @ref{ml_widget_set_property(3)}):
45  *
46  * @code{class}: The stylesheet class.
47  *
48  * @code{ml_form_layout_pack} packs a row in the form layout widget.
49  * The @code{label} string is the label for the row (normally
50  * something like @code{"field name:"}. This is placed in the left
51  * hand column, and rendered in bold, right-aligned. @code{label} may also be
52  * @code{NULL} for no label. @code{input} is a widget (normally
53  * a form input widget), which is placed in the right hand column.
54  *
55  * @code{ml_form_layout_pack_help} packs a row which consists of
56  * help information. This is placed in the right hand column and
57  * rendered as small text.
58  */
59 extern ml_form_layout new_ml_form_layout (pool pool);
60 extern void ml_form_layout_pack (ml_form_layout, const char *label, ml_widget input);
61 extern void ml_form_layout_pack_help (ml_form_layout, const char *help_text);
62
63 #endif /* ML_FORM_LAYOUT_H */