(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 5e7603154d
commit 25adefca23
61 changed files with 488 additions and 482 deletions

View File

@@ -296,7 +296,7 @@ struct NetworkChatWindow : public Window {
* @param type The type of destination.
* @param dest The actual destination index.
*/
NetworkChatWindow(const WindowDesc *desc, DestType type, int dest) : message_editbox(NETWORK_CHAT_LENGTH)
NetworkChatWindow(WindowDesc *desc, DestType type, int dest) : Window(desc), message_editbox(NETWORK_CHAT_LENGTH)
{
this->dtype = type;
this->dest = dest;
@@ -312,7 +312,7 @@ struct NetworkChatWindow : public Window {
assert((uint)this->dtype < lengthof(chat_captions));
this->dest_string = chat_captions[this->dtype];
this->InitNested(desc, type);
this->InitNested(type);
this->SetFocusedWidget(WID_NC_TEXTBOX);
InvalidateWindowData(WC_NEWS_WINDOW, 0, this->height);
@@ -459,7 +459,7 @@ struct NetworkChatWindow : public Window {
free(pre_buf);
}
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)
{
Point pt = { 0, _screen.height - sm_height - FindWindowById(WC_STATUS_BAR, 0)->height };
return pt;
@@ -540,7 +540,7 @@ static const NWidgetPart _nested_chat_window_widgets[] = {
};
/** The description of the chat window. */
static const WindowDesc _chat_window_desc(
static WindowDesc _chat_window_desc(
WDP_MANUAL, 640, 14, // x, y, width, height
WC_SEND_NETWORK_MSG, WC_NONE,
0,