(svn r25679) -Codechange: [Win32] Get the result string of an IME input directly without a trip through the window messaging system.

This commit is contained in:
michi_cc
2013-08-05 20:37:06 +00:00
parent 07cd393f7e
commit 1880c36405
14 changed files with 118 additions and 35 deletions

View File

@@ -2532,6 +2532,33 @@ void HandleCtrlChanged()
}
}
/**
* Insert a text string at the cursor position into the edit box widget.
* @param wid Edit box widget.
* @param str Text string to insert.
*/
/* virtual */ void Window::InsertTextString(int wid, const char *str)
{
QueryString *query = this->GetQueryString(wid);
if (query == NULL) return;
if (query->text.InsertString(str)) {
this->SetWidgetDirty(wid);
this->OnEditboxChanged(wid);
}
}
/**
* Handle text input.
* @param str Text string to input.
*/
void HandleTextInput(const char *str)
{
if (!EditBoxInGlobalFocus()) return;
_focused_window->InsertTextString(_focused_window->window_class == WC_CONSOLE ? 0 : _focused_window->nested_focus->index, str);
}
/**
* Local counter that is incremented each time an mouse input event is detected.
* The counter is used to stop auto-scrolling.