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

  1. /* 
  2.     demofram.c
  3.  
  4.     Copyright (c) 1988, by Oakland Group, Inc.
  5.     ALL RIGHTS RESERVED.
  6.  
  7.     Example using the framer menuing system.
  8.  
  9.     All of the menu choices call the function 'empty' defined below.
  10. */
  11.  
  12. #include <stdio.h>
  13.  
  14. #include <cscape.h>
  15. #include <popdecl.h>
  16. #include <framer.h>
  17.  
  18. /*** Note: C-scape uses the _arg macro to turn off prototyping 
  19.      for older compilers */
  20.  
  21. int empty(_arg2(VOID *, int));
  22.  
  23. struct frame_def test_frame[] = {   /* note: values must be positive */
  24.     { "Help!",                                 empty,  0    },
  25.     { "Help!",                                 empty,  1    },
  26.     { "The night before",                     empty,  2     },
  27.     { "You've got to hide your love away",     empty,  3     },
  28.     { "I need you",                         empty,  4     },
  29.     { "Another girl",                         empty,  5     },
  30.     { "You're going to lose that girl",     empty,  6     },
  31.     { "Ticket to ride",                     empty,  7     },
  32.     { "Act naturally",                         empty,  8     },
  33.     { "It's only love",                     empty,  9     },
  34.     { "You like me too much",                 empty, 10     },
  35.     { "Tell me what you see",                 empty, 11     },
  36.     { "I've just seen a face",                 empty, 12     },
  37.     { "Yesterday",                             empty, 13     },
  38.     { "Dizzy miss lizzie",                     empty, 14     },
  39.     { FRAME_END },
  40.     { "Rubber Soul",                empty, 20     },
  41.     { "Drive my car",                  empty, 21     },
  42.     { "Norwegian wood",              empty, 22     },
  43.     { "You won't see me",              empty, 23     },
  44.     { "Nowhere man",                  empty, 24     },
  45.     { "Think for yourself",          empty, 25     },
  46.     { "The word",                      empty, 26     },
  47.     { "Michelle",                      empty, 27    },
  48.     { "What goes on",                  empty, 28    },
  49.     { "Girl",                          empty, 29    },
  50.     { "I'm looking through you",      empty, 30    },
  51.     { "In my life",                  empty, 31     },
  52.     { "Wait",                          empty, 32     },
  53.     { "If I needed someone",          empty, 33     },
  54.     { "Run for your life",          empty, 34    },
  55.     { FRAME_END    },
  56.     { "Revolver",                          empty, 40    },
  57.     { "Taxman",                          empty, 41    },
  58.     { "Eleanor rigby",                  empty, 42    },
  59.     { "I'm only sleeping",              empty, 43    },
  60.     { "Love you to",                      empty, 44    },
  61.     { "Here, there and everywhere",      empty, 45    },
  62.     { "Yellow submarine",                  empty, 46    },
  63.     { "She said she said",              empty, 47    },
  64.     { "Good day sunshine",              empty, 48    },
  65.     { "And your bird can sing",          empty, 49    },
  66.     { "For no one",                      empty, 50    },
  67.     { "Doctor robert",                  empty, 51    },
  68.     { "I want to tell you",              empty, 52    },
  69.     { "Got to get you into my life",      empty, 53    },
  70.     { "Tomorrow never knows",              empty, 54    },
  71.     { FRAME_END },
  72.     { "Sgt. Pepper's Lonely Hearts Club Band",         empty, 60    },
  73.     { "Sgt. pepper's lonely hearts club band",      empty, 61    },
  74.     { "With a little help from my friends",          empty, 62    },
  75.     { "Lucy in the sky with diamonds",              empty, 63    },
  76.     { "Getting better",                              empty, 64    },
  77.     { "Fixing a hole",                              empty, 65    },
  78.     { "She's leaving home",                          empty, 66    },
  79.     { "Being for the benefit of mr. kite",          empty, 67    },
  80.     { "Within you without you",                      empty, 68    },
  81.     { "When I'm sixty-four",                          empty, 69    },
  82.     { "Lovely rita",                                  empty, 70    },
  83.     { "Good morning good morning",                  empty, 71    },
  84.     { "Sgt. pepper's lonely hearts club band (reprise)",  empty,  72 },
  85.     { "A day in the life",                          empty, 73     },
  86.     { FRAME_END },                                           
  87.     { FRAME_END }
  88. };
  89.  
  90. void main()
  91. {
  92.     sed_type frame;
  93.  
  94.     /* Initialize the display */
  95.     disp_Init(def_ModeText, NULL);
  96.  
  97.     frame = frame_Open(test_frame, bd_1, '\x70', '\x07', '\x70');
  98.     frame_Repaint(frame);
  99.  
  100.     /* get a keystroke */
  101.     kb_Read();
  102.  
  103.     frame_Go(frame, (char) ' ', NULL);
  104.     frame_Close(frame);
  105.  
  106.     /* Close down the display interface */
  107.     disp_Close();
  108. }
  109.  
  110. int empty(sdata, idata)
  111.     VOID *sdata;
  112.     int idata;
  113. /*
  114.     A user supplied function...
  115. */
  116. {
  117.     char msg[80];
  118.  
  119.     sprintf(msg, "This is message number %d\n", idata);
  120.  
  121.     pop_Prompt(msg, -1, -1, -1, -1, '\x70', bd_2);
  122.  
  123.     /* return 0 to return to menuing system */
  124.     /* return positive value to exit menuing system */
  125.  
  126.     return(0);
  127. }
  128.  
  129.  
  130.