|
@@ -504,25 +504,25 @@ struct GenerateLandscapeWindow : public
|
|
|
size->width = 0;
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
return;
|
|
|
}
|
|
|
if (strs != nullptr) {
|
|
|
while (*strs != INVALID_STRING_ID) {
|
|
|
*size = maxdim(*size, GetStringBoundingBox(*strs++));
|
|
|
}
|
|
|
}
|
|
|
size->width += padding.width;
|
|
|
size->height = max(size->height, (uint)(FONT_HEIGHT_NORMAL + WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM));
|
|
|
size->height = std::max(size->height, (uint)(FONT_HEIGHT_NORMAL + WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM));
|
|
|
}
|
|
|
|
|
|
void DrawWidget(const Rect &r, int widget) const override
|
|
|
{
|
|
|
switch (widget) {
|
|
|
case WID_GL_HEIGHTMAP_NAME_TEXT: {
|
|
|
DrawString(r.left, r.right, r.top, this->name, TC_ORANGE);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1205,25 +1205,25 @@ struct GenerateProgressWindow : public W
|
|
|
switch (widget) {
|
|
|
case WID_GP_PROGRESS_BAR: {
|
|
|
SetDParamMaxValue(0, 100);
|
|
|
*size = GetStringBoundingBox(STR_GENERATION_PROGRESS);
|
|
|
/* We need some spacing for the 'border' */
|
|
|
size->height += 8;
|
|
|
size->width += 8;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
case WID_GP_PROGRESS_TEXT:
|
|
|
for (uint i = 0; i < GWP_CLASS_COUNT; i++) {
|
|
|
size->width = max(size->width, GetStringBoundingBox(_generation_class_table[i]).width);
|
|
|
size->width = std::max(size->width, GetStringBoundingBox(_generation_class_table[i]).width);
|
|
|
}
|
|
|
size->height = FONT_HEIGHT_NORMAL * 2 + WD_PAR_VSEP_NORMAL;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void DrawWidget(const Rect &r, int widget) const override
|
|
|
{
|
|
|
switch (widget) {
|
|
|
case WID_GP_PROGRESS_BAR:
|
|
|
/* Draw the % complete with a bar and a text */
|
|
|
DrawFrameRect(r.left, r.top, r.right, r.bottom, COLOUR_GREY, FR_BORDERONLY);
|