Changeset - r13944:3617e6825e88
[Not reviewed]
master
0 3 0
alberth - 14 years ago 2009-12-13 20:54:52
alberth@openttd.org
(svn r18490) -Doc: Fixed syntax of a few doxygen pre and post coditions.
3 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/graph_gui.cpp
Show inline comments
 
@@ -98,25 +98,25 @@ struct GraphLegendWindow : Window {
 
	{
 
		if (Company::IsValidID(data)) return;
 

	
 
		SetBit(_legend_excluded_companies, data);
 
		this->RaiseWidget(data + GLW_FIRST_COMPANY);
 
	}
 
};
 

	
 
/**
 
 * Construct a vertical list of buttons, one for each company.
 
 * @param biggest_index Storage for collecting the biggest index used in the returned tree.
 
 * @return Panel with company buttons.
 
 * @postcond \c *biggest_index contains the largest used index in the tree.
 
 * @post \c *biggest_index contains the largest used index in the tree.
 
 */
 
static NWidgetBase *MakeNWidgetCompanyLines(int *biggest_index)
 
{
 
	NWidgetVertical *vert = new NWidgetVertical();
 

	
 
	for (int widnum = GLW_FIRST_COMPANY; widnum <= GLW_LAST_COMPANY; widnum++) {
 
		NWidgetBackground *panel = new NWidgetBackground(WWT_PANEL, COLOUR_GREY, widnum);
 
		panel->SetMinimalSize(246, FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM);
 
		panel->SetFill(1, 0);
 
		panel->SetDataTip(0x0, STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP);
 
		vert->Add(panel);
 
	}
 
@@ -1366,25 +1366,25 @@ struct PerformanceRatingDetailWindow : W
 
		}
 

	
 
		/* Make sure the widget is lowered */
 
		this->LowerWidget(this->company + PRW_COMPANY_FIRST);
 
	}
 
};
 

	
 
CompanyID PerformanceRatingDetailWindow::company = INVALID_COMPANY;
 

	
 
/** Make a vertical list of panels for outputting score details.
 
 * @param biggest_index Storage for collecting the biggest index used in the returned tree.
 
 * @return Panel with performance details.
 
 * @postcond \c *biggest_index contains the largest used index in the tree.
 
 * @post \c *biggest_index contains the largest used index in the tree.
 
 */
 
static NWidgetBase *MakePerformanceDetailPanels(int *biggest_index)
 
{
 
	const StringID performance_tips[] = {
 
		STR_PERFORMANCE_DETAIL_VEHICLES_TOOLTIP,
 
		STR_PERFORMANCE_DETAIL_STATIONS_TOOLTIP,
 
		STR_PERFORMANCE_DETAIL_MIN_PROFIT_TOOLTIP,
 
		STR_PERFORMANCE_DETAIL_MIN_INCOME_TOOLTIP,
 
		STR_PERFORMANCE_DETAIL_MAX_INCOME_TOOLTIP,
 
		STR_PERFORMANCE_DETAIL_DELIVERED_TOOLTIP,
 
		STR_PERFORMANCE_DETAIL_CARGO_TOOLTIP,
 
		STR_PERFORMANCE_DETAIL_MONEY_TOOLTIP,
 
@@ -1400,25 +1400,25 @@ static NWidgetBase *MakePerformanceDetai
 
		panel->SetFill(1, 1);
 
		panel->SetDataTip(0x0, performance_tips[widnum - PRW_SCORE_FIRST]);
 
		vert->Add(panel);
 
	}
 
	*biggest_index = PRW_SCORE_LAST;
 
	return vert;
 
}
 

	
 
/**
 
 * Make a number of rows with button-like graphics, for enabling/disabling each company.
 
 * @param biggest_index Storage for collecting the biggest index used in the returned tree.
 
 * @return Panel with rows of company buttons.
 
 * @postcond \c *biggest_index contains the largest used index in the tree.
 
 * @post \c *biggest_index contains the largest used index in the tree.
 
 */
 
static NWidgetBase *MakeCompanyButtonRows(int *biggest_index)
 
{
 
	static const int MAX_LENGTH = 8; // Maximal number of company buttons in one row.
 
	NWidgetVertical *vert = NULL; // Storage for all rows.
 
	NWidgetHorizontal *hor = NULL; // Storage for buttons in one row.
 
	int hor_length = 0;
 

	
 
	Dimension sprite_size = GetSpriteSize(SPR_COMPANY_ICON);
 
	sprite_size.width  += WD_MATRIX_LEFT + WD_MATRIX_RIGHT;
 
	sprite_size.height += WD_MATRIX_TOP + WD_MATRIX_BOTTOM + 1; // 1 for the 'offset' of being pressed
 

	
src/widget.cpp
Show inline comments
 
@@ -2080,25 +2080,25 @@ bool NWidgetLeaf::ButtonHit(const Point 
 
 * Construct a single nested widget in \a *dest from its parts.
 
 *
 
 * Construct a NWidgetBase object from a #NWidget function, and apply all
 
 * settings that follow it, until encountering a #EndContainer, another
 
 * #NWidget, or the end of the parts array.
 
 *
 
 * @param parts Array with parts of the nested widget.
 
 * @param count Length of the \a parts array.
 
 * @param dest  Address of pointer to use for returning the composed widget.
 
 * @param fill_dest Fill the composed widget with child widgets.
 
 * @param biggest_index Pointer to biggest nested widget index in the tree encountered so far.
 
 * @return Number of widget part elements used to compose the widget.
 
 * @precond \c biggest_index != NULL.
 
 * @pre \c biggest_index != NULL.
 
 */
 
static int MakeNWidget(const NWidgetPart *parts, int count, NWidgetBase **dest, bool *fill_dest, int *biggest_index)
 
{
 
	int num_used = 0;
 

	
 
	*dest = NULL;
 
	*fill_dest = false;
 

	
 
	while (count > num_used) {
 
		switch (parts->type) {
 
			case NWID_SPACER:
 
				if (*dest != NULL) return num_used;
 
@@ -2228,25 +2228,25 @@ static int MakeNWidget(const NWidgetPart
 
	}
 

	
 
	return num_used;
 
}
 

	
 
/**
 
 * Build a nested widget tree by recursively filling containers with nested widgets read from their parts.
 
 * @param parts  Array with parts of the nested widgets.
 
 * @param count  Length of the \a parts array.
 
 * @param parent Container to use for storing the child widgets.
 
 * @param biggest_index Pointer to biggest nested widget index in the tree.
 
 * @return Number of widget part elements used to fill the container.
 
 * @postcond \c *biggest_index contains the largest widget index of the tree and \c -1 if no index is used.
 
 * @post \c *biggest_index contains the largest widget index of the tree and \c -1 if no index is used.
 
 */
 
static int MakeWidgetTree(const NWidgetPart *parts, int count, NWidgetBase *parent, int *biggest_index)
 
{
 
	/* Given parent must be either a #NWidgetContainer or a #NWidgetBackground object. */
 
	NWidgetContainer *nwid_cont = dynamic_cast<NWidgetContainer *>(parent);
 
	NWidgetBackground *nwid_parent = dynamic_cast<NWidgetBackground *>(parent);
 
	assert((nwid_cont != NULL && nwid_parent == NULL) || (nwid_cont == NULL && nwid_parent != NULL));
 

	
 
	int total_used = 0;
 
	while (true) {
 
		NWidgetBase *sub_widget = NULL;
 
		bool fill_sub = false;
src/widget_type.h
Show inline comments
 
@@ -548,25 +548,25 @@ struct NWidgetPartPIP {
 

	
 
/** Widget part for storing minimal text line data.
 
 * @ingroup NestedWidgetParts */
 
struct NWidgetPartTextLines {
 
	uint8 lines;   ///< Number of text lines.
 
	uint8 spacing; ///< Extra spacing around lines.
 
	FontSize size; ///< Font size of text lines.
 
};
 

	
 
/** 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.
 
 * @post \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.
 
		NWidgetPartDataTip data_tip;     ///< Part with a data/tooltip.
 
		NWidgetPartWidget widget;        ///< Part with a start of a widget.
 
		NWidgetPartPaddings padding;     ///< Part with paddings.
0 comments (0 inline, 0 general)