aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewchildren.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llviewchildren.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewchildren.cpp32
1 files changed, 12 insertions, 20 deletions
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)
65void LLViewChildren::setText( 65void LLViewChildren::setText(
66 const char* id, const std::string& text, bool visible) 66 const char* id, const std::string& text, bool visible)
67{ 67{
68 LLTextBox* child = LLUICtrlFactory::getTextBoxByName(&mParent, id); 68 LLTextBox* child = mParent.getChild<LLTextBox>(id);
69 if (child) 69 if (child)
70 { 70 {
71 child->setVisible(visible); 71 child->setVisible(visible);
@@ -76,7 +76,7 @@ void LLViewChildren::setText(
76void LLViewChildren::setWrappedText( 76void LLViewChildren::setWrappedText(
77 const char* id, const std::string& text, bool visible) 77 const char* id, const std::string& text, bool visible)
78{ 78{
79 LLTextBox* child = LLUICtrlFactory::getTextBoxByName(&mParent, id); 79 LLTextBox* child = mParent.getChild<LLTextBox>(id);
80 if (child) 80 if (child)
81 { 81 {
82 child->setVisible(visible); 82 child->setVisible(visible);
@@ -86,33 +86,25 @@ void LLViewChildren::setWrappedText(
86 86
87void LLViewChildren::setBadge(const char* id, Badge badge, bool visible) 87void LLViewChildren::setBadge(const char* id, Badge badge, bool visible)
88{ 88{
89 static LLUUID badgeOK(gViewerArt.getString("badge_ok.tga")); 89 LLIconCtrl* child = mParent.getChild<LLIconCtrl>(id);
90 static LLUUID badgeNote(gViewerArt.getString("badge_note.tga"));
91 static LLUUID badgeWarn(gViewerArt.getString("badge_warn.tga"));
92 static LLUUID badgeError(gViewerArt.getString("badge_error.tga"));
93
94 LLUUID badgeUUID;
95 switch (badge)
96 {
97 default:
98 case BADGE_OK: badgeUUID = badgeOK; break;
99 case BADGE_NOTE: badgeUUID = badgeNote; break;
100 case BADGE_WARN: badgeUUID = badgeWarn; break;
101 case BADGE_ERROR: badgeUUID = badgeError; break;
102 }
103
104 LLIconCtrl* child = LLUICtrlFactory::getIconByName(&mParent, id);
105 if (child) 90 if (child)
106 { 91 {
107 child->setVisible(visible); 92 child->setVisible(visible);
108 child->setImage(badgeUUID); 93 switch (badge)
94 {
95 default:
96 case BADGE_OK: child->setImage("badge_ok.j2c"); break;
97 case BADGE_NOTE: child->setImage("badge_note.j2c"); break;
98 case BADGE_WARN: child->setImage("badge_warn.j2c"); break;
99 case BADGE_ERROR: child->setImage("badge_error.j2c"); break;
100 }
109 } 101 }
110} 102}
111 103
112void LLViewChildren::setAction(const char* id, 104void LLViewChildren::setAction(const char* id,
113 void(*function)(void*), void* value) 105 void(*function)(void*), void* value)
114{ 106{
115 LLButton* button = LLUICtrlFactory::getButtonByName(&mParent, id); 107 LLButton* button = mParent.getChild<LLButton>(id);
116 if (button) 108 if (button)
117 { 109 {
118 button->setClickedCallback(function, value); 110 button->setClickedCallback(function, value);