(svn r24801) -Codechange: Add functions to set integral DParams to suitable values for size computations.

This commit is contained in:
frosch
2012-12-08 17:18:51 +00:00
parent 18a5ba4ad7
commit b533523258
18 changed files with 82 additions and 49 deletions

View File

@@ -1097,7 +1097,7 @@ public:
if (widget != WID_O_ORDER_LIST) return;
bool rtl = _current_text_dir == TD_RTL;
SetDParam(0, 99);
SetDParamMaxValue(0, this->vehicle->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_FRAMETEXT_RIGHT - index_column_width : r.left + WD_FRAMETEXT_LEFT + index_column_width;