diff options
author | darkvater <darkvater@openttd.org> | 2005-04-05 21:03:30 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2005-04-05 21:03:30 +0000 |
commit | 22d36985cd7e1e16c008bfaecc7d98fde6e09d5d (patch) | |
tree | 7641c6fce22d5b8a61b5207f3a67097bcde54343 /network_gui.c | |
parent | 4aa7cf8e9fe09781de385ff964d234c4a83ac419 (diff) | |
download | openttd-22d36985cd7e1e16c008bfaecc7d98fde6e09d5d.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.c | 16 |
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); |