summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2013-08-05 20:37:14 +0000
committermichi_cc <michi_cc@openttd.org>2013-08-05 20:37:14 +0000
commitda09fd3077c288317aaa897b4665c30150358321 (patch)
treefeadeb4b523c314216133329c14d59095591cdda /src/window.cpp
parent21126aec623c4d5a9afea786f2d57d8897a407bc (diff)
downloadopenttd-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.cpp14
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