home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / DEMOT.ZIP / Src / Include / Sizecbar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-23  |  2.9 KB  |  96 lines

  1. // sizecbar.h : header file
  2. //
  3. // This class is from the article "Resizable Docking Window 2"
  4. // written by Cristi Posea.
  5. // http://www.codeguru.com/docking/docking_window.shtml
  6. //////////////////////////////////////////////////////////////////////
  7.  
  8. #if !defined(SIZECBAR_H_INCLUDED)
  9. #define SIZECBAR_H_INCLUDED
  10.  
  11. #if _MSC_VER >= 1000
  12. #pragma once
  13. #endif // _MSC_VER >= 1000
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CSizingControlBar control bar
  17.  
  18. class CLASS_EXPORT CSizingControlBar : public CControlBar
  19. {
  20.     DECLARE_DYNAMIC(CSizingControlBar)
  21. // Construction / destruction
  22. public:
  23.     CSizingControlBar();
  24.  
  25. // Attributes
  26. public:
  27.     CSize   m_sizeHorz;
  28.     CSize   m_sizeVert;
  29.     CSize   m_sizeFloat;
  30.     BOOL IsHorzDocked() const;
  31.     BOOL IsVertDocked() const;
  32.  
  33. // Operations
  34. public:
  35.  
  36. // Overridables
  37.     virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
  38.  
  39. // Overrides
  40. public:
  41.     // ClassWizard generated virtual function overrides
  42.     //{{AFX_VIRTUAL(CSizingControlBar)
  43.     public:
  44.     virtual BOOL Create(CWnd* pParentWnd, CSize sizeDefault, UINT nID, LPCTSTR lpszWindowName = NULL, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP);
  45.     virtual CSize CalcFixedLayout( BOOL bStretch, BOOL bHorz );
  46.     virtual CSize CalcDynamicLayout( int nLength, DWORD dwMode );
  47.     //}}AFX_VIRTUAL
  48.  
  49. // Implementation
  50. public:
  51.     void ToggleDocking();
  52.     virtual ~CSizingControlBar();
  53.     void StartTracking();
  54.     void StopTracking(BOOL bAccept);
  55.     void OnInvertTracker(const CRect& rect);
  56.     
  57.     // implementation helpers
  58.     CPoint& ClientToWnd(CPoint& point);
  59.  
  60. protected:
  61.     CSize       m_sizeMin;
  62.     CRect       m_rectBorder;
  63.     CRect       m_rectTracker;
  64.     UINT        m_nDockBarID;
  65.     CPoint      m_ptOld;
  66.     BOOL        m_bTracking;
  67.     BOOL        m_bInRecalcNC;
  68.     int         m_cxEdge;
  69.  
  70. // Generated message map functions
  71. protected:
  72.     //{{AFX_MSG(CSizingControlBar)
  73.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  74.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  75.     afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  76.     afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
  77.     afx_msg void OnNcPaint();
  78.     afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
  79.     afx_msg UINT OnNcHitTest(CPoint point);
  80.     afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
  81.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  82.     afx_msg void OnCaptureChanged(CWnd *pWnd);
  83.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  84.     //}}AFX_MSG
  85.  
  86.     DECLARE_MESSAGE_MAP()
  87. };
  88.  
  89. /////////////////////////////////////////////////////////////////////////////
  90.  
  91. //{{AFX_INSERT_LOCATION}}
  92. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  93.  
  94. #endif // !defined(SIZECBAR_H_INCLUDED)
  95.  
  96.