home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c185 / 1.ddi / EXAMPLE.EXE / CSCAPE / EXAMPLE / DEMOFSAV.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-12  |  1.5 KB  |  82 lines

  1. /*
  2.     demofsav.c
  3.  
  4.     jmd 6/89
  5.  
  6.     Copyright (c) 1989, by Oakland Group, Inc.
  7.     ALL RIGHTS RESERVED.
  8.  
  9.     This program demonstrates saving a sed to a screen file.
  10.  
  11.     It saves the sed to the screen file "test.lnf"
  12.     with the screen name "test"
  13.  
  14.     You can use the example program DEMOFLOD to load the screen.
  15. */
  16.  
  17. #include <stdio.h>
  18. #include <cscape.h>
  19. #include <sfile.h>
  20.  
  21. /* function symbol table */
  22.  
  23. fsyminit_struct my_list[] = {
  24.  
  25. {FSYM_CLASS},
  26. {"sedwin_Class",    (VOID_FPTR)    sedwin_Class    ,  NULL },
  27.  
  28. {FSYM_FIELDFUNCS },
  29. {"string_funcs", FNULL, (VOID *) &string_funcs},
  30.  
  31. {FSYM_USER },
  32.  
  33. {FSYM_BORDER },
  34. {"bd_box", (VOID_FPTR) bd_box, NULL},
  35.  
  36. {FSYM_MOUSE },
  37. {FSYM_MOVEMETHOD },
  38. {FSYM_EXPLODE },
  39. {FSYM_SPECIAL },
  40. {FSYM_AUX },
  41. {FSYM_LISTEND}
  42. };
  43.  
  44. void main()
  45. {
  46.     menu_type menu;
  47.     sed_type sed;
  48.     sfile_type sfile;
  49.     char name[22];
  50.  
  51.     name[0] = '\0';
  52.  
  53.     /* Initialize the display */
  54.     disp_Init(def_ModeText, NULL);
  55.  
  56.     /* Open the sfile */
  57.     sfile = sfile_Open("test.lnf", my_list);
  58.  
  59.     /* Create the sed */
  60.     menu = menu_Open();
  61.  
  62.     menu_Printf(menu, "This is a test\n");
  63.     menu_Printf(menu, "@f[#########]\n", name, &string_funcs);
  64.     menu_Printf(menu, "@a[0x24]All done\n");
  65.     menu_Printf(menu, "@a[0x31]All done");
  66.  
  67.     sed = sed_Open(menu);
  68.     sed_SetBorder(sed, bd_box);
  69.     sed_SetBorderTitle(sed, "Test");
  70.     sed_SetPosition(sed, 5, 10);
  71.  
  72.     /* Put the sed into the sfile */
  73.     sfile_SaveSed(sfile, sed, "test");
  74.  
  75.     sed_Repaint(sed);
  76.     sed_Go(sed);
  77.     sed_Close(sed);
  78.  
  79.     sfile_Close(sfile);
  80.     disp_Close();
  81. }
  82.