From 0931799f03df4a0d573cc9162f1a81f6e3222d3b Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Fri, 24 Sep 2010 15:57:17 -0700 Subject: VWR-21377 Script editor ctrl-f fix. let some LLViews handle shortcut keys if they want. reviewed with ambroff --- indra/llui/llfocusmgr.cpp | 14 ++++++++++++++ indra/llui/llfocusmgr.h | 2 ++ indra/llui/llview.h | 5 +++++ 3 files changed, 21 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 1f16d12add..7fbfd80d8d 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -315,6 +315,20 @@ void LLFocusMgr::removeKeyboardFocusWithoutCallback( const LLFocusableElement* f } } +bool LLFocusMgr::keyboardFocusHasMenus() const +{ + LLView* focus_view = dynamic_cast(mKeyboardFocus); + while( focus_view ) + { + if(focus_view->hasMenus()) + { + return true; + } + + focus_view = focus_view->getParent(); + } + return false; +} void LLFocusMgr::setMouseCapture( LLMouseHandler* new_captor ) { diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h index eef82a3b5a..e09bad0187 100644 --- a/indra/llui/llfocusmgr.h +++ b/indra/llui/llfocusmgr.h @@ -118,6 +118,8 @@ public: void unlockFocus(); BOOL focusLocked() const { return mLockedView != NULL; } + bool keyboardFocusHasMenus() const; + private: LLUICtrl* mLockedView; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 6bcee98f26..706858e65c 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -273,6 +273,11 @@ public: BOOL focusNextRoot(); BOOL focusPrevRoot(); + // Normally we want the app menus to get priority on modified keys + // However, if this item claims to have menus then we want to give + // it first chance at handling them. (eg. the script editor) + virtual bool hasMenus() const { return false; }; + // delete all children. Override this function if you need to // perform any extra clean up such as cached pointers to selected // children, etc. -- cgit v1.2.3 From f3b01596ddde08a178276fadc44f430928582748 Mon Sep 17 00:00:00 2001 From: Kelly Washington Date: Fri, 24 Sep 2010 16:31:43 -0700 Subject: VWR-21377 Script editor ctrl-f fix. change to better / more consistent naming --- indra/llui/llfocusmgr.cpp | 4 ++-- indra/llui/llfocusmgr.h | 2 +- indra/llui/llview.h | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 7fbfd80d8d..43e5f6b051 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -315,12 +315,12 @@ void LLFocusMgr::removeKeyboardFocusWithoutCallback( const LLFocusableElement* f } } -bool LLFocusMgr::keyboardFocusHasMenus() const +bool LLFocusMgr::keyboardFocusHasAccelerators() const { LLView* focus_view = dynamic_cast(mKeyboardFocus); while( focus_view ) { - if(focus_view->hasMenus()) + if(focus_view->hasAccelerators()) { return true; } diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h index e09bad0187..22c1895075 100644 --- a/indra/llui/llfocusmgr.h +++ b/indra/llui/llfocusmgr.h @@ -118,7 +118,7 @@ public: void unlockFocus(); BOOL focusLocked() const { return mLockedView != NULL; } - bool keyboardFocusHasMenus() const; + bool keyboardFocusHasAccelerators() const; private: LLUICtrl* mLockedView; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 706858e65c..33d345beff 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -273,10 +273,10 @@ public: BOOL focusNextRoot(); BOOL focusPrevRoot(); - // Normally we want the app menus to get priority on modified keys - // However, if this item claims to have menus then we want to give - // it first chance at handling them. (eg. the script editor) - virtual bool hasMenus() const { return false; }; + // Normally we want the app menus to get priority on accelerated keys + // However, sometimes we want to give specific views a first chance + // iat handling them. (eg. the script editor) + virtual bool hasAccelerators() const { return false; }; // delete all children. Override this function if you need to // perform any extra clean up such as cached pointers to selected -- cgit v1.2.3