|
@@ -188,25 +188,25 @@ struct NewGRFParametersWindow : public W
|
|
|
}
|
|
|
|
|
|
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
|
|
|
{
|
|
|
switch (widget) {
|
|
|
case WID_NP_NUMPAR_DEC:
|
|
|
case WID_NP_NUMPAR_INC: {
|
|
|
size->width = size->height = FONT_HEIGHT_NORMAL;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
case WID_NP_NUMPAR: {
|
|
|
SetDParam(0, 999);
|
|
|
SetDParamMaxValue(0, lengthof(this->grf_config->param));
|
|
|
Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->widget_data);
|
|
|
d.width += padding.width;
|
|
|
d.height += padding.height;
|
|
|
*size = maxdim(*size, d);
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
case WID_NP_BACKGROUND:
|
|
|
this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
|
|
|
|
|
|
resize->width = 1;
|
|
|
resize->height = this->line_height;
|
|
@@ -1956,35 +1956,35 @@ struct ScanProgressWindow : public Windo
|
|
|
}
|
|
|
|
|
|
/** Free the last name buffer. */
|
|
|
~ScanProgressWindow()
|
|
|
{
|
|
|
free(last_name);
|
|
|
}
|
|
|
|
|
|
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
|
|
|
{
|
|
|
switch (widget) {
|
|
|
case WID_SP_PROGRESS_BAR: {
|
|
|
SetDParam(0, 100);
|
|
|
SetDParamMaxValue(0, 100);
|
|
|
*size = GetStringBoundingBox(STR_GENERATION_PROGRESS);
|
|
|
/* We need some spacing for the 'border' */
|
|
|
size->height += 8;
|
|
|
size->width += 8;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
case WID_SP_PROGRESS_TEXT:
|
|
|
SetDParam(0, 9999);
|
|
|
SetDParam(1, 9999);
|
|
|
SetDParamMaxDigits(0, 4);
|
|
|
SetDParamMaxDigits(1, 4);
|
|
|
/* We really don't know the width. We could determine it by scanning the NewGRFs,
|
|
|
* but this is the status window for scanning them... */
|
|
|
size->width = max(400U, GetStringBoundingBox(STR_NEWGRF_SCAN_STATUS).width);
|
|
|
size->height = FONT_HEIGHT_NORMAL * 2 + WD_PAR_VSEP_NORMAL;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
virtual void DrawWidget(const Rect &r, int widget) const
|
|
|
{
|
|
|
switch (widget) {
|
|
|
case WID_SP_PROGRESS_BAR: {
|