📄 uicontrol.h
字号:
/*********************************************************************/
// 文 件 名: uiControl.h
// 程序说明: GUI控件基本功能
// 程序设计: 党德华
// 2001.10.19 设计完成 说明文档:R004-S208-0001
// 2002.02.02 增加guiSearchControl_Type函数 童湘彪
// 2002.03.06 将座标参数由WORD型改为short型 宋军霞
// 程序审查: 宋军霞
// 2002.01.22 审查完成 说明文档:R004-S208-0001
// 2002.02.04 审查guiSearchControl_Type函数
// 项目编号: R004-S208
// 版 本: V1.0
// 版 权: Reality Plus Technology (ShenZhen) Co.,Ltd.
/*********************************************************************/
#ifndef _GUI_CONTROL_H
#define _GUI_CONTROL_H
#include <typedefine.h>
#include <kernel/linklist.h>
// type of control
#define CONTROL_WINDOW 1
#define CONTROL_BUTTON 10
#define CONTROL_CHKBTN 15
#define CONTROL_LABEL 20
#define CONTROL_LISTBOX 25
#define CONTROL_TEXTFIELD 30
#define CONTROL_MENU 35
#define CONTROL_SCROLL 40
#define CONTROL_BITMAP 45
#define CONTROL_SWKBD 50
#define CONTROL_PROGRESS_BAR 55
#define CONTROL_SYS_INFO_BOX 60
#define CONTROL_SLIDER 65
#define CONTROL_CALENDAR 70
#define CONTROL_SELECTOR 75
#define CONTROL_VIEWPORT 80
#define CONTROL_ACTIVE 0x00
#define CONTROL_NOT_ACTIVE 0x01
#define CONTROL_VISIBLE 0x00
#define CONTROL_NOT_VISIBLE 0x02
// 参数分别为handle以及要求的动作, 及相关的座标
typedef void (*PF_ACTION)( HNDL, WORD, WORD, WORD );
// 参数为control的handle (function pointer to show widget)
typedef STATUS (*PF_SHOW)( HNDL );
// 参数为control的handle (function pointer to delete widget)
typedef STATUS (*PF_DELETE)( HNDL ) ;
/**************************************************************
Structure
**************************************************************/
typedef struct tagGuiControl
{
// handle is the pointer which point to this structure
HNDL handle ; // identify the control
short type; // indicate the type of the control.
short left, top ;
short right,bottom ;
// this field would be a special value, it's able to check
// the handle available or not
short checkFlag ;
WORD style ;
BYTE status ; //active and visible status
BYTE font; //FONT type
HNDL vportHandle ; //所属vport的handle
HNDL container ; //所属其window的handle
// callback function ;
// 当某个事件发生时(通常是被按下时), control的画面必须有所变化
// ( like button pressed ) 即此callback function在事件发生後会被
// windows thread或driver呼叫
PF_ACTION actionFun;
// 当这个control必须重画时, 系统会自动call这个function
PF_SHOW showFun;
// 当这个widget被delete掉时, 系统会自动call这个function
PF_DELETE delFun ;
}TGuiControl;
/*********************************************************************/
//para:
// hWnd 窗口句柄
// type 控件类型
// pPos 开始位置
//dest: 从窗口中的指定位置开始搜索指定类型的控件
//return:
// not find: NULL
// find: control handle
/*********************************************************************/
DLL_EXP(HNDL) guiSearchControl_Type(HNDL hWnd,short type,int *pPos);
/*********************************************************************/
//para: control list and pen's coordinate
//dest: search the control from the pen's coordinate
//return:
//not find: NULL
//find: control handle
/*********************************************************************/
DLL_EXP(HNDL) guiSearchControl( struct dLinkList* head, short x, short y );
DLL_EXP(HNDL) guiSearchScrollControl( struct dLinkList* head);
/*********************************************************************/
//para: control list head and control handle which wanted to be needed
//dest: delete the control handle from list
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP (STATUS) guiRemoveControl(struct dLinkList* head, HNDL handle);
/*********************************************************************/
//para: window handle and control handle
//dest: add the control to window control list
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_Add(HNDL hWin, HNDL hControl) ;
/*********************************************************************/
//para: control handle
//dest: show the control
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_Show( HNDL hControl) ;
/*********************************************************************/
//para: window handle and control handle
//dest: remove the control from window's control list
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_Remove(HNDL hWin, HNDL hControl) ;
/*********************************************************************/
//para: control handle
//dest: release the control's all resource
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_Delete( HNDL hControl) ;
/*********************************************************************/
//para: control handle
//dest: enable the control
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_Enable(HNDL handle) ;
/*********************************************************************/
//para: control handle
//dest: disable the control
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_Disable(HNDL handle) ;
/*********************************************************************/
//para: control handle
//dest: visible the control and show it
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_SetVisible(HNDL handle);
/*********************************************************************/
//para: control handle
//dest: invisible the control
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_DisVisible(HNDL handle);
/*********************************************************************/
//para: control handle and style
//dest: set new style and show it
//return:
//fail: STATUS_ERR
//success: STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_SetStyle(HNDL handle, WORD style) ;
/*********************************************************************/
//para: control handle
//dest: the control style's pointer
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_GetStyle(HNDL handle, WORD *style) ;
/*********************************************************************/
//para: control handle and new font
//dest: set control font and show it
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_SetFont(HNDL handle, BYTE font) ;
/*********************************************************************/
//para: control handle and font pointer
//dest: get control font
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_GetFont(HNDL handle, BYTE *font) ;
/*********************************************************************/
//para: control handle
//dest: judge the control's active status
//return:
// NOT ACTIVE: FALSE
// ACTIVE: TRUE
/*********************************************************************/
DLL_EXP(BOOL) guiControl_QueryIsActive(HNDL handle) ;
/*********************************************************************/
//para: control handle
//dest: judge the control visible status
//return:
// NOT VISIBLE: FALSE
// VISIBLE: TRUE
/*********************************************************************/
DLL_EXP(BOOL) guiControl_QueryIsVisible(HNDL handle);
/*********************************************************************/
//para: control handle and coordinate's pointer
//dest: get the control's corrdinate
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_QueryLocation(HNDL handle, short *left, short *top, short *right, short *bottom) ;
/*********************************************************************/
//para: control handle
//dest: judge the control whether in a vport or not
//return:
// not in vport: NULL
// in vport: control handle
/*********************************************************************/
DLL_EXP(HNDL) guiControl_IsInVport(HNDL handle) ;
/*********************************************************************/
//para: control handle and coordinate
//dest: set the control coordinate and show it
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_SetLocation(HNDL handle, short left, short top, short right, short bottom) ;
/*********************************************************************/
//para: control handle
//dest: clear the control region
//return:
// fail: STATUS_ERR
// success:STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiControl_Clear(HNDL handle) ;
/*********************************************************************/
//para: control handle
//dest: judge the control whether visible or not in a visual region
//return:
// not in a visual region: FALSE
// in a visual region: TRUE
/*********************************************************************/
DLL_EXP(BOOL) guiControl_IsVisible(HNDL hControl) ;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -