diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-04-01 17:45:04 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-04-01 17:45:04 +0000 |
commit | 941cb9f4124c9ccfd5c845bc94639fa46df12c3d (patch) | |
tree | e0f525e7bd6cc76d89b2df69c6f1554d191561e8 /indra/llui/lluictrl.cpp | |
parent | ecec626dec93524f7ef5831a5ba344d6449b99bc (diff) |
merge release@83343 skinning-1-merge@83714 -> release
QAR-424
Diffstat (limited to 'indra/llui/lluictrl.cpp')
-rw-r--r-- | indra/llui/lluictrl.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index ade301a32e..aa44663fd0 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -34,7 +34,9 @@ #include "linden_common.h" #include "lluictrl.h" #include "llfocusmgr.h" +#include "llpanel.h" +static LLRegisterWidget<LLUICtrl> r("ui_ctrl"); LLFocusableElement::LLFocusableElement() : mFocusLostCallback(NULL), @@ -473,7 +475,7 @@ BOOL LLUICtrl::focusPrevItem(BOOL text_fields_only) return focusPrev(result); } -const LLUICtrl* LLUICtrl::findRootMostFocusRoot() const +LLUICtrl* LLUICtrl::findRootMostFocusRoot() const { const LLUICtrl* focus_root = NULL; const LLUICtrl* next_view = this; @@ -485,7 +487,9 @@ const LLUICtrl* LLUICtrl::findRootMostFocusRoot() const } next_view = next_view->getParentUICtrl(); } - return focus_root; + // since focus_root could be this, need to cast away const to return + // a non-const result + return const_cast<LLUICtrl*>(focus_root); } @@ -538,14 +542,22 @@ LLXMLNodePtr LLUICtrl::getXML(bool save_children) const return node; } +//static +LLView* LLUICtrl::fromXML(LLXMLNodePtr node, LLView* parent, class LLUICtrlFactory* factory) +{ + LLUICtrl* ctrl = new LLUICtrl(); + ctrl->initFromXML(node, parent); + return ctrl; +} + + // *NOTE: If other classes derive from LLPanel, they will need to be // added to this function. LLPanel* LLUICtrl::getParentPanel() const { LLView* parent = getParent(); - while (parent - && parent->getWidgetType() != WIDGET_TYPE_PANEL - && parent->getWidgetType() != WIDGET_TYPE_FLOATER) + LLPanel* parent_panel = dynamic_cast<LLPanel*>(parent); + while (!parent_panel) { parent = parent->getParent(); } |