home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-3.ZIP / EXAMPLES.ZIP / VPOINT.H < prev    next >
C/C++ Source or Header  |  1992-02-18  |  1KB  |  35 lines

  1. // Borland C++ - (C) Copyright 1991 by Borland International
  2.  
  3. /* vpoint.h--Example from Getting Started */
  4.  
  5. // version of point.h with virtual functions for use with VCIRCLE
  6. // vpoint.h contains two classes:
  7. // class Location describes screen locations in X and Y coordinates
  8. // class Point describes whether a point is hidden or visible
  9.  
  10. enum Boolean {false, true};
  11.  
  12. class Location {
  13. protected:          // allows derived class to access private data
  14.    int X;
  15.    int Y;
  16.  
  17. public:             // these functions can be accessed from outside
  18.    Location(int InitX, int InitY);
  19.    int GetX();
  20.    int GetY();
  21. };
  22. class Point : public Location {      // derived from class Location
  23. // public derivation means that X and Y are protected within Point
  24.  
  25.    protected:
  26.    Boolean Visible;  // classes derived from Point will need access    
  27.  
  28. public:
  29.    Point(int InitX, int InitY);      // constructor
  30.    virtual void Show();
  31.    virtual void Hide();
  32.    Boolean IsVisible();
  33.    void MoveTo(int NewX, int NewY);
  34. };
  35.