home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / c / cwl30 / cwl3demo / cwlfunc8.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-05  |  1.8 KB  |  56 lines

  1. #include "cwldemo.h"
  2.  
  3. int WinVirtual(POPUP_MENU_PTR p, int sel)
  4. {
  5.   WPOINTER cw;
  6.   VWPOINTER vw;
  7.   WPOINTER wViewPort;
  8.   int i,j,k;
  9.   FILE *infile;
  10. #ifndef SHWARE
  11.   ProcessAllEvents(M_EVENT);
  12. #endif
  13.   cw = WindowInitialize(DESKTOP_WINDOW,
  14.                         BORDER,0,0,43,2,
  15.                         BLACKONCYAN,BLACKONCYAN,SINGLEBOX);
  16.   WindowWriteCenterString(cw,"You can create virtual windows...",0);
  17.   WindowCenter(cw,VERTCENTER | HORIZCENTER);
  18.   WindowDisplay(cw,1,NOEFFECT);
  19.  
  20.   vw = VirtualInitialize(NOATTRIBUTE, 100, 80, 0);
  21.   if (vw)
  22.   {
  23.     wViewPort = WindowInitialize(DESKTOP_WINDOW, BORDER, 0, 0, 50, 15,
  24.                                  0x70, 0x70, SINGLEBOX);
  25.     WindowMove(wViewPort,2,0);
  26.     WindowAssignToVirtual(wViewPort, vw, 0, 0);
  27. #ifndef SHWARE
  28.     WindowSetEventStyle(wViewPort,CWL_VSCROLL | CWL_HSCROLL | CWL_CAPTION |
  29.                         CWL_RESIZE);
  30.     WindowSetCaption(wViewPort, "This is a caption" );
  31. #endif
  32.     if (infile = read_file(vw,"CWLDEMO.C"))
  33.     {
  34.       WindowCenter(wViewPort,VERTCENTER | HORIZCENTER);
  35.       WindowDisplay(wViewPort, 2, NOEFFECT);
  36.       WindowClear(cw);
  37.       WindowResizeHeight(cw,3,ANCHORTOP);
  38.       WindowResizeWidth(cw,34,ANCHORLEFT);
  39.       WindowWriteString(cw,"You can create windows in memory",0,0);
  40.       WindowWriteString(cw,"and scroll through the contents",1,0);
  41.       WindowWriteString(cw,"using a displayed window.      ",2,0);
  42.       WindowCenter(cw, VERTCENTER | HORIZCENTER);
  43.       delay_approx(10000);
  44.       WindowPanViewport(wViewPort, DEFAULTPANKEYS);
  45.       fclose(infile);
  46.     }
  47.     VirtualClose(vw,TRUE,NOEFFECT);
  48.     WindowClose(wViewPort,NOEFFECT);
  49.   }
  50.   WindowClose(cw,NOEFFECT);
  51. #ifndef SHWARE
  52.   CWLQuitMessage( );  /* call for mouse event only */
  53. #endif
  54.   return POPUP_CONTINUE;
  55. }
  56.