summaryrefslogtreecommitdiff
path: root/src/toolbar_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-21 19:31:47 +0000
committerrubidium <rubidium@openttd.org>2009-03-21 19:31:47 +0000
commit93fe44a3c561e357313af0f8332a697b46812474 (patch)
tree815d6455f0947e44d67f175b86832b1932c3e96b /src/toolbar_gui.cpp
parent8a758beec30dcf3c43d69d5adafbac59f296b9f1 (diff)
downloadopenttd-93fe44a3c561e357313af0f8332a697b46812474.tar.xz
(svn r15783) -Codechange: make the dropdown draw code pass around the left/right instead of the x and width to make drawing text at offsets easier.
Diffstat (limited to 'src/toolbar_gui.cpp')
-rw-r--r--src/toolbar_gui.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 657802d38..965ebb25e 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -129,12 +129,12 @@ public:
virtual ~DropDownListCheckedItem() {}
- void Draw(int x, int y, uint width, uint height, bool sel, int bg_colour) const
+ void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const
{
if (checked) {
- DrawString(x + 2, y, STR_CHECKMARK, sel ? TC_WHITE : TC_BLACK);
+ DrawString(left + 2, right - 2, top, STR_CHECKMARK, sel ? TC_WHITE : TC_BLACK);
}
- DrawStringTruncated(x + 2, y, this->String(), sel ? TC_WHITE : TC_BLACK, width);
+ DrawString(left + 2, right - 2, top, this->String(), sel ? TC_WHITE : TC_BLACK);
}
};
@@ -164,10 +164,10 @@ public:
return GetStringBoundingBox(buffer).width + 19;
}
- void Draw(int x, int y, uint width, uint height, bool sel, int bg_colour) const
+ void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const
{
CompanyID company = (CompanyID)result;
- DrawCompanyIcon(company, x + 2, y + 1);
+ DrawCompanyIcon(company, left + 2, top + 1);
SetDParam(0, company);
SetDParam(1, company);
@@ -177,7 +177,7 @@ public:
} else {
col = sel ? TC_WHITE : TC_BLACK;
}
- DrawStringTruncated(x + 19, y, STR_7021, col, width - 17);
+ DrawString(left + 19, right - 2, top, STR_7021, col);
}
};