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

  1. //----------------------------------------------------------------------------
  2. // ObjectComponents
  3. // Copyright (c) 1991, 1996 by Borland International, All Rights Reserved
  4. //
  5. // $Revision:   2.3  $
  6. //
  7. // MoveWin.cpp -- An implementation of a floating border when
  8. //                                moving/resizing a window
  9. //----------------------------------------------------------------------------
  10. #ifndef MOVEWIN_H
  11. #define MOVEWIN_H
  12.  
  13. #include <windows.h>
  14.  
  15. #define STANDARD_THICKNESS         3
  16. // minimum size is three times standard thickness
  17. #define MINIMUM_SIZE                    21
  18.  
  19. //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
  20. ////\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
  21. //                                                                          
  22. // GrayGhostRect
  23. //
  24. //    Purpose:
  25. //        simulate non full drag operation even when full drag is on.
  26. //        Draw a resizable and movable rectangle on the screen accordingly
  27. //        to the window to be moved
  28. //
  29. class GrayGhostRect {
  30.  
  31.     public:
  32.  
  33.         GrayGhostRect (RECT&, UINT, UINT = STANDARD_THICKNESS);
  34.         ~GrayGhostRect ();
  35.  
  36.         HBRUSH FramePattern (const WORD*, int); // change the frame pattern
  37.         void MoveFrame (POINT&, BOOL);
  38.  
  39.         void SetStartMove (const POINT&);
  40.         void UpperCorner (POINT&) const;
  41.         void Size (POINT&) const;
  42.  
  43.     private:
  44.  
  45.         void XORFrame (HDC);
  46.         void UpdateRect (HDC, RECT&, RECT&);
  47.  
  48.     private:
  49.  
  50.         // frame related data
  51.         RECT GrayRect; // store rect dimension each MOUSEMOVE
  52.         UINT wThickness; // frame line thickness
  53.         POINT StartMove; // mouse initial point when moving (no size)
  54.  
  55.         // stuff used to paint the frame. Initialized at construction
  56.         // time and relesed when the destructor is called
  57.         WORD wGrayBmp[8]; // bitmap pattern
  58.         HBITMAP hBmp; // bitmap handle
  59.         HBRUSH  hBrush; // brush handle
  60.  
  61.         UINT wHitCode; // code describing operation type (move, size,..)
  62. };
  63.  
  64. #endif
  65.