screen_demo.pp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. program screen_demo;
  2. {---------------------------------------------------------------------------
  3. CncWare
  4. (c) Copyright 2000
  5. ---------------------------------------------------------------------------
  6. Filename..: screen_demo.pp
  7. Programmer: Ken J. Wright
  8. Date......: 08/24/2000
  9. Purpose - Demonstrate Linux screen saving/restoring with oCrt.
  10. -------------------------------<< REVISIONS >>--------------------------------
  11. Ver | Date | Prog| Description
  12. -------+----------+-----+----------------------------------------------------
  13. 1.00 | 08/24/00 | kjw | Initial Release.
  14. ------------------------------------------------------------------------------
  15. }
  16. uses ocrt;
  17. var
  18. i,j : integer;
  19. pb : pnScreenBuf;
  20. begin
  21. For i := 1 to 24 Do Begin
  22. TextColor(i);
  23. For j := 1 to 79 Do Write(chr(j+32));
  24. writeln;
  25. End;
  26. nGrabScreen(pb);
  27. Write('screen stored, press a key to clear');readkey;
  28. NormVideo;
  29. ClrScr;
  30. Write('press a key to restore previous screen');readkey;
  31. nPopScreen(pb);
  32. GotoXY(1,nMaxRows);
  33. Write('press a key to restore to a smaller window');readkey;
  34. ClrScr;
  35. Window(10,5,70,20);
  36. nPopScreen(pb);
  37. Window(1,1,nMaxCols,nMaxRows);
  38. GotoXY(1,nMaxRows);
  39. Write('press a key to offset stored screen');readkey;
  40. ClrScr;
  41. nPopScreen(pb,5,3);
  42. GotoXY(1,nMaxRows);
  43. Write('press a key to restore a portion of this screen in multiple ');readkey;
  44. nGrabScreen(pb,5,3,8,10);
  45. ClrScr;
  46. For i := 0 to 7 Do For j := 0 to 1 Do
  47. nPopScreen(pb,i*10+1,j*12+1);
  48. GotoXY(1,nMaxRows);
  49. { make sure to clean up! }
  50. nReleaseScreen(pb);
  51. end.