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

  1. //
  2. //**************************************************************************
  3. // 
  4. // BHatch.cpp -- An implementation of the hatched border around inplace
  5. //               active windows.
  6. //
  7. // Copyright (c) 1993,94 by Borland International, Inc. All rights reserved
  8. //
  9. //**************************************************************************
  10.  
  11. #ifndef HATCH_H
  12. #define HATCH_H
  13.  
  14. #include "BOleSite.h"
  15.  
  16. #define CLIPPED                0x0001
  17. #define CLIPPED_LEFT         0x0002
  18. #define CLIPPED_TOP        0x0004
  19. #define CLIPPED_TOPLEFT    CLIPPED_LEFT|CLIPPED_TOP
  20.  
  21. void SetRectExt (RECT FAR *,UINT,UINT,UINT);
  22.  
  23. class BOleHatchWindow {
  24.  
  25. public:
  26.  
  27.     BOleHatchWindow (HWND,HINSTANCE,BOleSite*);
  28.     ~BOleHatchWindow();
  29.  
  30.     static                     Register (HINSTANCE hInst); // register window
  31.     static void             InitWidth ();
  32.  
  33.     // window messages related member functions
  34. #ifdef ANSI
  35.     LRESULT                     wmCreate (LPCREATESTRUCTA);
  36. #else
  37.     LRESULT                     wmCreate (LPCREATESTRUCT);
  38. #endif
  39.     LRESULT                     wmPaint ();
  40.     UINT                         wmNCHitTest (LPPOINT);
  41.     LRESULT                     wmSetCursor (HWND, UINT, UINT);
  42.     UINT                         wmMouseActivate (HWND, UINT, UINT);
  43.     LRESULT                     wmNCLButtonDown (UINT, LPPOINT);
  44.     LRESULT                     wmGetMinMaxInfo (MINMAXINFO*);
  45.     LRESULT                     wmWindowPosChanging (LPWINDOWPOS);
  46.  
  47.     void                         Show (BOOL, LPOLEINPLACESITE = NULL);
  48.     void                         SetSize (LPRECT,LPRECT,LPPOINT);
  49.     void                         NegotiateSize (WINDOWPOS*);
  50.     UINT                         GetWidth ();
  51.  
  52.     operator                 HWND () {return hWndHatch;}
  53.  
  54. protected:
  55.  
  56.     static UINT             hatchWidth; // hatch border size
  57.  
  58.     HWND                         hWndHatch; // hatch window handle
  59.     RECT                         hatchRect; // keep server window rectangle in client coordinates
  60.  
  61.     int                         nClippedFlag; // clipped status flag
  62.     RECT                         MoveRect; // temp rect used only inside WM_WINDOWPOSCHANGING (orrible!)
  63.     BOOL                         fInMouseDown; // used to signal when mouse left button is kept down
  64.  
  65.     LPOLEINPLACESITE         pSite;
  66.     BOleSite *                pBack;
  67.  
  68. };
  69.  
  70. #endif
  71.  
  72.