summaryrefslogtreecommitdiff
path: root/indra/llui/llfocusmgr.cpp
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2009-09-30 01:00:51 +0000
committerRichard Nelson <richard@lindenlab.com>2009-09-30 01:00:51 +0000
commit6c70154cd1e5757e879f3f7463c0fedd69d82b63 (patch)
tree6be070977098f7b9b060ee202528f99c6d30979b /indra/llui/llfocusmgr.cpp
parent6d887be5895286f6b65ea751014f33bd9e0faac4 (diff)
converted focus change callbacks to use signals
replaced mFocusChangedSignal that PE added with our hierarchical focus mgmt reviewed by Leyla
Diffstat (limited to 'indra/llui/llfocusmgr.cpp')
-rw-r--r--indra/llui/llfocusmgr.cpp42
1 files changed, 7 insertions, 35 deletions
diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp
index ab9b59e252..279cbaa923 100644
--- a/indra/llui/llfocusmgr.cpp
+++ b/indra/llui/llfocusmgr.cpp
@@ -41,11 +41,6 @@ const F32 FOCUS_FADE_TIME = 0.3f;
// NOTE: the LLFocusableElement implementation has been moved here from lluictrl.cpp.
LLFocusableElement::LLFocusableElement()
-: mFocusLostCallback(NULL),
- mFocusReceivedCallback(NULL),
- mFocusChangedCallback(NULL),
- mTopLostCallback(NULL),
- mFocusCallbackUserData(NULL)
{
}
@@ -68,35 +63,19 @@ LLFocusableElement::~LLFocusableElement()
void LLFocusableElement::onFocusReceived()
{
- if( mFocusReceivedCallback )
- {
- mFocusReceivedCallback( this, mFocusCallbackUserData );
- }
- if( mFocusChangedCallback )
- {
- mFocusChangedCallback( this, mFocusCallbackUserData );
- }
+ mFocusReceivedCallback(this);
+ mFocusChangedCallback(this);
}
void LLFocusableElement::onFocusLost()
{
- if( mFocusLostCallback )
- {
- mFocusLostCallback( this, mFocusCallbackUserData );
- }
-
- if( mFocusChangedCallback )
- {
- mFocusChangedCallback( this, mFocusCallbackUserData );
- }
+ mFocusLostCallback(this);
+ mFocusChangedCallback(this);
}
void LLFocusableElement::onTopLost()
{
- if (mTopLostCallback)
- {
- mTopLostCallback(this, mFocusCallbackUserData);
- }
+ mTopLostCallback(this);
}
BOOL LLFocusableElement::hasFocus() const
@@ -188,12 +167,9 @@ void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, BOOL lock, BOOL
view_handle_list_t new_focus_list;
// walk up the tree to root and add all views to the new_focus_list
- for (LLView* ctrl = dynamic_cast<LLView*>(mKeyboardFocus); ctrl && ctrl != LLUI::getRootView(); ctrl = ctrl->getParent())
+ for (LLView* ctrl = dynamic_cast<LLView*>(mKeyboardFocus); ctrl; ctrl = ctrl->getParent())
{
- if (ctrl)
- {
- new_focus_list.push_back(ctrl->getHandle());
- }
+ new_focus_list.push_back(ctrl->getHandle());
}
// remove all common ancestors since their focus is unchanged
@@ -216,10 +192,6 @@ void LLFocusMgr::setKeyboardFocus(LLFocusableElement* new_focus, BOOL lock, BOOL
{
mCachedKeyboardFocusList.pop_front();
old_focus_view->onFocusLost();
-
- // part of fix of EXT-996
- // this need to handle event when user click inside in-world area
- mFocusChangeSignal();
}
}