|
@@ -460,26 +460,25 @@ static void DispatchLeftClickEvent(Windo
|
|
|
/* Close any child drop down menus. If the button pressed was the drop down
|
|
|
* list's own button, then we should not process the click any further. */
|
|
|
if (HideDropDownMenu(w) == widget_index && widget_index >= 0) return;
|
|
|
|
|
|
if ((widget_type & ~WWB_PUSHBUTTON) < WWT_LAST && (widget_type & WWB_PUSHBUTTON)) w->HandleButtonClick(widget_index);
|
|
|
|
|
|
Point pt = { x, y };
|
|
|
|
|
|
switch (widget_type) {
|
|
|
case NWID_VSCROLLBAR:
|
|
|
case NWID_HSCROLLBAR:
|
|
|
ScrollbarClickHandler(w, nw, x, y);
|
|
|
break;
|
|
|
|
|
|
case WWT_EDITBOX:
|
|
|
if (!focused_widget_changed) { // Only open the OSK window if clicking on an already focused edit box
|
|
|
/* Open the OSK window if clicked on an edit box */
|
|
|
if (w->querystrings.Contains(widget_index)) {
|
|
|
ShowOnScreenKeyboard(w, widget_index);
|
|
|
case WWT_EDITBOX: {
|
|
|
QueryString *query = w->GetQueryString(widget_index);
|
|
|
if (query != NULL) query->ClickEditBox(w, pt, widget_index, click_count, focused_widget_changed);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case WWT_CLOSEBOX: // 'X'
|
|
|
delete w;
|
|
|
return;
|
|
|
|
|
|
case WWT_CAPTION: // 'Title bar'
|
|
@@ -517,13 +516,12 @@ static void DispatchLeftClickEvent(Windo
|
|
|
/* Check if the widget is highlighted; if so, disable highlight and dispatch an event to the GameScript */
|
|
|
if (w->IsWidgetHighlighted(widget_index)) {
|
|
|
w->SetWidgetHighlight(widget_index, TC_INVALID);
|
|
|
Game::NewEvent(new ScriptEventWindowWidgetClick((ScriptWindow::WindowClass)w->window_class, w->window_number, widget_index));
|
|
|
}
|
|
|
|
|
|
Point pt = { x, y };
|
|
|
w->OnClick(pt, widget_index, click_count);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Dispatch right mouse-button click in window.
|
|
|
* @param w Window to dispatch event in
|