aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lluictrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/lluictrl.cpp')
-rw-r--r--linden/indra/llui/lluictrl.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/linden/indra/llui/lluictrl.cpp b/linden/indra/llui/lluictrl.cpp
index 977f523..1762d7c 100644
--- a/linden/indra/llui/lluictrl.cpp
+++ b/linden/indra/llui/lluictrl.cpp
@@ -5,6 +5,7 @@
5 * 5 *
6 * Copyright (c) 2001-2007, Linden Research, Inc. 6 * Copyright (c) 2001-2007, Linden Research, Inc.
7 * 7 *
8 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab 9 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0 10 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement 11 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -45,6 +46,7 @@ const U32 MAX_STRING_LENGTH = 10;
45 46
46LLUICtrl::LLUICtrl() : 47LLUICtrl::LLUICtrl() :
47 mCommitCallback(NULL), 48 mCommitCallback(NULL),
49 mFocusLostCallback(NULL),
48 mFocusReceivedCallback(NULL), 50 mFocusReceivedCallback(NULL),
49 mFocusChangedCallback(NULL), 51 mFocusChangedCallback(NULL),
50 mValidateCallback(NULL), 52 mValidateCallback(NULL),
@@ -63,6 +65,7 @@ LLUICtrl::LLUICtrl(const LLString& name, const LLRect& rect, BOOL mouse_opaque,
63 // of buttons in the UI. JC 7/20/2002 65 // of buttons in the UI. JC 7/20/2002
64 LLView( name, rect, mouse_opaque, reshape ), 66 LLView( name, rect, mouse_opaque, reshape ),
65 mCommitCallback( on_commit_callback) , 67 mCommitCallback( on_commit_callback) ,
68 mFocusLostCallback( NULL ),
66 mFocusReceivedCallback( NULL ), 69 mFocusReceivedCallback( NULL ),
67 mFocusChangedCallback( NULL ), 70 mFocusChangedCallback( NULL ),
68 mValidateCallback( NULL ), 71 mValidateCallback( NULL ),
@@ -76,6 +79,12 @@ LLUICtrl::LLUICtrl(const LLString& name, const LLRect& rect, BOOL mouse_opaque,
76LLUICtrl::~LLUICtrl() 79LLUICtrl::~LLUICtrl()
77{ 80{
78 gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() 81 gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit()
82
83 if( gFocusMgr.getTopCtrl() == this )
84 {
85 llwarns << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl;
86 gFocusMgr.removeTopCtrlWithoutCallback( this );
87 }
79} 88}
80 89
81void LLUICtrl::onCommit() 90void LLUICtrl::onCommit()
@@ -170,6 +179,11 @@ void LLUICtrl::onFocusReceived()
170 179
171void LLUICtrl::onFocusLost() 180void LLUICtrl::onFocusLost()
172{ 181{
182 if( mFocusLostCallback )
183 {
184 mFocusLostCallback( this, mCallbackUserData );
185 }
186
173 if( mFocusChangedCallback ) 187 if( mFocusChangedCallback )
174 { 188 {
175 mFocusChangedCallback( this, mCallbackUserData ); 189 mFocusChangedCallback( this, mCallbackUserData );