From fb1dbd6d192cfc532a6e82e86edc32cbb956f4c5 Mon Sep 17 00:00:00 2001 From: alberth Date: Tue, 5 May 2009 20:03:57 +0000 Subject: (svn r16231) -Codechange: Added nested widgets to chat window. --- src/network/network_chat_gui.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 9e0e92cb0..09459c5de 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -501,11 +501,33 @@ static const Widget _chat_window_widgets[] = { { WIDGETS_END}, }; +static const NWidgetPart _nested_chat_window_widgets[] = { + NWidget(NWID_HORIZONTAL), + NWidget(WWT_CLOSEBOX, COLOUR_GREY, NWCW_CLOSE), + NWidget(WWT_PANEL, COLOUR_GREY, NWCW_BACKGROUND), + NWidget(NWID_HORIZONTAL), + NWidget(WWT_EDITBOX, COLOUR_GREY, NWCW_TEXTBOX), SetMinimalSize(183, 12), SetPadding(1, 0, 1, 64), SetResize(1, 0), + SetDataTip(STR_NETWORK_CHAT_OSKTITLE, STR_NULL), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, NWCW_SENDBUTTON), SetMinimalSize(62, 12), SetPadding(1, 0, 1, 0), SetDataTip(STR_NETWORK_SEND, STR_NULL), + EndContainer(), + EndContainer(), + EndContainer(), +}; + +void test_chat() +{ + const Widget *wid; + + printf("_chat_window_widgets\n"); + wid = InitializeWidgetArrayFromNestedWidgets(_nested_chat_window_widgets, lengthof(_nested_chat_window_widgets), _chat_window_widgets, NULL); + free((void *)wid); +} + static const WindowDesc _chat_window_desc( WDP_CENTER, -26, 320, 14, 640, 14, // x, y, width, height WC_SEND_NETWORK_MSG, WC_NONE, WDF_STD_TOOLTIPS | WDF_DEF_WIDGET, - _chat_window_widgets + _chat_window_widgets, _nested_chat_window_widgets, lengthof(_nested_chat_window_widgets) ); void ShowNetworkChatQueryWindow(DestType type, int dest) -- cgit v1.2.3-70-g09d2