(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

@@ -37,7 +37,7 @@ static const struct NWidgetPart _background_widgets[] = {
/**
* Window description for the background window to prevent smearing.
*/
static const WindowDesc _background_desc(
static WindowDesc _background_desc(
WDP_MANUAL, 0, 0,
WC_BOOTSTRAP, WC_NONE,
0,
@@ -47,9 +47,9 @@ static const WindowDesc _background_desc(
/** The background for the game. */
class BootstrapBackground : public Window {
public:
BootstrapBackground() : Window()
BootstrapBackground() : Window(&_background_desc)
{
this->InitNested(&_background_desc, 0);
this->InitNested(0);
CLRBITS(this->flags, WF_WHITE_BORDER);
ResizeWindow(this, _screen.width, _screen.height);
}
@@ -70,7 +70,7 @@ static const NWidgetPart _nested_boostrap_download_status_window_widgets[] = {
};
/** Window description for the download window */
static const WindowDesc _bootstrap_download_status_window_desc(
static WindowDesc _bootstrap_download_status_window_desc(
WDP_CENTER, 0, 0,
WC_NETWORK_STATUS_WINDOW, WC_NONE,
WDF_MODAL,
@@ -115,7 +115,7 @@ static const NWidgetPart _bootstrap_query_widgets[] = {
};
/** The window description for the query. */
static const WindowDesc _bootstrap_query_desc(
static WindowDesc _bootstrap_query_desc(
WDP_CENTER, 0, 0,
WC_CONFIRM_POPUP_QUERY, WC_NONE,
0,
@@ -128,9 +128,9 @@ class BootstrapAskForDownloadWindow : public Window, ContentCallback {
public:
/** Start listening to the content client events. */
BootstrapAskForDownloadWindow() : Window()
BootstrapAskForDownloadWindow() : Window(&_bootstrap_query_desc)
{
this->InitNested(&_bootstrap_query_desc, WN_CONFIRM_POPUP_QUERY_BOOTSTRAP);
this->InitNested(WN_CONFIRM_POPUP_QUERY_BOOTSTRAP);
_network_content_client.AddCallback(this);
}