diff options
author | rubidium <rubidium@openttd.org> | 2008-03-26 10:08:17 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-03-26 10:08:17 +0000 |
commit | 327e870962e53a9ae809f588d520f216274679ed (patch) | |
tree | 6f0a8507b3787ee4fc264a975c90db6c455c39a1 /src/textbuf_gui.h | |
parent | 06c0e5df5a9b043ef9745e3c2cc1653847a110ab (diff) | |
download | openttd-327e870962e53a9ae809f588d520f216274679ed.tar.xz |
(svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
Diffstat (limited to 'src/textbuf_gui.h')
-rw-r--r-- | src/textbuf_gui.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/textbuf_gui.h b/src/textbuf_gui.h index 5f0f6bd78..4a7f70c85 100644 --- a/src/textbuf_gui.h +++ b/src/textbuf_gui.h @@ -7,6 +7,7 @@ #include "window_type.h" #include "string_type.h" +#include "strings_type.h" struct Textbuf { char *buf; ///< buffer in which text is saved @@ -26,6 +27,8 @@ struct querystr_d { }; assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(querystr_d)); +extern char _edit_str_buf[64]; +extern char _orig_str_buf[lengthof(_edit_str_buf)]; void DrawEditBox(Window *w, querystr_d *string, int wid); void HandleEditBox(Window *w, querystr_d *string, int wid); @@ -43,4 +46,16 @@ void UpdateTextBufferSize(Textbuf *tb); void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth, Window *parent, CharSetFilter afilter); void ShowQuery(StringID caption, StringID message, Window *w, void (*callback)(Window*, bool)); +/** The number of 'characters' on the on-screen keyboard. */ +static const uint OSK_KEYBOARD_ENTRIES = 50; + +/** + * The number of characters has to be OSK_KEYBOARD_ENTRIES. However, these + * have to be UTF-8 encoded, which means up to 4 bytes per character. + * Furthermore the string needs to be '\0'-terminated. + */ +extern char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1]; + +void ShowOnScreenKeyboard(Window *parent, querystr_d *q, int button, int cancel, int ok); + #endif /* TEXTBUF_GUI_H */ |