(svn r14046) -Codechange: make the size of querystring "widgets" more configurable.

This commit is contained in:
rubidium
2008-08-11 22:08:56 +00:00
parent 0fab1dc699
commit 122f029b93
6 changed files with 70 additions and 43 deletions

View File

@@ -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