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 / POINT.H < prev    next >
C/C++ Source or Header  |  1992-02-18  |  949b  |  34 lines

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