summaryrefslogtreecommitdiff
path: root/indra/llui/llfocusmgr.h
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2009-10-01 18:19:45 -0700
committerMark Palange (Mani) <palange@lindenlab.com>2009-10-01 18:19:45 -0700
commitdde2153014cd7d7b8fa704f7067a41344bfbb1c2 (patch)
treef7633ccef179644660897c8bf3684abeda3545f8 /indra/llui/llfocusmgr.h
parent9b8b0571645f8b607ecc24221c807cc02a03692f (diff)
parent85ea690d47208f6dda020c8ff81021179fbdd0b8 (diff)
merge of latest lindenlab/svn-imports-viewer-20
Diffstat (limited to 'indra/llui/llfocusmgr.h')
-rw-r--r--indra/llui/llfocusmgr.h27
1 files changed, 10 insertions, 17 deletions
diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h
index 2c2dae216a..2fa4e124fb 100644
--- a/indra/llui/llfocusmgr.h
+++ b/indra/llui/llfocusmgr.h
@@ -54,11 +54,12 @@ public:
virtual void setFocus( BOOL b );
virtual BOOL hasFocus() const;
- typedef boost::function<void(LLFocusableElement*, void*)> focus_callback_t;
- void setFocusLostCallback(focus_callback_t cb, void* user_data = NULL) { mFocusLostCallback = cb; mFocusCallbackUserData = user_data; }
- void setFocusReceivedCallback(focus_callback_t cb, void* user_data = NULL) { mFocusReceivedCallback = cb; mFocusCallbackUserData = user_data; }
- void setFocusChangedCallback(focus_callback_t cb, void* user_data = NULL ) { mFocusChangedCallback = cb; mFocusCallbackUserData = user_data; }
- void setTopLostCallback(focus_callback_t cb, void* user_data = NULL ) { mTopLostCallback = cb; mFocusCallbackUserData = user_data; }
+ typedef boost::signals2::signal<void(LLFocusableElement*)> focus_signal_t;
+
+ boost::signals2::connection setFocusLostCallback( const focus_signal_t::slot_type& cb) { return mFocusLostCallback.connect(cb);}
+ boost::signals2::connection setFocusReceivedCallback(const focus_signal_t::slot_type& cb) { return mFocusReceivedCallback.connect(cb);}
+ boost::signals2::connection setFocusChangedCallback(const focus_signal_t::slot_type& cb) { return mFocusChangedCallback.connect(cb);}
+ void setTopLostCallback(const focus_signal_t::slot_type& cb) { mTopLostCallback.connect(cb);}
// These were brought up the hierarchy from LLView so that we don't have to use dynamic_cast when dealing with keyboard focus.
virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
@@ -68,11 +69,10 @@ protected:
virtual void onFocusReceived();
virtual void onFocusLost();
virtual void onTopLost(); // called when registered as top ctrl and user clicks elsewhere
- focus_callback_t mFocusLostCallback;
- focus_callback_t mFocusReceivedCallback;
- focus_callback_t mFocusChangedCallback;
- focus_callback_t mTopLostCallback;
- void* mFocusCallbackUserData;
+ focus_signal_t mFocusLostCallback;
+ focus_signal_t mFocusReceivedCallback;
+ focus_signal_t mFocusChangedCallback;
+ focus_signal_t mTopLostCallback;
};
@@ -124,11 +124,6 @@ public:
void unlockFocus();
BOOL focusLocked() const { return mLockedView != NULL; }
- void addFocusChangeCallback(const boost::signals2::signal<void ()>::slot_type& cb)
- {
- mFocusChangeSignal.connect(cb);
- }
-
private:
LLUICtrl* mLockedView;
@@ -155,8 +150,6 @@ private:
typedef std::map<LLHandle<LLView>, LLHandle<LLView> > focus_history_map_t;
focus_history_map_t mFocusHistory;
- boost::signals2::signal<void()> mFocusChangeSignal;
-
#ifdef _DEBUG
std::string mMouseCaptorName;
std::string mKeyboardFocusName;