📄 tool.h
字号:
/********************************************************** 函 数 名: FindLastWindowLink 功 能: 从窗口链表中找到最后一个窗口 入口参数: 无 返 回 值: 找到的窗口的指针 调用方法: FindLastWindowLink();**********************************************************/ WINDOWLINK *FindLastWindowLink();/********************************************************** 函 数 名: DeleteLastWindowLink 功 能: 删除窗口链表中最后一个窗口 入口参数: 无 返 回 值: TRUE 成功 FALSE 失败 调用方法: DeleteLastWindowLink();**********************************************************/ int DeleteLastWindowLink();/********************************************************** 函 数 名: ShowVersion 功 能: 显示版本信息 入口参数: char *version 返 回 值: 无 调用方法: ShowVersion( " .. 系统 .." );**********************************************************/ int ShowVersion( char *Version );/* 画框 */int Box( int row, int col, int height, int width, int boardtype );int BoxWin( WINDOW *win, int boardtype );int BoxInWin( WINDOW *win, int row, int col, int height, int width, int boardtype );/********************************************************** 函 数 名: SetColorPattern 功 能: 设置调色板 入口参数: COLORPATTERN *colorpattern, short text_fcolor, short text_bcolor, short board_fcolor, short board_bcolor, short title_fcolor, short title_bcolor, short hight_fcolor, short hight_bcolor 返 回 值: 无 调用方法: **********************************************************/ int SetColorPattern( COLORPATTERN *colorpattern, short text_fcolor, short text_bcolor, short board_fcolor, short board_bcolor, short title_fcolor, short title_bcolor, short hight_fcolor, short hight_bcolor ); /********************************************************** 函 数 名: SetColor 功 能: 设置当前调色板 入口参数: COLORPATTERN *colorpattern 返 回 值: 无 调用方法: SetColor( colorpattern );**********************************************************/ int SetColor( COLORPATTERN *colorpattern );/* 背景框 */int Frame( int boardtype, short fcolor, short bcolor );/********************************************************** 函 数 名: InitPad 功 能: 初始化水平菜单 入口参数: WINDOW *win, Pad *pad, int row, int col, ITEMS *paditems, int itemnum, COLORPATTERN *colorpattern 返 回 值: 无 调用方法: **********************************************************/ int InitPad( WINDOW *win, PAD *pad, int row, int col, ITEMS *paditems, int itemnum, COLORPATTERN *colorpattern );/* 激活水平菜单 */int ActivatePad( PAD *ptr );/********************************************************** 函 数 名: InitMenu 功 能: 初始化下拉菜单 入口参数: MENU *menu, int row, int col, ITEMS *menuitems, int itemnum, int boardtype, COLORPATTERN *colorpattern 返 回 值: 调用方法: **********************************************************/ int InitMenu( MENU *menu, int row, int col, ITEMS *menuitems, int itemnum, int boardtype, COLORPATTERN *colorpattern );/* 激活下拉菜单 */int ActivateMenu( MENU *mtr );/********************************************************** 函 数 名: CreateWindow 功 能: 创建弹出式窗口 入口参数: int row 起始行 int col 起始列 int height 窗口高 int width 窗口宽 int boradtype 边框类型 char *title 窗口抬头 COLORPATTERN *colorpattern, 窗口调色板 返 回 值: WINDOWS * 窗口指针 调用方法: CreateWindow( 4, 4, 10, 60, REGULAR_BOARD, NULL, &LoginColor ); **********************************************************/ WINDOWS *CreateWindow( int row, int col, int height, int width, int boradtype, char *title, COLORPATTERN *colorpattern );/********************************************************** 函 数 名: DeleteWindow 功 能: 删除窗口 入口参数: WINDOWS *thiswindow 返 回 值: 无 调用方法: DeleteWindow( thiswindow );**********************************************************/ int DeleteWindow( WINDOWS *thiswindow );/********************************************************** 函 数 名: ClearWindow 功 能: 窗口清屏 入口参数: WINDOWS *thiswindow 返 回 值: 无 调用方法: ClearWindow( thiswindow ); **********************************************************/ int ClearWindow( WINDOWS *thiswindow );/********************************************************** 函 数 名: NeedQuery 功 能: 判断当前的数据操作是否需要先查询 入口参数: INPUTFIELD *inputtable 返 回 值: TRUE 需要 FALSE 不需要 调用方法: NeedQuery( inputtable ); **********************************************************/ int NeedQuery( INPUTFIELD *inputtable );/* 查询数据 */int QueryData( WINDOW *win, INPUTFIELD *inputtable, char *tablename );/* 增加数据 */int AddData( WINDOW *win, INPUTFIELD *inputtable, char *tablename );/********************************************************** 函 数 名: DeleteData 功 能: 删除数据内容 入口参数: WINDOW *win, INPUTFIELD *inputtable, char *tablename 返 回 值: 无 调用方法: DeleteData( win, inputtable, tablename ); **********************************************************/ int DeleteData( WINDOW *win, INPUTFIELD *inputtable, char *tablename );/********************************************************** 函 数 名: MessageBX 功 能: 信息提示窗口 入口参数: char *message 返 回 值: 无 调用方法: Message( "Please Notice" );**********************************************************/ int MessageBX( char *message );#define NEEDBEEP 1#define NOBEP 0/********************************************************** 函 数 名: DataWindow 功 能: 数据库操作窗口 入口参数: int boardtype, char *title, INPUTFIELD *inputtable, char *tablename, COLORPATTERN *colorpattern 返 回 值: 调用方法: **********************************************************/ /*DataWindow( int boardtype, char *title, INPUTFIELD *inputtable, char *tablename, COLORPATTERN *colorpattern, ushort datafunc );*/ /* 显示数据编辑界 */int ShowInputTable( WINDOW *win, INPUTFIELD *inputtable );/* 刷新编辑框 */int ShowInputField( WINDOW *win, INPUTFIELD *inputtable , int opt); /* 清编辑框 */int ClearInputField( WINDOW *win, INPUTFIELD *inputtable );/* 设置消息显示模式 */int SetMessageShowMode( int ShowMode );/* 显示信息 */int SetMessage( char *message );/* 退出系统 */int QuitSystem( int mode );/* 对话框 */int DialogBox( int dialogboxtype, int boardtype, char *message ); /* 登录系统 */int LoginSystem( INPUTFIELD *inputtable, char *tablename );/********************************************************** 函 数 名: IsEmptyString 功 能: 字符串为空或全为空格 入口参数: char *string 返 回 值: TRUE 成功 FALSE 失败 调用方法: IsEmptyString( "this string" );**********************************************************/ int IsEmptyString( char *string );/********************************************************** 函 数 名: RightTrim 功 能: 删除字符串尾部空格 入口参数: char *srcstring 返 回 值: char *desstring 调用方法: RightTrim( "this is " ); **********************************************************/ char * RightTrim( char *srcstring );/********************************************************** 函 数 名: LeftTrim 功 能: 删除字符串首部空格 入口参数: char *srcstring 返 回 值: char *desstring 调用方法: LeftTrim( " this is" );**********************************************************/ char * LeftTrim( char *srcstring );/********************************************************** 函 数 名: AllTrim 功 能: 删除字符串首尾空格 入口参数: char *srcstring 返 回 值: char *desstring 调用方法: AllTrim( " this is " );**********************************************************/ char * AllTrim( char *srcstring );/********************************************************** 函 数 名: BackGround 功 能: 设置背景色 入口参数: short fcolor, short bcolor 返 回 值: 无 调用方法: BackGround( WHITE, CYAN );**********************************************************/ int BackGround( short fcolor, short bcolor );#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -