home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool_main.zip / ool / include / xrect.h < prev    next >
Text File  |  1998-04-05  |  2KB  |  54 lines

  1. #ifndef __OOL_XRECT_H__
  2. #define __OOL_XRECT_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------------- r 1.0 */
  6. /*===========================================================================*/
  7. /*                              class: XRect                                 */
  8. /*                       derived from: XObject                               */
  9. /*                        last update: 3/97                                  */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13.  
  14. #include "xpoint.h"
  15. #include "XSize.h"
  16.  
  17. class _export_ XRect: public XPoint
  18. {
  19.       friend class XControl;
  20.       friend class XFrameWindow;
  21.       friend class XWindow;
  22.       friend class XText;
  23.    private:
  24.       LONG cx, cy;
  25.    public:
  26.       XRect( const long width, const long height)
  27.             { x=y=0; cx = width; cy = height;}
  28.       XRect( const long x1 = 0, const long y1 = 0, const long x_2 = 0, const long y_2 = 0):XPoint(x1,y1)
  29.             { cx=x_2; cy=y_2;}
  30.       virtual ~XRect() {;}
  31.       long GetHeight( void ) const { return cy;}
  32.       long GetWidth( void ) const { return cx;}
  33.       void SetWidth( const LONG w ) { cx = w;}
  34.       void SetHeight( const LONG h)  { cy = h;}
  35.       XRect operator =(const XRect& r)
  36.          {
  37.             x=r.x;
  38.             y=r.y;
  39.             cx=r.cx;
  40.             cy=r.cy;
  41.             return *this;
  42.          }
  43.       XRect operator =(const XSize& s)
  44.          {
  45.             cx=s.GetWidth();
  46.             cy=s.GetHeight();
  47.             return *this;
  48.          }
  49. };
  50.  
  51.  
  52.  
  53. #endif
  54.