(svn r16516) -Codechange: Added click and drag handling for nested widgets.

This commit is contained in:
alberth
2009-06-04 14:07:05 +00:00
parent 1a4934ef07
commit b144a5451c
4 changed files with 156 additions and 82 deletions

View File

@@ -1072,11 +1072,10 @@ bool HandleCaret(Textbuf *tb)
bool QueryString::HasEditBoxFocus(const Window *w, int wid) const
{
return (w->window_class == WC_OSK &&
_focused_window == w->parent &&
w->parent->focused_widget != NULL &&
w->parent->focused_widget->type == WWT_EDITBOX) ||
w->IsWidgetGloballyFocused(wid);
if (w->IsWidgetGloballyFocused(wid)) return true;
if (w->window_class != WC_OSK || _focused_window != w->parent) return false;
return (w->parent->focused_widget != NULL && w->parent->focused_widget->type == WWT_EDITBOX) ||
(w->parent->nested_focus != NULL && w->parent->nested_focus->type == WWT_EDITBOX);
}
HandleEditBoxResult QueryString::HandleEditBoxKey(Window *w, int wid, uint16 key, uint16 keycode, Window::EventState &state)