Changeset - r19790:98687049399d
[Not reviewed]
master
0 2 0
frosch - 12 years ago 2012-11-14 22:50:46
frosch@openttd.org
(svn r24745) -Codechange: Draw complete editbox via QueryString.
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/misc_gui.cpp
Show inline comments
 
@@ -775,20 +775,21 @@ void QueryString::HandleEditBox(Window *
 
		}
 
	}
 
}
 

	
 
void QueryString::DrawEditBox(const Window *w, int wid) const
 
{
 
	const NWidgetBase *wi = w->GetWidget<NWidgetBase>(wid);
 
	const NWidgetLeaf *wi = w->GetWidget<NWidgetLeaf>(wid);
 

	
 
	assert((wi->type & WWT_MASK) == WWT_EDITBOX);
 
	int left   = wi->pos_x;
 
	int right  = wi->pos_x + wi->current_x - 1;
 
	int top    = wi->pos_y;
 
	int bottom = wi->pos_y + wi->current_y - 1;
 

	
 
	DrawFrameRect(left, top, right, bottom, wi->colour, FR_LOWERED | FR_DARKENED);
 
	GfxFillRect(left + 1, top + 1, right - 1, bottom - 1, PC_BLACK);
 

	
 
	/* Limit the drawing of the string inside the widget boundaries */
 
	DrawPixelInfo dpi;
 
	if (!FillDrawPixelInfo(&dpi, left + WD_FRAMERECT_LEFT, top + WD_FRAMERECT_TOP, right - left - WD_FRAMERECT_RIGHT, bottom - top - WD_FRAMERECT_BOTTOM)) return;
 

	
src/widget.cpp
Show inline comments
 
@@ -2363,13 +2363,12 @@ void NWidgetLeaf::Draw(const Window *w)
 

	
 
		case WWT_MATRIX:
 
			DrawMatrix(r, this->colour, clicked, this->widget_data);
 
			break;
 

	
 
		case WWT_EDITBOX: {
 
			DrawFrameRect(r.left, r.top, r.right, r.bottom, this->colour, FR_LOWERED | FR_DARKENED);
 
			const QueryString *query = w->GetQueryString(this->index);
 
			if (query != NULL) query->DrawEditBox(w, this->index);
 
			break;
 
		}
 

	
 
		case WWT_CAPTION:
0 comments (0 inline, 0 general)