diff options
author | rubidium <rubidium@openttd.org> | 2008-08-11 22:08:56 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-08-11 22:08:56 +0000 |
commit | 122f029b9387c0834fdc1e9b75c09abf6ebf024e (patch) | |
tree | 64cc604a5c6fdb994ac66d9a17d50caab8d78364 /src/osk_gui.cpp | |
parent | 0fab1dc6992bd316c1752378b6f3f913d36087e9 (diff) | |
download | openttd-122f029b9387c0834fdc1e9b75c09abf6ebf024e.tar.xz |
(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.
Diffstat (limited to 'src/osk_gui.cpp')
-rw-r--r-- | src/osk_gui.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index 7df8836a4..9e1ee75b1 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -48,7 +48,7 @@ struct OskWindow : public Window { int ok_btn; ///< widget number of parent's ok button (=0 when ok shouldn't be passed on) int cancel_btn; ///< widget number of parent's cancel button (=0 when cancel shouldn't be passed on; text will be reverted to original) Textbuf *text; ///< pointer to parent's textbuffer (to update caret position) - char orig_str_buf[64]; ///< Original string. + char *orig_str_buf; ///< Original string. OskWindow(const WindowDesc *desc, QueryStringBaseWindow *parent, int button, int cancel, int ok) : Window(desc) { @@ -64,7 +64,7 @@ struct OskWindow : public Window { this->text = &parent->text; /* make a copy in case we need to reset later */ - strcpy(this->orig_str_buf, this->qs->text.buf); + this->orig_str_buf = strdup(this->qs->text.buf); SetBit(_no_scroll, SCROLL_EDIT); /* Not needed by default. */ @@ -73,6 +73,11 @@ struct OskWindow : public Window { this->FindWindowPlacementAndResize(desc); } + ~OskWindow() + { + free(this->orig_str_buf); + } + /** * Only show valid characters; do not show characters that would * only insert a space when we have a spacebar to do that or |