mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r24745) -Codechange: Draw complete editbox via QueryString.
This commit is contained in:
parent
c8c040d057
commit
1b3e8a8af6
@ -778,7 +778,7 @@ void QueryString::HandleEditBox(Window *w, int wid)
|
||||
|
||||
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;
|
||||
@ -786,6 +786,7 @@ void QueryString::DrawEditBox(const Window *w, int wid) const
|
||||
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 */
|
||||
|
@ -2366,7 +2366,6 @@ void NWidgetLeaf::Draw(const Window *w)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user