summaryrefslogtreecommitdiff
path: root/indra/llui/lluictrl.cpp
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-03-31 01:41:19 +0000
committerJosh Bell <josh@lindenlab.com>2007-03-31 01:41:19 +0000
commitea8fb7238e6f12383ee4bc081475fa6235637581 (patch)
treef384da93c884353bef55cf887f6c86f2081db271 /indra/llui/lluictrl.cpp
parentffc6680d956069625fc1fe5da133bdf7922cea83 (diff)
svn merge -r 59364:59813 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release
Diffstat (limited to 'indra/llui/lluictrl.cpp')
-rw-r--r--indra/llui/lluictrl.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 0d9791c660..abf796fde0 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -26,6 +26,7 @@ const U32 MAX_STRING_LENGTH = 10;
LLUICtrl::LLUICtrl() :
mCommitCallback(NULL),
+ mFocusLostCallback(NULL),
mFocusReceivedCallback(NULL),
mFocusChangedCallback(NULL),
mValidateCallback(NULL),
@@ -44,6 +45,7 @@ LLUICtrl::LLUICtrl(const LLString& name, const LLRect& rect, BOOL mouse_opaque,
// of buttons in the UI. JC 7/20/2002
LLView( name, rect, mouse_opaque, reshape ),
mCommitCallback( on_commit_callback) ,
+ mFocusLostCallback( NULL ),
mFocusReceivedCallback( NULL ),
mFocusChangedCallback( NULL ),
mValidateCallback( NULL ),
@@ -57,6 +59,12 @@ LLUICtrl::LLUICtrl(const LLString& name, const LLRect& rect, BOOL mouse_opaque,
LLUICtrl::~LLUICtrl()
{
gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit()
+
+ if( gFocusMgr.getTopCtrl() == this )
+ {
+ llwarns << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl;
+ gFocusMgr.removeTopCtrlWithoutCallback( this );
+ }
}
void LLUICtrl::onCommit()
@@ -151,6 +159,11 @@ void LLUICtrl::onFocusReceived()
void LLUICtrl::onFocusLost()
{
+ if( mFocusLostCallback )
+ {
+ mFocusLostCallback( this, mCallbackUserData );
+ }
+
if( mFocusChangedCallback )
{
mFocusChangedCallback( this, mCallbackUserData );