diff options
author | rubidium <rubidium@openttd.org> | 2009-11-02 09:58:08 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-11-02 09:58:08 +0000 |
commit | 148d9b8e387cf7298421747917d17c00acc7bb99 (patch) | |
tree | 8fc42e53fede717bdf1bdb2a7e1942d168412516 /src/network | |
parent | cb7c9b09ff05c1065a3cb8835205cc779ede117e (diff) | |
download | openttd-148d9b8e387cf7298421747917d17c00acc7bb99.tar.xz |
(svn r17946) -Codechange: move the widget definition of the client list closer to the window
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_gui.cpp | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index de68f794c..d725f7aaa 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1765,32 +1765,6 @@ enum { CLNWND_ROWSIZE = 10 }; -/** Widget numbers of the client list window. */ -enum ClientListWidgets { - CLW_CLOSE, - CLW_CAPTION, - CLW_STICKY, - CLW_PANEL, -}; - -static const Widget _client_list_widgets[] = { -{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_BLACK_CROSS, STR_TOOLTIP_CLOSE_WINDOW}, -{ WWT_CAPTION, RESIZE_NONE, COLOUR_GREY, 11, 237, 0, 13, STR_NETWORK_COMPANY_LIST_CLIENT_LIST, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS}, -{ WWT_STICKYBOX, RESIZE_NONE, COLOUR_GREY, 238, 249, 0, 13, STR_NULL, STR_TOOLTIP_STICKY}, - -{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 249, 14, 14 + CLNWND_ROWSIZE + 1, 0x0, STR_NULL}, -{ WIDGETS_END}, -}; - -static const NWidgetPart _nested_client_list_widgets[] = { - NWidget(NWID_HORIZONTAL), - NWidget(WWT_CLOSEBOX, COLOUR_GREY, CLW_CLOSE), - NWidget(WWT_CAPTION, COLOUR_GREY, CLW_CAPTION), SetDataTip(STR_NETWORK_COMPANY_LIST_CLIENT_LIST, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), - NWidget(WWT_STICKYBOX, COLOUR_GREY, CLW_STICKY), - EndContainer(), - NWidget(WWT_PANEL, COLOUR_GREY, CLW_PANEL), SetMinimalSize(250, CLNWND_ROWSIZE + 2), EndContainer(), -}; - static const Widget _client_list_popup_widgets[] = { { WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 99, 0, 0, 0, STR_NULL}, { WIDGETS_END}, @@ -1800,13 +1774,6 @@ static const NWidgetPart _nested_client_list_popup_widgets[] = { NWidget(WWT_PANEL, COLOUR_GREY, 0), SetMinimalSize(100, 1), EndContainer(), }; -static const WindowDesc _client_list_desc( - WDP_AUTO, WDP_AUTO, 250, 1, 250, 1, - WC_CLIENT_LIST, WC_NONE, - WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, - _client_list_widgets, _nested_client_list_widgets, lengthof(_nested_client_list_widgets) -); - /* Finds the Xth client-info that is active */ static NetworkClientInfo *NetworkFindClientInfo(byte client_no) { @@ -2029,6 +1996,40 @@ static void PopupClientList(int client_no, int x, int y) new NetworkClientListPopupWindow(x, y, wid, client_no); } + +/** Widget numbers of the client list window. */ +enum ClientListWidgets { + CLW_CLOSE, + CLW_CAPTION, + CLW_STICKY, + CLW_PANEL, +}; + +static const Widget _client_list_widgets[] = { +{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_BLACK_CROSS, STR_TOOLTIP_CLOSE_WINDOW}, +{ WWT_CAPTION, RESIZE_NONE, COLOUR_GREY, 11, 237, 0, 13, STR_NETWORK_COMPANY_LIST_CLIENT_LIST, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS}, +{ WWT_STICKYBOX, RESIZE_NONE, COLOUR_GREY, 238, 249, 0, 13, STR_NULL, STR_TOOLTIP_STICKY}, + +{ WWT_PANEL, RESIZE_NONE, COLOUR_GREY, 0, 249, 14, 14 + CLNWND_ROWSIZE + 1, 0x0, STR_NULL}, +{ WIDGETS_END}, +}; + +static const NWidgetPart _nested_client_list_widgets[] = { + NWidget(NWID_HORIZONTAL), + NWidget(WWT_CLOSEBOX, COLOUR_GREY, CLW_CLOSE), + NWidget(WWT_CAPTION, COLOUR_GREY, CLW_CAPTION), SetDataTip(STR_NETWORK_COMPANY_LIST_CLIENT_LIST, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), + NWidget(WWT_STICKYBOX, COLOUR_GREY, CLW_STICKY), + EndContainer(), + NWidget(WWT_PANEL, COLOUR_GREY, CLW_PANEL), SetMinimalSize(250, CLNWND_ROWSIZE + 2), EndContainer(), +}; + +static const WindowDesc _client_list_desc( + WDP_AUTO, WDP_AUTO, 250, 1, 250, 1, + WC_CLIENT_LIST, WC_NONE, + WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, + _client_list_widgets, _nested_client_list_widgets, lengthof(_nested_client_list_widgets) +); + /** * Main handle for clientlist */ |