Codechange: Add OnClick handler for dropdown items.

This allows each dropdown item to indicate if something different should happen depending on where in the item was clicked.
This commit is contained in:
Peter Nelson
2025-05-23 17:44:17 +01:00
committed by Peter Nelson
parent 04e07dff84
commit 984d864c72
29 changed files with 95 additions and 55 deletions

View File

@@ -1082,7 +1082,7 @@ struct NetworkStartServerWindow : public Window {
}
}
void OnDropdownSelect(WidgetID widget, int index) override
void OnDropdownSelect(WidgetID widget, int index, int) override
{
switch (widget) {
case WID_NSS_CONNTYPE_BTN:
@@ -1768,15 +1768,15 @@ public:
return false;
}
void OnDropdownClose(Point pt, WidgetID widget, int index, bool instant_close) override
void OnDropdownClose(Point pt, WidgetID widget, int index, int click_result, bool instant_close) override
{
/* If you close the dropdown outside the list, don't take any action. */
if (widget == WID_CL_MATRIX) return;
Window::OnDropdownClose(pt, widget, index, instant_close);
Window::OnDropdownClose(pt, widget, index, click_result, instant_close);
}
void OnDropdownSelect(WidgetID widget, int index) override
void OnDropdownSelect(WidgetID widget, int index, int) override
{
switch (widget) {
case WID_CL_SERVER_VISIBILITY: