From ce28e056c20bf2723f565bbf464b87781ec248a2 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:42 -0500 Subject: Second Life viewer sources 1.20.2 --- linden/indra/newview/llviewchildren.cpp | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'linden/indra/newview/llviewchildren.cpp') diff --git a/linden/indra/newview/llviewchildren.cpp b/linden/indra/newview/llviewchildren.cpp index 5f579f9..b19a336 100644 --- a/linden/indra/newview/llviewchildren.cpp +++ b/linden/indra/newview/llviewchildren.cpp @@ -65,7 +65,7 @@ void LLViewChildren::enable(const char* id, bool enabled) void LLViewChildren::setText( const char* id, const std::string& text, bool visible) { - LLTextBox* child = LLUICtrlFactory::getTextBoxByName(&mParent, id); + LLTextBox* child = mParent.getChild(id); if (child) { child->setVisible(visible); @@ -76,7 +76,7 @@ void LLViewChildren::setText( void LLViewChildren::setWrappedText( const char* id, const std::string& text, bool visible) { - LLTextBox* child = LLUICtrlFactory::getTextBoxByName(&mParent, id); + LLTextBox* child = mParent.getChild(id); if (child) { child->setVisible(visible); @@ -86,33 +86,25 @@ void LLViewChildren::setWrappedText( void LLViewChildren::setBadge(const char* id, Badge badge, bool visible) { - static LLUUID badgeOK(gViewerArt.getString("badge_ok.tga")); - static LLUUID badgeNote(gViewerArt.getString("badge_note.tga")); - static LLUUID badgeWarn(gViewerArt.getString("badge_warn.tga")); - static LLUUID badgeError(gViewerArt.getString("badge_error.tga")); - - LLUUID badgeUUID; - switch (badge) - { - default: - case BADGE_OK: badgeUUID = badgeOK; break; - case BADGE_NOTE: badgeUUID = badgeNote; break; - case BADGE_WARN: badgeUUID = badgeWarn; break; - case BADGE_ERROR: badgeUUID = badgeError; break; - } - - LLIconCtrl* child = LLUICtrlFactory::getIconByName(&mParent, id); + LLIconCtrl* child = mParent.getChild(id); if (child) { child->setVisible(visible); - child->setImage(badgeUUID); + switch (badge) + { + default: + case BADGE_OK: child->setImage("badge_ok.j2c"); break; + case BADGE_NOTE: child->setImage("badge_note.j2c"); break; + case BADGE_WARN: child->setImage("badge_warn.j2c"); break; + case BADGE_ERROR: child->setImage("badge_error.j2c"); break; + } } } void LLViewChildren::setAction(const char* id, void(*function)(void*), void* value) { - LLButton* button = LLUICtrlFactory::getButtonByName(&mParent, id); + LLButton* button = mParent.getChild(id); if (button) { button->setClickedCallback(function, value); -- cgit v1.1