summaryrefslogtreecommitdiff
path: root/src/osk_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-11 22:08:56 +0000
committerrubidium <rubidium@openttd.org>2008-08-11 22:08:56 +0000
commit6995365535370da08116d49a30ebd84d56e7d8ff (patch)
tree64cc604a5c6fdb994ac66d9a17d50caab8d78364 /src/osk_gui.cpp
parent3b4c3a3df690d5ec02ba2bf93a69aa6fe9908810 (diff)
downloadopenttd-6995365535370da08116d49a30ebd84d56e7d8ff.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.cpp9
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