File: ui_attrib.c

package info (click to toggle)
libforms 1.0.93sp1-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,548 kB
  • ctags: 9,107
  • sloc: ansic: 97,227; sh: 9,236; makefile: 858
file content (220 lines) | stat: -rw-r--r-- 8,027 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/* Form definition file generated by fdesign */

#include <stdlib.h>
#include "ui_attrib.h"


/***************************************
 ***************************************/

FD_attrib *
create_form_attrib( void )
{
    FL_OBJECT *obj;
    FD_attrib *fdui = fl_malloc( sizeof *fdui );

    int old_bw = fl_get_border_width( );
    fl_set_border_width( -1 );

    fdui->vdata = fdui->cdata = NULL;
    fdui->ldata = 0;

    fdui->attrib = fl_bgn_form( FL_NO_BOX, 630, 310 );

    fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 630, 310, "" );

    obj = fl_add_box( FL_UP_BOX, 541, 0, 89, 310, "" );

    fdui->readyobj = obj = fl_add_button( FL_RETURN_BUTTON, 550, 85, 70, 24, "Accept" );
    fl_set_object_lalign( obj, FL_ALIGN_CENTER );

    fdui->cancelobj = obj = fl_add_button( FL_NORMAL_BUTTON, 550, 109, 70, 24, "Cancel" );
    fl_set_button_shortcut( obj, "#C^[", 1 );
    fl_set_object_lalign( obj, FL_ALIGN_CENTER );

    fdui->applyobj = obj = fl_add_button( FL_NORMAL_BUTTON, 550, 133, 70, 24, "Apply" );
    fl_set_button_shortcut( obj, "#A", 1 );
    fl_set_object_lalign( obj, FL_ALIGN_CENTER );
    fl_set_object_callback( obj, apply_cb, 0 );

    fdui->restoreobj = obj = fl_add_button( FL_NORMAL_BUTTON, 550, 158, 70, 24, "   Restore   " );
    fl_set_button_shortcut( obj, "#R", 1 );
    fl_set_object_lalign( obj, FL_ALIGN_CENTER );
    fl_set_object_callback( obj, restore_cb, 0 );

    fdui->autoapplyobj = obj = fl_add_checkbutton( FL_PUSH_BUTTON, 545, 25, 25, 30, "AutoApply" );
    fl_set_object_color( obj, FL_COL1, FL_BLUE );
    fl_set_object_callback( obj, autoapply_setting_cb, 0 );

    fdui->attrib_folder = obj = fl_add_tabfolder( FL_TOP_TABFOLDER, 6, 5, 531, 299, "" );
    fl_set_object_lstyle( obj, FL_BOLD_STYLE );
    fl_set_object_resize( obj, FL_RESIZE_ALL );
    fl_set_object_callback( obj, folder_switch_cb, 0 );

    fl_end_form( );

    fdui->attrib->fdui = fdui;
    fl_set_border_width( old_bw );

    return fdui;
}


/***************************************
 ***************************************/

FD_generic_attrib *
create_form_generic_attrib( void )
{
    FL_OBJECT *obj;
    FD_generic_attrib *fdui = fl_malloc( sizeof *fdui );

    int old_bw = fl_get_border_width( );
    fl_set_border_width( -1 );

    fdui->vdata = fdui->cdata = NULL;
    fdui->ldata = 0;

    fdui->generic_attrib = fl_bgn_form( FL_NO_BOX, 534, 278 );

    fdui->background = obj = fl_add_box( FL_FLAT_BOX, 0, 0, 534, 278, "" );

    fdui->generic_group = fl_bgn_group( );

    fdui->text[2] = obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 235, 120, 185, 137, "Misc." );
    fl_set_object_lstyle( obj, FL_BOLD_STYLE );

    fdui->text[1] = obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 235, 15, 185, 95, "Font" );
    fl_set_object_lstyle( obj, FL_BOLD_STYLE );

    fdui->text[0] = obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 10, 15, 212, 242, "Basic Attributes" );
    fl_set_object_lstyle( obj, FL_BOLD_STYLE );

    fdui->typeobj = obj = fl_add_choice( FL_NORMAL_CHOICE, 69, 31, 143, 25, "Type" );
    fl_set_object_shortcut( obj, "#T", 1 );
    fl_set_object_boxtype( obj, FL_SHADOW_BOX );
    fl_set_object_callback( obj, auto_apply_cb, 0 );

    fdui->boxobj = obj = fl_add_choice( FL_NORMAL_CHOICE, 69, 61, 143, 25, "BoxType" );
    fl_set_object_shortcut( obj, "#B", 1 );
    fl_set_object_boxtype( obj, FL_SHADOW_BOX );
    fl_set_object_callback( obj, auto_apply_cb, 0 );

    fdui->nameobj = obj = fl_add_input( FL_NORMAL_INPUT, 69, 121, 143, 25, "Name" );
    fl_set_input_shortcut( obj, "#N", 1 );
    fl_set_object_color( obj, FL_COL1, FL_TOP_BCOL );
    fl_set_object_callback( obj, validate_cvar_name_cb, 0 );
    fl_set_object_return( obj, FL_RETURN_END_CHANGED );

    fdui->cbnameobj = obj = fl_add_input( FL_NORMAL_INPUT, 69, 151, 143, 25, "Callback" );
    fl_set_input_shortcut( obj, "#K", 1 );
    fl_set_object_color( obj, FL_COL1, FL_TOP_BCOL );
    fl_set_object_callback( obj, validate_cvar_name_cb, 1 );
    fl_set_object_return( obj, FL_RETURN_END_CHANGED );

    fdui->argobj = obj = fl_add_input( FL_NORMAL_INPUT, 69, 181, 143, 25, "Argument" );
    fl_set_input_shortcut( obj, "#U", 1 );
    fl_set_object_color( obj, FL_COL1, FL_TOP_BCOL );
    fl_set_object_return( obj, FL_RETURN_END_CHANGED );

    fdui->scobj = obj = fl_add_input( FL_NORMAL_INPUT, 69, 211, 143, 25, "Shortcut" );
    fl_set_input_shortcut( obj, "#S", 1 );
    fl_set_object_color( obj, FL_COL1, FL_TOP_BCOL );
    fl_set_object_callback( obj, auto_apply_cb, 0 );
    fl_set_object_return( obj, FL_RETURN_END_CHANGED );

    fdui->labelobj = obj = fl_add_input( FL_NORMAL_INPUT, 69, 91, 143, 25, "Label" );
    fl_set_input_shortcut( obj, "#L", 1 );
    fl_set_object_color( obj, FL_COL1, FL_TOP_BCOL );
    fl_set_object_callback( obj, auto_apply_cb, 0 );
    fl_set_object_return( obj, FL_RETURN_END_CHANGED );

    fdui->fontobj = obj = fl_add_choice( FL_NORMAL_CHOICE, 278, 24, 131, 25, "Font" );
    fl_set_object_shortcut( obj, "#F", 1 );
    fl_set_object_boxtype( obj, FL_SHADOW_BOX );
    fl_set_object_callback( obj, auto_apply_cb, 0 );

    fdui->styleobj = obj = fl_add_choice( FL_NORMAL_CHOICE, 278, 51, 131, 25, "Style" );
    fl_set_object_shortcut( obj, "#S", 1 );
    fl_set_object_boxtype( obj, FL_SHADOW_BOX );
    fl_set_object_callback( obj, auto_apply_cb, 0 );

    fdui->sizeobj = obj = fl_add_choice( FL_NORMAL_CHOICE, 278, 78, 131, 25, "Size" );
    fl_set_object_shortcut( obj, "#Z", 1 );
    fl_set_object_boxtype( obj, FL_SHADOW_BOX );
    fl_set_object_callback( obj, auto_apply_cb, 0 );

    fdui->text[3] = obj = fl_add_labelframe( FL_ENGRAVED_FRAME, 431, 80, 89, 150, "Color" );
    fl_set_object_lstyle( obj, FL_BOLD_STYLE );

    fdui->lcolobj = obj = fl_add_button( FL_NORMAL_BUTTON, 440, 191, 70, 20, "LabelColor" );
    fl_set_object_lalign( obj, FL_ALIGN_TOP );
    fl_set_object_callback( obj, setcolor_cb, 0 );

    fdui->col1obj = obj = fl_add_button( FL_NORMAL_BUTTON, 440, 111, 70, 20, "Color1" );
    fl_set_button_shortcut( obj, "#1", 1 );
    fl_set_object_lalign( obj, FL_ALIGN_TOP );
    fl_set_object_callback( obj, setcolor_cb, 1 );

    fdui->col2obj = obj = fl_add_button( FL_NORMAL_BUTTON, 440, 151, 70, 20, "Color 2" );
    fl_set_button_shortcut( obj, "#2", 1 );
    fl_set_object_lalign( obj, FL_ALIGN_TOP );
    fl_set_object_callback( obj, setcolor_cb, 2 );

    fdui->align = obj = fl_add_choice( FL_NORMAL_CHOICE, 305, 130, 108, 23, "LabelAlign" );
    fl_set_object_boxtype( obj, FL_SHADOW_BOX );
    fl_set_object_callback( obj, auto_apply_cb, 0 );

    fdui->nwgravity = obj = fl_add_choice( FL_NORMAL_CHOICE, 305, 182, 108, 23, "NW Gravity" );
    fl_set_object_boxtype( obj, FL_SHADOW_BOX );

    fdui->segravity = obj = fl_add_choice( FL_NORMAL_CHOICE, 305, 206, 108, 23, "SE Gravity" );
    fl_set_object_boxtype( obj, FL_SHADOW_BOX );

    fdui->inside = obj = fl_add_choice( FL_NORMAL_CHOICE, 305, 154, 108, 23, "In/Out" );
    fl_set_object_boxtype( obj, FL_SHADOW_BOX );
    fl_set_object_callback( obj, auto_apply_cb, 0 );

    fdui->resize = obj = fl_add_choice( FL_NORMAL_CHOICE, 305, 230, 108, 23, "Resize" );
    fl_set_object_boxtype( obj, FL_SHADOW_BOX );
    fl_end_group( );


    fl_end_form( );

    fdui->generic_attrib->fdui = fdui;
    fl_set_border_width( old_bw );

    return fdui;
}


/***************************************
 ***************************************/

FD_nullattrib *
create_form_nullattrib( void )
{
    FL_OBJECT *obj;
    FD_nullattrib *fdui = fl_malloc( sizeof *fdui );

    int old_bw = fl_get_border_width( );
    fl_set_border_width( -1 );

    fdui->vdata = fdui->cdata = NULL;
    fdui->ldata = 0;

    fdui->nullattrib = fl_bgn_form( FL_NO_BOX, 540, 280 );

    obj = fl_add_box( FL_FLAT_BOX, 0, 0, 540, 280, "" );

    obj = fl_add_box( FL_UP_BOX, 90, 100, 350, 50, "Not implemented (or not interesting)" );
    fl_set_object_lsize( obj, FL_NORMAL_SIZE );

    fl_end_form( );

    fdui->nullattrib->fdui = fdui;
    fl_set_border_width( old_bw );

    return fdui;
}