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

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