CoolControlBar.h
上传用户:sunh8215
上传日期:2010-02-13
资源大小:1616k
文件大小:4k
- /*########################################################################
- Filename: CoolControlbar.h
- ----------------------------------------------------
- Remarks: ...
- ----------------------------------------------------
- ########################################################################*/
- #if !defined(_ANYOU_COOLCONTROLBAR_H)
- #define _ANYOU_COOLCONTROLBAR_H
- #if _MSC_VER > 1000
- #pragma once
- #endif
- #include <afxpriv.h> // for CDockContext
- #include <afxtempl.h> // for CArray
- #define TITLE_HEIGHT 23
- #define SIZING_WIDTH 5
- #if !defined CBRS_TITLEBAR
- #define CBRS_TITLEBAR CBRS_GRIPPER
- #endif
- /*########################################################################
- -------------------------------------------------------------
- CFriendDockBar dummy class for access to protected members
- -------------------------------------------------------------
- ########################################################################*/
- class CFriendDockBar : public CDockBar
- {
- friend class CCoolControlBar;
- };
- class CCoolControlBar;
- typedef CTypedPtrArray <CPtrArray, CCoolControlBar*> CCoolBarArray;
- /*########################################################################
- ------------------------------------------------
- class CCoolControlBar
- ------------------------------------------------
- ########################################################################*/
- class CCoolControlBar : public CControlBar
- {
- DECLARE_DYNAMIC(CCoolControlBar);
- // Construction--------------------------------------------------
- public:
- CCoolControlBar();
- virtual ~CCoolControlBar();
- BOOL Create(CWnd* pParentWnd, CSize size, UINT dwStyle, UINT uID);
- // Attributes----------------------------------------------------
- protected:
- CSize m_szHorz;
- CSize m_szVert;
- CSize m_szFloat;
- CSize m_szDefault;
-
- int m_bTrackType;
- BOOL m_bParentSizing;
- BOOL m_bTracking;
- CPoint m_oldPoint;
- CRect m_rcCloseButton;
- DWORD m_dwButtonState;
- static CCoolBarArray m_arrBars;
- // Operations----------------------------------------------------
- public:
- BOOL IsHorizontal();
- int FindCoolBar(CControlBar* pBar);
- static void LoadStates(LPCTSTR lpszProfileName);
- static void SaveStates(LPCTSTR lpszProfileName);
- // Overrides-----------------------------------------------------
- //{{AFX_VIRTUAL(CCoolControlBar)
- public:
- virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
- virtual CSize CalcDynamicLayout(int nLength, DWORD dwMode);
- virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
- virtual BOOL DestroyWindow();
- //}}AFX_VIRTUAL
- // Implementation------------------------------------------------
- protected:
- int GetLastBar();
- int GetFirstBar();
- void GetCoolBars(CCoolBarArray &arrCoolBars);
- BOOL GetTrackRect(CRect& rcTrack, int nEdge);
- void UpdateWndSize(CPoint point);
- BOOL AutoSize(int nLengthAvail, BOOL bHorz);
- void AutoAlign();
- virtual void LoadState(LPCTSTR lpszProfileName);
- virtual void SaveState(LPCTSTR lpszProfileName);
- virtual void DrawCloseButton(CDC* pDC, DWORD dwState);
- virtual void DrawTitleBar(CDC* pDC, const CRect& rect, BOOL bHorz);
- // Generated message map functions-------------------------------
- protected:
- //{{AFX_MSG(CCoolControlBar)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
- afx_msg void OnNcPaint();
- afx_msg void OnPaint();
- afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
- afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
- afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg UINT OnNcHitTest(CPoint point);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- //{{AFX_INSERT_LOCATION}}
- #endif // !defined(_ANYOU_COOLCONTROLBAR_H)