(svn r25692) -Add: Replacement of a part of the edit box text with a new string.

This commit is contained in:
michi_cc
2013-08-05 20:37:57 +00:00
parent e34fe220e2
commit 164aba8732
6 changed files with 61 additions and 40 deletions

View File

@@ -2620,12 +2620,12 @@ void HandleCtrlChanged()
* @param wid Edit box widget.
* @param str Text string to insert.
*/
/* virtual */ void Window::InsertTextString(int wid, const char *str, bool marked, const char *caret)
/* virtual */ void Window::InsertTextString(int wid, const char *str, bool marked, const char *caret, const char *insert_location, const char *replacement_end)
{
QueryString *query = this->GetQueryString(wid);
if (query == NULL) return;
if (query->text.InsertString(str, marked, caret) || marked) {
if (query->text.InsertString(str, marked, caret, insert_location, replacement_end) || marked) {
this->SetWidgetDirty(wid);
this->OnEditboxChanged(wid);
}
@@ -2637,11 +2637,11 @@ void HandleCtrlChanged()
* @param marked Is the input a marked composition string from an IME?
* @param caret Move the caret to this point in the insertion string.
*/
void HandleTextInput(const char *str, bool marked, const char *caret)
void HandleTextInput(const char *str, bool marked, const char *caret, const char *insert_location, const char *replacement_end)
{
if (!EditBoxInGlobalFocus()) return;
_focused_window->InsertTextString(_focused_window->window_class == WC_CONSOLE ? 0 : _focused_window->nested_focus->index, str, marked, caret);
_focused_window->InsertTextString(_focused_window->window_class == WC_CONSOLE ? 0 : _focused_window->nested_focus->index, str, marked, caret, insert_location, replacement_end);
}
/**