win32_gui: cycle accelerator letters on large menues
This commit is contained in:
+7
-3
@@ -169,7 +169,7 @@ mswin_menu_window_select_menu(HWND hWnd, int how, MENU_ITEM_P **_selected,
|
|||||||
if (next_char > 'z')
|
if (next_char > 'z')
|
||||||
next_char = 'A';
|
next_char = 'A';
|
||||||
else if (next_char > 'Z')
|
else if (next_char > 'Z')
|
||||||
break;
|
next_char = 'a';
|
||||||
|
|
||||||
data->menu.items[i].accelerator = next_char;
|
data->menu.items[i].accelerator = next_char;
|
||||||
}
|
}
|
||||||
@@ -1441,7 +1441,11 @@ onListChar(HWND hWnd, HWND hwndList, WORD ch)
|
|||||||
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
|
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
|
||||||
|| is_accelerator) {
|
|| is_accelerator) {
|
||||||
if (data->how == PICK_ANY || data->how == PICK_ONE) {
|
if (data->how == PICK_ANY || data->how == PICK_ONE) {
|
||||||
for (i = 0; i < data->menu.size; i++) {
|
topIndex = ListView_GetTopIndex(hwndList);
|
||||||
|
if( topIndex < 0 || topIndex > data->menu.size ) break; // impossible?
|
||||||
|
int iter = topIndex;
|
||||||
|
do {
|
||||||
|
i = iter % data->menu.size;
|
||||||
if (data->menu.items[i].accelerator == ch) {
|
if (data->menu.items[i].accelerator == ch) {
|
||||||
if (data->how == PICK_ANY) {
|
if (data->how == PICK_ANY) {
|
||||||
SelectMenuItem(
|
SelectMenuItem(
|
||||||
@@ -1459,7 +1463,7 @@ onListChar(HWND hWnd, HWND hwndList, WORD ch)
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} while( (++iter % data->menu.size) != topIndex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user