summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-07-02 00:38:13 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-07-02 00:38:13 +0000
commit39905b927d60e204438705728d2c214cb3f9ef81 (patch)
tree7bb617cc204514b233e081457d905693aa0ae409 /indra/llui
parent687cff0eb8dfe663b99e18cfd953e0764d8ab372 (diff)
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@873 https://svn.aws.productengine.com/secondlife/pe/stable@888 -> viewer-2.0.0-pe-4
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llpanel.cpp4
-rw-r--r--indra/llui/llpanel.h5
-rw-r--r--indra/llui/lluictrl.cpp18
-rw-r--r--indra/llui/lluictrl.h11
4 files changed, 35 insertions, 3 deletions
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 0136a41d61..3a76e72868 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -869,12 +869,12 @@ void LLPanel::childSetAction(const std::string& id, boost::function<void(void*)>
}
}
-void LLPanel::childSetActionTextbox(const std::string& id, void(*function)(void*), void* value)
+void LLPanel::childSetActionTextbox(const std::string& id, boost::function<void(void*)> function, void* value)
{
LLTextBox* textbox = findChild<LLTextBox>(id);
if (textbox)
{
- textbox->setClickedCallback(function, value);
+ textbox->setClickedCallback(boost::bind(function, value));
}
}
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index fc40cd77eb..c38e9df53b 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -235,7 +235,10 @@ public:
// LLButton
void childSetAction(const std::string& id, boost::function<void(void*)> function, void* value = NULL);
- void childSetActionTextbox(const std::string& id, void(*function)(void*), void* value = NULL);
+
+ // LLTextBox
+ void childSetActionTextbox(const std::string& id, boost::function<void(void*)> function, void* value = NULL);
+
void childSetControlName(const std::string& id, const std::string& control_name);
// Error reporting
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 7b378fd9c7..0fbcf24c49 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -48,6 +48,8 @@ LLUICtrl::Params::Params()
commit_callback("commit_callback"),
validate_callback("validate_callback"),
rightclick_callback("rightclick_callback"),
+ mouseenter_callback("mouseenter_callback"),
+ mouseleave_callback("mouseleave_callback"),
control_name("control_name")
{
addSynonym(initial_value, "initial_val");
@@ -200,6 +202,11 @@ void LLUICtrl::initFromParams(const Params& p)
if(p.rightclick_callback.isProvided())
initCommitCallback(p.rightclick_callback, mRightClickSignal);
+ if(p.mouseenter_callback.isProvided())
+ initCommitCallback(p.mouseenter_callback, mMouseEnterSignal);
+
+ if(p.mouseleave_callback.isProvided())
+ initCommitCallback(p.mouseleave_callback, mMouseLeaveSignal);
}
@@ -264,6 +271,17 @@ void LLUICtrl::initEnableCallback(const EnableCallbackParam& cb, enable_signal_t
}
}
+// virtual
+void LLUICtrl::onMouseEnter(S32 x, S32 y, MASK mask)
+{
+ mMouseEnterSignal(this, getValue());
+}
+
+// virtual
+void LLUICtrl::onMouseLeave(S32 x, S32 y, MASK mask)
+{
+ mMouseLeaveSignal(this, getValue());
+}
void LLUICtrl::onCommit()
{
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index 6dfbd9cf8b..2b9caa2a82 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -145,6 +145,9 @@ public:
Optional<EnableCallbackParam> validate_callback;
Optional<CommitCallbackParam> rightclick_callback;
+
+ Optional<CommitCallbackParam> mouseenter_callback;
+ Optional<CommitCallbackParam> mouseleave_callback;
Optional<focus_callback_t> focus_lost_callback;
@@ -181,6 +184,8 @@ public:
/*virtual*/ BOOL isCtrl() const;
/*virtual*/ void setTentative(BOOL b);
/*virtual*/ BOOL getTentative() const;
+ /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
+ /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
// From LLFocusableElement
/*virtual*/ void setFocus( BOOL b );
@@ -246,6 +251,9 @@ public:
boost::signals2::connection setCommitCallback( const commit_signal_t::slot_type& cb ) { return mCommitSignal.connect(cb); }
boost::signals2::connection setValidateCallback( const enable_signal_t::slot_type& cb ) { return mValidateSignal.connect(cb); }
+
+ boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { return mMouseEnterSignal.connect(cb); }
+ boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { return mMouseLeaveSignal.connect(cb); }
// *TODO: Deprecate; for backwards compatability only:
boost::signals2::connection setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data);
@@ -275,6 +283,9 @@ protected:
enable_signal_t mValidateSignal;
commit_signal_t mRightClickSignal;
+ commit_signal_t mMouseEnterSignal;
+ commit_signal_t mMouseLeaveSignal;
+
LLViewModelPtr mViewModel;
LLControlVariable* mControlVariable;