home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / IDIOMS.ZIP / 10-2.C < prev    next >
C/C++ Source or Header  |  1991-12-04  |  777b  |  23 lines

  1. /* Copyright (c) 1992 by AT&T Bell Laboratories. */
  2. /* Advanced C++ Programming Styles and Idioms */
  3. /* James O. Coplien */
  4. /* All rights reserved. */
  5.  
  6. class EditWindow {
  7. public:
  8.     void addch(char x)       { window->addch(x); }
  9.     void addstr(string x)    { window->addstr(x); }
  10.     void clear()             { window->clear(); }
  11.     . . . .
  12.     EditWindow()             { if (\fIthis_is_an_X_environment\f5) {
  13.                                    window = new XWindow;
  14.                                    . . . . 
  15.                                } else {
  16.                                    window = new CursesWindow;
  17.                                    . . . .
  18.                              } }
  19. private:
  20.     Window *window;
  21.     short topLine, bottomLine;
  22. };
  23.