📄 component.h
字号:
/**
*file component.h
* 单色LCD,简单任务,不支持 Touch Panel
*/
#ifndef _COMPONENT_BASE
#define _COMPONENT_BASE
#include "datatype.h"
#include "msgevent.h"
#include "hard_key.h"
#include "metawndo1.h"
#include "xlist.h"
#ifndef ENABLE
#define ENABLE 1
#endif
#ifndef DISABLE
#define DISABLE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#define NULL ((void*)0)
#endif
#define INACTIVED 0
#define ACTIVED 1
typedef struct xmessage XMSG;
typedef int (*comp_proc_f)(XMSG *msg); /* 消息处理函数 */
/**
*comp_prop_t --- 组件属性
*/
typedef struct comp_prop {
byte disable; /**< 组件状态:FALSE -- ENABLE TRUE -- DISABLE */
byte fntsize; /**< 组件字体尺寸: 12 or 16 */
} comp_prop_t;
/**
*component_t --- 组件数据结构
*/
typedef struct component component_t;
struct component {
rect rc; /**< 组件的矩形区域 */
component_t *parent; /**< 组件的所有者 */
component_t *prev;
comp_prop_t prop; /**< 组件属性 */
comp_proc_f proc; /**< 组件的消息处理 */
list_t child; /**< 组件的子组件链表 */
list_t brother; /**< 组件的同级组件链表 */
int saveback; /**< 是否保存父窗口图像 */
image* saveimg; /**< 保存的图像数据 */
};
/*
*XMSG --- 窗口消息数据结构
*/
struct xmessage {
component_t *comp; /**< 消息的所有者 */
int message;
DWORD param1;
DWORD param2;
};
int XSetDefaultProp(component_t *comp);
int XGetComponentProp(component_t *comp, comp_prop_t *prop);
int XSetComponentProp(component_t *comp, comp_prop_t *newprop, comp_prop_t *oldprop);
int XSendMessage(component_t *comp, int message, DWORD param1, DWORD param2);
int XShowComponent(component_t *comp);
//int XHideComponent(component_t *comp);
int XEnableComponent(component_t *comp);
int XDisableComponent(component_t *comp);
int XDestroyComponent(component_t *comp);
int XDefaultComponentProc(XMSG *msg);
int XIsEnable(const component_t *comp);
component_t* XGetParent(component_t *comp);
image* XSaveRect(rect *rScr);
void XRestoreRect(rect *rScr, image* rImg, int flag);
int XSaveBack(component_t *comp);
void XRestoreBack(component_t *comp, int flag);
int XGetComponentArea(component_t *comp, rect *rc);
comp_proc_f XComponentProcGet(component_t *comp);
void XComponentProcSet(component_t *comp, comp_proc_f proc);
int XSetParent(component_t *parent, component_t *child);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -