home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / c / cwl30 / cwl3demo / cwlfun10.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-24  |  2.4 KB  |  133 lines

  1. #include "cwldemo.h"
  2.  
  3. int ScreenDirect(POPUP_MENU_PTR p, int sel)
  4. {
  5.   CHECK_SNOW = FALSE;
  6.   SCREEN_WRITE_METHOD = DMA;
  7.  
  8.   /* Check This menu entry */
  9.   PopupCheckEntry(p,sel,TRUE);
  10.  
  11.   /* Uncheck other entries */
  12.   PopupCheckEntry(p,sel+1,FALSE);
  13.   PopupCheckEntry(p,sel+2,FALSE);
  14.   return POPUP_CONTINUE;
  15. }
  16.  
  17. int ScreenBIOS  (POPUP_MENU_PTR p, int sel)
  18. {
  19.   SCREEN_WRITE_METHOD = BIOS;
  20.  
  21.   /* Check This menu entry */
  22.   PopupCheckEntry(p,sel,TRUE);
  23.  
  24.   /* Uncheck other entries */
  25.   PopupCheckEntry(p,sel-1,FALSE);
  26.   PopupCheckEntry(p,sel+1,FALSE);
  27.   return POPUP_CONTINUE;
  28. }
  29.  
  30. int ScreenSnow  (POPUP_MENU_PTR p, int sel)
  31. {
  32.   CHECK_SNOW = TRUE;
  33.   SCREEN_WRITE_METHOD = DMA;
  34.  
  35.   /* Check This menu entry */
  36.   PopupCheckEntry(p,sel,TRUE);
  37.  
  38.   /* Uncheck other entries */
  39.   PopupCheckEntry(p,sel-1,FALSE);
  40.   PopupCheckEntry(p,sel-2,FALSE);
  41.   return POPUP_CONTINUE;
  42. }
  43.  
  44.  
  45. int Screen25 (POPUP_MENU_PTR p, int sel)
  46. {
  47.   int i;
  48.   if (change_screen_size(ScreenSize[sel - 4]))
  49.   {
  50.     for (i = 4; i <= 6; i++)
  51.     {
  52.       if (i == sel)
  53.         PopupCheckEntry(p,i,TRUE);
  54.       else
  55.         PopupCheckEntry(p,i,FALSE);
  56.     }
  57.   }
  58.   return POPUP_CONTINUE;
  59. }
  60.  
  61. int change_screen_size(int numrows)
  62. {
  63.   int b;
  64.   int retval = 0;
  65.   /* Check for VGA mode */
  66.   if (numrows == 50 && CWLscreen_rows != 50)
  67.   {
  68.     if (VGA_MODE_ON)
  69.     {
  70.       SetVideoRows(numrows,1);
  71.       retval = 1;
  72.     }
  73.   }
  74.   else
  75.   if (numrows == 43 && CWLscreen_rows != 43)
  76.   {
  77.     /* Check for EGA or MCGA mode */
  78.     if (EGA_MODE_ON || MCGA_MODE_ON)
  79.     {
  80.       SetVideoRows(numrows,1);
  81.       retval = 1;
  82.     }
  83.   }
  84.   else
  85.   {
  86.     if (CWLscreen_rows != 25)
  87.     {
  88.       SetVideoRows(25,1);
  89.       retval = 1;
  90.     }
  91.   }
  92.  
  93.   /* Adjust all global data in The C Window Library to reflect the new
  94.    * number of rows */
  95.   if (retval)
  96.   {
  97.     int mstatus = MouseOff();
  98.     AdjustScreenInfo(0);
  99.     MouseOn(mstatus);
  100.   }
  101. /*  MOUSESHOW();*/
  102.   return retval;
  103. }
  104.  
  105. int FormDialog (POPUP_MENU_PTR p, int sel)
  106. {
  107.   DialogDemo( );
  108.   POPUP_CONTINUE;
  109. }
  110.  
  111.  
  112. int EventClock (POPUP_MENU_PTR p, int sel)
  113. {
  114.   static int clock_on = 0;
  115.   if (!clock_on)
  116.   {
  117.     clock_on = 1;
  118.     DoClock( );
  119.     clock_on = 0;
  120.     return POPUP_CONTINUE;
  121.   }
  122.   else
  123.     return POPUP_CONTINUE;
  124. }
  125.  
  126.  
  127. int ListFunctions (BAR_MENU_PTR b, int sel)
  128. {
  129.   WindowCenter(POPUP_WINDOW(funclist), VERTCENTER | HORIZCENTER);
  130.   PopupSelectMenu(funclist,1,0);
  131.   return PULLDOWN_CONTINUE;
  132. }
  133.