diff options
author | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:37:44 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2013-08-05 20:37:44 +0000 |
commit | f5e41314922604c160efc4ac18c77056a1b66400 (patch) | |
tree | 38f170e1e3a23264104803d4b573ab43644e23a0 /src/querystring_gui.h | |
parent | c64e297e0c3f5f1f59a21d1ad3e12e6834e155d7 (diff) | |
download | openttd-f5e41314922604c160efc4ac18c77056a1b66400.tar.xz |
(svn r25689) -Add: [OSX] Display the IME composition string ourself.
Diffstat (limited to 'src/querystring_gui.h')
-rw-r--r-- | src/querystring_gui.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/querystring_gui.h b/src/querystring_gui.h index a652b382d..db6e33076 100644 --- a/src/querystring_gui.h +++ b/src/querystring_gui.h @@ -55,6 +55,37 @@ public: void HandleEditBox(Window *w, int wid); Point GetCaretPosition(const Window *w, int wid) const; + + /** + * Get the current text. + * @return Current text. + */ + const char *GetText() const + { + return this->text.buf; + } + + /** + * Get the position of the caret in the text buffer. + * @return Pointer to the caret in the text buffer. + */ + const char *GetCaret() const + { + return this->text.buf + this->text.caretpos; + } + + /** + * Get the currently marked text. + * @param[out] length Length of the marked text. + * @return Begining of the marked area or NULL if no text is marked. + */ + const char *GetMarkedText(size_t *length) const + { + if (this->text.markend == 0) return NULL; + + *length = this->text.markend - this->text.markpos; + return this->text.buf + this->text.markpos; + } }; void ShowOnScreenKeyboard(Window *parent, int button); |