window.h

来自「本程序是使用CDMA450模块开发的一个无线公话完整程序」· C头文件 代码 · 共 60 行

H
60
字号
/**
*file window.h
*@
*/
#ifndef  _COMPONENT_WINDOW
#define  _COMPONENT_WINDOW

#include "component.h"

#define LCD_WIDTH		112//128
#define LCD_HEIGHT		64//80
#define LCD_ICONEND		12

#define LCD_HMID		(LCD_WIDTH/2)
#define LCD_VMID		(LCD_HEIGHT/2)

#define MAX_TITLE_LEN	12
typedef struct window window_t;
/**
*window_t --- 窗口数据结构
*/ 
struct window {
	component_t	comp;					/**< 窗口组件 */
	int			state;					/**<状态,-1为退出 0为正常 */
	char		title[MAX_TITLE_LEN];	/**< 窗口标题 */
};
	

/**
*XGetMessage --- 取得消息
*/
int XGetMessage(XMSG *msg);
int XDispatchMessage(XMSG *msg);
int XDefaultWindowProc(XMSG *msg);

void XPostQuitMessage(window_t *wnd);

void XSetFirstWindow(window_t *wnd);
void XSetBaseWindow(window_t *wnd);
 
/**
*XCreateWindow --- 创建窗口 
*/
int XCreateWindow(component_t	*parent, 
				   window_t		*wnd, 
				   const rect	*rc,
				   char			*title,
				   comp_proc_f	msgProc,
				   int			saveBack);

void XSetTop(window_t *wnd);
window_t* XGetTop(void);

int XDestroyWindow(window_t *comp);

void FrameWindow(rect *rc);
void OnPaintWindow(window_t *wnd);

#endif

⌨️ 快捷键说明

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