From: Laszlo T. <ave...@us...> - 2011-08-11 19:46:25
|
gemrb: Infinity Engine emulator The branch master has been updated via 7f89562ff4ed34aaed5478103f58b75152edb5be (commit) Summary of changes: gemrb/core/GUI/EventMgr.cpp | 10 ++++++---- gemrb/core/GUI/EventMgr.h | 5 +---- gemrb/core/GUI/Window.cpp | 6 +++++- gemrb/core/GUI/Window.h | 1 + gemrb/core/Interface.cpp | 4 ++++ 5 files changed, 17 insertions(+), 9 deletions(-) from 7f5ba810a138c200e958ca4593a02e13a590e137 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=7f89562ff4ed34aaed5478103f58b75152edb5be commit 7f89562ff4ed34aaed5478103f58b75152edb5be Author: Avenger <ave...@so...> Date: Thu Aug 11 21:44:56 2011 +0200 restore functionbar status after a window became visible again diff --git a/gemrb/core/GUI/EventMgr.cpp b/gemrb/core/GUI/EventMgr.cpp index fa7ae82..5938275 100644 --- a/gemrb/core/GUI/EventMgr.cpp +++ b/gemrb/core/GUI/EventMgr.cpp @@ -120,7 +120,6 @@ void EventMgr::Clear() /** Remove a Window from the array */ void EventMgr::DelWindow(Window *win) -//unsigned short WindowID, const char *WindowPack) { if (last_win_focused == win) { last_win_focused = NULL; @@ -138,6 +137,7 @@ void EventMgr::DelWindow(Window *win) if (windows.size() == 0) { return; } + int pos = -1; std::vector< Window*>::iterator m; for (m = windows.begin(); m != windows.end(); ++m) { @@ -151,7 +151,7 @@ void EventMgr::DelWindow(Window *win) return; } } - printMessage("EventManager","Couldn't find window",YELLOW); + printMessage("EventManager","Couldn't delete window!",YELLOW); } } } @@ -384,9 +384,11 @@ void EventMgr::OnSpecialKeyPress(unsigned char Key) } } - //if there was no default button set, then the current focus will get it + //if there was no default button set, then the current focus will get it (except function keys) if (!ctrl) { - ctrl = last_win_focused->GetFocus(); + if (Key<GEM_FUNCTION1 || Key > GEM_FUNCTION16) { + ctrl = last_win_focused->GetFocus(); + } } //if one is under focus, use the default scroll focus if (!ctrl) { diff --git a/gemrb/core/GUI/EventMgr.h b/gemrb/core/GUI/EventMgr.h index 3be96bb..af64871 100644 --- a/gemrb/core/GUI/EventMgr.h +++ b/gemrb/core/GUI/EventMgr.h @@ -135,10 +135,7 @@ public: void SetRKDelay(unsigned long t); unsigned long GetRKDelay(); unsigned long SetRKFlags(unsigned long arg, unsigned int op); - void SetFunctionBar(Window *win) { - function_bar = win; - } - + void inline SetFunctionBar(Window *win) { function_bar = win; } /** Mask of which Mouse Buttons are pressed */ unsigned char MButtons; private: diff --git a/gemrb/core/GUI/Window.cpp b/gemrb/core/GUI/Window.cpp index 576def9..8614e30 100644 --- a/gemrb/core/GUI/Window.cpp +++ b/gemrb/core/GUI/Window.cpp @@ -53,6 +53,7 @@ Window::Window(unsigned short WindowID, unsigned short XPos, DefaultControl[0] = -1; DefaultControl[1] = -1; ScrollControl = -1; + FunctionBar = false; } Window::~Window() @@ -155,11 +156,14 @@ void Window::SetFrame() Control* Window::GetFunctionControl(int x) { + if (!FunctionBar) { + return NULL; + } + std::vector< Control*>::const_iterator m; for (m = Controls.begin(); m != Controls.end(); m++) { Control *ctrl = *m; -print("%d\n", ctrl->GetFunctionNumber() ); if ( ctrl->GetFunctionNumber() == x ) return ctrl; } return NULL; diff --git a/gemrb/core/GUI/Window.h b/gemrb/core/GUI/Window.h index 1ddd4e0..86bd74f 100644 --- a/gemrb/core/GUI/Window.h +++ b/gemrb/core/GUI/Window.h @@ -133,6 +133,7 @@ public: //Public attributes int Cursor; int DefaultControl[2]; //default enter and cancel int ScrollControl; + bool FunctionBar; private: // Private attributes /** BackGround Image. No BackGround if this variable is NULL. */ Sprite2D* BackGround; diff --git a/gemrb/core/Interface.cpp b/gemrb/core/Interface.cpp index 57cb968..ae26841 100644 --- a/gemrb/core/Interface.cpp +++ b/gemrb/core/Interface.cpp @@ -3077,6 +3077,7 @@ int Interface::SetTooltip(unsigned short WindowIndex, } if (Function) { + win->FunctionBar = true; evntmgr->SetFunctionBar(win); ctrl->SetFunctionNumber(Function-1); } @@ -3137,6 +3138,9 @@ int Interface::SetVisible(unsigned short WindowIndex, int visible) case WINDOW_FRONT: if (win->Visible==WINDOW_VISIBLE) { evntmgr->AddWindow( win ); + if (win->FunctionBar) { + evntmgr->SetFunctionBar( win ); + } } win->Invalidate(); SetOnTop( WindowIndex ); ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |