SplitterBar.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:2k
源码类别:
DirextX编程
开发平台:
Visual C++
- // CSplitterBar.h : header file
- //
- /////////////////////////////////////////////////////////////////////////////
- #ifndef __SPLITTER_BAR_H__
- #define __SPLITTER_BAR_H__
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- #define WM_SPLITTER_MOVED WM_USER+1000
- /////////////////////////////////////////////////////////////////////////////
- // CSplitterBar
- class CSplitterBar : public CWnd
- {
- DECLARE_DYNAMIC(CSplitterBar)
- enum DRAGFLAG { DRAG_ENTER=0, DRAG_EXIT=1, DRAGGING=2 };
- protected:
- CRect m_rectSplitter;
- CRect m_rectDragPrev;
- CRect m_rectDragCurt;
- BOOL m_bDragging;
- CWnd *m_pwndLeftPane; //left pane window
- CWnd *m_pwndRightPane; //right pane window
- int m_cxLeftMost; //left most, relative to parent window
- int m_cxRightMost; //right most, relative to parent window
- CRect m_rectPosition; // position, relative to parent window
- // Construction
- public:
- CSplitterBar();
- BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
- // Attributes
- public:
- BOOL IsCursorOverSplitter( const CPoint& ptCursor );
- // Operations
- public:
- void DrawDraggingBar(CPoint point,DRAGFLAG df=DRAGGING);
- void SetPanes(CWnd *pwndLeftPane,CWnd *pwndRightPane);
- void MovePanes();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CSplitterBar)
- //}}AFX_VIRTUAL
- // Implementation
- public:
- VOID SetPosition(LPCRECT lpRect);
- virtual ~CSplitterBar();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CSplitterBar)
- afx_msg void OnPaint();
- afx_msg UINT OnNcHitTest(CPoint point);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
- #endif