forked from mirror/OpenTTD
(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
This commit is contained in:
@@ -149,11 +149,11 @@ struct SignListWindow : Window, SignList {
|
||||
int text_offset; ///< Offset of the sign text relative to the left edge of the WID_SIL_LIST widget.
|
||||
Scrollbar *vscroll;
|
||||
|
||||
SignListWindow(const WindowDesc *desc, WindowNumber window_number) : filter_editbox(MAX_LENGTH_SIGN_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_SIGN_NAME_CHARS)
|
||||
SignListWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc), filter_editbox(MAX_LENGTH_SIGN_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_SIGN_NAME_CHARS)
|
||||
{
|
||||
this->CreateNestedTree(desc);
|
||||
this->CreateNestedTree();
|
||||
this->vscroll = this->GetScrollbar(WID_SIL_SCROLLBAR);
|
||||
this->FinishInitNested(desc, window_number);
|
||||
this->FinishInitNested(window_number);
|
||||
this->SetWidgetLoweredState(WID_SIL_FILTER_MATCH_CASE_BTN, SignList::match_case);
|
||||
|
||||
/* Initialize the text edit widget */
|
||||
@@ -369,7 +369,7 @@ static const NWidgetPart _nested_sign_list_widgets[] = {
|
||||
EndContainer(),
|
||||
};
|
||||
|
||||
static const WindowDesc _sign_list_desc(
|
||||
static WindowDesc _sign_list_desc(
|
||||
WDP_AUTO, 358, 138,
|
||||
WC_SIGN_LIST, WC_NONE,
|
||||
0,
|
||||
@@ -412,14 +412,14 @@ struct SignWindow : Window, SignList {
|
||||
QueryString name_editbox;
|
||||
SignID cur_sign;
|
||||
|
||||
SignWindow(const WindowDesc *desc, const Sign *si) : name_editbox(MAX_LENGTH_SIGN_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_SIGN_NAME_CHARS)
|
||||
SignWindow(WindowDesc *desc, const Sign *si) : Window(desc), name_editbox(MAX_LENGTH_SIGN_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_SIGN_NAME_CHARS)
|
||||
{
|
||||
this->querystrings[WID_QES_TEXT] = &this->name_editbox;
|
||||
this->name_editbox.caption = STR_EDIT_SIGN_CAPTION;
|
||||
this->name_editbox.cancel_button = WID_QES_CANCEL;
|
||||
this->name_editbox.ok_button = WID_QES_OK;
|
||||
|
||||
this->InitNested(desc, WN_QUERY_STRING_SIGN);
|
||||
this->InitNested(WN_QUERY_STRING_SIGN);
|
||||
|
||||
UpdateSignEditWindow(si);
|
||||
this->SetFocusedWidget(WID_QES_TEXT);
|
||||
@@ -531,7 +531,7 @@ static const NWidgetPart _nested_query_sign_edit_widgets[] = {
|
||||
EndContainer(),
|
||||
};
|
||||
|
||||
static const WindowDesc _query_sign_edit_desc(
|
||||
static WindowDesc _query_sign_edit_desc(
|
||||
WDP_AUTO, 0, 0,
|
||||
WC_QUERY_STRING, WC_NONE,
|
||||
WDF_CONSTRUCTION,
|
||||
|
Reference in New Issue
Block a user