home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / microcrn / issue_44.arc / MICROCAD.ARC / SQUARE.CPP < prev    next >
Text File  |  1988-09-27  |  698b  |  28 lines

  1. // Figure 8 for "A Little CAD with C++"
  2. // Copyright 1988 Bruce Eckel
  3. // Permission required to distribute source
  4.  
  5. // file: square.cpp
  6. #include "square.hpp"
  7. #include <fg.h>
  8.  
  9. void square::draw() {
  10.     msm_hidecursor();
  11.     small_box [FG_X1] = x_center;
  12.     small_box [FG_X2] = x_center + 20;
  13.     small_box [FG_Y1] = y_center;
  14.     small_box [FG_Y2] = y_center + 20;
  15.     fg_drawbox (FG_WHITE, FG_MODE_SET, ~0,
  16.                 FG_LINE_SOLID,
  17.                 small_box, fg_displaybox);
  18.     msm_showcursor();
  19. }
  20.  
  21. void square::erase() {
  22.     msm_hidecursor();
  23.     fg_drawbox (FG_BLACK, FG_MODE_SET, ~0,
  24.          FG_LINE_SOLID, small_box, fg_displaybox);
  25.     msm_showcursor();
  26. }
  27.  
  28.