|
@@ -450,20 +450,22 @@ struct NewGRFParametersWindow : public W
|
|
|
par_info.SetValue(this->grf_config, val);
|
|
|
this->SetDirty();
|
|
|
}
|
|
|
|
|
|
void OnDropdownSelect(int widget, int index) override
|
|
|
{
|
|
|
if (widget >= 0) return;
|
|
|
assert(this->clicked_dropdown);
|
|
|
GRFParameterInfo &par_info = this->GetParameterInfo(this->clicked_row);
|
|
|
par_info.SetValue(this->grf_config, index);
|
|
|
this->SetDirty();
|
|
|
}
|
|
|
|
|
|
void OnDropdownClose(Point, int widget, int, bool) override
|
|
|
{
|
|
|
if (widget >= 0) return;
|
|
|
/* We cannot raise the dropdown button just yet. OnClick needs some hint, whether
|
|
|
* the same dropdown button was clicked again, and then not open the dropdown again.
|
|
|
* So, we only remember that it was closed, and process it on the next OnPaint, which is
|
|
|
* after OnClick. */
|
|
|
assert(this->clicked_dropdown);
|
|
|
this->closing_dropdown = true;
|
|
@@ -1166,12 +1168,13 @@ struct NewGRFWindow : public Window, New
|
|
|
this->avails.ForceRebuild();
|
|
|
this->CloseChildWindows(WC_QUERY_STRING); // Remove the parameter query window
|
|
|
}
|
|
|
|
|
|
void OnDropdownSelect(int widget, int index) override
|
|
|
{
|
|
|
if (widget >= 0) return;
|
|
|
if (!this->editable) return;
|
|
|
|
|
|
ClearGRFConfigList(&this->actives);
|
|
|
this->preset = index;
|
|
|
|
|
|
if (index != -1) {
|
|
@@ -1349,20 +1352,22 @@ struct NewGRFWindow : public Window, New
|
|
|
this->InvalidateData(0);
|
|
|
}
|
|
|
|
|
|
return ES_HANDLED;
|
|
|
}
|
|
|
|
|
|
void OnEditboxChanged(int wid) override
|
|
|
void OnEditboxChanged(int widget) override
|
|
|
{
|
|
|
if (!this->editable) return;
|
|
|
|
|
|
string_filter.SetFilterTerm(this->filter_editbox.text.buf);
|
|
|
this->avails.SetFilterState(!string_filter.IsEmpty());
|
|
|
this->avails.ForceRebuild();
|
|
|
this->InvalidateData(0);
|
|
|
if (widget == WID_NS_FILTER) {
|
|
|
string_filter.SetFilterTerm(this->filter_editbox.text.buf);
|
|
|
this->avails.SetFilterState(!string_filter.IsEmpty());
|
|
|
this->avails.ForceRebuild();
|
|
|
this->InvalidateData(0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void OnDragDrop(Point pt, int widget) override
|
|
|
{
|
|
|
if (!this->editable) return;
|
|
|
|