diff options
author | frosch <frosch@openttd.org> | 2012-12-08 17:18:51 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-12-08 17:18:51 +0000 |
commit | b533523258dfd943caa307d28413693bcaa64007 (patch) | |
tree | 1236d0e560354d9b22d34269ba5ff99265a94cf6 /src/timetable_gui.cpp | |
parent | 18a5ba4ad7967c537854a3061df9e600c8f55bf7 (diff) | |
download | openttd-b533523258dfd943caa307d28413693bcaa64007.tar.xz |
(svn r24801) -Codechange: Add functions to set integral DParams to suitable values for size computations.
Diffstat (limited to 'src/timetable_gui.cpp')
-rw-r--r-- | src/timetable_gui.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 272682eb1..6533e351d 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -200,7 +200,7 @@ struct TimetableWindow : Window { { switch (widget) { case WID_VT_ARRIVAL_DEPARTURE_PANEL: - SetDParam(0, MAX_YEAR * DAYS_IN_YEAR); + SetDParamMaxValue(0, MAX_YEAR * DAYS_IN_YEAR); this->deparr_time_width = GetStringBoundingBox(STR_JUST_DATE_TINY).width; this->deparr_abbr_width = max(GetStringBoundingBox(STR_TIMETABLE_ARRIVAL_ABBREVIATION).width, GetStringBoundingBox(STR_TIMETABLE_DEPARTURE_ABBREVIATION).width); size->width = WD_FRAMERECT_LEFT + this->deparr_abbr_width + 10 + this->deparr_time_width + WD_FRAMERECT_RIGHT; @@ -368,7 +368,7 @@ struct TimetableWindow : Window { bool final_order = false; bool rtl = _current_text_dir == TD_RTL; - SetDParam(0, 99); + SetDParamMaxValue(0, v->GetNumOrders(), 2); int index_column_width = GetStringBoundingBox(STR_ORDER_INDEX).width + 2 * GetSpriteSize(rtl ? SPR_ARROW_RIGHT : SPR_ARROW_LEFT).width + 3; int middle = rtl ? r.right - WD_FRAMERECT_RIGHT - index_column_width : r.left + WD_FRAMERECT_LEFT + index_column_width; |