⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apmenu.h

📁 Unix/Linux文本模式下显示和操作菜单的处理程序。
💻 H
字号:
/*****	APMENU.H 	1998/11*****/#include "view.h"#define Key_up 65#define Key_down 66#define Key_left 68#define Key_right 67#define Key_ctrl_up 56#define Key_ctrl_down 50#define Key_ctrl_left 52#define Key_ctrl_right 54#define Key_esc 27#define Key_enter 13#define Key_nxtrow 10#define Key_space 32#define Key_backspace 8#define Key_end 70#define Key_f1 77#define Key_pagedown 71#define Key_home 72#define Key_pageup 73#define Key_tab 9 #define Max_y   23 #define Max_x   80 #define Min(a,b)   (((a)<(b))?(a):(b))#define Max(a,b) (((a)>(b))?(a):(b))#define strmove(s1,s2,nmove) ( (strncpy( s1, s2, nmove )), (s1[nmove] = '\0') )int LS_FC;			/***** 子菜单:选中项FONTCOLOR*******/	int LS_BC;			/***** 子菜单:选中项BACKCOLOR*******/	int L_FC; 			/***** 子菜单:非选中项FONTCOLOR*****/	int L_BC; 			/***** 子菜单:非选中项BACKCOLOR*****/	int MS_FC;			/***** 主菜单:选中项FONTCOLOR*******/	int MS_BC;			/***** 主菜单:选中项BACKCOLOR*******/	int M_FC;			/***** 主菜单:非选中项FONTCOLOR*****/	int M_BC;			/***** 主菜单:非选中项BACKCOLOR*****/	#define  MENUSHADOW	0		/***** 子菜单:SHOW THE SHADOW*******/	struct save_scr{	int height,width;	int *p;	};typedef struct save_scr  SAVESCR;extern struct menu_item_code {        int level;        char code[5];        char *itemname;	char *acckey;        } ;typedef struct menu_item_code MENU_ITEM;struct menu_code_proc {        char    code[5];        int     (*itemproc)();       } ;typedef struct menu_code_proc MENU_PROC;struct menu_color {	int ls_fc;			/***** 子菜单:选中项FONTCOLOR*******/		int ls_bc;			/***** 子菜单:选中项BACKCOLOR*******/		int l_fc; 			/***** 子菜单:非选中项FONTCOLOR*****/		int l_bc; 			/***** 子菜单:非选中项BACKCOLOR*****/		int ms_fc;			/***** 主菜单:选中项FONTCOLOR*******/		int ms_bc;			/***** 主菜单:选中项BACKCOLOR*******/		int m_fc;			/***** 主菜单:非选中项FONTCOLOR*****/		int m_bc;			/***** 主菜单:非选中项BACKCOLOR*****/	};typedef struct menu_color MENU_COLOR;	#define TREE_TEXT_LEN 64#define TREE_TOPIC_LEN 64struct tree_item {				/****树形结构链表*********/	int 	level;	bool 	openflag;	char 	text[TREE_TEXT_LEN];		/********显示内容*********/	void    *link;				/**** 附信息指针 *********/	struct 	tree_item *nextlink;	struct 	tree_item *prelink;	struct 	tree_item *nextlevellink;	/****下层TREE_ITEM链首****/	struct 	tree_item *prelevellink;	/****下层TREE_ITEM链首****/};typedef struct tree_item TREE_ITEM;struct tree_control_list {			/*树形控件的屏幕显示列表**/	int xh;					/*****顺序显示的序号******/	int level;				/******** 级 别 **********/	int visible;				/********显示标志*********/	struct 	tree_item *item;		/********对应的链表*******/};typedef struct tree_control_list TREE_LIST;#define MAX_LIST_NUM	1024			/***每个控件允许LIST个数**/struct tree_control {				/*******树形结构控件******/	WINDOW *win;				/******** WINDOW  ********/	int y;					/******** y point ********/	int x;					/******** x point ********/	int h;					/******** height  ********/	int w;					/******** width   ********/	int bk_color;				/******非选中背景色*******/	int fn_color;				/******非选中前景色*******/	int sebk_color;				/****** 选中背景色 *******/	int sefn_color;				/****** 选中前景色 *******/	int cur_col;				/*** 当前的是第几条LIST***/	int col;				/*** 从第几行开始显示 ****/	int scr_col;				/*** 显示屏幕的当前行 ****/	int n;					/*** 可显示的LIST个数 ****/	int i;					/****** 生成LIST个数 *****/	int num;				/********ITEM个数*********/	struct tree_item *startitem;		/**********链首***********/	struct tree_item *curitem;		/********当前链表*********/	struct tree_control_list *list;		/********LIST数组*********/        int     (*enterproc)();        int     (*moveproc)();        int     (*keydownproc)();       };typedef struct tree_control TREE_CONTROL;

⌨️ 快捷键说明

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