summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-12-08 17:18:51 +0000
committerfrosch <frosch@openttd.org>2012-12-08 17:18:51 +0000
commitb533523258dfd943caa307d28413693bcaa64007 (patch)
tree1236d0e560354d9b22d34269ba5ff99265a94cf6 /src/newgrf_gui.cpp
parent18a5ba4ad7967c537854a3061df9e600c8f55bf7 (diff)
downloadopenttd-b533523258dfd943caa307d28413693bcaa64007.tar.xz
(svn r24801) -Codechange: Add functions to set integral DParams to suitable values for size computations.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index bcdaa8db8..e052cc19c 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -197,7 +197,7 @@ struct NewGRFParametersWindow : public Window {
}
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;
@@ -1965,7 +1965,7 @@ struct ScanProgressWindow : public Window {
{
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;
@@ -1974,8 +1974,8 @@ struct ScanProgressWindow : public Window {
}
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);