add support for MENU_ITEMFLAGS_SKIPINVERT

Able to test:
win/tty
win/win32
win/curses

Unable to test:
win/X11
win/Qt
win/Qt3
win/gem
win/gnome
This commit is contained in:
nhmall
2019-12-23 08:36:44 -05:00
parent c9bc2f5a2a
commit 7012e7046f
18 changed files with 63 additions and 35 deletions
+4 -2
View File
@@ -1306,7 +1306,8 @@ onListChar(HWND hWnd, HWND hwndList, WORD ch)
if (data->how == PICK_ANY) {
reset_menu_count(hwndList, data);
for (i = 0; i < data->menu.size; i++) {
SelectMenuItem(hwndList, data, i,
if (!(data->menu.items[i].itemflags & MENU_ITEMFLAGS_SKIPINVERT))
SelectMenuItem(hwndList, data, i,
NHMENU_IS_SELECTED(data->menu.items[i]) ? 0
: -1);
}
@@ -1353,7 +1354,8 @@ onListChar(HWND hWnd, HWND hwndList, WORD ch)
from = max(0, topIndex);
to = min(data->menu.size, from + pageSize);
for (i = from; i < to; i++) {
SelectMenuItem(hwndList, data, i,
if (!(data->menu.items[i].itemflags & MENU_ITEMFLAGS_SKIPINVERT))
SelectMenuItem(hwndList, data, i,
NHMENU_IS_SELECTED(data->menu.items[i]) ? 0
: -1);
}