diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-10-25 09:34:06 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-10-25 09:34:06 -0400 |
commit | 7c08ddb3f748d2173948335fd799879e3d58d81c (patch) | |
tree | 1f72cc9ec78d7b8c4bad57f4ef14c12a04b7a3a0 /indra/llui/llview.h | |
parent | 1f172281453171175dea76fc469a358e1e932b60 (diff) | |
parent | 444bdef6d4949b6381b8706ab056588bc6bd88eb (diff) |
merge
Diffstat (limited to 'indra/llui/llview.h')
-rw-r--r-- | indra/llui/llview.h | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/indra/llui/llview.h b/indra/llui/llview.h index fe15307a5d..6d1dda90af 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -97,13 +97,10 @@ private: static std::vector<LLViewDrawContext*> sDrawContextStack; }; -class LLViewWidgetRegistry : public LLChildRegistry<LLViewWidgetRegistry> -{}; - class LLView : public LLMouseHandler, public LLMortician, public LLFocusableElement { public: - struct Follows : public LLInitParam::Choice<Follows> + struct Follows : public LLInitParam::ChoiceBlock<Follows> { Alternative<std::string> string; Alternative<U32> flags; @@ -152,7 +149,8 @@ public: Params(); }; - typedef LLViewWidgetRegistry child_registry_t; + // most widgets are valid children of LLView + typedef LLDefaultChildRegistry child_registry_t; void initFromParams(const LLView::Params&); @@ -242,7 +240,7 @@ public: ECursorType getHoverCursor() { return mHoverCursor; } - const std::string& getToolTip() const { return mToolTipMsg.getString(); } + virtual const std::string getToolTip() const { return mToolTipMsg.getString(); } void sendChildToFront(LLView* child); void sendChildToBack(LLView* child); @@ -472,6 +470,20 @@ public: return dynamic_cast<T*>(widgetp); } + template <class T> T* getParentByType() const + { + LLView* parent = getParent(); + while(parent) + { + if (dynamic_cast<T*>(parent)) + { + return static_cast<T*>(parent); + } + parent = parent->getParent(); + } + return NULL; + } + ////////////////////////////////////////////// // statics ////////////////////////////////////////////// @@ -487,7 +499,6 @@ public: // return query for iterating over focus roots in tab order static const LLCtrlQuery & getFocusRootsQuery(); - static void deleteViewByHandle(LLHandle<LLView> handle); static LLWindow* getWindow(void) { return LLUI::sWindow; } // Set up params after XML load before calling new(), |