diff options
author | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:37:14 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:37:14 +0000 |
commit | da09fd3077c288317aaa897b4665c30150358321 (patch) | |
tree | feadeb4b523c314216133329c14d59095591cdda /src/window.cpp | |
parent | 21126aec623c4d5a9afea786f2d57d8897a407bc (diff) | |
download | openttd-da09fd3077c288317aaa897b4665c30150358321.tar.xz |
(svn r25681) -Change: [Win32] Position the IME composition window at the caret position.
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp index 522a10a6f..2805301f0 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -323,6 +323,20 @@ QueryString *Window::GetQueryString(uint widnum) return query != this->querystrings.End() ? query->second : NULL; } +/** + * Get the current caret position if an edit box has the focus. + * @return Top-left location of the caret, relative to the window. + */ +/* virtual */ Point Window::GetCaretPosition() const +{ + if (this->nested_focus != NULL && this->nested_focus->type == WWT_EDITBOX) { + return this->GetQueryString(this->nested_focus->index)->GetCaretPosition(this, this->nested_focus->index); + } + + Point pt = {0, 0}; + return pt; +} + /** * Set the window that has the focus |