|
@@ -540,50 +540,54 @@ bool CompareWidgetArrays(const Widget *o
|
|
|
struct NWidgetPartDataTip {
|
|
|
uint16 data; ///< Data value of the widget.
|
|
|
StringID tooltip; ///< Tooltip of the widget.
|
|
|
};
|
|
|
|
|
|
/** Widget part for storing basic widget information.
|
|
|
* @ingroup NestedWidgetParts */
|
|
|
struct NWidgetPartWidget {
|
|
|
Colours colour; ///< Widget colour.
|
|
|
int16 index; ///< Widget index in the widget array.
|
|
|
};
|
|
|
|
|
|
/** Widget part for storing padding.
|
|
|
* @ingroup NestedWidgetParts */
|
|
|
struct NWidgetPartPaddings {
|
|
|
uint8 top, right, bottom, left; ///< Paddings for all directions.
|
|
|
};
|
|
|
|
|
|
/** Widget part for storing pre/inter/post spaces.
|
|
|
* @ingroup NestedWidgetParts */
|
|
|
struct NWidgetPartPIP {
|
|
|
uint8 pre, inter, post; ///< Amount of space before/between/after child widgets.
|
|
|
};
|
|
|
|
|
|
/** Pointer to function returning a nested widget. */
|
|
|
typedef NWidgetBase *NWidgetFunctionType();
|
|
|
/** Pointer to function returning a nested widget.
|
|
|
* @param biggest_index Pointer to storage for collecting the biggest index used in the nested widget.
|
|
|
* @return Nested widget (tree).
|
|
|
* @postcond \c *biggest_index must contain the value of the biggest index in the returned tree.
|
|
|
*/
|
|
|
typedef NWidgetBase *NWidgetFunctionType(int *biggest_index);
|
|
|
|
|
|
/** Partial widget specification to allow NWidgets to be written nested.
|
|
|
* @ingroup NestedWidgetParts */
|
|
|
struct NWidgetPart {
|
|
|
WidgetType type; ///< Type of the part. @see NWidgetPartType.
|
|
|
union {
|
|
|
Point xy; ///< Part with an x/y size.
|
|
|
Point *xy_ptr; ///< Part with a pointer to an x/y size.
|
|
|
NWidgetPartDataTip data_tip; ///< Part with a data/tooltip.
|
|
|
NWidgetPartDataTip *datatip_ptr; ///< Part with a pointer to data/tooltip.
|
|
|
NWidgetPartWidget widget; ///< Part with a start of a widget.
|
|
|
NWidgetPartPaddings padding; ///< Part with paddings.
|
|
|
NWidgetPartPIP pip; ///< Part with pre/inter/post spaces.
|
|
|
NWidgetFunctionType *func_ptr; ///< Part with a function call.
|
|
|
NWidContainerFlags cont_flags; ///< Part with container flags.
|
|
|
} u;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* Widget part function for setting the resize step.
|
|
|
* @param dx Horizontal resize step. 0 means no horizontal resizing.
|
|
|
* @param dy Vertical resize step. 0 means no horizontal resizing.
|
|
|
* @ingroup NestedWidgetParts
|
|
|
*/
|