?? gui.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 + -