diff options
author | Kyle Ambroff <ambroff@lindenlab.com> | 2010-10-29 19:52:01 -0700 |
---|---|---|
committer | Kyle Ambroff <ambroff@lindenlab.com> | 2010-10-29 19:52:01 -0700 |
commit | fa17864382a64c90e9106a54368386f6e4115d67 (patch) | |
tree | 7883e97e7bd4d3b0a7d9ac7a0096424e71e0c1ad /indra/llui/lltoggleablemenu.cpp | |
parent | 4b49b0eff79c41060ba53d0d33ff83b4c18e277b (diff) | |
parent | 42b49397d2347b6a97394ce0b35efe5cc2ab44a2 (diff) |
Merge with lindenlab/viewer-development
Diffstat (limited to 'indra/llui/lltoggleablemenu.cpp')
-rw-r--r-- | indra/llui/lltoggleablemenu.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/llui/lltoggleablemenu.cpp b/indra/llui/lltoggleablemenu.cpp index 0eb2dc1387..d29260750f 100644 --- a/indra/llui/lltoggleablemenu.cpp +++ b/indra/llui/lltoggleablemenu.cpp @@ -35,10 +35,22 @@ static LLDefaultChildRegistry::Register<LLToggleableMenu> r("toggleable_menu"); LLToggleableMenu::LLToggleableMenu(const LLToggleableMenu::Params& p) : LLMenuGL(p), mButtonRect(), + mVisibilityChangeSignal(NULL), mClosedByButtonClick(false) { } +LLToggleableMenu::~LLToggleableMenu() +{ + delete mVisibilityChangeSignal; +} + +boost::signals2::connection LLToggleableMenu::setVisibilityChangeCallback(const commit_signal_t::slot_type& cb) +{ + if (!mVisibilityChangeSignal) mVisibilityChangeSignal = new commit_signal_t(); + return mVisibilityChangeSignal->connect(cb); +} + // virtual void LLToggleableMenu::handleVisibilityChange (BOOL curVisibilityIn) { @@ -49,6 +61,12 @@ void LLToggleableMenu::handleVisibilityChange (BOOL curVisibilityIn) { mClosedByButtonClick = true; } + + if (mVisibilityChangeSignal) + { + (*mVisibilityChangeSignal)(this, + LLSD().with("visibility", curVisibilityIn).with("closed_by_button_click", mClosedByButtonClick)); + } } void LLToggleableMenu::setButtonRect(const LLRect& rect, LLView* current_view) |