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

📄 gui.h

📁 PDA程序开发PDA程序开发PDA程序开发PDA程序开发PDA程序开发PDA程序开发PDA程序开发PDA程序开发
💻 H
字号:
/*========================================================================
 *
 *  版权所有 (C) 2000-2001 吴柏建. All Rights Reserved.
 *
 *  文件:       gui.h
 *  内容:		PSDE_DEMO_PDA处理显示和消息的函数声明。
 *	作者:			吴柏建。
 *	制作日期:		2000.8.6-2001.10.6
 *	修改日期:		2001..
 *
 *========================================================================*/

#ifndef _PDAGUI_
#define _PDAGUI_

#define COLOR0  0
#define COLOR1  1
#define COLOR2  2
#define COLOR3  3
#define COLOR4  4
#define COLOR5  5
#define COLOR6  6
#define COLOR7  7
#define COLOR8  8
#define COLOR9  9
#define COLOR10 10
#define COLOR11 11
#define COLOR12 12
#define COLOR13 13
#define COLOR14 14
#define COLOR15 15

#define COLOR_WHITE    0
#define COLOR_BLACK    15
#define COLOR_LOWBACK  1
#define COLOR_BACK     2
#define COLOR_HIGHBACK 4
#define COLOR_LOWGRAY  6
#define COLOR_GRAY     8
#define COLOR_HIGHGRAY 10
#define COLOR_TRANS    0xff

/*≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
□---RECT结构定义----RECT---
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡*/
#ifndef __cplusplus
#define RECT PDARECT
#endif
typedef struct _PDARECT
{
	short left;
	short top;
	short right;
	short bottom;
}PDARECT;

/*PDAMSG::type*/
#define MSG_NULL     0
#define MSG_SECOND   1/*秒中断发生消息*/
#define MSG_KEY      2/*按键消息*/
#define MSG_CHAR     3/*键盘或软件产生的字符消息*/
#define MSG_PEN      4/*触摸屏笔触中断消息*/
#define MSG_LCD      5/*LCD坐标的笔触中断消息*/
#define MSG_INIT     6/*初始化消息*/
#define MSG_PAINT    7/*绘制窗口消息*/

//ICON消息值为80~99。
#define MSG_HOME     80/*回到主界面消息*/
#define MSG_PDA      81/*PDA*/
#define MSG_TEL      82/*电话本*/
#define MSG_NOTEPAD  83/*记事本*/
#define MSG_DRAW     84/*绘图*/
#define MSG_GAME     85/*游戏*/
#define MSG_DICT     86/*词典*/
#define MSG_REMIND   87/*提醒*/
#define MSG_CALC     88/*计算器*/
#define MSG_TIME     89/*时间*/

#define MSG_NEW      90/*新增*/
#define MSG_SAVE     91/*保存*/
#define MSG_COPY     92/*复制*/
#define MSG_PASTE    93/*粘贴*/
#define MSG_DEL      94/*删除*/
#define MSG_FIND     95/*查找*/
#define MSG_LEFT     96/*←*/
#define MSG_RIGHT    97/*→*/
#define MSG_EXIT     98/*退出*/
#define MSG_OK       99/*确定*/

typedef struct _PDAMSG
{
	short type;
	union
	{
	short wParam;
	short key;
	unsigned short character;
	short msg;
	short x;
	};
	union
	{
	short lParam;
	short y;
	};
	union
	{
	short PenStatus;
	short z;
	};
}PDAMSG;
void SendMsg(PDAMSG *msg);
void TranslateMsg(PDAMSG *msg);
void GetMsg(PDAMSG *msg);


void DispDot(short x,short y,unsigned char c);
void DispImage(short x,short y,short w,short h,unsigned char *s);
void DispBmp(short x,short y,unsigned char *s);
void DispBmpGray(short x,short y,unsigned char *s);
void DispReverse(short x,short y,short w,short h);
short CheckPointInRect(short x,short y,PDARECT *pRc);
void InitRect(short left,short top,short right,short bottom,PDARECT *pRc);
short DispChar(short x,short y,unsigned short CharCode,unsigned char FrontColor,unsigned char BackColor);
void DispStr(short x,short y,unsigned char *s,unsigned char FrontColor,unsigned char BackColor);
short GetStrLength(unsigned char *s);
short GetStrCharNum(unsigned char *s);
short GetStrWidth(short Margin,unsigned char *s);

void DispBar(short x,short y,short w,short h,unsigned char c);
void DispReverse(short x,short y,short w,short h);
void DrawBar(PDARECT *rc,unsigned char c);
void ReverseBar(PDARECT *rc);
void DrawLineX(short x,short y,short w,unsigned char c);
void ReverseLineX(short x,short y,short w);
void DrawDotLineX(short x,short y,short w,short dot,unsigned char c);
void ReverseDotLineX(short x,short y,short w,short dot);
void DrawLineY(short x,short y,short h,unsigned char c);
void ReverseLineY(short x,short y,short h);
void DrawDotLineY(short x,short y,short h,short dot,unsigned char c);
void ReverseDotLineY(short x,short y,short h,short dot);
void DrawRect(PDARECT *rc,unsigned char c);
void ReverseRect(PDARECT *rc);
void DrawDotRect(PDARECT *rc,short dot,unsigned char c);
void ReverseDotRect(PDARECT *rc,short dot);
void DrawLine(short x1,short y1,short x2,short y2,unsigned char c);
void ReverseLine(short x1,short y1,short x2,short y2);

/*≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
□---CURSOR函数声明-------
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡*/
void SetCursorSize(short width,short height);
void CursorOn(void);
void MoveCursor(short x,short y);
void CursorOff(void);


/*≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
□---BUTTON风格宏-------
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡*/
#define PBN_NOFRAME		0x01/*无边框*/
#define PBN_FRAME		0x00/*有边框(缺省项)*/
#define PBN_REVERSE		0x08/*反显按钮*/
#define PBN_PUSH		0x00/*下压按钮(缺省项)*/
#define PBN_STRING		0x02/*字符按钮*/
#define PBN_BMP			0x04/*图象按钮*/
#define PBN_TWOBMP		0x10/*双图象按钮*/
#define PBN_ICON		0x20/*图标按钮*/
/*≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
□---BUTTON结构定义----BUTTON---
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡*/
typedef struct _BUTTON
{
	char Status;
	PDARECT Rect;
	short  Style;
	unsigned char *Str;
	unsigned char *Bmp;

	short  StrX,StrY;
	short  BmpX,BmpY;
	unsigned char BackColor;
	unsigned char StrColor;
}BUTTON;

/*≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
□---BUTTON函数声明-------
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡*/
void InitButton(BUTTON *b,PDARECT *pRc,short style);
void SetButtonStr(BUTTON *b,unsigned char *str,unsigned char c);
void SetButtonBmp(BUTTON *b,unsigned char *bmp1,unsigned char *bmp2);
void DrawButton(BUTTON *b,short i);
short GetButton(BUTTON *b,PDAMSG *pMsg);
short GetNullButton(BUTTON *b,PDAMSG *pMsg,void *func(BUTTON *b,short i));


#endif

⌨️ 快捷键说明

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