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

📄 mycoolmenu.h

📁 用c++ 开发的中国象棋
💻 H
字号:
// MyCoolMenu.h: interface for the CMyCoolMenu class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MYCOOLMENU_H__061B4615_4569_4278_9F86_6DFF6FCEA45F__INCLUDED_)
#define AFX_MYCOOLMENU_H__061B4615_4569_4278_9F86_6DFF6FCEA45F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/***********************************************************
//功能:完成对菜单的重画,(图标,文本,背景等)
//文件名:mycoolMenu.h
*************************************************************/
#ifndef Public_Area
#define Public_Area 20 //最左边灰色区域宽度
#endif
class CMenuItemContext//保存菜单的所有有关信息
{
public:
	int     nMenuID; 
	//-2:顶层菜单条 //-1:弹出菜单
	//0:分隔条      //>0:一般的菜单
	UINT    U_icon;
	CString strText;//menu text 
	
};
class CMyCoolMenu : public CMenu  
{
public:
	CMyCoolMenu();
	virtual ~CMyCoolMenu();
public:
	//property
	CUIntArray m_menuIDs;       // store the menu ids
	CImageList   m_ImageList;   //store the menu icons
public:
	void show();
	//method
	int			GetImageFromToolBar(UINT uToolBarID, CSize sz, CImageList *pImageList,  CUIntArray *uIDArray);
	int			GetIconIndexByID(UINT uID);
	BOOL		ChangeMenuStyle(HMENU hMenu, BOOL bTop);
	BOOL		AttachMenu(HMENU hMenu,UINT uToolBarID,CSize sz);
	UINT		AddToolBar(UINT uToolBarID, CSize sz);
	void		DrawBestRect(CDC *pDC, CRect rect, COLORREF cr1,COLORREF cr2, BOOL bHor);
	void		DrawTop(CDC *pDC,CRect rect,BOOL bSelected);
	void		DrawBGColor(CDC* pDC, CRect rect, BOOL bSelected);
	void		DrawIcon(CDC* pDC, CRect rect, UINT uIndex, BOOL IsEnabled);
	void		DrawText(CDC* pDC, CRect rect, CString sText);
	void		DrawGray(CDC* pDC, CRect rect, CString sText);
	virtual		void DrawItem(LPDRAWITEMSTRUCT lpDIS);
	virtual		void MeasureItem(LPMEASUREITEMSTRUCT lpMIS);
};
//that all,this is my coolmenus head file!不要见笑呀!:)
#endif // !defined(AFX_MYCOOLMENU_H__061B4615_4569_4278_9F86_6DFF6FCEA45F__INCLUDED_)

⌨️ 快捷键说明

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