rttoolbar.h

来自「vc++编写的界面源代码,对C++爱好者是很发的帮助。」· C头文件 代码 · 共 49 行

H
49
字号
#pragma once


// CRTToolBar

class CRTToolBar : public CToolBar
{
	DECLARE_DYNAMIC(CRTToolBar)

public:
	CRTToolBar();
	virtual ~CRTToolBar();
	BOOL LoadToolBar (UINT nIDResource);
	BOOL InsertControl (int nIndex, CWnd& Ctrl);
	void TrackPopupMenu (int nID, CMenu* pMenu);
	static BOOL EnableSkin(BOOL IsEnable = TRUE);
protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
protected:
	static BOOL      m_IsEnableSkin;
	static CBitmap * m_ToolBarBitamp[4];
	static UINT      m_ToolBarBitmapDrawMode[4];
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
	BYTE m_bCheckVisibility;
	CSize CalcDynamicLayout (int nLength, DWORD dwMode);
	void OnButtonDropDown (NMHDR* lpnmhdr, LRESULT* plResult);
public:
	afx_msg void OnPaint();
	static BOOL SetBitmap(CBitmap* ToolBarBitmap[],UINT DrawMode[]);
};


#define DROPDOWN(item) ((WORD)-item)

#define IS_STDBTN(button)        (((button).fsStyle&(TBSTYLE_SEP|TBSTYLE_CHECKGROUP))==TBSTYLE_BUTTON)
#define IS_CHECKBTN(button)      (((button).fsStyle&(TBSTYLE_SEP|TBSTYLE_CHECKGROUP))==TBSTYLE_CHECK)
#define IS_GROUPBTN(button)      (((button).fsStyle&(TBSTYLE_SEP|TBSTYLE_CHECKGROUP))==TBSTYLE_CHECKGROUP)
#define IS_DROPDOWN(button)      (((button).fsStyle&TBSTYLE_DROPDOWN)==TBSTYLE_DROPDOWN)
#define IS_SEPARATOR(button)     (((button).fsStyle&TBSTYLE_SEP)&&((button).idCommand==0))
#define IS_CONTROL(button)       (((button).fsStyle&TBSTYLE_SEP)&&((button).idCommand!=0))
#define IS_CHECKED(button)       (((button).fsState&TBSTATE_CHECKED)==TBSTATE_CHECKED)
#define IS_ENABLED(button)       (((button).fsState&TBSTATE_ENABLED)==TBSTATE_ENABLED)
#define IS_INDETERMINATE(button) (((button).fsState&TBSTATE_INDETERMINATE)==TBSTATE_INDETERMINATE)
#define IS_PRESSED(button)       (((button).fsState&TBSTATE_ENABLED)==TBSTATE_PRESSED)
#define IS_VISIBLE(button)       (((button).fsState&TBSTATE_HIDDEN)==0)
#define IS_WRAP(button)          (((button).fsState&TBSTATE_WRAP)==TBSTATE_WRAP)

⌨️ 快捷键说明

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