⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coolcontrolbar.h

📁 一个完整的VC对数据库操作的实例
💻 H
字号:
/*########################################################################
	Filename: 	CoolControlbar.h
	----------------------------------------------------
	Remarks:	...
	----------------------------------------------------
	Author:		成真
	Email:		anyou@sina.com
				anyou@msn.com
	Created:	7/3/2003 21:52
  ########################################################################*/
#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)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -