summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2013-08-05 20:37:53 +0000
committermichi_cc <michi_cc@openttd.org>2013-08-05 20:37:53 +0000
commit30867c487f17ca13744977c7873f4e1cf214fd33 (patch)
tree7b7c7bcf951dba613468a4431c0f7510be76180a /src/window.cpp
parente2ec0ddb030afd4e7bdf08d1a8f3cb9361388eae (diff)
downloadopenttd-30867c487f17ca13744977c7873f4e1cf214fd33.tar.xz
(svn r25691) -Add: [OSX] Support for mouse selection in the IME composition string.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 3496c5633..df7d6ef3d 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -393,6 +393,19 @@ QueryString *Window::GetQueryString(uint widnum)
return r;
}
+/**
+ * Get the character that is rendered at a position by the focused edit box.
+ * @param pt The position to test.
+ * @return Pointer to the character at the position or NULL if no character is at the position.
+ */
+/* virtual */ const char *Window::GetTextCharacterAtPosition(const Point &pt) const
+{
+ if (this->nested_focus != NULL && this->nested_focus->type == WWT_EDITBOX) {
+ return this->GetQueryString(this->nested_focus->index)->GetCharAtPosition(this, this->nested_focus->index, pt);
+ }
+
+ return NULL;
+}
/**
* Set the window that has the focus