From 861e9cefb3c31f1cab46ddb068af7a3648f45b4a Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 9 Feb 2009 01:22:29 +0000 Subject: (svn r15424) -Codechange: make it possible to have multiple windows with edit box open simultaniously (Zuu). --- src/console_gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/console_gui.cpp') diff --git a/src/console_gui.cpp b/src/console_gui.cpp index e2bbf11f6..c80c9d7c1 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -150,7 +150,6 @@ struct IConsoleWindow : Window IConsoleWindow(const WindowDesc *desc) : Window(desc) { _iconsole_mode = ICONSOLE_OPENED; - _no_scroll++; // override cursor arrows; the gamefield will not scroll this->height = _screen.height / 3; this->width = _screen.width; @@ -159,7 +158,6 @@ struct IConsoleWindow : Window ~IConsoleWindow() { _iconsole_mode = ICONSOLE_CLOSED; - _no_scroll--; } virtual void OnPaint() @@ -180,7 +178,7 @@ struct IConsoleWindow : Window DoDrawString(_iconsole_cmdline.buf, 10 + delta, this->height - ICON_LINE_HEIGHT, CC_COMMAND); - if (_iconsole_cmdline.caret) { + if (_focused_window == this && _iconsole_cmdline.caret) { DoDrawString("_", 10 + delta + _iconsole_cmdline.caretxoffs, this->height - ICON_LINE_HEIGHT, TC_WHITE); } } @@ -201,6 +199,8 @@ struct IConsoleWindow : Window virtual EventState OnKeyPress(uint16 key, uint16 keycode) { + if (_focused_window != this) return ES_NOT_HANDLED; + const int scroll_height = (this->height / ICON_LINE_HEIGHT) - 1; switch (keycode) { case WKC_UP: -- cgit v1.2.3-54-g00ecf