diff options
author | Logan Dethrow <log@lindenlab.com> | 2011-07-12 13:59:26 -0400 |
---|---|---|
committer | Logan Dethrow <log@lindenlab.com> | 2011-07-12 13:59:26 -0400 |
commit | b750a5afb7833d91aed88d9d1f75ee0b4bc2aa80 (patch) | |
tree | ee54bbaed8f2f6016915cd3bb0506805e33179aa /indra/llui/lluictrl.cpp | |
parent | 543943279894d76662833c3b4e35efd7d09a91fc (diff) | |
parent | 44c7c6feaa824f4049d326965cb066e76ebefee3 (diff) |
merge
Diffstat (limited to 'indra/llui/lluictrl.cpp')
-rw-r--r-- | indra/llui/lluictrl.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 0a06b5e74f..d58df5801b 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -68,6 +68,7 @@ LLUICtrl::ControlVisibility::ControlVisibility() LLUICtrl::Params::Params() : tab_stop("tab_stop", true), chrome("chrome", false), + requests_front("requests_front", false), label("label"), initial_value("value"), init_callback("init_callback"), @@ -96,9 +97,10 @@ const LLUICtrl::Params& LLUICtrl::getDefaultParams() LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel) : LLView(p), - mTentative(FALSE), mIsChrome(FALSE), + mRequestsFront(p.requests_front), mTabStop(FALSE), + mTentative(FALSE), mViewModel(viewmodel), mControlVariable(NULL), mEnabledControlVariable(NULL), @@ -123,6 +125,8 @@ void LLUICtrl::initFromParams(const Params& p) { LLView::initFromParams(p); + mRequestsFront = p.requests_front; + setIsChrome(p.chrome); setControlName(p.control_name); if(p.enabled_controls.isProvided()) @@ -403,6 +407,36 @@ LLViewModel* LLUICtrl::getViewModel() const return mViewModel; } +//virtual +BOOL LLUICtrl::postBuild() +{ + // + // Find all of the children that want to be in front and move them to the front + // + + if (getChildCount() > 0) + { + std::vector<LLUICtrl*> childrenToMoveToFront; + + for (LLView::child_list_const_iter_t child_it = beginChild(); child_it != endChild(); ++child_it) + { + LLUICtrl* uictrl = dynamic_cast<LLUICtrl*>(*child_it); + + if (uictrl && uictrl->mRequestsFront) + { + childrenToMoveToFront.push_back(uictrl); + } + } + + for (std::vector<LLUICtrl*>::iterator it = childrenToMoveToFront.begin(); it != childrenToMoveToFront.end(); ++it) + { + sendChildToFront(*it); + } + } + + return LLView::postBuild(); +} + bool LLUICtrl::setControlValue(const LLSD& value) { if (mControlVariable) |