summaryrefslogtreecommitdiff
path: root/widget.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-05-06 20:29:31 +0000
committerpeter1138 <peter1138@openttd.org>2006-05-06 20:29:31 +0000
commit5c94fd7afa166551a4ceee4df657c561f2ba957c (patch)
tree9dcab3fa3791bad869709aef1650cf2657d77568 /widget.c
parent82037a5abecea4e1f51e76f4cbde773d6c7013f5 (diff)
downloadopenttd-5c94fd7afa166551a4ceee4df657c561f2ba957c.tar.xz
(svn r4753) - Truncate text in dropdown lists to stop text overflowing.
Diffstat (limited to 'widget.c')
-rw-r--r--widget.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/widget.c b/widget.c
index ac722f501..7b9bb9f92 100644
--- a/widget.c
+++ b/widget.c
@@ -212,7 +212,7 @@ void DrawWindowWidgets(const Window *w)
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_LOWERED | FR_DARKENED);
str = wi->unkA;
- if (str != 0) DrawString(r.left + 2, r.top + 1, str, 0);
+ if (str != 0) DrawStringTruncated(r.left + 2, r.top + 1, str, 0, r.right - r.left - 10);
goto draw_default;
}
@@ -494,7 +494,7 @@ static void DropdownMenuWndProc(Window *w, WindowEvent *e)
}
if (WP(w,dropdown_d).items[i] != 0) {
if (sel == 0) GfxFillRect(x + 1, y, x + w->width - 4, y + 9, 0);
- DrawString(x + 2, y, WP(w,dropdown_d).items[i], sel == 0 ? 12 : 16);
+ DrawStringTruncated(x + 2, y, WP(w,dropdown_d).items[i], sel == 0 ? 12 : 16, w->width - 4);
if (HASBIT(WP(w,dropdown_d).disabled_state, i)) {
GfxFillRect(x, y, x + w->width - 3, y + 9,