home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / sclib31 / examples / scrollwn.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-31  |  1.8 KB  |  56 lines

  1. #include <scl1.h>
  2. #include <scl1clor.h>
  3. #include <scl1keys.h>
  4.  
  5. char *Info[]={
  6. " BigCursor         - Changes the cursor size to a block.",
  7. " Center            - Centers a string horizontally.",
  8. " Cls               - Clears a screen area.",
  9. " CursorOff         - Turns the cursor off.",
  10. " CursorOn          - Turns the cursor on (cursor visible).",
  11. " DrawItemList      - Draws an item list to the screen.",
  12. " GetCurLine        - Returns the current cursor row position.",
  13. " GetCurSize        - Returns the current cursor size.",
  14. " ScrollUp          - Scrolls up a screen area.",
  15. " SetCurPos         - Sets the cursor position.",
  16. " SetCurSize        - Sets the cursor size.",
  17. " SetVideoMode      - Sets the video mode.",
  18. " SetVideoPage      - Sets the video page.",
  19. " SetVideo25        - Sets the display mode to 25 lines.",
  20. " Shadow            - Draws a shadow effect to a screen area.",
  21. " Video             - Detects if the video adapter in use is",
  22. "                     either Monochrome, CGA or EGA.",
  23. " WriteCharBlock    - Writes a block of characters.",
  24. 0};
  25.  
  26. unsigned int ExitK[]={ESC,ENTER,0};
  27.  
  28. main()
  29. {
  30. int i;
  31. SWData sw;  /* Scroll Window structure */
  32.  
  33. CursorOff();                 /* Turn off cursor */
  34. InitMouse(IM_SHOW);
  35. Cls(WHITE_BLACK,CLS_ALL);
  36. ScrollWindow(SW_INIT,&sw);   /* Initialize Scroll Window */
  37.  
  38. sw.UpperRow=4;               /* Change default window size */
  39. sw.LeftCol=4;
  40. sw.LowerRow=18;
  41. sw.RightCol=75;
  42. sw.ExitKeys=ExitK;
  43. sw.Array=Info;
  44. sw.Title="[ Information ]";
  45.  
  46. ScrollWindow(SW_DRAW,&sw);   /* Now, draw the Scroll Window */
  47. do                           /* Browse window until an exit key is pressed */
  48.     {
  49.     i=ScrollWindow(SW_ACTIVE,&sw);
  50.     if(i==SW_ILLEGAL_KEY)
  51.         SW_MoveTo(&sw);
  52.     }while(i!=SW_EXIT_KEY && i!=SW_MOUSE_EVENT);
  53. CursorOn();
  54. Cls(7,CLS_ALL);
  55. }
  56.