mirror of https://github.com/OpenTTD/OpenTTD
(svn r13105) -Fix [FS#2015]: the title of a query window would (sometimes) change when the on screen keyboard was opened.
parent
5ae795953a
commit
8ba6f08ca6
|
@ -42,6 +42,7 @@ enum {
|
||||||
static byte _keystate = KEYS_NONE;
|
static byte _keystate = KEYS_NONE;
|
||||||
|
|
||||||
struct OskWindow : public Window {
|
struct OskWindow : public Window {
|
||||||
|
StringID caption; ///< the caption for this window.
|
||||||
QueryString *qs; ///< text-input
|
QueryString *qs; ///< text-input
|
||||||
int text_btn; ///< widget number of parent's text field
|
int text_btn; ///< widget number of parent's text field
|
||||||
int ok_btn; ///< widget number of parent's ok button (=0 when ok shouldn't be passed on)
|
int ok_btn; ///< widget number of parent's ok button (=0 when ok shouldn't be passed on)
|
||||||
|
@ -54,7 +55,7 @@ struct OskWindow : public Window {
|
||||||
this->parent = parent;
|
this->parent = parent;
|
||||||
assert(parent != NULL);
|
assert(parent != NULL);
|
||||||
|
|
||||||
if (parent->widget[button].data != 0) parent->caption = parent->widget[button].data;
|
this->caption = (parent->widget[button].data != STR_NULL) ? parent->widget[button].data : parent->caption;
|
||||||
|
|
||||||
this->qs = parent;
|
this->qs = parent;
|
||||||
this->text_btn = button;
|
this->text_btn = button;
|
||||||
|
@ -96,7 +97,7 @@ struct OskWindow : public Window {
|
||||||
|
|
||||||
this->ChangeOskDiabledState(shift);
|
this->ChangeOskDiabledState(shift);
|
||||||
|
|
||||||
SetDParam(0, this->qs->caption);
|
SetDParam(0, this->caption);
|
||||||
DrawWindowWidgets(this);
|
DrawWindowWidgets(this);
|
||||||
|
|
||||||
for (uint i = 0; i < OSK_KEYBOARD_ENTRIES; i++) {
|
for (uint i = 0; i < OSK_KEYBOARD_ENTRIES; i++) {
|
||||||
|
|
Loading…
Reference in New Issue