Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.8 KiB

  1. /*--------------------------------------------------------------------------*
  2. *
  3. * Microsoft Windows
  4. * Copyright (C) Microsoft Corporation, 1992 - 1999
  5. *
  6. * File: vwtrack.h
  7. *
  8. * Contents: Interface file for CViewTracker
  9. *
  10. * History: 01-May-98 JeffRo Created
  11. *
  12. *--------------------------------------------------------------------------*/
  13. #ifndef VWTRACK_H
  14. #define VWTRACK_H
  15. #pragma once
  16. #include "amcview.h"
  17. class CFocusSubclasser;
  18. class CFrameSubclasser;
  19. class CViewSubclasser;
  20. struct TRACKER_INFO;
  21. typedef void (CALLBACK *TRACKER_CALLBACK)(TRACKER_INFO* pTrackerInfo, bool bAccept, bool bSyncLayout);
  22. /*
  23. * This structure is copied in the CViewTracker using its (default) copy
  24. * constructor. If you add any members for which member-wise copy is not
  25. * appropriate, you *must* define a copy constructor for this structure.
  26. */
  27. typedef struct TRACKER_INFO
  28. {
  29. CView* pView; // View to manage
  30. CRect rectArea; // Total area available
  31. CRect rectTracker; // Current tracker position
  32. CRect rectBounds; // Tracker movement bounds
  33. BOOL bAllowLeftHide; // Can left pane be hidden
  34. BOOL bAllowRightHide; // Can right pane be hidden
  35. LONG_PTR lUserData; // User data
  36. TRACKER_CALLBACK pCallback; // Tracking completion callback
  37. } TRACKER_INFO;
  38. class CHalftoneClientDC : public CClientDC
  39. {
  40. public:
  41. CHalftoneClientDC (CWnd* pwnd)
  42. : CClientDC (pwnd), m_hBrush(NULL)
  43. {
  44. CBrush *pBrush = SelectObject (GetHalftoneBrush ());
  45. if (pBrush != NULL)
  46. m_hBrush = *pBrush;
  47. }
  48. ~CHalftoneClientDC ()
  49. {
  50. if (m_hBrush != NULL)
  51. SelectObject ( CBrush::FromHandle(m_hBrush) );
  52. }
  53. private:
  54. HBRUSH m_hBrush;
  55. };
  56. class CViewTracker : public CObject
  57. {
  58. DECLARE_DYNAMIC (CViewTracker)
  59. // private ctor, use StartTracking to create one
  60. CViewTracker (TRACKER_INFO& TrackerInfo);
  61. // private dtor
  62. ~CViewTracker() {};
  63. public:
  64. static bool StartTracking (TRACKER_INFO* pTrackerInfo);
  65. void StopTracking (BOOL fAcceptNewPosition);
  66. void Track(CPoint pt);
  67. private:
  68. void DrawTracker (CRect& rect) const;
  69. CWnd* PrepTrackedWindow (CWnd* pwnd);
  70. void UnprepTrackedWindow (CWnd* pwnd);
  71. private:
  72. /*
  73. * m_fFullWindowDrag must be first, so it will be initialized first;
  74. * other member initializers will use m_fFullWindowDrag's setting
  75. */
  76. const bool m_fFullWindowDrag;
  77. bool m_fRestoreClipChildrenStyle;
  78. TRACKER_INFO m_Info;
  79. CHalftoneClientDC mutable m_dc;
  80. CFocusSubclasser * m_pFocusSubclasser;
  81. CViewSubclasser * m_pViewSubclasser;
  82. CFrameSubclasser * m_pFrameSubclasser;
  83. const LONG m_lOriginalTrackerLeft;
  84. }; /* class CViewTracker */
  85. #endif /* VWTRACK_H */