diff options
author | rubidium <rubidium@openttd.org> | 2010-12-05 22:22:54 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-12-05 22:22:54 +0000 |
commit | 66c7f00b607666df05849e66f6911dac9b426bd4 (patch) | |
tree | 173929763007a6333a78df6531c6120a9d01203f /src/querystring_gui.h | |
parent | bbaa262b0db6cf3b9ba942e0d0018ea403224c09 (diff) | |
download | openttd-66c7f00b607666df05849e66f6911dac9b426bd4.tar.xz |
(svn r21407) -Codechange: prepare the text buffer code for limiting on number of characters besides the number of bytes
Diffstat (limited to 'src/querystring_gui.h')
-rw-r--r-- | src/querystring_gui.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/querystring_gui.h b/src/querystring_gui.h index ba0776318..02ac8cb18 100644 --- a/src/querystring_gui.h +++ b/src/querystring_gui.h @@ -62,8 +62,9 @@ public: struct QueryStringBaseWindow : public Window, public QueryString { char *edit_str_buf; ///< Buffer for string. const uint16 edit_str_size; ///< Maximum length of string (in bytes), including terminating '\0'. + const uint16 max_chars; ///< Maximum length of string (in characters), including terminating '\0'. - QueryStringBaseWindow(uint16 size) : Window(), edit_str_size(size) + QueryStringBaseWindow(uint16 size, uint16 chars = UINT16_MAX) : Window(), edit_str_size(size), max_chars(chars == UINT16_MAX ? size : chars) { assert(size != 0); this->edit_str_buf = CallocT<char>(size); |