📄 curlib.h
字号:
/*----------------------------------------------------------------------------* * Function: End screen. * Argument: * None. * Return : * None. *----------------------------------------------------------------------------*/extern int end_work();/*----------------------------------------------------------------------------* * Function: 创建一个窗口. * Argument: * uchar sy - 指定box的开始行坐标. * uchar sx - 指定box的开始列坐标. * uchar row - 指定box的行数. * uchar col - 指定box的列数. * chtype tattr - 文本的前景色和背景色. * chtype battr - 边框的前景色和背景色. * chtype flag - WINDOW_SHADE: 阴影 WINDOW_ENGLISH: 英文制表符. * Return : * window_t * - 创建的窗口指针. * NULL - 创建失败. *----------------------------------------------------------------------------*/extern window_t *create_window(uchar sy,uchar sx,uchar row,uchar col,chtype tattr,chtype battr,chtype style);/*----------------------------------------------------------------------------* * Function: 显示一个窗口,并保存窗口所覆盖的区域. * Argument: * window_t *win - 窗口指针. * Return : * TRUE - Success. * FALSE - Failure. *----------------------------------------------------------------------------*/extern int show_window(window_t *win);/*----------------------------------------------------------------------------* * Function: 隐一个窗口,并恢复窗口所覆盖的区域. * Argument: * window_t *win - 窗口指针. * Return : * TRUE - Success. *----------------------------------------------------------------------------*/extern int hide_window(window_t *win);/*----------------------------------------------------------------------------* * Function: 删除一个窗口,并恢复窗口所覆盖的区域. * Argument: * window_t *win - 窗口指针. * Return : * TRUE - Success. *----------------------------------------------------------------------------*/extern int delete_window(window_t *win);/*----------------------------------------------------------------------------* * Function: 画一个box. * Argument: * uchar sy - 指定box的开始行坐标. * uchar sx - 指定box的开始列坐标. * uchar row - 指定box的行数. * uchar col - 指定box的列数. * chtype tattr - 文本的前景色和背景色. * chtype battr - 边框的前景色和背景色. * chtype flag - WINDOW_SHADE: 阴影 WINDOW_ENGLISH: 英文制表符. * Return : * TRUE. *----------------------------------------------------------------------------*/extern int draw_box(uchar sy,uchar sx,uchar row,uchar col,chtype tattr,chtype battr,chtype style);/*----------------------------------------------------------------------------* * Function: 在指定窗口画一个box. * Argument: * WINDOW *win - 指定的窗口. * chtype tattr - 文本的前景色和背景色. * chtype battr - 边框的前景色和背景色. * chtype flag - WINDOW_SHADE: 阴影 WINDOW_ENGLISH: 英文制表符. * Return : * TRUE. *----------------------------------------------------------------------------*/extern int wdraw_box(WINDOW *win,chtype tattr,chtype battr,chtype flag);/*----------------------------------------------------------------------------* * Function: 用某种颜色清除屏幕. * Argument: * short sy - 开始行. * short sx - 开始列. * short row - 列. * short col - 行. * chtype attr - 颜色. * Return : * TRUE. *----------------------------------------------------------------------------*/extern int cls(int sy,int sx,int row,int col,chtype attr);/*----------------------------------------------------------------------------* * Function: 用某种颜色清除窗口. * Argument: * WINDOW *win - 窗口. * chtype attr - 颜色. * Return : * TRUE. *----------------------------------------------------------------------------*/extern int wcls(WINDOW *win,chtype attr);/*----------------------------------------------------------------------------* * Function: 用某种颜色清除屏幕的一行. * Argument: * short sy - 开始行. * short sx - 开始列. * short len - 长度. * chtype attr - 颜色. * Return : * TRUE. *----------------------------------------------------------------------------*/extern int cls_line(int sy,int sx,int len,chtype attr);/*----------------------------------------------------------------------------* * Function: 用某种颜色清除窗口的一行. * Argument: * WINDOW *win - 窗口. * short sy - 开始行. * short sx - 开始列. * short len - 长度. * chtype attr - 颜色. * Return : * TRUE. *----------------------------------------------------------------------------*/extern int wcls_line(WINDOW *win,int sy,int sx,int len,chtype attr);/*----------------------------------------------------------------------------* * Function: 在屏幕中央显示一个系统消息窗口. * Argument: * char *msg - 消息文本. * Return : * TRUE. *----------------------------------------------------------------------------*/extern int disp_sysbox(char *msg);/*----------------------------------------------------------------------------* * Function: 显示一个消息窗口. * Argument: * short sy - 消息框的开始行. * short sx - 消息框的开始列. * char *msg - 消息文本. * char *title - 标题文本. * chtype flag - MSG_OK, MSG_OC, MSG_YN, MSG_YNC, MSG_RC, MSG_ARI. * Return : * TRUE. *----------------------------------------------------------------------------*/extern disp_box(uchar sy,uchar sx,char *msg,char *title,chtype flag);/*----------------------------------------------------------------------------* * Function: 显示一个消息框. * Argument: * short sy - 消息框的开始行. * short sx - 消息框的开始列. * char *msg - 消息文本. * char *title - 标题文本. * chtype flag - MSG_OK, MSG_OC, MSG_YN, MSG_YNC, MSG_RC, MSG_ARI. * chtype style - 窗口风格: WINDOW_SHADE, WINDOW_CHINESE. * chtype tattr - 正文颜色. * chtype battr - 边框颜色. * chtype sattr - 选项颜色. * chtype hattr - 标题颜色. * Return : * TRUE. *----------------------------------------------------------------------------*/extern int message_box(uchar sy,uchar sx,char *msg,char *heading,chtype flag,chtype style,chtype tattr,chtype battr,chtype sattr,chtype hattr);/*----------------------------------------------------------------------------* * Function: 显示一个消息窗口(使用WINDOW). * Argument: * short sy - 消息框的开始行. * short sx - 消息框的开始列. * char *msg - 消息文本. * char *heading - 标题文本. * chtype flag - MSG_OK, MSG_OC, MSG_YN, MSG_YNC, MSG_RC, MSG_ARI. * chtype style - 窗口风格: WINDOW_SHADE, WINDOW_CHINESE. * chtype tattr - 正文颜色. * chtype battr - 边框颜色. * chtype sattr - 选项颜色. * chtype hattr - 标题颜色. * Return : * TRUE. *----------------------------------------------------------------------------*/extern int message_win(short sy,short sx,char *msg,char *heading,chtype flag,chtype style,chtype tattr,chtype battr,chtype sattr,chtype hattr);/*----------------------------------------------------------------------------* * Function: 在窗口中画一条制表线. * Argument: * WINDOW *win - 窗口. * short sy - 开始行. * short sx - 开始列. * int width - 宽度. * chtype style - 窗口风格: WINDOW_SHADE, WINDOW_CHINESE. * Return : * TRUE. *----------------------------------------------------------------------------*/extern int wdraw_line(WINDOW *win,int sy,int sx,int width,chtype flag);/****************************************************************************** * <第二章> 输入函数.(input) * ******************************************************************************//*----------------------------------------------------------------------------* * FUNCTION: Get a Char from keybord. No wait. * Argument: * None. * Return : * > 0 - If You Press Key. * = 0 - If no key pressed. * * Notes : If You Press Cursor_Key,You Must Call get_key() 3 Times. *----------------------------------------------------------------------------*/extern int get_key();/*----------------------------------------------------------------------------* * FUNCTION: Get Char From Keyboard. Wait. * Argument: * None. * Return : * > 0 - If You Press Key. * * Notes : If No Key Press, Wait Until Key Pressed. *----------------------------------------------------------------------------*/extern int get_char();/*----------------------------------------------------------------------------* * Function: Get function key from Keyboard, Wait. * Argument: * unsigned char *c - Get char. * Return : * 0 - if you press other Key,and 'c' is the key by pressed. * Funckey - if you press special key,and c=0. *----------------------------------------------------------------------------*/extern int get_funckey(unsigned char *c);/****************************************************************************** * <第三章> 输出函数.(output) * ******************************************************************************//*----------------------------------------------------------------------------* * FUNCTION: 屏幕显示(按 printf 格式 ) * Argument: * short y - 开始行. * short x - 开始列. * char *format - 宽度. * va_alist - 类似 printf() 的参数形式. * Return : * TRUE. * 说 明: * va_dcl 等同于 int va_alist; * va_list 等同于 char * * va_start(arg) 等同于 arg=(char *)&va_alist *----------------------------------------------------------------------------*/extern int sprint();/*----------------------------------------------------------------------------* * FUNCTION: 窗口显示(按 printf 格式 ) * Argument: * WINDOW *win - 窗口. * short y - 开始行. * short x - 开始列. * char *format - 宽度. * va_alist - 类似 printf() 的参数形式. * Return : * TRUE. * 说 明: * va_dcl 等同于 int va_alist; * va_list 等同于 char * * va_start(arg) 等同于 arg=(char *)&va_alist *----------------------------------------------------------------------------*/extern int wsprint();/****************************************************************************** * <第四章> 菜单函数.(menu) * ******************************************************************************//*----------------------------------------------------------------------------* * Function: 初始化菜单. * Argument: * char *menufile - 菜单数据文件. * Return : * >= 0 成功. * < 0 失败. *----------------------------------------------------------------------------*/extern int menu_init(char *menufile);/*----------------------------------------------------------------------------* * Function: 菜单主循环. * Argument: * None. * Return : * > 0 被选择的菜单id. * = 0 按了ESC键或'0'. *----------------------------------------------------------------------------*/extern int menu_select();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -