diff options
Diffstat (limited to 'indra/llui/lluictrl.cpp')
| -rw-r--r-- | indra/llui/lluictrl.cpp | 13 |
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 ); |
