2nd follow-up to alternative fix for menu search (':')
This commit is contained in:
@@ -3442,6 +3442,8 @@ extern void add_menu(winid, const glyph_info *, const ANY_P *,
|
|||||||
char, char, int, int, const char *, unsigned int);
|
char, char, int, int, const char *, unsigned int);
|
||||||
extern void add_menu_heading(winid, const char *);
|
extern void add_menu_heading(winid, const char *);
|
||||||
extern void add_menu_str(winid, const char *);
|
extern void add_menu_str(winid, const char *);
|
||||||
|
extern int select_menu(winid, int, menu_item **);
|
||||||
|
|
||||||
extern void getlin(const char *, char *);
|
extern void getlin(const char *, char *);
|
||||||
|
|
||||||
/* ### windows.c ### */
|
/* ### windows.c ### */
|
||||||
|
|||||||
+7
-5
@@ -125,13 +125,15 @@ extern
|
|||||||
#define putmixed (*windowprocs.win_putmixed)
|
#define putmixed (*windowprocs.win_putmixed)
|
||||||
#define display_file (*windowprocs.win_display_file)
|
#define display_file (*windowprocs.win_display_file)
|
||||||
#define start_menu (*windowprocs.win_start_menu)
|
#define start_menu (*windowprocs.win_start_menu)
|
||||||
/* 3.7: There is a real add_menu() in the core now, which does
|
#define end_menu (*windowprocs.win_end_menu)
|
||||||
* some common activities, such as menu_colors.
|
/* 3.7: There are real add_menu() and select_menu
|
||||||
* add_menu() is in windows.c
|
* in the core now.
|
||||||
|
* add_menu does some common activities, such as menu_colors.
|
||||||
|
* select_menu does some before and after activities.
|
||||||
|
* add_menu() and select_menu() are in windows.c
|
||||||
*/
|
*/
|
||||||
/* #define add_menu (*windowprocs.win_add_menu) */
|
/* #define add_menu (*windowprocs.win_add_menu) */
|
||||||
#define end_menu (*windowprocs.win_end_menu)
|
/* #define select_menu (*windowprocs.win_select_menu) */
|
||||||
#define select_menu (*windowprocs.win_select_menu)
|
|
||||||
#define message_menu (*windowprocs.win_message_menu)
|
#define message_menu (*windowprocs.win_message_menu)
|
||||||
|
|
||||||
#define mark_synch (*windowprocs.win_mark_synch)
|
#define mark_synch (*windowprocs.win_mark_synch)
|
||||||
|
|||||||
+5
-1
@@ -8739,7 +8739,8 @@ doset(void) /* changing options via menu by Per Liboriussen */
|
|||||||
menu_item *pick_list;
|
menu_item *pick_list;
|
||||||
int indexoffset, startpass, endpass;
|
int indexoffset, startpass, endpass;
|
||||||
boolean setinitial = FALSE, fromfile = FALSE,
|
boolean setinitial = FALSE, fromfile = FALSE,
|
||||||
gavehelp = FALSE, skiphelp = !iflags.cmdassist;
|
gavehelp = FALSE, skiphelp = !iflags.cmdassist,
|
||||||
|
save_bot_disabled;
|
||||||
int clr = NO_COLOR;
|
int clr = NO_COLOR;
|
||||||
|
|
||||||
if (iflags.menu_requested) {
|
if (iflags.menu_requested) {
|
||||||
@@ -8874,6 +8875,8 @@ doset(void) /* changing options via menu by Per Liboriussen */
|
|||||||
end_menu(tmpwin, "Set what options?");
|
end_menu(tmpwin, "Set what options?");
|
||||||
go.opt_need_redraw = FALSE;
|
go.opt_need_redraw = FALSE;
|
||||||
go.opt_need_glyph_reset = FALSE;
|
go.opt_need_glyph_reset = FALSE;
|
||||||
|
save_bot_disabled = gb.bot_disabled;
|
||||||
|
gb.bot_disabled = TRUE;
|
||||||
if ((pick_cnt = select_menu(tmpwin, PICK_ANY, &pick_list)) > 0) {
|
if ((pick_cnt = select_menu(tmpwin, PICK_ANY, &pick_list)) > 0) {
|
||||||
/*
|
/*
|
||||||
* Walk down the selection list and either invert the booleans
|
* Walk down the selection list and either invert the booleans
|
||||||
@@ -8930,6 +8933,7 @@ doset(void) /* changing options via menu by Per Liboriussen */
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy_nhwindow(tmpwin);
|
destroy_nhwindow(tmpwin);
|
||||||
|
gb.bot_disabled = save_bot_disabled;
|
||||||
|
|
||||||
if (pick_cnt == 1 && gavehelp) {
|
if (pick_cnt == 1 && gavehelp) {
|
||||||
/* when '?' is only the thing selected, go back and pick all
|
/* when '?' is only the thing selected, go back and pick all
|
||||||
|
|||||||
@@ -1679,6 +1679,17 @@ get_menu_coloring(const char *str, int *color, int *attr)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int select_menu(winid window, int how, menu_item **menu_list)
|
||||||
|
{
|
||||||
|
int reslt;
|
||||||
|
boolean old_bot_disabled = gb.bot_disabled;
|
||||||
|
|
||||||
|
gb.bot_disabled = TRUE;
|
||||||
|
reslt = (*windowprocs.win_select_menu)(window, how, menu_list);
|
||||||
|
gb.bot_disabled = old_bot_disabled;
|
||||||
|
return reslt;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
getlin(const char *query, register char *bufp)
|
getlin(const char *query, register char *bufp)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user