Changeset - r11958:10dc4cb3ebb1
[Not reviewed]
master
0 2 0
alberth - 15 years ago 2009-05-21 16:14:04
alberth@openttd.org
(svn r16369) -Codechange: Renaming ComputeMinimalSize() to SetupSmallestSize(), and AssignMinimalPosition() to AssignSizePosition(), they do not compute minimal size anymore.
2 files changed with 41 insertions and 41 deletions:
0 comments (0 inline, 0 general)
src/widget.cpp
Show inline comments
 
@@ -683,26 +683,26 @@ NWidgetBase::NWidgetBase(WidgetType tp) 
 
	this->type = tp;
 
}
 

	
 
/* ~NWidgetContainer() takes care of #next and #prev data members. */
 

	
 
/**
 
 * @fn int NWidgetBase::ComputeMinimalSize()
 
 * @fn int NWidgetBase::SetupSmallestSize()
 
 * @brief Compute smallest size needed by the widget.
 
 *
 
 * The smallest size of a widget is the smallest size that a widget needs to
 
 * display itself properly.
 
 * In addition, filling and resizing of the widget are computed.
 
 * @return Biggest index in the widget array of all child widgets.
 
 *
 
 * @note After the computation, the results can be queried by accessing the data members of the widget.
 
 */
 

	
 
/**
 
 * @fn void NWidgetBase::AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
 * @brief Assign minimal size and position to the widget.
 
 * @fn void NWidgetBase::AssignSizePosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
 * @brief Assign size and position to the widget.
 
 * @param x              Horizontal offset of the widget relative to the left edge of the window.
 
 * @param y              Vertical offset of the widget relative to the top edge of the window.
 
 * @param given_width    Width allocated to the widget.
 
 * @param given_height   Height allocated to the widget.
 
 * @param allow_resize_x Horizontal resizing is allowed.
 
 * @param allow_resize_y Vertical resizing is allowed.
 
@@ -764,13 +764,13 @@ void NWidgetResizeBase::SetFill(bool fil
 
void NWidgetResizeBase::SetResize(uint resize_x, uint resize_y)
 
{
 
	this->resize_x = resize_x;
 
	this->resize_y = resize_y;
 
}
 

	
 
void NWidgetResizeBase::AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
void NWidgetResizeBase::AssignSizePosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
{
 
	this->pos_x = x;
 
	this->pos_y = y;
 
	this->smallest_x = given_width;
 
	this->smallest_y = given_height;
 
	if (!allow_resize_x) this->resize_x = 0;
 
@@ -812,13 +812,13 @@ void NWidgetCore::SetIndex(int index)
 
void NWidgetCore::SetDataTip(uint16 widget_data, StringID tool_tip)
 
{
 
	this->widget_data = widget_data;
 
	this->tool_tip = tool_tip;
 
}
 

	
 
int NWidgetCore::ComputeMinimalSize()
 
int NWidgetCore::SetupSmallestSize()
 
{
 
	this->smallest_x = this->min_x;
 
	this->smallest_y = this->min_y;
 
	/* All other data is already at the right place. */
 
	return this->index;
 
}
 
@@ -903,37 +903,37 @@ void NWidgetContainer::Add(NWidgetBase *
 
 * @param tp Kind of stacking, must be either #NWID_SELECTION or #NWID_LAYERED.
 
 */
 
NWidgetStacked::NWidgetStacked(WidgetType tp) : NWidgetContainer(tp)
 
{
 
}
 

	
 
int NWidgetStacked::ComputeMinimalSize()
 
int NWidgetStacked::SetupSmallestSize()
 
{
 
	/* First sweep, recurse down and compute minimal size and filling. */
 
	int biggest_index = -1;
 
	this->smallest_x = 0;
 
	this->smallest_y = 0;
 
	this->fill_x = (this->head != NULL);
 
	this->fill_y = (this->head != NULL);
 
	this->resize_x = (this->head != NULL) ? 1 : 0;
 
	this->resize_y = (this->head != NULL) ? 1 : 0;
 
	for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
		int idx = child_wid->ComputeMinimalSize();
 
		int idx = child_wid->SetupSmallestSize();
 
		biggest_index = max(biggest_index, idx);
 

	
 
		this->smallest_x = max(this->smallest_x, child_wid->smallest_x + child_wid->padding_left + child_wid->padding_right);
 
		this->smallest_y = max(this->smallest_y, child_wid->smallest_y + child_wid->padding_top + child_wid->padding_bottom);
 
		this->fill_x &= child_wid->fill_x;
 
		this->fill_y &= child_wid->fill_y;
 
		this->resize_x = LeastCommonMultiple(this->resize_x, child_wid->resize_x);
 
		this->resize_y = LeastCommonMultiple(this->resize_y, child_wid->resize_y);
 
	}
 
	return biggest_index;
 
}
 

	
 
void NWidgetStacked::AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
void NWidgetStacked::AssignSizePosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
{
 
	assert(given_width >= this->smallest_x && given_height >= this->smallest_y);
 

	
 
	this->pos_x = x;
 
	this->pos_y = y;
 
	this->smallest_x = given_width;
 
@@ -960,13 +960,13 @@ void NWidgetStacked::AssignMinimalPositi
 
			child_height = given_height - child_wid->padding_top - child_wid->padding_bottom;
 
			child_pos_y = 0;
 
		} else {
 
			child_height = child_wid->smallest_y;
 
			child_pos_y = (given_height - child_wid->padding_top - child_wid->padding_bottom - child_height) / 2;
 
		}
 
		child_wid->AssignMinimalPosition(x + child_pos_x, y + child_pos_y, child_width, child_height, (this->resize_x > 0), (this->resize_y > 0), rtl);
 
		child_wid->AssignSizePosition(x + child_pos_x, y + child_pos_y, child_width, child_height, (this->resize_x > 0), (this->resize_y > 0), rtl);
 
	}
 
}
 

	
 
void NWidgetStacked::StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl)
 
{
 
	for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
@@ -996,25 +996,25 @@ void NWidgetPIPContainer::SetPIP(uint8 p
 

	
 
/** Horizontal container widget. */
 
NWidgetHorizontal::NWidgetHorizontal() : NWidgetPIPContainer(NWID_HORIZONTAL)
 
{
 
}
 

	
 
int NWidgetHorizontal::ComputeMinimalSize()
 
int NWidgetHorizontal::SetupSmallestSize()
 
{
 
	int biggest_index = -1;
 
	this->smallest_x = 0;      // Sum of minimal size of all childs.
 
	this->smallest_y = 0;      // Biggest child.
 
	this->fill_x = false; // true if at least one child allows fill_x.
 
	this->fill_y = true;  // true if all childs allow fill_y.
 
	this->resize_x = 0;   // smallest non-zero child widget resize step.
 
	this->resize_y = 1;   // smallest common child resize step
 

	
 
	if (this->head != NULL) this->head->padding_left += this->pip_pre;
 
	for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
		int idx = child_wid->ComputeMinimalSize();
 
		int idx = child_wid->SetupSmallestSize();
 
		biggest_index = max(biggest_index, idx);
 

	
 
		if (child_wid->next != NULL) {
 
			child_wid->padding_right += this->pip_inter;
 
		} else {
 
			child_wid->padding_right += this->pip_post;
 
@@ -1033,13 +1033,13 @@ int NWidgetHorizontal::ComputeMinimalSiz
 
	/* We need to zero the PIP settings so we can re-initialize the tree. */
 
	this->pip_pre = this->pip_inter = this->pip_post = 0;
 

	
 
	return biggest_index;
 
}
 

	
 
void NWidgetHorizontal::AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
void NWidgetHorizontal::AssignSizePosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
{
 
	assert(given_width >= this->smallest_x && given_height >= this->smallest_y);
 

	
 
	uint additional_length = given_width - this->smallest_x; // Additional width given to us.
 
	this->pos_x = x;
 
	this->pos_y = y;
 
@@ -1081,13 +1081,13 @@ void NWidgetHorizontal::AssignMinimalPos
 
			additional_length -= increment;
 
			num_changing_childs--;
 

	
 
			child_width += increment;
 
		}
 

	
 
		child_wid->AssignMinimalPosition(x + position + (rtl ? child_wid->padding_right : child_wid->padding_left), y + child_pos_y, child_width, child_height, allow_resize_x, (this->resize_y > 0), rtl);
 
		child_wid->AssignSizePosition(x + position + (rtl ? child_wid->padding_right : child_wid->padding_left), y + child_pos_y, child_width, child_height, allow_resize_x, (this->resize_y > 0), rtl);
 
		position += child_width + child_wid->padding_right + child_wid->padding_left;
 
		if (child_wid->resize_x > 0) allow_resize_x = false; // Widget array allows only one child resizing
 

	
 
		child_wid = rtl ? child_wid->prev : child_wid->next;
 
	}
 
}
 
@@ -1106,40 +1106,40 @@ void NWidgetHorizontal::StoreWidgets(Wid
 
/** Horizontal left-to-right container widget. */
 
NWidgetHorizontalLTR::NWidgetHorizontalLTR() : NWidgetHorizontal()
 
{
 
	this->type = NWID_HORIZONTAL_LTR;
 
}
 

	
 
void NWidgetHorizontalLTR::AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
void NWidgetHorizontalLTR::AssignSizePosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
{
 
	NWidgetHorizontal::AssignMinimalPosition(x, y, given_width, given_height, allow_resize_x, allow_resize_y, false);
 
	NWidgetHorizontal::AssignSizePosition(x, y, given_width, given_height, allow_resize_x, allow_resize_y, false);
 
}
 

	
 
void NWidgetHorizontalLTR::StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl)
 
{
 
	NWidgetHorizontal::StoreWidgets(widgets, length, left_moving, top_moving, false);
 
}
 

	
 
/** Vertical container widget. */
 
NWidgetVertical::NWidgetVertical() : NWidgetPIPContainer(NWID_VERTICAL)
 
{
 
}
 

	
 
int NWidgetVertical::ComputeMinimalSize()
 
int NWidgetVertical::SetupSmallestSize()
 
{
 
	int biggest_index = -1;
 
	this->smallest_x = 0;      // Biggest child.
 
	this->smallest_y = 0;      // Sum of minimal size of all childs.
 
	this->fill_x = true;  // true if all childs allow fill_x.
 
	this->fill_y = false; // true if at least one child allows fill_y.
 
	this->resize_x = 1;   // smallest common child resize step
 
	this->resize_y = 0;   // smallest non-zero child widget resize step.
 

	
 
	if (this->head != NULL) this->head->padding_top += this->pip_pre;
 
	for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
		int idx = child_wid->ComputeMinimalSize();
 
		int idx = child_wid->SetupSmallestSize();
 
		biggest_index = max(biggest_index, idx);
 

	
 
		if (child_wid->next != NULL) {
 
			child_wid->padding_bottom += this->pip_inter;
 
		} else {
 
			child_wid->padding_bottom += this->pip_post;
 
@@ -1158,13 +1158,13 @@ int NWidgetVertical::ComputeMinimalSize(
 
	/* We need to zero the PIP settings so we can re-initialize the tree. */
 
	this->pip_pre = this->pip_inter = this->pip_post = 0;
 

	
 
	return biggest_index;
 
}
 

	
 
void NWidgetVertical::AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
void NWidgetVertical::AssignSizePosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
{
 
	assert(given_width >= this->smallest_x && given_height >= this->smallest_y);
 

	
 
	int additional_length = given_height - this->smallest_y; // Additional height given to us.
 
	this->pos_x = x;
 
	this->pos_y = y;
 
@@ -1204,13 +1204,13 @@ void NWidgetVertical::AssignMinimalPosit
 
			additional_length -= increment;
 
			num_changing_childs--;
 

	
 
			child_height += increment;
 
		}
 

	
 
		child_wid->AssignMinimalPosition(x + child_pos_x, y + position + child_wid->padding_top, child_width, child_height, (this->resize_x > 0), allow_resize_y, rtl);
 
		child_wid->AssignSizePosition(x + child_pos_x, y + position + child_wid->padding_top, child_width, child_height, (this->resize_x > 0), allow_resize_y, rtl);
 
		position += child_height + child_wid->padding_top + child_wid->padding_bottom;
 
		if (child_wid->resize_y > 0) allow_resize_y = false; // Widget array allows only one child resizing
 
	}
 
}
 

	
 
void NWidgetVertical::StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl)
 
@@ -1229,13 +1229,13 @@ void NWidgetVertical::StoreWidgets(Widge
 
NWidgetSpacer::NWidgetSpacer(int length, int height) : NWidgetResizeBase(NWID_SPACER, false, false)
 
{
 
	this->SetMinimalSize(length, height);
 
	this->SetResize(0, 0);
 
}
 

	
 
int NWidgetSpacer::ComputeMinimalSize()
 
int NWidgetSpacer::SetupSmallestSize()
 
{
 
	this->smallest_x = this->min_x;
 
	this->smallest_y = this->min_y;
 
	return -1;
 
}
 

	
 
@@ -1296,17 +1296,17 @@ void NWidgetBackground::SetPIP(uint8 pip
 
	if (this->child == NULL) {
 
		this->child = new NWidgetVertical();
 
	}
 
	this->child->SetPIP(pip_pre, pip_inter, pip_post);
 
}
 

	
 
int NWidgetBackground::ComputeMinimalSize()
 
int NWidgetBackground::SetupSmallestSize()
 
{
 
	int biggest_index = this->index;
 
	if (this->child != NULL) {
 
		int idx = this->child->ComputeMinimalSize();
 
		int idx = this->child->SetupSmallestSize();
 
		biggest_index = max(biggest_index, idx);
 

	
 
		this->smallest_x = this->child->smallest_x;
 
		this->smallest_y = this->child->smallest_y;
 
		this->fill_x = this->child->fill_x;
 
		this->fill_y = this->child->fill_y;
 
@@ -1317,26 +1317,26 @@ int NWidgetBackground::ComputeMinimalSiz
 
		this->smallest_y = this->min_y;
 
	}
 

	
 
	return biggest_index;
 
}
 

	
 
void NWidgetBackground::AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
void NWidgetBackground::AssignSizePosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl)
 
{
 
	this->pos_x = x;
 
	this->pos_y = y;
 
	this->smallest_x = given_width;
 
	this->smallest_y = given_height;
 
	if (!allow_resize_x) this->resize_x = 0;
 
	if (!allow_resize_y) this->resize_y = 0;
 

	
 
	if (this->child != NULL) {
 
		uint x_offset = (rtl ? this->child->padding_right : this->child->padding_left);
 
		uint width = given_width - this->child->padding_right - this->child->padding_left;
 
		uint height = given_height - this->child->padding_top - this->child->padding_bottom;
 
		this->child->AssignMinimalPosition(x + x_offset, y + this->child->padding_top, width, height, (this->resize_x > 0), (this->resize_y > 0), rtl);
 
		this->child->AssignSizePosition(x + x_offset, y + this->child->padding_top, width, height, (this->resize_x > 0), (this->resize_y > 0), rtl);
 
	}
 
}
 

	
 
void NWidgetBackground::StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl)
 
{
 
	NWidgetCore::StoreWidgets(widgets, length, left_moving, top_moving, rtl);
 
@@ -1439,14 +1439,14 @@ NWidgetLeaf::NWidgetLeaf(WidgetType tp, 
 
 * @note Caller should release returned widget array with \c free(widgets).
 
 * @ingroup NestedWidgets
 
 */
 
Widget *InitializeNWidgets(NWidgetBase *nwid, bool rtl)
 
{
 
	/* Initialize nested widgets. */
 
	int biggest_index = nwid->ComputeMinimalSize();
 
	nwid->AssignMinimalPosition(0, 0, nwid->smallest_x, nwid->smallest_y, (nwid->resize_x > 0), (nwid->resize_y > 0), rtl);
 
	int biggest_index = nwid->SetupSmallestSize();
 
	nwid->AssignSizePosition(0, 0, nwid->smallest_x, nwid->smallest_y, (nwid->resize_x > 0), (nwid->resize_y > 0), rtl);
 

	
 
	/* Construct a local widget array and initialize all its types to #WWT_LAST. */
 
	Widget *widgets = MallocT<Widget>(biggest_index + 2);
 
	int i;
 
	for (i = 0; i < biggest_index + 2; i++) {
 
		widgets[i].type = WWT_LAST;
src/widget_type.h
Show inline comments
 
@@ -149,14 +149,14 @@ struct Widget {
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetBase : public ZeroedMemoryAllocator {
 
public:
 
	NWidgetBase(WidgetType tp);
 

	
 
	virtual int ComputeMinimalSize() = 0;
 
	virtual void AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl) = 0;
 
	virtual int SetupSmallestSize() = 0;
 
	virtual void AssignSizePosition(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;
 

	
 
	/**
 
	 * Set additional space (padding) around the widget.
 
	 * @param top    Amount of additional space above the widget.
 
@@ -175,13 +175,13 @@ public:
 
	WidgetType type;      ///< Type of the widget / nested widget.
 
	bool fill_x;          ///< Allow horizontal filling from initial size.
 
	bool fill_y;          ///< Allow vertical filling from initial size.
 
	uint resize_x;        ///< Horizontal resize step (\c 0 means not resizable).
 
	uint resize_y;        ///< Vertical resize step (\c 0 means not resizable).
 
	/* Size of the widget in the smallest window possible.
 
	 * Computed by #ComputeMinimalSize() followed by #AssignMinimalPosition().
 
	 * Computed by #SetupSmallestSize() followed by #AssignSizePosition().
 
	 */
 
	uint smallest_x;      ///< Smallest horizontal size of the widget in a filled window.
 
	uint smallest_y;      ///< Smallest vertical size of the widget in a filled window.
 

	
 
	uint pos_x;           ///< Horizontal position of top-left corner of the widget in the window.
 
	uint pos_y;           ///< Vertical position of top-left corner of the widget in the window.
 
@@ -202,13 +202,13 @@ public:
 
	NWidgetResizeBase(WidgetType tp, bool fill_x, bool fill_y);
 

	
 
	void SetMinimalSize(uint min_x, uint min_y);
 
	void SetFill(bool fill_x, bool fill_y);
 
	void SetResize(uint resize_x, uint resize_y);
 

	
 
	void AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
 
	void AssignSizePosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
 

	
 
	uint min_x; ///< Minimal horizontal size of only this widget.
 
	uint min_y; ///< Minimal vertical size of only this widget.
 
};
 

	
 
/** Base class for a 'real' widget.
 
@@ -217,13 +217,13 @@ class NWidgetCore : public NWidgetResize
 
public:
 
	NWidgetCore(WidgetType tp, Colours colour, bool def_fill_x, bool def_fill_y, uint16 widget_data, StringID tool_tip);
 

	
 
	void SetIndex(int index);
 
	void SetDataTip(uint16 widget_data, StringID tool_tip);
 

	
 
	int ComputeMinimalSize();
 
	int SetupSmallestSize();
 
	void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
 

	
 
	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').
 
	uint16 widget_data; ///< Data of the widget. @see Widget::data
 
	StringID tool_tip;  ///< Tooltip of the widget. @see Widget::tootips
 
@@ -250,14 +250,14 @@ protected:
 
 * @note the semantics difference between #NWID_SELECTION and #NWID_LAYERED is currently not used.
 
 */
 
class NWidgetStacked : public NWidgetContainer {
 
public:
 
	NWidgetStacked(WidgetType tp);
 

	
 
	int ComputeMinimalSize();
 
	void AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
 
	int SetupSmallestSize();
 
	void AssignSizePosition(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);
 
};
 

	
 
/** Container with pre/inter/post child space. */
 
class NWidgetPIPContainer : public NWidgetContainer {
 
public:
 
@@ -274,49 +274,49 @@ protected:
 
/** Horizontal container.
 
 * @ingroup NestedWidgets */
 
class NWidgetHorizontal : public NWidgetPIPContainer {
 
public:
 
	NWidgetHorizontal();
 

	
 
	int ComputeMinimalSize();
 
	void AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
 
	int SetupSmallestSize();
 
	void AssignSizePosition(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);
 
};
 

	
 
/** Horizontal container that doesn't change the direction of the widgets for RTL languages.
 
 * @ingroup NestedWidgets */
 
class NWidgetHorizontalLTR : public NWidgetHorizontal {
 
public:
 
	NWidgetHorizontalLTR();
 

	
 
	void AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
 
	void AssignSizePosition(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);
 
};
 

	
 
/** Vertical container.
 
 * @ingroup NestedWidgets */
 
class NWidgetVertical : public NWidgetPIPContainer {
 
public:
 
	NWidgetVertical();
 

	
 
	int ComputeMinimalSize();
 
	void AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
 
	int SetupSmallestSize();
 
	void AssignSizePosition(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);
 
};
 

	
 

	
 
/** Spacer widget.
 
 * @ingroup NestedWidgets */
 
class NWidgetSpacer : public NWidgetResizeBase {
 
public:
 
	NWidgetSpacer(int length, int height);
 

	
 
	int ComputeMinimalSize();
 
	int SetupSmallestSize();
 
	void StoreWidgets(Widget *widgets, int length, bool left_moving, bool top_moving, bool rtl);
 
};
 

	
 
/** Nested widget with a child.
 
 * @ingroup NestedWidgets */
 
class NWidgetBackground : public NWidgetCore {
 
@@ -324,14 +324,14 @@ public:
 
	NWidgetBackground(WidgetType tp, Colours colour, int index, NWidgetPIPContainer *child = NULL);
 
	~NWidgetBackground();
 

	
 
	void Add(NWidgetBase *nwid);
 
	void SetPIP(uint8 pip_pre, uint8 pip_inter, uint8 pip_post);
 

	
 
	int ComputeMinimalSize();
 
	void AssignMinimalPosition(uint x, uint y, uint given_width, uint given_height, bool allow_resize_x, bool allow_resize_y, bool rtl);
 
	int SetupSmallestSize();
 
	void AssignSizePosition(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);
 
private:
 
	NWidgetPIPContainer *child; ///< Child widget.
 
};
 

	
0 comments (0 inline, 0 general)