亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? menubox.c

?? busybox最新版本. 嵌入式編程必不可少之工具.
?? C
字號:
/* *  menubox.c -- implements the menu box * *  ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) *  MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com) * *  This program is free software; you can redistribute it and/or *  modify it under the terms of the GNU General Public License *  as published by the Free Software Foundation; either version 2 *  of the License, or (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *//* *  Changes by Clifford Wolf (god@clifford.at) * *  [ 1998-06-13 ] * *    *)  A bugfix for the Page-Down problem * *    *)  Formerly when I used Page Down and Page Up, the cursor would be set *        to the first position in the menu box.  Now lxdialog is a bit *        smarter and works more like other menu systems (just have a look at *        it). * *    *)  Formerly if I selected something my scrolling would be broken because *        lxdialog is re-invoked by the Menuconfig shell script, can't *        remember the last scrolling position, and just sets it so that the *        cursor is at the bottom of the box.  Now it writes the temporary file *        lxdialog.scrltmp which contains this information. The file is *        deleted by lxdialog if the user leaves a submenu or enters a new *        one, but it would be nice if Menuconfig could make another "rm -f" *        just to be sure.  Just try it out - you will recognise a difference! * *  [ 1998-06-14 ] * *    *)  Now lxdialog is crash-safe against broken "lxdialog.scrltmp" files *        and menus change their size on the fly. * *    *)  If for some reason the last scrolling position is not saved by *        lxdialog, it sets the scrolling so that the selected item is in the *        middle of the menu box, not at the bottom. * * 02 January 1999, Michael Elizabeth Chastain (mec@shout.net) * Reset 'scroll' to 0 if the value from lxdialog.scrltmp is bogus. * This fixes a bug in Menuconfig where using ' ' to descend into menus * would leave mis-synchronized lxdialog.scrltmp files lying around, * fscanf would read in 'scroll', and eventually that value would get used. */#include "dialog.h"static int menu_width, item_x;/* * Print menu item */static void do_print_item(WINDOW * win, const char *item, int choice,                          int selected, int hotkey){	int j;	char *menu_item = malloc(menu_width + 1);	strncpy(menu_item, item, menu_width - item_x);	menu_item[menu_width] = 0;	j = first_alpha(menu_item, "YyNnMmHh");	/* Clear 'residue' of last item */	wattrset(win, menubox_attr);	wmove(win, choice, 0);#if OLD_NCURSES	{		int i;		for (i = 0; i < menu_width; i++)			waddch(win, ' ');	}#else	wclrtoeol(win);#endif	wattrset(win, selected ? item_selected_attr : item_attr);	mvwaddstr(win, choice, item_x, menu_item);	if (hotkey) {		wattrset(win, selected ? tag_key_selected_attr : tag_key_attr);		mvwaddch(win, choice, item_x + j, menu_item[j]);	}	if (selected) {		wmove(win, choice, item_x + 1);	}	free(menu_item);	wrefresh(win);}#define print_item(index, choice, selected) \do {\	int hotkey = (items[(index) * 2][0] != ':'); \	do_print_item(menu, items[(index) * 2 + 1], choice, selected, hotkey); \} while (0)/* * Print the scroll indicators. */static void print_arrows(WINDOW * win, int item_no, int scroll, int y, int x,			 int height){	int cur_y, cur_x;	getyx(win, cur_y, cur_x);	wmove(win, y, x);	if (scroll > 0) {		wattrset(win, uarrow_attr);		waddch(win, ACS_UARROW);		waddstr(win, "(-)");	} else {		wattrset(win, menubox_attr);		waddch(win, ACS_HLINE);		waddch(win, ACS_HLINE);		waddch(win, ACS_HLINE);		waddch(win, ACS_HLINE);	}	y = y + height + 1;	wmove(win, y, x);	wrefresh(win);	if ((height < item_no) && (scroll + height < item_no)) {		wattrset(win, darrow_attr);		waddch(win, ACS_DARROW);		waddstr(win, "(+)");	} else {		wattrset(win, menubox_border_attr);		waddch(win, ACS_HLINE);		waddch(win, ACS_HLINE);		waddch(win, ACS_HLINE);		waddch(win, ACS_HLINE);	}	wmove(win, cur_y, cur_x);	wrefresh(win);}/* * Display the termination buttons. */static void print_buttons(WINDOW * win, int height, int width, int selected){	int x = width / 2 - 16;	int y = height - 2;	print_button(win, "Select", y, x, selected == 0);	print_button(win, " Exit ", y, x + 12, selected == 1);	print_button(win, " Help ", y, x + 24, selected == 2);	wmove(win, y, x + 1 + 12 * selected);	wrefresh(win);}/* scroll up n lines (n may be negative) */static void do_scroll(WINDOW *win, int *scroll, int n){	/* Scroll menu up */	scrollok(win, TRUE);	wscrl(win, n);	scrollok(win, FALSE);	*scroll = *scroll + n;	wrefresh(win);}/* * Display a menu for choosing among a number of options */int dialog_menu(const char *title, const char *prompt, int height, int width,		int menu_height, const char *current, int item_no,		const char *const *items){	int i, j, x, y, box_x, box_y;	int key = 0, button = 0, scroll = 0, choice = 0;	int first_item =  0, max_choice;	WINDOW *dialog, *menu;	FILE *f;	max_choice = MIN(menu_height, item_no);	/* center dialog box on screen */	x = (COLS - width) / 2;	y = (LINES - height) / 2;	draw_shadow(stdscr, y, x, height, width);	dialog = newwin(height, width, y, x);	keypad(dialog, TRUE);	draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);	wattrset(dialog, border_attr);	mvwaddch(dialog, height - 3, 0, ACS_LTEE);	for (i = 0; i < width - 2; i++)		waddch(dialog, ACS_HLINE);	wattrset(dialog, dialog_attr);	wbkgdset(dialog, dialog_attr & A_COLOR);	waddch(dialog, ACS_RTEE);	print_title(dialog, title, width);	wattrset(dialog, dialog_attr);	print_autowrap(dialog, prompt, width - 2, 1, 3);	menu_width = width - 6;	box_y = height - menu_height - 5;	box_x = (width - menu_width) / 2 - 1;	/* create new window for the menu */	menu = subwin(dialog, menu_height, menu_width,		      y + box_y + 1, x + box_x + 1);	keypad(menu, TRUE);	/* draw a box around the menu items */	draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2,		 menubox_border_attr, menubox_attr);	item_x = (menu_width - 70) / 2;	/* Set choice to default item */	for (i = 0; i < item_no; i++)		if (strcmp(current, items[i * 2]) == 0)			choice = i;	/* get the scroll info from the temp file */	if ((f = fopen("lxdialog.scrltmp", "r")) != NULL) {		if ((fscanf(f, "%d\n", &scroll) == 1) && (scroll <= choice) &&		    (scroll + max_choice > choice) && (scroll >= 0) &&		    (scroll + max_choice <= item_no)) {			first_item = scroll;			choice = choice - scroll;			fclose(f);		} else {			scroll = 0;			remove("lxdialog.scrltmp");			fclose(f);			f = NULL;		}	}	if ((choice >= max_choice) || (f == NULL && choice >= max_choice / 2)) {		if (choice >= item_no - max_choice / 2)			scroll = first_item = item_no - max_choice;		else			scroll = first_item = choice - max_choice / 2;		choice = choice - scroll;	}	/* Print the menu */	for (i = 0; i < max_choice; i++) {		print_item(first_item + i, i, i == choice);	}	wnoutrefresh(menu);	print_arrows(dialog, item_no, scroll,		     box_y, box_x + item_x + 1, menu_height);	print_buttons(dialog, height, width, 0);	wmove(menu, choice, item_x + 1);	wrefresh(menu);	while (key != ESC) {		key = wgetch(menu);		if (key < 256 && isalpha(key))			key = tolower(key);		if (strchr("ynmh", key))			i = max_choice;		else {			for (i = choice + 1; i < max_choice; i++) {				j = first_alpha(items[(scroll + i) * 2 + 1], "YyNnMmHh");				if (key == tolower(items[(scroll + i) * 2 + 1][j]))					break;			}			if (i == max_choice)				for (i = 0; i < max_choice; i++) {					j = first_alpha(items [(scroll + i) * 2 + 1], "YyNnMmHh");					if (key == tolower(items[(scroll + i) * 2 + 1][j]))						break;				}		}		if (i < max_choice ||		    key == KEY_UP || key == KEY_DOWN ||		    key == '-' || key == '+' ||		    key == KEY_PPAGE || key == KEY_NPAGE) {			/* Remove highligt of current item */			print_item(scroll + choice, choice, FALSE);			if (key == KEY_UP || key == '-') {				if (choice < 2 && scroll) {					/* Scroll menu down */					do_scroll(menu, &scroll, -1);					print_item(scroll, 0, FALSE);				} else					choice = MAX(choice - 1, 0);			} else if (key == KEY_DOWN || key == '+') {				print_item(scroll+choice, choice, FALSE);				if ((choice > max_choice - 3) &&				    (scroll + max_choice < item_no)) {					/* Scroll menu up */					do_scroll(menu, &scroll, 1);					print_item(scroll+max_choice - 1,						   max_choice - 1, FALSE);				} else					choice = MIN(choice + 1, max_choice - 1);			} else if (key == KEY_PPAGE) {				scrollok(menu, TRUE);				for (i = 0; (i < max_choice); i++) {					if (scroll > 0) {						do_scroll(menu, &scroll, -1);						print_item(scroll, 0, FALSE);					} else {						if (choice > 0)							choice--;					}				}			} else if (key == KEY_NPAGE) {				for (i = 0; (i < max_choice); i++) {					if (scroll + max_choice < item_no) {						do_scroll(menu, &scroll, 1);						print_item(scroll+max_choice-1,							   max_choice - 1, FALSE);					} else {						if (choice + 1 < max_choice)							choice++;					}				}			} else				choice = i;			print_item(scroll + choice, choice, TRUE);			print_arrows(dialog, item_no, scroll,				     box_y, box_x + item_x + 1, menu_height);			wnoutrefresh(dialog);			wrefresh(menu);			continue;	/* wait for another key press */		}		switch (key) {		case KEY_LEFT:		case TAB:		case KEY_RIGHT:			button = ((key == KEY_LEFT ? --button : ++button) < 0)			    ? 2 : (button > 2 ? 0 : button);			print_buttons(dialog, height, width, button);			wrefresh(menu);			break;		case ' ':		case 's':		case 'y':		case 'n':		case 'm':		case '/':			/* save scroll info */			if ((f = fopen("lxdialog.scrltmp", "w")) != NULL) {				fprintf(f, "%d\n", scroll);				fclose(f);			}			delwin(dialog);			fprintf(stderr, "%s\n", items[(scroll + choice) * 2]);			switch (key) {			case 's':				return 3;			case 'y':				return 3;			case 'n':				return 4;			case 'm':				return 5;			case ' ':				return 6;			case '/':				return 7;			}			return 0;		case 'h':		case '?':			button = 2;		case '\n':			delwin(dialog);			if (button == 2)				fprintf(stderr, "%s \"%s\"\n",					items[(scroll + choice) * 2],					items[(scroll + choice) * 2 + 1] +					first_alpha(items [(scroll + choice) * 2 + 1], ""));			else				fprintf(stderr, "%s\n",					items[(scroll + choice) * 2]);			remove("lxdialog.scrltmp");			return button;		case 'e':		case 'x':			key = ESC;		case ESC:			break;		}	}	delwin(dialog);	remove("lxdialog.scrltmp");	return -1;		/* ESC pressed */}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕日韩一区| 大美女一区二区三区| 午夜私人影院久久久久| 亚洲欧美二区三区| 亚洲欧美中日韩| 国产精品久久毛片av大全日韩| 国产亚洲精品7777| 久久午夜老司机| 久久久91精品国产一区二区三区| 精品国产三级a在线观看| 日韩欧美一级在线播放| 日韩欧美国产综合在线一区二区三区 | 日日欢夜夜爽一区| 午夜在线电影亚洲一区| 香蕉加勒比综合久久| 色综合天天做天天爱| 欧美日韩一级二级三级| 欧美日韩一卡二卡| 91国内精品野花午夜精品| 91福利资源站| 4438亚洲最大| 欧美精品一二三四| 欧美浪妇xxxx高跟鞋交| 亚洲制服丝袜一区| 欧美激情中文不卡| 日韩理论片网站| 一二三区精品视频| 视频一区二区不卡| 精品一二三四区| 成人av网址在线| 精品视频在线免费| 精品久久久久香蕉网| 国产精品初高中害羞小美女文| 亚洲人午夜精品天堂一二香蕉| 天天操天天色综合| 黄页视频在线91| 91小视频在线免费看| 欧美日韩一区二区三区在线| 欧美一区三区二区| 国产欧美一区二区精品久导航 | 欧美日本一区二区三区| www亚洲一区| 亚洲天堂免费看| 性欧美疯狂xxxxbbbb| 国产精品综合二区| 色婷婷久久99综合精品jk白丝| 欧美精品欧美精品系列| 国产日本亚洲高清| 午夜精品影院在线观看| 国产在线不卡一卡二卡三卡四卡| 91网站在线观看视频| 中文字幕国产一区| 日本成人在线网站| 成人av在线电影| 91精品国产黑色紧身裤美女| 国产精品无圣光一区二区| 亚洲综合男人的天堂| 激情深爱一区二区| 欧美性三三影院| 国产清纯在线一区二区www| 亚洲精品一卡二卡| 国产一区二区三区综合| 在线视频欧美精品| 国产亚洲成年网址在线观看| 亚洲成a人在线观看| 成人精品高清在线| 欧美mv日韩mv亚洲| 亚洲福利视频导航| 99精品在线免费| 国产亚洲欧美中文| 日韩经典一区二区| 日本韩国欧美国产| 国产精品二区一区二区aⅴ污介绍| 青青草国产精品97视觉盛宴| 色8久久人人97超碰香蕉987| 久久精品人人做人人综合 | 国产suv精品一区二区6| 精品久久人人做人人爽| 亚洲bt欧美bt精品777| 色偷偷久久一区二区三区| 中文字幕av一区 二区| 国产自产视频一区二区三区| 91精品国产欧美一区二区成人| 亚洲综合色婷婷| 91美女视频网站| 国产精品久久久久永久免费观看| 国产一区二区三区电影在线观看| 欧美一区二视频| 午夜精品福利一区二区三区av| fc2成人免费人成在线观看播放| 久久久影院官网| 国产麻豆精品theporn| 日韩午夜在线观看| 日韩精品一区第一页| 色婷婷精品久久二区二区蜜臂av| 久久伊99综合婷婷久久伊| 综合欧美亚洲日本| av在线一区二区三区| 亚洲综合色噜噜狠狠| 成人一级片网址| 久久久精品一品道一区| 久久69国产一区二区蜜臀| 精品视频在线免费观看| 五月天国产精品| 欧美日韩久久久一区| 亚洲综合视频网| 在线看日韩精品电影| 国产精品久久久一本精品| 成人激情综合网站| 国产欧美精品一区二区三区四区 | 欧美r级电影在线观看| 午夜私人影院久久久久| 欧美一级片免费看| 日本伊人色综合网| 欧美三电影在线| 亚洲成av人片在www色猫咪| 91成人免费在线视频| 欧美国产乱子伦| 91在线精品一区二区| 椎名由奈av一区二区三区| 粉嫩av一区二区三区| 国产人成亚洲第一网站在线播放| 国产盗摄一区二区三区| 日韩免费高清视频| 国产v综合v亚洲欧| 欧美国产日韩一二三区| 成人黄色片在线观看| 国产精品久久久久久久第一福利| 成人99免费视频| 成人免费一区二区三区在线观看| 日本乱码高清不卡字幕| 亚洲午夜久久久久久久久久久| 欧美三电影在线| 奇米影视一区二区三区| 精品少妇一区二区三区在线播放| 日本女人一区二区三区| 精品国产百合女同互慰| 国产一区二区免费在线| 欧美极品少妇xxxxⅹ高跟鞋| 99视频国产精品| 一级精品视频在线观看宜春院| 91色porny| 日韩黄色片在线观看| 精品欧美乱码久久久久久1区2区| 国产精品综合在线视频| 中文字幕免费不卡| 在线观看视频一区二区 | 丁香六月综合激情| 亚洲免费在线视频一区 二区| 欧美写真视频网站| 蜜桃av噜噜一区二区三区小说| 欧美精品日韩精品| 成人av资源下载| 亚洲成av人片一区二区梦乃| 欧美成va人片在线观看| 成人丝袜18视频在线观看| 悠悠色在线精品| 69久久99精品久久久久婷婷| 懂色av中文一区二区三区 | 日韩精品免费专区| 国产精品美女视频| 欧美日韩午夜影院| 国产在线精品一区在线观看麻豆| 中文字幕一区二| 欧美久久久一区| 99精品久久久久久| 日本午夜一区二区| 国产精品丝袜一区| 91精品国产麻豆国产自产在线| 国产经典欧美精品| 亚洲综合在线第一页| 国产视频一区在线播放| 欧美视频在线观看一区二区| 国产麻豆一精品一av一免费| 亚洲一区二区欧美日韩 | 久久精品视频一区二区三区| 色又黄又爽网站www久久| 久久精品国产秦先生| 一区二区三区四区av| 久久综合给合久久狠狠狠97色69| 欧美日韩精品欧美日韩精品 | 国产xxx精品视频大全| 日韩和欧美的一区| 亚洲人成网站色在线观看| 国产三区在线成人av| 91精品国产高清一区二区三区 | 国产成人免费av在线| 日韩精品三区四区| 亚洲精品成人悠悠色影视| 2022国产精品视频| 色94色欧美sute亚洲线路一久 | 不卡视频免费播放| 韩国欧美一区二区| 日本中文在线一区| 一区二区三区国产| 国产精品网友自拍| 日韩欧美黄色影院| 日韩欧美国产电影| 欧美日韩另类一区| 日本电影欧美片|