home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / OWLINC.PAK / UIHANDLE.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  2KB  |  58 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // (C) Copyright 1994 by Borland International, All Rights Reserved
  4. //
  5. //----------------------------------------------------------------------------
  6. #if !defined(OWL_UIHANDLE_H)
  7. #define OWL_UIHANDLE_H
  8.  
  9. #if !defined(OWL_OWLDEFS_H)
  10. # include <owl/owldefs.h>
  11. #endif
  12. #if !defined(OSL_GEOMETRY_H)
  13. # include <osl/geometry.h>
  14. #endif
  15. class _OWLCLASS TDC;
  16.  
  17. class _OWLCLASS TUIHandle {
  18.   public:
  19.     enum TWhere {
  20.       // Nine handle positions 
  21.       TopLeft=0, TopCenter=1, TopRight=2,
  22.       MidLeft=3, MidCenter=4, MidRight=5,
  23.       BottomLeft=6, BottomCenter=9, BottomRight=8,
  24.       Outside=-1,  // Hit completely outside the object
  25.       Inside=-2    // Hit inside object, not on handles, & InsideSpecial is set
  26.     };
  27.     enum TStyle {
  28.       HandlesIn = 0,        // One of these 2 base styles
  29.       HandlesOut = 1,       //
  30.       Framed = 2,           // Frame rect is drawn solid
  31.       DashFramed = 4,       //  or frame rect is drawn dashed or none
  32.       Grapples = 8,         // Eight grapple boxes are drawn
  33.       HatchBorder = 16,     // Border handle area drawn hatched
  34.       HatchRect = 32,       //  or whole rect drawn hatched or none
  35.       InsideSpecial = 64,   // Inside area hit-tested independently
  36.     };
  37.     TUIHandle(const TRect& frame,
  38.               uint style = HandlesIn|Grapples|HatchBorder,
  39.               int thickness = 5);
  40.  
  41.     void   MoveTo(int x, int y);
  42.     void   Move(int dx, int dy);
  43.     void   Size(int w, int h);
  44.     TRect  GetBoundingRect() const;
  45.  
  46.     TWhere HitTest(const TPoint& point) const;
  47.     void   Paint(TDC& dc) const;
  48.  
  49.     static uint16 GetCursorId(TWhere where);
  50.     
  51.   private:
  52.     TRect  Frame;
  53.     uint   Style;
  54.     TPoint HandleBox;
  55. };
  56.  
  57. #endif  // OWL_UIHANDLE_H
  58.