1 /*
2 * This file is part of XForms.
3 *
4 * XForms is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2.1, or
7 * (at your option) any later version.
8 *
9 * XForms is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with XForms; see the file COPYING. If not, write to
16 * the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
17 * MA 02111-1307, USA.
18 */
19
20
21 /* Multiline labels. */
22
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
26
27 #include "include/forms.h"
28
29 FL_FORM *form;
30
31 FL_OBJECT *readyobj;
32
33
34 /***************************************
35 ***************************************/
36
37 void
create_form_0(void)38 create_form_0( void )
39 {
40 FL_OBJECT *obj;
41
42 form = fl_bgn_form( FL_NO_BOX, 400, 470 );
43
44 obj = fl_add_box( FL_UP_BOX, 0, 0, 400, 470, "" );
45 fl_set_object_color( obj, FL_SLATEBLUE, FL_COL1 );
46
47 obj = fl_add_text( FL_NORMAL_TEXT, 140, 40, 120, 120,
48 "This is\na multi-line\nlabelT" );
49 fl_set_object_boxtype( obj, FL_BORDER_BOX );
50 fl_set_object_lalign( obj, FL_ALIGN_TOP );
51
52 obj = fl_add_text( FL_NORMAL_TEXT, 140, 160, 120, 120,
53 "This is\na multi-line\nlabelC" );
54 fl_set_object_boxtype( obj, FL_BORDER_BOX );
55 fl_set_object_color( obj, FL_PALEGREEN, FL_COL1 );
56 fl_set_object_lsize( obj, FL_LARGE_SIZE );
57 fl_set_object_lalign( obj, FL_ALIGN_CENTER );
58
59 readyobj = obj = fl_add_button( FL_NORMAL_BUTTON, 280, 400, 100, 50,
60 "I am sure\nthat I am\nReady" );
61 fl_set_object_lsize( obj, FL_SMALL_SIZE );
62
63 obj = fl_add_text( FL_NORMAL_TEXT, 260, 160, 120, 120,
64 "This is\na multi-line\nlabelR" );
65 fl_set_object_boxtype( obj, FL_BORDER_BOX );
66 fl_set_object_lalign( obj, FL_ALIGN_RIGHT );
67
68 obj = fl_add_text( FL_NORMAL_TEXT, 140, 280, 120, 120,
69 "This is\na multi-line\nlabelB" );
70 fl_set_object_boxtype( obj, FL_BORDER_BOX );
71 fl_set_object_lalign( obj, FL_ALIGN_BOTTOM );
72
73 obj = fl_add_text( FL_NORMAL_TEXT, 20, 160, 120, 120,
74 "This is\na multi-line\nlabelL" );
75 fl_set_object_boxtype( obj, FL_BORDER_BOX );
76
77 fl_end_form( );
78 }
79
80 /***************************************
81 ***************************************/
82
83 int
main(int argc,char * argv[])84 main( int argc,
85 char * argv[ ] )
86 {
87 FL_OBJECT *obj;
88
89 fl_initialize( &argc, argv, "FormDemo", 0, 0 );
90 create_form_0( );
91
92 fl_show_form( form,FL_PLACE_CENTER, FL_NOBORDER, "Labels" );
93
94 do
95 obj = fl_do_forms( );
96 while ( obj != readyobj );
97
98 fl_hide_form( form );
99 fl_finish( );
100
101 return 0;
102 }
103
104
105 /*
106 * Local variables:
107 * tab-width: 4
108 * indent-tabs-mode: nil
109 * End:
110 */
111