summaryrefslogtreecommitdiff
path: root/network_gui.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-04-05 21:03:30 +0000
committerdarkvater <darkvater@openttd.org>2005-04-05 21:03:30 +0000
commit648fa7c97d817e218722f2b54db0a6e49c72ddc9 (patch)
tree7641c6fce22d5b8a61b5207f3a67097bcde54343 /network_gui.c
parent4b3f20f4842dc6bda9088b5e72363b094e23f390 (diff)
downloadopenttd-648fa7c97d817e218722f2b54db0a6e49c72ddc9.tar.xz
(svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
- CodeChange: Introduction of SendWindowMessage() where a window can send another window a message (ala windows style msg, wparam, lparam). Messages can be sent by windowclass and by windowpointer. - CodeChange: IsVitalWindow() simplifies a lot of checks for window handling that need to know what windows it can close, or be on top of, etc.
Diffstat (limited to 'network_gui.c')
-rw-r--r--network_gui.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/network_gui.c b/network_gui.c
index c749f37c2..5e0245b99 100644
--- a/network_gui.c
+++ b/network_gui.c
@@ -1362,13 +1362,16 @@ void ShowJoinStatusWindowAfterJoin(void)
static void ChatWindowWndProc(Window *w, WindowEvent *e)
{
static bool closed = false;
- switch(e->event) {
- case WE_PAINT: {
+ switch (e->event) {
+ case WE_CREATE:
+ SendWindowMessage(WC_NEWS_WINDOW, 0, WE_CREATE, w->height, 0);
+ closed = false;
+ break;
+ case WE_PAINT:
DrawWindowWidgets(w);
-
DrawEditBox(w, 1);
- } break;
+ break;
case WE_CLICK:
switch(e->click.widget) {
@@ -1418,11 +1421,8 @@ press_ok:;
}
} break;
- case WE_CREATE:
- closed = false;
- break;
-
case WE_DESTROY:
+ SendWindowMessage(WC_NEWS_WINDOW, 0, WE_DESTROY, 0, 0);
// If the window is not closed yet, it means it still needs to send a CANCEL
if (!closed) {
Window *parent = FindWindowById(WP(w,querystr_d).wnd_class, WP(w,querystr_d).wnd_num);