26 |
* Driver for the demo/test suite |
* Driver for the demo/test suite |
27 |
* |
* |
28 |
* This file is part of xforms package |
* This file is part of xforms package |
29 |
* M. Overmars and T.C. Zhao |
* M. Overmars and T.C. Zhao |
30 |
* |
* |
31 |
*/ |
*/ |
32 |
|
|
105 |
int mennumb = 0; |
int mennumb = 0; |
106 |
|
|
107 |
/* Returns the number of a given menu name. */ |
/* Returns the number of a given menu name. */ |
108 |
int |
int |
109 |
find_menu(char *nnn) |
find_menu(char *nnn) |
110 |
{ |
{ |
111 |
int i; |
int i; |
196 |
int stsize = 0; |
int stsize = 0; |
197 |
|
|
198 |
/* Pushes a menu to be visible */ |
/* Pushes a menu to be visible */ |
199 |
static void |
static void |
200 |
push_menu(char nnn[]) |
push_menu(char nnn[]) |
201 |
{ |
{ |
202 |
int n, i, bn; |
int n, i, bn; |
228 |
} |
} |
229 |
|
|
230 |
/* Pops a menu */ |
/* Pops a menu */ |
231 |
static void |
static void |
232 |
pop_menu(void) |
pop_menu(void) |
233 |
{ |
{ |
234 |
if (stsize <= 1) |
if (stsize <= 1) |
245 |
char **fl_get_cmdline_args(int *); |
char **fl_get_cmdline_args(int *); |
246 |
|
|
247 |
/* handles a button push */ |
/* handles a button push */ |
248 |
void |
void |
249 |
dobut(FL_OBJECT * obj, long arg) |
dobut(FL_OBJECT * obj, long arg) |
250 |
{ |
{ |
251 |
int men = find_menu(stack[stsize - 1]); |
int men = find_menu(stack[stsize - 1]); |
268 |
fl_addto_command_log(cmd); |
fl_addto_command_log(cmd); |
269 |
fl_addto_command_log("\n"); |
fl_addto_command_log("\n"); |
270 |
fl_deactivate_all_forms(); |
fl_deactivate_all_forms(); |
271 |
fl_exe_command(cmd, 1); |
fl_exe_command(cmd, 1); |
272 |
fl_activate_all_forms(); |
fl_activate_all_forms(); |
273 |
} |
} |
274 |
} |
} |
275 |
|
|
276 |
/* Go up a level in the menu tree */ |
/* Go up a level in the menu tree */ |
277 |
void |
void |
278 |
doback(FL_OBJECT * obj, long arg) |
doback(FL_OBJECT * obj, long arg) |
279 |
{ |
{ |
280 |
pop_menu(); |
pop_menu(); |
281 |
} |
} |
282 |
|
|
283 |
/* Exit the program */ |
/* Exit the program */ |
284 |
void |
void |
285 |
doexit(FL_OBJECT * obj, long arg) |
doexit(FL_OBJECT * obj, long arg) |
286 |
{ |
{ |
287 |
fl_hide_form(form); |
fl_hide_form(form); |
297 |
|
|
298 |
|
|
299 |
/* Loads the menu file. Returns whether successful. */ |
/* Loads the menu file. Returns whether successful. */ |
300 |
static int |
static int |
301 |
load_the_menu(char fname[]) |
load_the_menu(char fname[]) |
302 |
{ |
{ |
303 |
FILE *fin; |
FILE *fin; |
355 |
extern void dobut(FL_OBJECT *, long); |
extern void dobut(FL_OBJECT *, long); |
356 |
|
|
357 |
|
|
358 |
void |
void |
359 |
create_form_form(void) |
create_form_form(void) |
360 |
{ |
{ |
361 |
FL_OBJECT *obj; |
FL_OBJECT *obj; |
420 |
fl_adjust_form_size(form); |
fl_adjust_form_size(form); |
421 |
} |
} |
422 |
|
|
423 |
void |
void |
424 |
create_the_forms(void) |
create_the_forms(void) |
425 |
{ |
{ |
426 |
create_form_form(); |
create_form_form(); |