(svn r4753) - Truncate text in dropdown lists to stop text overflowing.
authorpeter1138
Sat, 06 May 2006 20:29:31 +0000
changeset 3762 91f23249d987
parent 3761 b8468ecd6dda
child 3763 7098c393c172
(svn r4753) - Truncate text in dropdown lists to stop text overflowing.
widget.c
--- a/widget.c	Sat May 06 20:27:32 2006 +0000
+++ b/widget.c	Sat May 06 20:29:31 2006 +0000
@@ -212,7 +212,7 @@
 			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 @@
 				}
 				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,