diff options
author | Seth ProductEngine <slitovchuk@productengine.com> | 2011-09-27 21:05:05 +0300 |
---|---|---|
committer | Seth ProductEngine <slitovchuk@productengine.com> | 2011-09-27 21:05:05 +0300 |
commit | 0f3221e25d6261d7f29b5b37391156c07fde1d0c (patch) | |
tree | b0bd6ec7e8f5434f2b715e6d0755912c9744fb14 /indra/newview/llfloatersidepanelcontainer.h | |
parent | a80d5f2b46b21a8d1a48da4b4d2c740cb8260928 (diff) |
EXP-1225 FIXED Added a floater for My Inventory side tab.
- Replaced calls to LLSideTray with LLFloaterSidePanelContainer.
- Added LLFloaterSidePanelContainer::getPanel<T>() for getting custom type panels.
Diffstat (limited to 'indra/newview/llfloatersidepanelcontainer.h')
-rw-r--r-- | indra/newview/llfloatersidepanelcontainer.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 7b4e7643ae..0d17a14c0b 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -51,6 +51,29 @@ public: LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); static void showPanel(const std::string& floater_name, const LLSD& panel_name); + + static LLPanel* getPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName); + + /** + * Gets the panel of given type T (doesn't show it or do anything else with it). + * + * @param floater_name a string specifying the floater to be searched for a child panel. + * @param panel_name a string specifying the child panel to get. + * @returns a pointer to the panel of given type T. + */ + template <typename T> + static T* getPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName) + { + T* panel = dynamic_cast<T*>(getPanel(floater_name, panel_name)); + if (!panel) + { + llwarns << "Child named \"" << panel_name << "\" of type " << typeid(T*).name() << " not found" << llendl; + } + return panel; + } + +private: + static const std::string sMainPanelName; }; #endif // LL_LLFLOATERSIDEPANELCONTAINER_H |