Sizecbar.h
上传用户:libwxy
上传日期:2007-01-02
资源大小:200k
文件大小:3k
源码类别:

工具条

开发平台:

Visual C++

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