diff options
author | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:37:53 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:37:53 +0000 |
commit | 30867c487f17ca13744977c7873f4e1cf214fd33 (patch) | |
tree | 7b7c7bcf951dba613468a4431c0f7510be76180a /src/console_gui.cpp | |
parent | e2ec0ddb030afd4e7bdf08d1a8f3cb9361388eae (diff) | |
download | openttd-30867c487f17ca13744977c7873f4e1cf214fd33.tar.xz |
(svn r25691) -Add: [OSX] Support for mouse selection in the IME composition string.
Diffstat (limited to 'src/console_gui.cpp')
-rw-r--r-- | src/console_gui.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/console_gui.cpp b/src/console_gui.cpp index 530cb8bfd..1e1fd069b 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -351,12 +351,21 @@ struct IConsoleWindow : Window int delta = min(this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH, 0); Point p1 = GetCharPosInString(_iconsole_cmdline.buf, from, FS_NORMAL); - Point p2 = from != to ? GetCharPosInString(_iconsole_cmdline.buf, from, FS_NORMAL) : p1; + Point p2 = from != to ? GetCharPosInString(_iconsole_cmdline.buf, from) : p1; Rect r = {this->line_offset + delta + p1.x, this->height - this->line_height, this->line_offset + delta + p2.x, this->height}; return r; } + virtual const char *GetTextCharacterAtPosition(const Point &pt) const + { + int delta = min(this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH, 0); + + if (!IsInsideMM(pt.y, this->height - this->line_height, this->height)) return NULL; + + return GetCharAtPosition(_iconsole_cmdline.buf, pt.x - delta); + } + virtual void OnMouseWheel(int wheel) { this->Scroll(-wheel); |