home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / FACETV.ZIP / TEXTMODE.CPP < prev    next >
C/C++ Source or Header  |  1994-01-04  |  1KB  |  54 lines

  1. /************************************************************************
  2. **
  3. ** @(#)textmode.cpp    04/01/93    Chris Ahlstrom
  4. **
  5. **  ------------------------
  6. **  73340.26!compuserve.com
  7. **  ------------------------
  8. **
  9. **    Implements simple control of the text mode of the DOS screen.
  10. ** Allows the programmer to select the modes allowed by the Borland
  11. ** C function textmode().
  12. **
  13. *************************************************************************/
  14.  
  15. #define TEXTMODE_cpp
  16.  
  17. #include "textmode.h"
  18.  
  19.  
  20. /************************************************************************
  21. ** TextMode::TextMode
  22. *************************************************************************/
  23.  
  24. TextMode::TextMode
  25. (
  26.     int startmode            // initial text mode
  27. )
  28. {
  29.     textMode = startmode;        // the mode to use next
  30.     chngMode = 0;            // cause the mode to be changed
  31.     textmode(startmode);
  32. }
  33.  
  34.  
  35. /************************************************************************
  36. ** TextMode::changeMode
  37. **
  38. **    Checks the chngMode field; if non-zero, the text mode is
  39. ** changed to textMode, and chngMode is zeroed.
  40. **
  41. **    The caller must redraw() itself, if necessary.
  42. **
  43. *************************************************************************/
  44.  
  45. void
  46. TextMode::changeMode ()            // changing of the text mode
  47. {
  48.     if (chngMode)
  49.     {
  50.     chngMode = 0;
  51.     textmode(textMode);
  52.     }
  53. }
  54.