Changeset - r14039:d4bba0bc72ea
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-12-21 18:13:43
rubidium@openttd.org
(svn r18592) -Fix (r18591): argh... save after starting the commit :(
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/widget.cpp
Show inline comments
 
@@ -1584,49 +1584,49 @@ void NWidgetBackground::Draw(const Windo
 
	if (this->child != NULL) this->child->Draw(w);
 

	
 
	if (this->IsDisabled()) {
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, _colour_gradient[this->colour & 0xF][2], FILLRECT_CHECKER);
 
	}
 
}
 

	
 
NWidgetCore *NWidgetBackground::GetWidgetFromPos(int x, int y)
 
{
 
	NWidgetCore *nwid = NULL;
 
	if (IsInsideBS(x, this->pos_x, this->current_x) && IsInsideBS(y, this->pos_y, this->current_y)) {
 
		if (this->child != NULL) nwid = this->child->GetWidgetFromPos(x, y);
 
		if (nwid == NULL) nwid = this;
 
	}
 
	return nwid;
 
}
 

	
 
Scrollbar *NWidgetBackground::FindScrollbar(Window *w, bool allow_next) const
 
{
 
	if (this->index >= 0 && allow_next && this->child == NULL && (uint)(this->index) + 1 < w->nested_array_size) {
 
		/* GetWidget ensures that the widget is of the given type.
 
		 * As we might have cases where the next widget in the array
 
		 * is a non-Core widget (e.g. NWID_SELECTION) we first get
 
		 * the base class and then dynamic_cast that. */
 
		const NWidgetCore *next_wid = dynamic_cast<NWidgetCore>(w->GetWidget<NWidgetBase>(this->index + 1));
 
		const NWidgetCore *next_wid = dynamic_cast<NWidgetCore*>(w->GetWidget<NWidgetBase>(this->index + 1));
 
		if (next_wid != NULL) return next_wid->FindScrollbar(w, false);
 
	}
 
	return NULL;
 
}
 

	
 
NWidgetBase *NWidgetBackground::GetWidgetOfType(WidgetType tp)
 
{
 
	NWidgetBase *nwid = NULL;
 
	if (this->child != NULL) nwid = this->child->GetWidgetOfType(tp);
 
	if (nwid == NULL && this->type == tp) nwid = this;
 
	return nwid;
 
}
 

	
 
NWidgetViewport::NWidgetViewport(int index) : NWidgetCore(NWID_VIEWPORT, INVALID_COLOUR, 1, 1, 0x0, STR_NULL)
 
{
 
	this->SetIndex(index);
 
}
 

	
 
void NWidgetViewport::SetupSmallestSize(Window *w, bool init_array)
 
{
 
	if (init_array && this->index >= 0) {
 
		assert(w->nested_array_size > (uint)this->index);
 
		w->nested_array[this->index] = this;
 
	}
0 comments (0 inline, 0 general)