summaryrefslogtreecommitdiff
path: root/src/widget_type.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-06-30 14:32:31 +0000
committerfrosch <frosch@openttd.org>2013-06-30 14:32:31 +0000
commit98fdd20f84c5d1dc64b8b07dca533fc41be4d8e3 (patch)
tree593aaf868f673d36ad7ab6b6ce20818403c82877 /src/widget_type.h
parent631540c4000e0d9236fe52b48b1c4e70497ee3b4 (diff)
downloadopenttd-98fdd20f84c5d1dc64b8b07dca533fc41be4d8e3.tar.xz
(svn r25531) -Codechange: Use separate function to set data of WWT_MATRIX widgets.
Diffstat (limited to 'src/widget_type.h')
-rw-r--r--src/widget_type.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/widget_type.h b/src/widget_type.h
index 222983cd2..14b555315 100644
--- a/src/widget_type.h
+++ b/src/widget_type.h
@@ -1021,6 +1021,18 @@ static inline NWidgetPart SetDataTip(uint16 data, StringID tip)
}
/**
+ * Widget part function for setting the data and tooltip of WWT_MATRIX widgets
+ * @param cols Number of columns.
+ * @param rows Number of rows.
+ * @param tip Tooltip of the widget.
+ * @ingroup NestedWidgetParts
+ */
+static inline NWidgetPart SetMatrixDataTip(uint8 cols, uint8 rows, StringID tip)
+{
+ return SetDataTip((rows << MAT_ROW_START) | (cols << MAT_COL_START), tip);
+}
+
+/**
* Widget part function for setting additional space around a widget.
* Parameters start above the widget, and are specified in clock-wise direction.
* @param top The padding above the widget.