(svn r9088) -Add : a new type of widget, called WWT_TEXT. It is a simple truncated string. It will be usefull on windows where lot of simple text is always drawn on the WE_PAINT event, making the code clearer. For now, left, right (total size of the window), top, color and data are necessary to use it. Maybe more features will be available soon.
authorbelugas
Sat, 10 Mar 2007 03:25:15 +0000
changeset 6604 ad6057954de6
parent 6603 a83fd7ad59d0
child 6605 0d727f17ee17
(svn r9088) -Add : a new type of widget, called WWT_TEXT. It is a simple truncated string. It will be usefull on windows where lot of simple text is always drawn on the WE_PAINT event, making the code clearer. For now, left, right (total size of the window), top, color and data are necessary to use it. Maybe more features will be available soon.
src/widget.cpp
src/window.h
--- a/src/widget.cpp	Sat Mar 10 00:30:18 2007 +0000
+++ b/src/widget.cpp	Sat Mar 10 03:25:15 2007 +0000
@@ -235,6 +235,13 @@
 			goto draw_default;
 		}
 
+		case WWT_TEXT: {
+			StringID str = wi->data;
+
+			if (str != STR_NULL) DrawStringTruncated(r.left, r.top, str, wi->color, r.right - r.left);
+			break;
+		}
+
 		case WWT_INSET: {
 			StringID str = wi->data;
 			DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_LOWERED | FR_DARKENED);
--- a/src/window.h	Sat Mar 10 00:30:18 2007 +0000
+++ b/src/window.h	Sat Mar 10 03:25:15 2007 +0000
@@ -492,6 +492,7 @@
 	WWT_TEXTBTN,    ///< button with text
 	WWT_TEXTBTN_2,  ///< button with diff text when clicked
 	WWT_LABEL,      ///< centered label
+	WWT_TEXT,       ///< pure simple text
 	WWT_MATRIX,
 	WWT_SCROLLBAR,
 	WWT_FRAME,      ///< frame