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

📄 popmenu.h

📁 brew一些源码
💻 H
字号:
/*===========================================================================
渐变效果弹出式菜单
FILE: PopMenu.h
===========================================================================*/
#include "HeaderData.h"
#ifndef		_BBCBAO_POPMENU_2006_3_20
#define		_BBCBAO_POPMENU_2006_3_20
//============================弹出式图片菜单================================//
//////////////////////////////////////////////////////////////////////////
//
#define	 POPMENU_SCROLL_WIDTH	4					//弹出菜单滚动条
#define	 POPMENU_ITEMMAX_CHAR	8					//么个菜单项最多的字符
#define	 POPMENU_ITEMBET		24					//菜单间距离
#define  POPMENU_ITEM_COUNT		5					//显示的菜单数
#define	 POPMENU_ITEM_WIDTH		80					//菜单宽度
#define	 POPMENU_ITEM_XPIC		2					//菜单项X偏离
#define  POPMENU_ITEM_YPIC		3					//菜单项Y偏离
#define  POPMENU_ACTION								//动画效果
//////////////////////////////////////////////////////////////////////////
//不可变

#define	 POPMENU_FIND_UP		0					//FindNext专用
#define	 POPMENU_FIND_DOWN		1					//FindNext专用

#define	 MY_COMMAND				EVT_USER+15			//菜单命令参数宏
#define  POPMENU_FREE(p)		CPopMenu_Release((CPopMenu **)&(p))

typedef		struct _PopMenu		CPopMenu;//菜单结构
typedef		struct _PopItem		CPopItem;//菜单项结构
struct _PopMenu
{
	//////////////////////////////////////////////////////////////////////////
	//新建菜单需要初始化的变量
	AEEApplet*		m_pThis;			//AEEapplent对象
	AEERect*		m_pRect;			//当菜单弹出时背景黯淡的范围
	IBitmap*		m_pDevBit;			//设备位图引用
	boolean			m_bActive;			//是否可用也决定是否出现菜单
	//////////////////////////////////////////////////////////////////////////
	//菜单项目信息
#ifdef POPMENU_ACTION
	IBitmap*		m_pBiMatBack;
	byte			t_nStep;
#endif
	IBitmap*		m_pBitMap;			//暂时的菜单背景位图,是否有菜单项目的标志
	CPopItem*		m_pItems;			//菜单子项

	AEERect			m_tagMen;			//菜单范围
	uint16			m_nFrist;			//菜单第一项索引
	uint16			m_nLastd;			//菜单最后一项索引
	uint16			m_nNowIx;			//菜单当前索引项
	uint16			m_nIndex;			//当前菜单当前项索引
	uint16			m_nPaeIx;			//当前页索引
	uint16			m_nNowCo;			//当前可见菜单数目
	uint16			m_nPgSiz;			//当前叶数

	uint16			m_nNowCm;			//当前引用项

	uint16			m_nItemCount;		//菜单项目总数
	int				m_x;				//位置
	int				m_y;				//位置
	//////////////////////////////////////////////////////////////////////////
	//全局私有变量	
};
struct _PopItem
{
	AECHAR			m_szAeName[POPMENU_ITEMMAX_CHAR];	//菜单项名
	boolean         m_bAble;						//是否显示此项
	uint16			m_nID;							//命令ID
};

//============================函数定义================================//
CPopMenu*		CPopMenu_New(AEEApplet* pThis , AEERect* pRect);
boolean			CPopMenu_SetItems(CPopMenu* pThis ,
								 const char* pResFile ,	//图象资源 
								 uint16* pnIDItem ,		//图像资源数组
								 uint16 nItems);		//菜单项目个数
void			CPopMenu_SetPoint(CPopMenu* pThis , int nx , int ny);
boolean			CPopMenu_Init(CPopMenu* pThis);
void			CPopMenu_SetItemAble(CPopMenu* pThis , uint16 nIndex , boolean bFlag);
void			CPopMenu_ReDraw(CPopMenu* pThis);
void			CPopMenu_Draw(CPopMenu* pThis);
void			CPopMenu_SetActive(CPopMenu* pThis , boolean bFlag);
boolean			CPopMenu_IsActive(CPopMenu* pThis);
void			CPopMenu_ClearItems(CPopMenu* pThis);
void			CPopMenu_Release(CPopMenu** ppThis);
boolean			CPopMenu_HandleEvent(CPopMenu* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam);
//////////////////////////////////////////////////////////////////////////
//私有函数
#ifdef POPMENU_ACTION
void			DrawAction(CPopMenu* pThis);
#endif
void			DrawClear(CPopMenu* pThis);
//========================================DEND MENU========================================//
#endif

⌨️ 快捷键说明

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