summaryrefslogtreecommitdiff
path: root/network_gui.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-05-02 18:08:34 +0000
committerDarkvater <Darkvater@openttd.org>2005-05-02 18:08:34 +0000
commit5ee09dd2081b5a76423ce67c75dd5f4dc4557c91 (patch)
tree0ed78dc775e5fd026e3e3d63a669f8ec2dc5fc23 /network_gui.c
parentdf46ae6e6aa5cbcde70146fbd0f7a903394753d6 (diff)
downloadopenttd-5ee09dd2081b5a76423ce67c75dd5f4dc4557c91.tar.xz
(svn r2251) - Fix: [ 1193945 ] Clicking on the chat text box causes an assertion failure
Diffstat (limited to 'network_gui.c')
-rw-r--r--network_gui.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/network_gui.c b/network_gui.c
index 93f26ae6b..f2d025d27 100644
--- a/network_gui.c
+++ b/network_gui.c
@@ -1368,13 +1368,13 @@ static void ChatWindowWndProc(Window *w, WindowEvent *e)
case WE_PAINT:
DrawWindowWidgets(w);
- DrawEditBox(w, 1);
+ DrawEditBox(w, 2);
break;
case WE_CLICK:
- switch(e->click.widget) {
- case 3: DeleteWindow(w); break; // Cancel
- case 2: // Send
+ switch (e->click.widget) {
+ case 4: DeleteWindow(w); break; // Cancel
+ case 3: // Send
press_ok:;
if (strcmp(WP(w, querystr_d).text.buf, WP(w, querystr_d).text.buf + MAX_QUERYSTR_LEN) == 0) {
DeleteWindow(w);
@@ -1406,11 +1406,11 @@ press_ok:;
DeleteWindow(w);
return;
}
- HandleEditBox(w, 1);
+ HandleEditBox(w, 2);
} break;
case WE_KEYPRESS: {
- switch(HandleEditBoxKey(w, 1, e)) {
+ switch (HandleEditBoxKey(w, 2, e)) {
case 1: // Return
goto press_ok;
case 2: // Escape
@@ -1435,10 +1435,11 @@ press_ok:;
}
static const Widget _chat_window_widgets[] = {
-{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 639, 0, 13, 0x0, STR_NULL}, // background
-{ WWT_IMGBTN, RESIZE_NONE, 14, 2, 399, 1, 12, 0x0, STR_NULL}, // text box
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 400, 519, 1, 12, STR_NETWORK_SEND,STR_NULL}, // send button
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 520, 639, 1, 12, STR_012E_CANCEL, STR_NULL}, // cancel button
+{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 639, 0, 13, STR_NULL, STR_NULL}, // background
+{ WWT_EMPTY, RESIZE_NONE, 14, 0, 639, 0, 13, STR_NULL, STR_NULL},
+{ WWT_IMGBTN, RESIZE_NONE, 14, 2, 399, 1, 12, STR_NULL, STR_NULL}, // text box
+{ WWT_TEXTBTN, RESIZE_NONE, 14, 400, 519, 1, 12, STR_NETWORK_SEND, STR_NULL}, // send button
+{ WWT_TEXTBTN, RESIZE_NONE, 14, 520, 639, 1, 12, STR_012E_CANCEL, STR_NULL}, // cancel button
{ WIDGETS_END},
};