summaryrefslogtreecommitdiff
path: root/src/error_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-05-26 19:23:42 +0000
committerfrosch <frosch@openttd.org>2013-05-26 19:23:42 +0000
commit56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b (patch)
treef3e5c225182fce7a451af4e09e943920e0f1cc3c /src/error_gui.cpp
parentb10a4f151aa534860dcc61ecf8cba7b3589e6281 (diff)
downloadopenttd-56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b.tar.xz
(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
Diffstat (limited to 'src/error_gui.cpp')
-rw-r--r--src/error_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/error_gui.cpp b/src/error_gui.cpp
index db73d31b2..df5aa7b6d 100644
--- a/src/error_gui.cpp
+++ b/src/error_gui.cpp
@@ -39,7 +39,7 @@ static const NWidgetPart _nested_errmsg_widgets[] = {
EndContainer(),
};
-static const WindowDesc _errmsg_desc(
+static WindowDesc _errmsg_desc(
WDP_MANUAL, 0, 0,
WC_ERRMSG, WC_NONE,
0,
@@ -59,7 +59,7 @@ static const NWidgetPart _nested_errmsg_face_widgets[] = {
EndContainer(),
};
-static const WindowDesc _errmsg_face_desc(
+static WindowDesc _errmsg_face_desc(
WDP_MANUAL, 0, 0,
WC_ERRMSG, WC_NONE,
0,
@@ -171,9 +171,9 @@ private:
uint height_detailed; ///< Height of the #detailed_msg string in pixels in the #WID_EM_MESSAGE widget.
public:
- ErrmsgWindow(const ErrorMessageData &data) : Window(), ErrorMessageData(data)
+ ErrmsgWindow(const ErrorMessageData &data) : Window(data.HasFace() ? &_errmsg_face_desc : &_errmsg_desc), ErrorMessageData(data)
{
- this->InitNested((this->face == INVALID_COMPANY) ? &_errmsg_desc : &_errmsg_face_desc);
+ this->InitNested();
}
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
@@ -195,7 +195,7 @@ public:
size->height = max(size->height, panel_height);
}
- virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
+ virtual Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number)
{
/* Position (0, 0) given, center the window. */
if (this->position.x == 0 && this->position.y == 0) {