summaryrefslogtreecommitdiff
path: root/indra/newview
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/newview
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/newview')
-rw-r--r--indra/newview/llchatbar.cpp8
-rw-r--r--indra/newview/llchatbar.h4
-rw-r--r--indra/newview/llfloaterland.cpp2
-rw-r--r--indra/newview/llfloaterpostcard.cpp2
-rw-r--r--indra/newview/llfolderview.cpp4
-rw-r--r--indra/newview/llfolderview.h2
-rw-r--r--indra/newview/llimfloater.cpp8
-rw-r--r--indra/newview/llimpanel.cpp9
-rw-r--r--indra/newview/llimpanel.h2
-rw-r--r--indra/newview/lllocationinputctrl.cpp1
-rw-r--r--indra/newview/llnearbychatbar.cpp2
-rw-r--r--indra/newview/llpanelclassified.cpp4
-rw-r--r--indra/newview/llpanelgroupgeneral.cpp4
-rw-r--r--indra/newview/llpanelgrouproles.cpp2
-rw-r--r--indra/newview/llpanellogin.cpp4
-rw-r--r--indra/newview/llpanellogin.h2
16 files changed, 29 insertions, 31 deletions
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index 96c707b08f..4523267edd 100644
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -125,8 +125,8 @@ BOOL LLChatBar::postBuild()
mInputEditor = getChild<LLLineEditor>("Chat Editor");
mInputEditor->setKeystrokeCallback(&onInputEditorKeystroke, this);
- mInputEditor->setFocusLostCallback(&onInputEditorFocusLost, this);
- mInputEditor->setFocusReceivedCallback( &onInputEditorGainFocus, this );
+ mInputEditor->setFocusLostCallback(boost::bind(&LLChatBar::onInputEditorFocusLost));
+ mInputEditor->setFocusReceivedCallback(boost::bind(&LLChatBar::onInputEditorGainFocus));
mInputEditor->setCommitOnFocusLost( FALSE );
mInputEditor->setRevertOnEsc( FALSE );
mInputEditor->setIgnoreTab(TRUE);
@@ -538,14 +538,14 @@ void LLChatBar::onInputEditorKeystroke( LLLineEditor* caller, void* userdata )
}
// static
-void LLChatBar::onInputEditorFocusLost( LLFocusableElement* caller, void* userdata)
+void LLChatBar::onInputEditorFocusLost()
{
// stop typing animation
gAgent.stopTyping();
}
// static
-void LLChatBar::onInputEditorGainFocus( LLFocusableElement* caller, void* userdata )
+void LLChatBar::onInputEditorGainFocus()
{
LLFloaterChat::setHistoryCursorAndScrollToEnd();
}
diff --git a/indra/newview/llchatbar.h b/indra/newview/llchatbar.h
index a41947218d..86aa3ebd2a 100644
--- a/indra/newview/llchatbar.h
+++ b/indra/newview/llchatbar.h
@@ -87,8 +87,8 @@ public:
static void onTabClick( void* userdata );
static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
- static void onInputEditorFocusLost(LLFocusableElement* caller,void* userdata);
- static void onInputEditorGainFocus(LLFocusableElement* caller,void* userdata);
+ static void onInputEditorFocusLost();
+ static void onInputEditorGainFocus();
void onCommitGesture(LLUICtrl* ctrl);
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index e5f5e8eedb..3fe7d8d9da 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1043,7 +1043,7 @@ BOOL LLPanelLandObjects::postBuild()
mSelectedObjects = getChild<LLTextBox>("selected_objects_text");
mCleanOtherObjectsTime = getChild<LLLineEditor>("clean other time");
- mCleanOtherObjectsTime->setFocusLostCallback(onLostFocus, this);
+ mCleanOtherObjectsTime->setFocusLostCallback(boost::bind(onLostFocus, _1, this));
mCleanOtherObjectsTime->setCommitCallback(onCommitClean, this);
childSetPrevalidate("clean other time", LLLineEditor::prevalidateNonNegativeS32);
diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp
index fbc0ff3cf5..938370b732 100644
--- a/indra/newview/llfloaterpostcard.cpp
+++ b/indra/newview/llfloaterpostcard.cpp
@@ -106,7 +106,7 @@ BOOL LLFloaterPostcard::postBuild()
childSetValue("name_form", LLSD(name_string));
// For the first time a user focusess to .the msg box, all text will be selected.
- getChild<LLUICtrl>("msg_form")->setFocusChangedCallback(onMsgFormFocusRecieved, this);
+ getChild<LLUICtrl>("msg_form")->setFocusChangedCallback(boost::bind(onMsgFormFocusRecieved, _1, this));
childSetFocus("to_form", TRUE);
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 2a29566120..d149c8bbb5 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -1318,7 +1318,7 @@ void LLFolderView::startRenamingSelectedItem( void )
mRenamer->setVisible( TRUE );
// set focus will fail unless item is visible
mRenamer->setFocus( TRUE );
- mRenamer->setTopLostCallback(onRenamerLost);
+ mRenamer->setTopLostCallback(boost::bind(onRenamerLost, _1));
gFocusMgr.setTopCtrl( mRenamer );
}
}
@@ -2147,7 +2147,7 @@ void LLFolderView::updateRenamerPosition()
///----------------------------------------------------------------------------
//static
-void LLFolderView::onRenamerLost( LLFocusableElement* renamer, void* user_data)
+void LLFolderView::onRenamerLost( LLFocusableElement* renamer)
{
LLUICtrl* uictrl = dynamic_cast<LLUICtrl*>(renamer);
if (uictrl)
diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h
index a05dec3193..69c0c5b132 100644
--- a/indra/newview/llfolderview.h
+++ b/indra/newview/llfolderview.h
@@ -279,7 +279,7 @@ protected:
LLScrollContainer* mScrollContainer; // NULL if this is not a child of a scroll container.
void commitRename( const LLSD& data );
- static void onRenamerLost( LLFocusableElement* renamer, void* user_data);
+ static void onRenamerLost( LLFocusableElement* renamer);
void finishRenamingItem( void );
void closeRenamer( void );
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 29102feb64..254e16e1fb 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -78,7 +78,7 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id)
}
// LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im_session.xml");
- gFocusMgr.addFocusChangeCallback(boost::bind(&LLIMFloater::focusChangeCallback, this));
+ LLUI::getRootView()->setFocusLostCallback(boost::bind(&LLIMFloater::focusChangeCallback, this));
mCloseSignal.connect(boost::bind(&LLIMFloater::onClose, this));
}
@@ -177,8 +177,8 @@ BOOL LLIMFloater::postBuild()
// enable line history support for instant message bar
mInputEditor->setEnableLineHistory(TRUE);
- mInputEditor->setFocusReceivedCallback( onInputEditorFocusReceived, this );
- mInputEditor->setFocusLostCallback( onInputEditorFocusLost, this );
+ mInputEditor->setFocusReceivedCallback( boost::bind(onInputEditorFocusReceived, _1, this) );
+ mInputEditor->setFocusLostCallback( boost::bind(onInputEditorFocusLost, _1, this) );
mInputEditor->setKeystrokeCallback( onInputEditorKeystroke, this );
mInputEditor->setCommitOnFocusLost( FALSE );
mInputEditor->setRevertOnEsc( FALSE );
@@ -221,7 +221,7 @@ void* LLIMFloater::createPanelGroupControl(void* userdata)
void LLIMFloater::focusChangeCallback()
{
// hide docked floater if user clicked inside in-world area
- if (isDocked() && gFocusMgr.getKeyboardFocus() == NULL)
+ if (isDocked())
{
setVisible(false);
}
diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp
index de4faf72f5..aa2beabf3d 100644
--- a/indra/newview/llimpanel.cpp
+++ b/indra/newview/llimpanel.cpp
@@ -1086,10 +1086,7 @@ LLFloaterIMPanel::~LLFloaterIMPanel()
mVoiceChannel = NULL;
//delete focus lost callback
- if(mInputEditor)
- {
- mInputEditor->setFocusLostCallback( NULL );
- }
+ mFocusCallbackConnection.disconnect();
}
BOOL LLFloaterIMPanel::postBuild()
@@ -1099,8 +1096,8 @@ BOOL LLFloaterIMPanel::postBuild()
mVisibleSignal.connect(boost::bind(&LLFloaterIMPanel::onVisibilityChange, this, _2));
mInputEditor = getChild<LLLineEditor>("chat_editor");
- mInputEditor->setFocusReceivedCallback( onInputEditorFocusReceived, this );
- mInputEditor->setFocusLostCallback( onInputEditorFocusLost, this );
+ mInputEditor->setFocusReceivedCallback( boost::bind(onInputEditorFocusReceived, _1, this) );
+ mFocusCallbackConnection = mInputEditor->setFocusLostCallback( boost::bind(onInputEditorFocusLost, _1, this));
mInputEditor->setKeystrokeCallback( onInputEditorKeystroke, this );
mInputEditor->setCommitCallback( onCommitChat, this );
mInputEditor->setCommitOnFocusLost( FALSE );
diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h
index dbf5e1cb6a..fd1134ee5e 100644
--- a/indra/newview/llimpanel.h
+++ b/indra/newview/llimpanel.h
@@ -357,6 +357,8 @@ private:
// Timer to detect when user has stopped typing.
LLFrameTimer mLastKeystrokeTimer;
+ boost::signals2::connection mFocusCallbackConnection;
+
void disableWhileSessionStarting();
};
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index 9d14a3fbdc..a6c2435e1e 100644
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -190,7 +190,6 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
params.max_length_bytes(p.max_chars);
params.commit_callback.function(boost::bind(&LLComboBox::onTextCommit, this, _2));
params.keystroke_callback(boost::bind(&LLComboBox::onTextEntry, this, _1));
- params.focus_lost_callback(NULL);
params.handle_edit_keys_directly(true);
params.commit_on_focus_lost(false);
params.follows.flags(FOLLOWS_ALL);
diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index cec4b9f7c7..1d8789fde0 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -190,7 +190,7 @@ BOOL LLNearbyChatBar::postBuild()
mChatBox->setCommitCallback(boost::bind(&LLNearbyChatBar::onChatBoxCommit, this));
mChatBox->setKeystrokeCallback(&onChatBoxKeystroke, this);
- mChatBox->setFocusLostCallback(&onChatBoxFocusLost, this);
+ mChatBox->setFocusLostCallback(boost::bind(&onChatBoxFocusLost, _1, this));
mChatBox->setIgnoreArrowKeys(TRUE);
mChatBox->setCommitOnFocusLost( FALSE );
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index ee5d265220..7eaee92778 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -238,13 +238,13 @@ BOOL LLPanelClassified::postBuild()
mNameEditor = getChild<LLLineEditor>("given_name_editor");
mNameEditor->setMaxTextLength(DB_PARCEL_NAME_LEN);
mNameEditor->setCommitOnFocusLost(TRUE);
- mNameEditor->setFocusReceivedCallback(focusReceived, this);
+ mNameEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this));
mNameEditor->setCommitCallback(onCommitAny, this);
mNameEditor->setPrevalidate( LLLineEditor::prevalidateASCII );
mDescEditor = getChild<LLTextEditor>("desc_editor");
mDescEditor->setCommitOnFocusLost(TRUE);
- mDescEditor->setFocusReceivedCallback(focusReceived, this);
+ mDescEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this));
mDescEditor->setCommitCallback(onCommitAny, this);
mLocationEditor = getChild<LLLineEditor>("location_editor");
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index d63fd141b0..5eb7b8f5f5 100644
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -99,8 +99,8 @@ BOOL LLPanelGroupGeneral::postBuild()
if(mEditCharter)
{
mEditCharter->setCommitCallback(onCommitAny, this);
- mEditCharter->setFocusReceivedCallback(onFocusEdit, this);
- mEditCharter->setFocusChangedCallback(onFocusEdit, this);
+ mEditCharter->setFocusReceivedCallback(boost::bind(onFocusEdit, _1, this));
+ mEditCharter->setFocusChangedCallback(boost::bind(onFocusEdit, _1, this));
}
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index 378a09e315..99bb760b61 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -1730,7 +1730,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
mRoleDescription->setCommitOnFocusLost(TRUE);
mRoleDescription->setCommitCallback(onDescriptionCommit, this);
- mRoleDescription->setFocusReceivedCallback(onDescriptionFocus, this);
+ mRoleDescription->setFocusReceivedCallback(boost::bind(onDescriptionFocus, _1, this));
setFooterEnabled(FALSE);
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 150fd399c6..809e1852f4 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -229,7 +229,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
LLComboBox* server_choice_combo = sInstance->getChild<LLComboBox>("server_combo");
server_choice_combo->setCommitCallback(onSelectServer, NULL);
- server_choice_combo->setFocusLostCallback(onServerComboLostFocus);
+ server_choice_combo->setFocusLostCallback(boost::bind(onServerComboLostFocus, _1));
childSetAction("connect_btn", onClickConnect, this);
@@ -973,7 +973,7 @@ void LLPanelLogin::onSelectServer(LLUICtrl*, void*)
loadLoginPage();
}
-void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*)
+void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe)
{
if (!sInstance) return;
diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h
index ffcf6a9b70..5692b8d345 100644
--- a/indra/newview/llpanellogin.h
+++ b/indra/newview/llpanellogin.h
@@ -94,7 +94,7 @@ private:
static void onClickForgotPassword(void*);
static void onPassKey(LLLineEditor* caller, void* user_data);
static void onSelectServer(LLUICtrl*, void*);
- static void onServerComboLostFocus(LLFocusableElement*, void*);
+ static void onServerComboLostFocus(LLFocusableElement*);
private:
LLPointer<LLUIImage> mLogoImage;