1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-24 06:59:10 +00:00

(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.

This commit is contained in:
frosch
2013-05-26 19:23:42 +00:00
parent b10a4f151a
commit 56e4a8c4d6
61 changed files with 488 additions and 482 deletions

View File

@@ -42,19 +42,19 @@ static const NWidgetPart _nested_textfile_widgets[] = {
};
/** Window definition for the textfile window */
static const WindowDesc _textfile_desc(
static WindowDesc _textfile_desc(
WDP_CENTER, 630, 460,
WC_TEXTFILE, WC_NONE,
0,
_nested_textfile_widgets, lengthof(_nested_textfile_widgets)
);
TextfileWindow::TextfileWindow(TextfileType file_type) : Window(), file_type(file_type)
TextfileWindow::TextfileWindow(TextfileType file_type) : Window(&_textfile_desc), file_type(file_type)
{
this->CreateNestedTree(&_textfile_desc);
this->CreateNestedTree();
this->vscroll = this->GetScrollbar(WID_TF_VSCROLLBAR);
this->hscroll = this->GetScrollbar(WID_TF_HSCROLLBAR);
this->FinishInitNested(&_textfile_desc);
this->FinishInitNested();
this->GetWidget<NWidgetCore>(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
}