Changeset - r13654:40728efcf28d
[Not reviewed]
master
0 4 0
rubidium - 15 years ago 2009-11-19 18:01:24
rubidium@openttd.org
(svn r18188) -Codechange: s/NWID_BUTTON_DRPDOWN/NWID_BUTTON_DROPDOWN/g
4 files changed with 25 insertions and 25 deletions:
0 comments (0 inline, 0 general)
src/order_gui.cpp
Show inline comments
 
@@ -1296,29 +1296,29 @@ static const NWidgetPart _nested_orders_
 
	EndContainer(),
 

	
 
	/* First button row. */
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
			NWidget(NWID_SELECTION, INVALID_COLOUR, ORDER_WIDGET_SEL_TOP_LEFT),
 
				NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_NON_STOP), SetMinimalSize(124, 12), SetFill(true, false),
 
				NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_NON_STOP), SetMinimalSize(124, 12), SetFill(true, false),
 
														SetDataTip(STR_ORDER_NON_STOP, STR_ORDER_TOOLTIP_NON_STOP), SetResize(1, 0),
 
				NWidget(WWT_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_COND_VARIABLE), SetMinimalSize(124, 12), SetFill(true, false),
 
														SetDataTip(STR_NULL, STR_ORDER_CONDITIONAL_VARIABLE_TOOLTIP), SetResize(1, 0),
 
			EndContainer(),
 
			NWidget(NWID_SELECTION, INVALID_COLOUR, ORDER_WIDGET_SEL_TOP_MIDDLE),
 
				NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_FULL_LOAD), SetMinimalSize(124, 12), SetFill(true, false),
 
				NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_FULL_LOAD), SetMinimalSize(124, 12), SetFill(true, false),
 
														SetDataTip(STR_ORDER_TOGGLE_FULL_LOAD, STR_ORDER_TOOLTIP_FULL_LOAD), SetResize(1, 0),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ORDER_WIDGET_REFIT), SetMinimalSize(124, 12), SetFill(true, false),
 
														SetDataTip(STR_ORDER_REFIT, STR_ORDER_REFIT_TOOLTIP), SetResize(1, 0),
 
				NWidget(WWT_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_COND_COMPARATOR), SetMinimalSize(124, 12), SetFill(true, false),
 
														SetDataTip(STR_NULL, STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP), SetResize(1, 0),
 
			EndContainer(),
 
			NWidget(NWID_SELECTION, INVALID_COLOUR, ORDER_WIDGET_SEL_TOP_RIGHT),
 
				NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_UNLOAD), SetMinimalSize(124, 12), SetFill(true, false),
 
				NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_UNLOAD), SetMinimalSize(124, 12), SetFill(true, false),
 
														SetDataTip(STR_ORDER_TOGGLE_UNLOAD, STR_ORDER_TOOLTIP_UNLOAD), SetResize(1, 0),
 
				NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_SERVICE), SetMinimalSize(124, 12), SetFill(true, false),
 
				NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_SERVICE), SetMinimalSize(124, 12), SetFill(true, false),
 
														SetDataTip(STR_ORDER_SERVICE, STR_ORDER_SERVICE_TOOLTIP), SetResize(1, 0),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ORDER_WIDGET_COND_VALUE), SetMinimalSize(124, 12), SetFill(true, false),
 
														SetDataTip(STR_BLACK_COMMA, STR_ORDER_CONDITIONAL_VALUE_TOOLTIP), SetResize(1, 0),
 
			EndContainer(),
 
		EndContainer(),
 
		NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, ORDER_WIDGET_SHARED_ORDER_LIST), SetMinimalSize(12, 12), SetDataTip(SPR_SHARED_ORDERS_ICON, STR_ORDERS_VEH_WITH_SHARED_ORDERS_LIST_TOOLTIP),
 
@@ -1328,13 +1328,13 @@ static const NWidgetPart _nested_orders_
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ORDER_WIDGET_SKIP), SetMinimalSize(124, 12), SetFill(true, false),
 
													SetDataTip(STR_ORDERS_SKIP_BUTTON, STR_ORDERS_SKIP_TOOLTIP), SetResize(1, 0),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ORDER_WIDGET_DELETE), SetMinimalSize(124, 12), SetFill(true, false),
 
													SetDataTip(STR_ORDERS_DELETE_BUTTON, STR_ORDERS_DELETE_TOOLTIP), SetResize(1, 0),
 
			NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_GOTO), SetMinimalSize(124, 12), SetFill(true, false),
 
			NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_GOTO), SetMinimalSize(124, 12), SetFill(true, false),
 
													SetDataTip(STR_ORDERS_GO_TO_BUTTON, STR_ORDERS_GO_TO_TOOLTIP), SetResize(1, 0),
 
		EndContainer(),
 
		NWidget(WWT_RESIZEBOX, COLOUR_GREY, ORDER_WIDGET_RESIZE),
 
	EndContainer(),
 
};
 

	
 
@@ -1360,22 +1360,22 @@ static const NWidgetPart _nested_orders_
 

	
 
	/* First button row. */
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(NWID_SELECTION, INVALID_COLOUR, ORDER_WIDGET_SEL_TOP_ROW),
 
			/* load + unload buttons. */
 
			NWidget(NWID_HORIZONTAL),
 
				NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_FULL_LOAD), SetMinimalSize(186, 12), SetFill(true, false),
 
				NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_FULL_LOAD), SetMinimalSize(186, 12), SetFill(true, false),
 
													SetDataTip(STR_ORDER_TOGGLE_FULL_LOAD, STR_ORDER_TOOLTIP_FULL_LOAD), SetResize(1, 0),
 
				NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_UNLOAD), SetMinimalSize(186, 12), SetFill(true, false),
 
				NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_UNLOAD), SetMinimalSize(186, 12), SetFill(true, false),
 
													SetDataTip(STR_ORDER_TOGGLE_UNLOAD, STR_ORDER_TOOLTIP_UNLOAD), SetResize(1, 0),
 
			EndContainer(),
 
			/* Refit + service buttons. */
 
			NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
				NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ORDER_WIDGET_REFIT), SetMinimalSize(186, 12), SetFill(true, false),
 
													SetDataTip(STR_ORDER_REFIT, STR_ORDER_REFIT_TOOLTIP), SetResize(1, 0),
 
				NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_SERVICE), SetMinimalSize(124, 12), SetFill(true, false),
 
				NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_SERVICE), SetMinimalSize(124, 12), SetFill(true, false),
 
													SetDataTip(STR_ORDER_SERVICE, STR_ORDER_SERVICE_TOOLTIP), SetResize(1, 0),
 
			EndContainer(),
 

	
 
			/* Buttons for setting a condition. */
 
			NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
				NWidget(WWT_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_COND_VARIABLE), SetMinimalSize(124, 12), SetFill(true, false),
 
@@ -1393,13 +1393,13 @@ static const NWidgetPart _nested_orders_
 
	/* Second button row. */
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ORDER_WIDGET_SKIP), SetMinimalSize(124, 12), SetFill(true, false),
 
											SetDataTip(STR_ORDERS_SKIP_BUTTON, STR_ORDERS_SKIP_TOOLTIP), SetResize(1, 0),
 
		NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ORDER_WIDGET_DELETE), SetMinimalSize(124, 12), SetFill(true, false),
 
											SetDataTip(STR_ORDERS_DELETE_BUTTON, STR_ORDERS_DELETE_TOOLTIP), SetResize(1, 0),
 
		NWidget(NWID_BUTTON_DRPDOWN, COLOUR_GREY, ORDER_WIDGET_GOTO), SetMinimalSize(124, 12), SetFill(true, false),
 
		NWidget(NWID_BUTTON_DROPDOWN, COLOUR_GREY, ORDER_WIDGET_GOTO), SetMinimalSize(124, 12), SetFill(true, false),
 
											SetDataTip(STR_ORDERS_GO_TO_BUTTON, STR_ORDERS_GO_TO_TOOLTIP), SetResize(1, 0),
 
		NWidget(WWT_RESIZEBOX, COLOUR_GREY, ORDER_WIDGET_RESIZE),
 
	EndContainer(),
 
};
 

	
 
static const WindowDesc _orders_desc(
src/widget.cpp
Show inline comments
 
@@ -512,13 +512,13 @@ static inline void DrawCaption(const Rec
 
	}
 

	
 
	if (str != STR_NULL) DrawString(r.left + WD_CAPTIONTEXT_LEFT, r.right - WD_CAPTIONTEXT_RIGHT, r.top + WD_CAPTIONTEXT_TOP, str, TC_FROMSTRING, SA_CENTER);
 
}
 

	
 
/**
 
 * Draw a button with a dropdown (#WWT_DROPDOWN and #NWID_BUTTON_DRPDOWN).
 
 * Draw a button with a dropdown (#WWT_DROPDOWN and #NWID_BUTTON_DROPDOWN).
 
 * @param r                Rectangle containing the widget.
 
 * @param colour           Background colour of the widget.
 
 * @param clicked_button   The button-part is lowered.
 
 * @param clicked_dropdown The drop-down part is lowered.
 
 * @param str              Text of the button.
 
 *
 
@@ -1691,13 +1691,13 @@ NWidgetLeaf::NWidgetLeaf(WidgetType tp, 
 
		case WWT_PUSHTXTBTN:
 
		case WWT_TEXTBTN_2:
 
		case WWT_LABEL:
 
		case WWT_TEXT:
 
		case WWT_MATRIX:
 
		case WWT_EDITBOX:
 
		case NWID_BUTTON_DRPDOWN:
 
		case NWID_BUTTON_DROPDOWN:
 
		case NWID_BUTTON_ARROW:
 
			this->SetFill(false, false);
 
			break;
 

	
 
		case WWT_SCROLLBAR:
 
		case WWT_SCROLL2BAR:
 
@@ -1873,13 +1873,13 @@ void NWidgetLeaf::SetupSmallestSize(Wind
 
			d2.width += extra.width;
 
			d2.height += extra.height;
 
			size = maxdim(size, d2);
 
			break;
 
		}
 
		case WWT_DROPDOWN:
 
		case NWID_BUTTON_DRPDOWN: {
 
		case NWID_BUTTON_DROPDOWN: {
 
			static const Dimension extra = {WD_DROPDOWNTEXT_LEFT + WD_DROPDOWNTEXT_RIGHT, WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM};
 
			padding = &extra;
 
			if (this->index >= 0) w->SetStringParameters(this->index);
 
			Dimension d2 = GetStringBoundingBox(this->widget_data);
 
			d2.width += extra.width;
 
			d2.height += extra.height;
 
@@ -2008,13 +2008,13 @@ void NWidgetLeaf::Draw(const Window *w)
 

	
 
		case WWT_DROPDOWN:
 
			if (this->index >= 0) w->SetStringParameters(this->index);
 
			DrawDropdown(r, this->colour, clicked, this->widget_data);
 
			break;
 

	
 
		case NWID_BUTTON_DRPDOWN:
 
		case NWID_BUTTON_DROPDOWN:
 
			if (this->index >= 0) w->SetStringParameters(this->index);
 
			DrawButtonDropdown(r, this->colour, clicked, (this->disp_flags & ND_DROPDOWN_ACTIVE) != 0, this->widget_data);
 
			break;
 

	
 
		default:
 
			NOT_REACHED();
 
@@ -2036,13 +2036,13 @@ Scrollbar *NWidgetLeaf::FindScrollbar(Wi
 
		if (next_wid != NULL) return next_wid->FindScrollbar(w, false);
 
	}
 
	return NULL;
 
}
 

	
 
/**
 
 * For a #NWID_BUTTON_DRPDOWN, test whether \a pt refers to the button or to the drop-down.
 
 * For a #NWID_BUTTON_DROPDOWN, test whether \a pt refers to the button or to the drop-down.
 
 * @param pt Point in the widget.
 
 * @return The point refers to the button.
 
 *
 
 * @note The magic constants are also used at #DrawButtonDropdown.
 
 */
 
bool NWidgetLeaf::ButtonHit(const Point &pt)
 
@@ -2197,13 +2197,13 @@ static int MakeNWidget(const NWidgetPart
 
				*biggest_index = max(*biggest_index, (int)parts->u.widget.index);
 
				break;
 
			}
 

	
 
			default:
 
				if (*dest != NULL) return num_used;
 
				assert((parts->type & WWT_MASK) < WWT_LAST || parts->type == NWID_BUTTON_DRPDOWN || parts->type == NWID_BUTTON_ARROW);
 
				assert((parts->type & WWT_MASK) < WWT_LAST || parts->type == NWID_BUTTON_DROPDOWN || parts->type == NWID_BUTTON_ARROW);
 
				*dest = new NWidgetLeaf(parts->type, parts->u.widget.colour, parts->u.widget.index, 0x0, STR_NULL);
 
				*biggest_index = max(*biggest_index, (int)parts->u.widget.index);
 
				break;
 
		}
 
		num_used++;
 
		parts++;
src/widget_type.h
Show inline comments
 
@@ -119,20 +119,20 @@ enum WidgetType {
 
	WWT_CLOSEBOX,   ///< Close box (at top-left of a window)
 
	WWT_DROPDOWN,   ///< Drop down list
 
	WWT_EDITBOX,    ///< a textbox for typing
 
	WWT_LAST,       ///< Last Item. use WIDGETS_END to fill up padding!!
 

	
 
	/* Nested widget types. */
 
	NWID_HORIZONTAL,     ///< Horizontal container.
 
	NWID_HORIZONTAL_LTR, ///< Horizontal container that doesn't change the order of the widgets for RTL languages.
 
	NWID_VERTICAL,       ///< Vertical container.
 
	NWID_SPACER,         ///< Invisible widget that takes some space.
 
	NWID_SELECTION,      ///< Stacked widgets, only one visible at a time (eg in a panel with tabs).
 
	NWID_VIEWPORT,       ///< Nested widget containing a viewport.
 
	NWID_BUTTON_DRPDOWN, ///< Button with a drop-down.
 
	NWID_BUTTON_ARROW,   ///< Button with an arrow
 
	NWID_HORIZONTAL,      ///< Horizontal container.
 
	NWID_HORIZONTAL_LTR,  ///< Horizontal container that doesn't change the order of the widgets for RTL languages.
 
	NWID_VERTICAL,        ///< Vertical container.
 
	NWID_SPACER,          ///< Invisible widget that takes some space.
 
	NWID_SELECTION,       ///< Stacked widgets, only one visible at a time (eg in a panel with tabs).
 
	NWID_VIEWPORT,        ///< Nested widget containing a viewport.
 
	NWID_BUTTON_DROPDOWN, ///< Button with a drop-down.
 
	NWID_BUTTON_ARROW,    ///< Button with an arrow
 

	
 
	/* Nested widget part types. */
 
	WPT_RESIZE,       ///< Widget part for specifying resizing.
 
	WPT_MINSIZE,      ///< Widget part for specifying minimal size.
 
	WPT_MINTEXTLINES, ///< Widget part for specifying minimal number of lines of text.
 
	WPT_FILL,         ///< Widget part for specifying fill.
src/widgets/dropdown.cpp
Show inline comments
 
@@ -159,13 +159,13 @@ struct DropdownWindow : Window {
 
	~DropdownWindow()
 
	{
 
		Window *w2 = FindWindowById(this->parent_wnd_class, this->parent_wnd_num);
 
		if (w2 != NULL) {
 
			if (w2->nested_array != NULL) {
 
				NWidgetCore *nwi2 = w2->GetWidget<NWidgetCore>(this->parent_button);
 
				if (nwi2->type == NWID_BUTTON_DRPDOWN) {
 
				if (nwi2->type == NWID_BUTTON_DROPDOWN) {
 
					nwi2->disp_flags &= ~ND_DROPDOWN_ACTIVE;
 
				} else {
 
					w2->RaiseWidget(this->parent_button);
 
				}
 
			} else {
 
				w2->RaiseWidget(this->parent_button);
 
@@ -330,13 +330,13 @@ void ShowDropDownList(Window *w, DropDow
 
	wi_rect.left   = nwi->pos_x;
 
	wi_rect.right  = nwi->pos_x + nwi->current_x - 1;
 
	wi_rect.top    = nwi->pos_y;
 
	wi_rect.bottom = nwi->pos_y + nwi->current_y - 1;
 
	wi_colour = nwi->colour;
 

	
 
	if (nwi->type == NWID_BUTTON_DRPDOWN) {
 
	if (nwi->type == NWID_BUTTON_DROPDOWN) {
 
		nwi->disp_flags |= ND_DROPDOWN_ACTIVE;
 
	} else {
 
		w->LowerWidget(button);
 
	}
 
	w->SetWidgetDirty(button);
 

	
0 comments (0 inline, 0 general)