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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user