home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0000 - 0009 / ibm0000-0009 / ibm0003.tar / ibm0003 / C_DISK5.ZIP / MICROCAD / LINE.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-26  |  636 b   |  27 lines

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