home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / BOCOLE.PAK / BHATCH.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  2.1 KB  |  73 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectComponents
  3. // Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
  4. //
  5. // $Revision:   2.6  $
  6. //
  7. // An implementation of the hatched border around inplace active windows.
  8. //----------------------------------------------------------------------------
  9. #ifndef _BHATCH_H
  10. #define _BHATCH_H
  11.  
  12. #include "BOleSite.h"
  13.  
  14. #ifndef MOVEWIN_H
  15. #include "movewin.h"
  16. #endif
  17.  
  18. #define CLIPPED                            0x0001
  19. #define CLIPPED_LEFT                 0x0002
  20. #define CLIPPED_TOP            0x0004
  21. #define CLIPPED_TOPLEFT        CLIPPED_LEFT|CLIPPED_TOP
  22.  
  23. void SetRectExt (RECT FAR *,UINT,UINT,UINT);
  24.  
  25. class BOleHatchWindow {
  26.  
  27. public:
  28.  
  29.     BOleHatchWindow (HWND,HINSTANCE,BOleSite*);
  30.     ~BOleHatchWindow();
  31.  
  32.     static                     Register (HINSTANCE hInst); // register window
  33.     static void         InitWidth ();
  34.  
  35.     // window messages related member functions
  36.     LRESULT                 wmCreate (LPCREATESTRUCT);
  37.     LRESULT                 wmPaint ();
  38.     UINT                         wmNCHitTest (LPPOINT);
  39.     LRESULT                 wmSetCursor (HWND, UINT, UINT);
  40.     UINT                         wmMouseActivate (HWND, UINT, UINT);
  41.     LRESULT                 wmNCLButtonDown (UINT, LPPOINT);
  42.     LRESULT                 wmMouseMove (UINT, LPPOINT);
  43.     LRESULT                 wmLButtonUp (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.     GrayGhostRect*    GrayFrame; // gray frame showing window movement
  66.  
  67.     LPOLEINPLACESITE    pSite;
  68.     BOleSite *            pBack;
  69.  
  70. };
  71.  
  72. #endif
  73.