/[xforms]/xforms/demos/demo.c
ViewVC logotype

Diff of /xforms/demos/demo.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by leeming, Thu Apr 24 09:35:33 2003 UTC revision 1.5 by leeming, Tue Sep 9 00:28:25 2003 UTC
# Line 26  Line 26 
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    
# Line 105  MENU menus[MAXMENU]; Line 105  MENU menus[MAXMENU];
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;
# Line 196  char stack[64][32]; Line 196  char stack[64][32];
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;
# Line 228  push_menu(char nnn[]) Line 228  push_menu(char nnn[])
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)
# Line 245  extern "C" Line 245  extern "C"
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]);
# Line 268  dobut(FL_OBJECT * obj, long arg) Line 268  dobut(FL_OBJECT * obj, long arg)
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);
# Line 297  showlog(FL_OBJECT *obj, long arg) Line 297  showlog(FL_OBJECT *obj, long arg)
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;
# Line 355  extern void doback(FL_OBJECT *, long); Line 355  extern void doback(FL_OBJECT *, long);
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;
# Line 420  create_form_form(void) Line 420  create_form_form(void)
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();

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26