curses menu revision

Redo menu sizing to eliminate one of the analyzer hacks.  There's no
need to loop through the menu entries a second time to find the last
one.  The first time can remember it.

Also, some routines were taking arguments with
 some_function(WINDOW *win, nhmenu *menu, ...)
and others with
 other_function(nhmenu *menu, WINDOW *win, ...).
Change them all to have the window pointer 1st and menu pointer 2nd.
This commit is contained in:
PatR
2023-12-29 18:16:14 -08:00
parent 9d32956616
commit d4dfb1765c
2 changed files with 51 additions and 42 deletions

View File

@@ -8,9 +8,10 @@
/* Global declarations */
void curses_line_input_dialog(const char *prompt, char *answer, int buffer);
void curses_line_input_dialog(const char *prompt, char *answer,
int buffer) NONNULLPTRS;
int curses_character_input_dialog(const char *prompt, const char *choices,
char def);
char def) NONNULLARG1;
int curses_ext_cmd(void);
void curses_create_nhmenu(winid wid, unsigned long);
void curses_add_nhmenu_item(winid wid, const glyph_info *glyphinfo,
@@ -24,6 +25,7 @@ boolean curses_menu_exists(winid wid);
void curses_del_menu(winid, boolean);
boolean curs_nonselect_menu_action(WINDOW *win, void *menu, int how,
int curletter, int *curpage_p,
char selectors[256], int *num_selected_p);
char selectors[256], int *num_selected_p)
NONNULLPTRS;
#endif /* CURSDIAL_H */