summaryrefslogtreecommitdiff
path: root/src/widget_type.h
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-06-03 20:00:33 +0000
committeralberth <alberth@openttd.org>2009-06-03 20:00:33 +0000
commit1ba3755aa7383c34042f781c85a28f76417962cd (patch)
treefe4f24c20a367e5f0d53e64b5107ea6a8d6c8446 /src/widget_type.h
parentcaf98238e3cffedbc80fc9f7aa0f485500f6913a (diff)
downloadopenttd-1ba3755aa7383c34042f781c85a28f76417962cd.tar.xz
(svn r16513) -Codechange: Add nested widgets root and array to Window, and NWidgetBase::FillNestedArray() to fill the array.
Diffstat (limited to 'src/widget_type.h')
-rw-r--r--src/widget_type.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widget_type.h b/src/widget_type.h
index 3ddc33de6..56fa5054f 100644
--- a/src/widget_type.h
+++ b/src/widget_type.h
@@ -151,6 +151,9 @@ enum SizingType {
ST_RESIZE, ///< Resize the nested widget tree.
};
+/* Forward declarations. */
+class NWidgetCore;
+
/**
* Baseclass for nested widgets.
* @invariant After initialization, \f$current\_x = smallest\_x + n * resize\_x, for n \geq 0\f$.
@@ -165,6 +168,7 @@ public:
virtual void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl) = 0;
virtual void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl) = 0;
+ virtual void FillNestedArray(NWidgetCore **array, uint length) = 0;
/**
* Set additional space (padding) around the widget.
@@ -260,6 +264,7 @@ public:
int SetupSmallestSize();
void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
+ /* virtual */ void FillNestedArray(NWidgetCore **array, uint length);
Colours colour; ///< Colour of this widget.
int index; ///< Index of the nested widget in the widget array of the window (\c -1 means 'not used').
@@ -275,6 +280,7 @@ public:
~NWidgetContainer();
void Add(NWidgetBase *wid);
+ /* virtual */ void FillNestedArray(NWidgetCore **array, uint length);
/** Return whether the container is empty. */
inline bool IsEmpty() { return head == NULL; };
@@ -353,6 +359,7 @@ public:
int SetupSmallestSize();
void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
+ /* virtual */ void FillNestedArray(NWidgetCore **array, uint length);
};
/** Nested widget with a child.
@@ -369,6 +376,8 @@ public:
void AssignSizePosition(SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
+ /* virtual */ void FillNestedArray(NWidgetCore **array, uint length);
+
private:
NWidgetPIPContainer *child; ///< Child widget.
};