Changeset - r12300:489a80ad79ba
[Not reviewed]
master
0 2 0
alberth - 15 years ago 2009-07-02 21:18:22
alberth@openttd.org
(svn r16727) -Codechange: Introducing WD_SORTBUTTON_ARROW_WIDTH constant.
2 files changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/widget.cpp
Show inline comments
 
@@ -806,32 +806,32 @@ void ResizeWindowForWidget(Window *w, ui
 
/**
 
 * Draw a sort button's up or down arrow symbol.
 
 * @param widget Sort button widget
 
 * @param state State of sort button
 
 */
 
void Window::DrawSortButtonState(int widget, SortButtonState state) const
 
{
 
	if (state == SBS_OFF) return;
 

	
 
	int offset = this->IsWidgetLowered(widget) ? 1 : 0;
 
	int base, top;
 
	if (this->widget != NULL) {
 
		base = offset + (_dynlang.text_dir == TD_LTR ? this->widget[widget].right - 11 : this->widget[widget].left);
 
		base = offset + (_dynlang.text_dir == TD_LTR ? this->widget[widget].right - WD_SORTBUTTON_ARROW_WIDTH : this->widget[widget].left);
 
		top = this->widget[widget].top;
 
	} else {
 
		assert(this->nested_array != NULL);
 
		base = offset + this->nested_array[widget]->pos_x + (_dynlang.text_dir == TD_LTR ? this->nested_array[widget]->current_x - 11 : 0);
 
		base = offset + this->nested_array[widget]->pos_x + (_dynlang.text_dir == TD_LTR ? this->nested_array[widget]->current_x - WD_SORTBUTTON_ARROW_WIDTH : 0);
 
		top = this->nested_array[widget]->pos_y;
 
	}
 
	DrawString(base, base + 11, top + 1 + offset, state == SBS_DOWN ? DOWNARROW : UPARROW, TC_BLACK, SA_CENTER);
 
	DrawString(base, base + WD_SORTBUTTON_ARROW_WIDTH, top + 1 + offset, state == SBS_DOWN ? DOWNARROW : UPARROW, TC_BLACK, SA_CENTER);
 
}
 

	
 

	
 
/**
 
 * @defgroup NestedWidgets Hierarchical widgets.
 
 * Hierarchical widgets, also known as nested widgets, are widgets stored in a tree. At the leafs of the tree are (mostly) the 'real' widgets
 
 * visible to the user. At higher levels, widgets get organized in container widgets, until all widgets of the window are merged.
 
 *
 
 * \section nestedwidgetkinds Hierarchical widget kinds
 
 * A leaf widget is one of
 
 * <ul>
 
 * <li> #NWidgetLeaf for widgets visible for the user, or
src/window_gui.h
Show inline comments
 
@@ -67,24 +67,26 @@ enum WidgetDrawDistances {
 

	
 
	/* WWT_CAPTION */
 
	WD_CAPTION_HEIGHT = 14,     ///< Height of a title bar.
 
	WD_CAPTIONTEXT_LEFT = 2,    ///< Offset of the caption text at the left.
 
	WD_CAPTIONTEXT_RIGHT = 2,   ///< Offset of the caption text at the right.
 
	WD_CAPTIONTEXT_TOP = 2,     ///< Offset of the caption text at the top.
 

	
 
	/* Dropdown widget. */
 
	WD_DROPDOWN_HEIGHT = 12,    ///< Height of a drop down widget.
 
	WD_DROPDOWNTEXT_LEFT = 2,   ///< Left offset of the dropdown widget string.
 
	WD_DROPDOWNTEXT_RIGHT = 14, ///< Right offset of the dropdown widget string.
 
	WD_DROPDOWNTEXT_TOP = 1,    ///< Top offset of the dropdown widget string.
 

	
 
	WD_SORTBUTTON_ARROW_WIDTH = 11, ///< Width of up/down arrow of sort button state.
 
};
 

	
 
/* wiget.cpp */
 
void DrawFrameRect(int left, int top, int right, int bottom, Colours colour, FrameFlags flags);
 

	
 
/* window.cpp */
 
extern Window *_z_front_window;
 
extern Window *_z_back_window;
 
extern Window *_focused_window;
 

	
 
/**
 
 * High level window description
0 comments (0 inline, 0 general)