diff options
author | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:37:48 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:37:48 +0000 |
commit | e2ec0ddb030afd4e7bdf08d1a8f3cb9361388eae (patch) | |
tree | 1c90e05fa6e94d2b0f1ebf2fff6ff444e2d515ed /src/window.cpp | |
parent | f5e41314922604c160efc4ac18c77056a1b66400 (diff) | |
download | openttd-e2ec0ddb030afd4e7bdf08d1a8f3cb9361388eae.tar.xz |
(svn r25690) -Change: [OSX] Position the candidate window at the caret position.
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp index 907f575c6..3496c5633 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -377,6 +377,22 @@ QueryString *Window::GetQueryString(uint widnum) return pt; } +/** + * Get the bounding rectangle for a text range if an edit box has the focus. + * @param from Start of the string range. + * @param to End of the string range. + * @return Rectangle encompassing the string range, relative to the window. + */ +/* virtual */ Rect Window::GetTextBoundingRect(const char *from, const char *to) const +{ + if (this->nested_focus != NULL && this->nested_focus->type == WWT_EDITBOX) { + return this->GetQueryString(this->nested_focus->index)->GetBoundingRect(this, this->nested_focus->index, from, to); + } + + Rect r = {0, 0, 0, 0}; + return r; +} + /** * Set the window that has the focus |