aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lluictrlfactory.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llui/lluictrlfactory.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/lluictrlfactory.cpp224
1 files changed, 95 insertions, 129 deletions
diff --git a/linden/indra/llui/lluictrlfactory.cpp b/linden/indra/llui/lluictrlfactory.cpp
index a51d8e4..cfee76a 100644
--- a/linden/indra/llui/lluictrlfactory.cpp
+++ b/linden/indra/llui/lluictrlfactory.cpp
@@ -59,6 +59,8 @@
59#include "llscrolllistctrl.h" 59#include "llscrolllistctrl.h"
60#include "llslider.h" 60#include "llslider.h"
61#include "llsliderctrl.h" 61#include "llsliderctrl.h"
62#include "llmultislider.h"
63#include "llmultisliderctrl.h"
62#include "llspinctrl.h" 64#include "llspinctrl.h"
63#include "lltabcontainer.h" 65#include "lltabcontainer.h"
64#include "lltabcontainervertical.h" 66#include "lltabcontainervertical.h"
@@ -67,7 +69,6 @@
67#include "llui.h" 69#include "llui.h"
68#include "llviewborder.h" 70#include "llviewborder.h"
69 71
70
71const char XML_HEADER[] = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n"; 72const char XML_HEADER[] = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n";
72 73
73// *NOTE: If you add a new class derived from LLPanel, add a check for its 74// *NOTE: If you add a new class derived from LLPanel, add a check for its
@@ -93,6 +94,8 @@ const LLString LLUICtrlFactory::sUICtrlNames[WIDGET_TYPE_COUNT] =
93 LLString("slider"), //WIDGET_TYPE_SLIDER, actually LLSliderCtrl 94 LLString("slider"), //WIDGET_TYPE_SLIDER, actually LLSliderCtrl
94 LLString("slider_bar"), //WIDGET_TYPE_SLIDER_BAR, actually LLSlider 95 LLString("slider_bar"), //WIDGET_TYPE_SLIDER_BAR, actually LLSlider
95 LLString("volume_slider"), //WIDGET_TYPE_VOLUME_SLIDER, actually LLSlider + "volume" param 96 LLString("volume_slider"), //WIDGET_TYPE_VOLUME_SLIDER, actually LLSlider + "volume" param
97 LLString("multi_slider"), //WIDGET_TYPE_MULTI_SLIDER, actually LLMultiSliderCtrl
98 LLString("multi_slider_bar"), //WIDGET_TYPE_MULTI_SLIDER_BAR, actually LLMultiSlider
96 LLString("spinner"), //WIDGET_TYPE_SPINNER, actually LLSpinCtrl 99 LLString("spinner"), //WIDGET_TYPE_SPINNER, actually LLSpinCtrl
97 LLString("text_editor"), //WIDGET_TYPE_TEXT_EDITOR 100 LLString("text_editor"), //WIDGET_TYPE_TEXT_EDITOR
98 LLString("texture_picker"),//WIDGET_TYPE_TEXTURE_PICKER 101 LLString("texture_picker"),//WIDGET_TYPE_TEXTURE_PICKER
@@ -207,6 +210,8 @@ LLUICtrlFactory::LLUICtrlFactory()
207 LLUICtrlCreator<LLSliderCtrl>::registerCreator(LL_SLIDER_CTRL_TAG, this); 210 LLUICtrlCreator<LLSliderCtrl>::registerCreator(LL_SLIDER_CTRL_TAG, this);
208 LLUICtrlCreator<LLSlider>::registerCreator(LL_SLIDER_TAG, this); 211 LLUICtrlCreator<LLSlider>::registerCreator(LL_SLIDER_TAG, this);
209 LLUICtrlCreator<LLSlider>::registerCreator(LL_VOLUME_SLIDER_CTRL_TAG, this); 212 LLUICtrlCreator<LLSlider>::registerCreator(LL_VOLUME_SLIDER_CTRL_TAG, this);
213 LLUICtrlCreator<LLMultiSliderCtrl>::registerCreator(LL_MULTI_SLIDER_CTRL_TAG, this);
214 LLUICtrlCreator<LLMultiSlider>::registerCreator(LL_MULTI_SLIDER_TAG, this);
210 LLUICtrlCreator<LLSpinCtrl>::registerCreator(LL_SPIN_CTRL_TAG, this); 215 LLUICtrlCreator<LLSpinCtrl>::registerCreator(LL_SPIN_CTRL_TAG, this);
211 LLUICtrlCreator<LLTextBox>::registerCreator(LL_TEXT_BOX_TAG, this); 216 LLUICtrlCreator<LLTextBox>::registerCreator(LL_TEXT_BOX_TAG, this);
212 LLUICtrlCreator<LLRadioGroup>::registerCreator(LL_RADIO_GROUP_TAG, this); 217 LLUICtrlCreator<LLRadioGroup>::registerCreator(LL_RADIO_GROUP_TAG, this);
@@ -214,7 +219,7 @@ LLUICtrlFactory::LLUICtrlFactory()
214 LLUICtrlCreator<LLUICtrlLocate>::registerCreator(LL_UI_CTRL_LOCATE_TAG, this); 219 LLUICtrlCreator<LLUICtrlLocate>::registerCreator(LL_UI_CTRL_LOCATE_TAG, this);
215 LLUICtrlCreator<LLUICtrlLocate>::registerCreator(LL_PAD_TAG, this); 220 LLUICtrlCreator<LLUICtrlLocate>::registerCreator(LL_PAD_TAG, this);
216 LLUICtrlCreator<LLViewBorder>::registerCreator(LL_VIEW_BORDER_TAG, this); 221 LLUICtrlCreator<LLViewBorder>::registerCreator(LL_VIEW_BORDER_TAG, this);
217 LLUICtrlCreator<LLTabContainerCommon>::registerCreator(LL_TAB_CONTAINER_COMMON_TAG, this); 222 LLUICtrlCreator<LLTabContainer>::registerCreator(LL_TAB_CONTAINER_COMMON_TAG, this);
218 LLUICtrlCreator<LLScrollableContainerView>::registerCreator(LL_SCROLLABLE_CONTAINER_VIEW_TAG, this); 223 LLUICtrlCreator<LLScrollableContainerView>::registerCreator(LL_SCROLLABLE_CONTAINER_VIEW_TAG, this);
219 LLUICtrlCreator<LLPanel>::registerCreator(LL_PANEL_TAG, this); 224 LLUICtrlCreator<LLPanel>::registerCreator(LL_PANEL_TAG, this);
220 LLUICtrlCreator<LLMenuGL>::registerCreator(LL_MENU_GL_TAG, this); 225 LLUICtrlCreator<LLMenuGL>::registerCreator(LL_MENU_GL_TAG, this);
@@ -223,7 +228,6 @@ LLUICtrlFactory::LLUICtrlFactory()
223 LLUICtrlCreator<LLLayoutStack>::registerCreator(LL_LAYOUT_STACK_TAG, this); 228 LLUICtrlCreator<LLLayoutStack>::registerCreator(LL_LAYOUT_STACK_TAG, this);
224 229
225 setupPaths(); 230 setupPaths();
226
227} 231}
228 232
229void LLUICtrlFactory::setupPaths() 233void LLUICtrlFactory::setupPaths()
@@ -234,14 +238,7 @@ void LLUICtrlFactory::setupPaths()
234 BOOL success = LLXMLNode::parseFile(filename, root, NULL); 238 BOOL success = LLXMLNode::parseFile(filename, root, NULL);
235 mXUIPaths.clear(); 239 mXUIPaths.clear();
236 240
237 if (!success) 241 if (success)
238 {
239 LLString slash = gDirUtilp->getDirDelimiter();
240 LLString dir = gDirUtilp->getAppRODataDir() + slash + "skins" + slash + "xui" + slash + "en-us" + slash;
241 llwarns << "XUI::config file unable to open." << llendl;
242 mXUIPaths.push_back(dir);
243 }
244 else
245 { 242 {
246 LLXMLNodePtr path; 243 LLXMLNodePtr path;
247 LLString app_dir = gDirUtilp->getAppRODataDir(); 244 LLString app_dir = gDirUtilp->getAppRODataDir();
@@ -267,16 +264,15 @@ void LLUICtrlFactory::setupPaths()
267 } 264 }
268 } 265 }
269 } 266 }
270 267 else // parsing failed
271 268 {
269 LLString slash = gDirUtilp->getDirDelimiter();
270 LLString dir = gDirUtilp->getAppRODataDir() + slash + "skins" + slash + "xui" + slash + "en-us" + slash;
271 llwarns << "XUI::config file unable to open." << llendl;
272 mXUIPaths.push_back(dir);
273 }
272} 274}
273 275
274//-----------------------------------------------------------------------------
275// ~LLUICtrlFactory()
276//-----------------------------------------------------------------------------
277LLUICtrlFactory::~LLUICtrlFactory()
278{
279}
280 276
281 277
282//----------------------------------------------------------------------------- 278//-----------------------------------------------------------------------------
@@ -284,7 +280,6 @@ LLUICtrlFactory::~LLUICtrlFactory()
284//----------------------------------------------------------------------------- 280//-----------------------------------------------------------------------------
285bool LLUICtrlFactory::getLayeredXMLNode(const LLString &filename, LLXMLNodePtr& root) 281bool LLUICtrlFactory::getLayeredXMLNode(const LLString &filename, LLXMLNodePtr& root)
286{ 282{
287
288 if (!LLXMLNode::parseFile(mXUIPaths.front() + filename, root, NULL)) 283 if (!LLXMLNode::parseFile(mXUIPaths.front() + filename, root, NULL))
289 { 284 {
290 if (!LLXMLNode::parseFile(filename, root, NULL)) 285 if (!LLXMLNode::parseFile(filename, root, NULL))
@@ -347,7 +342,7 @@ void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename
347 342
348 if (LLUI::sShowXUINames) 343 if (LLUI::sShowXUINames)
349 { 344 {
350 floaterp->mToolTipMsg = filename; 345 floaterp->setToolTip(filename);
351 } 346 }
352 347
353 if (factory_map) 348 if (factory_map)
@@ -355,7 +350,7 @@ void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename
355 mFactoryStack.pop_front(); 350 mFactoryStack.pop_front();
356 } 351 }
357 352
358 LLViewHandle handle = floaterp->getHandle(); 353 LLHandle<LLFloater> handle = floaterp->getHandle();
359 mBuiltFloaters[handle] = filename; 354 mBuiltFloaters[handle] = filename;
360} 355}
361 356
@@ -411,10 +406,10 @@ BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename,
411 406
412 if (LLUI::sShowXUINames) 407 if (LLUI::sShowXUINames)
413 { 408 {
414 panelp->mToolTipMsg = filename; 409 panelp->setToolTip(filename);
415 } 410 }
416 411
417 LLViewHandle handle = panelp->getHandle(); 412 LLHandle<LLPanel> handle = panelp->getHandle();
418 mBuiltPanels[handle] = filename; 413 mBuiltPanels[handle] = filename;
419 414
420 if (factory_map) 415 if (factory_map)
@@ -446,8 +441,6 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp)
446 return NULL; 441 return NULL;
447 } 442 }
448 443
449
450
451 if (root->hasName("menu")) 444 if (root->hasName("menu"))
452 { 445 {
453 menu = (LLMenuGL*)LLMenuGL::fromXML(root, parentp, this); 446 menu = (LLMenuGL*)LLMenuGL::fromXML(root, parentp, this);
@@ -459,7 +452,7 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp)
459 452
460 if (LLUI::sShowXUINames) 453 if (LLUI::sShowXUINames)
461 { 454 {
462 menu->mToolTipMsg = filename; 455 menu->setToolTip(filename);
463 } 456 }
464 457
465 return menu; 458 return menu;
@@ -470,7 +463,6 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp)
470//----------------------------------------------------------------------------- 463//-----------------------------------------------------------------------------
471LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* parentp) 464LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* parentp)
472{ 465{
473
474 LLXMLNodePtr root; 466 LLXMLNodePtr root;
475 467
476 if (!LLUICtrlFactory::getLayeredXMLNode(filename, root)) 468 if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
@@ -494,29 +486,13 @@ LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* paren
494 486
495 if (LLUI::sShowXUINames) 487 if (LLUI::sShowXUINames)
496 { 488 {
497 menu->mToolTipMsg = filename; 489 menu->setToolTip(filename);
498 } 490 }
499 491
500 return menu; 492 return menu;
501} 493}
502 494
503//----------------------------------------------------------------------------- 495//-----------------------------------------------------------------------------
504// removePanel()
505//-----------------------------------------------------------------------------
506void LLUICtrlFactory::removePanel(LLPanel* panelp)
507{
508 mBuiltPanels.erase(panelp->getHandle());
509}
510
511//-----------------------------------------------------------------------------
512// removeFloater()
513//-----------------------------------------------------------------------------
514void LLUICtrlFactory::removeFloater(LLFloater* floaterp)
515{
516 mBuiltFloaters.erase(floaterp->getHandle());
517}
518
519//-----------------------------------------------------------------------------
520// rebuild() 496// rebuild()
521//----------------------------------------------------------------------------- 497//-----------------------------------------------------------------------------
522void LLUICtrlFactory::rebuild() 498void LLUICtrlFactory::rebuild()
@@ -525,48 +501,48 @@ void LLUICtrlFactory::rebuild()
525 for (built_panel_it = mBuiltPanels.begin(); 501 for (built_panel_it = mBuiltPanels.begin();
526 built_panel_it != mBuiltPanels.end(); 502 built_panel_it != mBuiltPanels.end();
527 ++built_panel_it) 503 ++built_panel_it)
504 {
505 LLString filename = built_panel_it->second;
506 LLPanel* panelp = built_panel_it->first.get();
507 if (!panelp)
528 { 508 {
529 LLString filename = built_panel_it->second; 509 continue;
530 LLPanel* panelp = LLPanel::getPanelByHandle(built_panel_it->first);
531 if (!panelp)
532 {
533 continue;
534 }
535 llinfos << "Rebuilding UI panel " << panelp->getName()
536 << " from " << filename
537 << llendl;
538 BOOL visible = panelp->getVisible();
539 panelp->setVisible(FALSE);
540 panelp->setFocus(FALSE);
541 panelp->deleteAllChildren();
542
543 buildPanel(panelp, filename.c_str(), &panelp->getFactoryMap());
544 panelp->setVisible(visible);
545 } 510 }
511 llinfos << "Rebuilding UI panel " << panelp->getName()
512 << " from " << filename
513 << llendl;
514 BOOL visible = panelp->getVisible();
515 panelp->setVisible(FALSE);
516 panelp->setFocus(FALSE);
517 panelp->deleteAllChildren();
518
519 buildPanel(panelp, filename.c_str(), &panelp->getFactoryMap());
520 panelp->setVisible(visible);
521 }
546 522
547 built_floater_t::iterator built_floater_it; 523 built_floater_t::iterator built_floater_it;
548 for (built_floater_it = mBuiltFloaters.begin(); 524 for (built_floater_it = mBuiltFloaters.begin();
549 built_floater_it != mBuiltFloaters.end(); 525 built_floater_it != mBuiltFloaters.end();
550 ++built_floater_it) 526 ++built_floater_it)
527 {
528 LLFloater* floaterp = built_floater_it->first.get();
529 if (!floaterp)
551 { 530 {
552 LLFloater* floaterp = LLFloater::getFloaterByHandle(built_floater_it->first); 531 continue;
553 if (!floaterp)
554 {
555 continue;
556 }
557 LLString filename = built_floater_it->second;
558 llinfos << "Rebuilding UI floater " << floaterp->getName()
559 << " from " << filename
560 << llendl;
561 BOOL visible = floaterp->getVisible();
562 floaterp->setVisible(FALSE);
563 floaterp->setFocus(FALSE);
564 floaterp->deleteAllChildren();
565
566 gFloaterView->removeChild(floaterp);
567 buildFloater(floaterp, filename, &floaterp->getFactoryMap());
568 floaterp->setVisible(visible);
569 } 532 }
533 LLString filename = built_floater_it->second;
534 llinfos << "Rebuilding UI floater " << floaterp->getName()
535 << " from " << filename
536 << llendl;
537 BOOL visible = floaterp->getVisible();
538 floaterp->setVisible(FALSE);
539 floaterp->setFocus(FALSE);
540 floaterp->deleteAllChildren();
541
542 gFloaterView->removeChild(floaterp);
543 buildFloater(floaterp, filename, &floaterp->getFactoryMap());
544 floaterp->setVisible(visible);
545 }
570} 546}
571 547
572//----------------------------------------------------------------------------- 548//-----------------------------------------------------------------------------
@@ -674,113 +650,103 @@ BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const LLString& name,
674 650
675//============================================================================ 651//============================================================================
676 652
677LLButton* LLUICtrlFactory::getButtonByName(LLPanel* panelp, const LLString& name) 653LLButton* LLUICtrlFactory::getButtonByName(const LLPanel* panelp, const LLString& name)
678{ 654{
679 return (LLButton*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_BUTTON); 655 return panelp->getChild<LLButton>(name);
680} 656}
681 657
682LLCheckBoxCtrl* LLUICtrlFactory::getCheckBoxByName(LLPanel* panelp, const LLString& name) 658LLCheckBoxCtrl* LLUICtrlFactory::getCheckBoxByName(const LLPanel* panelp, const LLString& name)
683{ 659{
684 return (LLCheckBoxCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_CHECKBOX); 660 return panelp->getChild<LLCheckBoxCtrl>(name);
685} 661}
686 662
687LLComboBox* LLUICtrlFactory::getComboBoxByName(LLPanel* panelp, const LLString& name) 663LLComboBox* LLUICtrlFactory::getComboBoxByName(const LLPanel* panelp, const LLString& name)
688{ 664{
689 return (LLComboBox*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_COMBO_BOX); 665 return panelp->getChild<LLComboBox>(name);
690} 666}
691 667
692LLIconCtrl* LLUICtrlFactory::getIconByName(LLPanel* panelp, const LLString& name) 668LLIconCtrl* LLUICtrlFactory::getIconByName(const LLPanel* panelp, const LLString& name)
693{ 669{
694 return (LLIconCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_ICON); 670 return panelp->getChild<LLIconCtrl>(name);
695} 671}
696 672
697LLLineEditor* LLUICtrlFactory::getLineEditorByName(LLPanel* panelp, const LLString& name) 673LLLineEditor* LLUICtrlFactory::getLineEditorByName(const LLPanel* panelp, const LLString& name)
698{ 674{
699 return (LLLineEditor*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_LINE_EDITOR); 675 return panelp->getChild<LLLineEditor>(name);
700} 676}
701 677
702LLNameListCtrl* LLUICtrlFactory::getNameListByName(LLPanel* panelp, const LLString& name) 678LLRadioGroup* LLUICtrlFactory::getRadioGroupByName(const LLPanel* panelp, const LLString& name)
703{ 679{
704 return (LLNameListCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_NAME_LIST); 680 return panelp->getChild<LLRadioGroup>(name);
705} 681}
706 682
707LLRadioGroup* LLUICtrlFactory::getRadioGroupByName(LLPanel* panelp, const LLString& name) 683LLScrollListCtrl* LLUICtrlFactory::getScrollListByName(const LLPanel* panelp, const LLString& name)
708{ 684{
709 return (LLRadioGroup*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_RADIO_GROUP); 685 return panelp->getChild<LLScrollListCtrl>(name);
710} 686}
711 687
712LLScrollListCtrl* LLUICtrlFactory::getScrollListByName(LLPanel* panelp, const LLString& name) 688LLSliderCtrl* LLUICtrlFactory::getSliderByName(const LLPanel* panelp, const LLString& name)
713{ 689{
714 return (LLScrollListCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_SCROLL_LIST); 690 return panelp->getChild<LLSliderCtrl>(name);
715} 691}
716 692
717LLSliderCtrl* LLUICtrlFactory::getSliderByName(LLPanel* panelp, const LLString& name) 693LLSlider* LLUICtrlFactory::getSliderBarByName(const LLPanel* panelp, const LLString& name)
718{ 694{
719 return (LLSliderCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_SLIDER); 695 return panelp->getChild<LLSlider>(name);
720} 696}
721 697
722LLSlider* LLUICtrlFactory::getSliderBarByName(LLPanel* panelp, const LLString& name) 698LLSpinCtrl* LLUICtrlFactory::getSpinnerByName(const LLPanel* panelp, const LLString& name)
723{ 699{
724 return (LLSlider*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_SLIDER_BAR); 700 return panelp->getChild<LLSpinCtrl>(name);
725} 701}
726 702
727LLSpinCtrl* LLUICtrlFactory::getSpinnerByName(LLPanel* panelp, const LLString& name) 703LLTextBox* LLUICtrlFactory::getTextBoxByName(const LLPanel* panelp, const LLString& name)
728{ 704{
729 return (LLSpinCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_SPINNER); 705 return panelp->getChild<LLTextBox>(name);
730} 706}
731 707
732LLTextBox* LLUICtrlFactory::getTextBoxByName(LLPanel* panelp, const LLString& name) 708LLTextEditor* LLUICtrlFactory::getTextEditorByName(const LLPanel* panelp, const LLString& name)
733{ 709{
734 return (LLTextBox*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_TEXT_BOX); 710 return panelp->getChild<LLTextEditor>(name);
735} 711}
736 712
737LLTextEditor* LLUICtrlFactory::getTextEditorByName(LLPanel* panelp, const LLString& name) 713LLTabContainer* LLUICtrlFactory::getTabContainerByName(const LLPanel* panelp, const LLString& name)
738{ 714{
739 return (LLTextEditor*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_TEXT_EDITOR); 715 return panelp->getChild<LLTabContainer>(name);
740}
741
742LLTabContainerCommon* LLUICtrlFactory::getTabContainerByName(LLPanel* panelp, const LLString& name)
743{
744 return (LLTabContainerCommon*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_TAB_CONTAINER);
745}
746
747LLScrollableContainerView* LLUICtrlFactory::getScrollableContainerByName(LLPanel* panelp, const LLString& name)
748{
749 return (LLScrollableContainerView*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_SCROLL_CONTAINER);
750} 716}
751 717
752LLTextureCtrl* LLUICtrlFactory::getTexturePickerByName(LLPanel* panelp, const LLString& name) 718LLScrollableContainerView* LLUICtrlFactory::getScrollableContainerByName(const LLPanel* panelp, const LLString& name)
753{ 719{
754 return (LLTextureCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_TEXTURE_PICKER); 720 return panelp->getChild<LLScrollableContainerView>(name);
755} 721}
756 722
757LLPanel* LLUICtrlFactory::getPanelByName(LLPanel* panelp, const LLString& name) 723LLPanel* LLUICtrlFactory::getPanelByName(const LLPanel* panelp, const LLString& name)
758{ 724{
759 return (LLPanel*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_PANEL); 725 return panelp->getChild<LLPanel>(name);
760} 726}
761 727
762LLColorSwatchCtrl* LLUICtrlFactory::getColorSwatchByName(LLPanel* panelp, const LLString& name) 728LLMenuItemCallGL* LLUICtrlFactory::getMenuItemCallByName(const LLPanel* panelp, const LLString& name)
763{ 729{
764 return (LLColorSwatchCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_COLOR_SWATCH); 730 return panelp->getChild<LLMenuItemCallGL>(name);
765} 731}
766 732
767LLWebBrowserCtrl* LLUICtrlFactory::getWebBrowserCtrlByName(LLPanel* panelp, const LLString& name) 733LLScrollingPanelList* LLUICtrlFactory::getScrollingPanelList(const LLPanel* panelp, const LLString& name)
768{ 734{
769 return (LLWebBrowserCtrl*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_WEBBROWSER); 735 return panelp->getChild<LLScrollingPanelList>(name);
770} 736}
771 737
772LLMenuItemCallGL* LLUICtrlFactory::getMenuItemCallByName(LLPanel* panelp, const LLString& name) 738LLMultiSliderCtrl* LLUICtrlFactory::getMultiSliderByName(const LLPanel* panelp, const LLString& name)
773{ 739{
774 return (LLMenuItemCallGL*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_MENU_ITEM_CALL); 740 return panelp->getChild<LLMultiSliderCtrl>(name);
775} 741}
776 742
777LLScrollingPanelList* LLUICtrlFactory::getScrollingPanelList(LLPanel* panelp, const LLString& name) 743LLMultiSlider* LLUICtrlFactory::getMultiSliderBarByName(const LLPanel* panelp, const LLString& name)
778{ 744{
779 return (LLScrollingPanelList*)panelp->getCtrlByNameAndType(name, WIDGET_TYPE_SCROLLING_PANEL_LIST); 745 return panelp->getChild<LLMultiSlider>(name);
780} 746}
781 747
782 748
783LLCtrlListInterface* LLUICtrlFactory::getListInterfaceByName(LLPanel* panelp, const LLString& name) 749LLCtrlListInterface* LLUICtrlFactory::getListInterfaceByName(const LLPanel* panelp, const LLString& name)
784{ 750{
785 LLView* viewp = panelp->getCtrlByNameAndType(name, WIDGET_TYPE_DONTCARE); 751 LLView* viewp = panelp->getCtrlByNameAndType(name, WIDGET_TYPE_DONTCARE);
786 if (viewp && viewp->isCtrl()) 752 if (viewp && viewp->isCtrl())
@@ -790,7 +756,7 @@ LLCtrlListInterface* LLUICtrlFactory::getListInterfaceByName(LLPanel* panelp, co
790 return NULL; 756 return NULL;
791} 757}
792 758
793LLCtrlSelectionInterface* LLUICtrlFactory::getSelectionInterfaceByName(LLPanel* panelp, const LLString& name) 759LLCtrlSelectionInterface* LLUICtrlFactory::getSelectionInterfaceByName(const LLPanel* panelp, const LLString& name)
794{ 760{
795 LLView* viewp = panelp->getCtrlByNameAndType(name, WIDGET_TYPE_DONTCARE); 761 LLView* viewp = panelp->getCtrlByNameAndType(name, WIDGET_TYPE_DONTCARE);
796 if (viewp && viewp->isCtrl()) 762 if (viewp && viewp->isCtrl())
@@ -800,7 +766,7 @@ LLCtrlSelectionInterface* LLUICtrlFactory::getSelectionInterfaceByName(LLPanel*
800 return NULL; 766 return NULL;
801} 767}
802 768
803LLCtrlScrollInterface* LLUICtrlFactory::getScrollInterfaceByName(LLPanel* panelp, const LLString& name) 769LLCtrlScrollInterface* LLUICtrlFactory::getScrollInterfaceByName(const LLPanel* panelp, const LLString& name)
804{ 770{
805 LLView* viewp = panelp->getCtrlByNameAndType(name, WIDGET_TYPE_DONTCARE); 771 LLView* viewp = panelp->getCtrlByNameAndType(name, WIDGET_TYPE_DONTCARE);
806 if (viewp && viewp->isCtrl()) 772 if (viewp && viewp->isCtrl())