diff options
author | rubidium <rubidium@openttd.org> | 2009-02-09 01:22:29 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-02-09 01:22:29 +0000 |
commit | 861e9cefb3c31f1cab46ddb068af7a3648f45b4a (patch) | |
tree | 2efbc4cf44063706f8bd6b787f55a92c57290fbb /src/console_gui.cpp | |
parent | 9907742a0f73bdbbf578cd2b6c424b80d254fed1 (diff) | |
download | openttd-861e9cefb3c31f1cab46ddb068af7a3648f45b4a.tar.xz |
(svn r15424) -Codechange: make it possible to have multiple windows with edit box open simultaniously (Zuu).
Diffstat (limited to 'src/console_gui.cpp')
-rw-r--r-- | src/console_gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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: |