summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelpicks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelpicks.cpp')
-rw-r--r--indra/newview/llpanelpicks.cpp66
1 files changed, 35 insertions, 31 deletions
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index bde8d02885..65254e50b4 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -218,7 +218,7 @@ void LLPanelPicks::updateData()
mNoPicks = false;
mNoClassifieds = false;
- childSetValue("picks_panel_text", LLTrans::getString("PicksClassifiedsLoadingText"));
+ getChild<LLUICtrl>("picks_panel_text")->setValue(LLTrans::getString("PicksClassifiedsLoadingText"));
mPicksList->clear();
LLAvatarPropertiesProcessor::getInstance()->sendAvatarPicksRequest(getAvatarId());
@@ -237,7 +237,7 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type)
{
std::string name, second_name;
gCacheName->getName(getAvatarId(),name,second_name);
- childSetTextArg("pick_title", "[NAME]",name);
+ getChild<LLUICtrl>("pick_title")->setTextArg("[NAME]", name);
// Save selection, to be able to edit same item after saving changes. See EXT-3023.
LLUUID selected_id = mPicksList->getSelectedValue()[PICK_ID];
@@ -324,11 +324,11 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type)
{
if(getAvatarId() == gAgentID)
{
- childSetValue("picks_panel_text", LLTrans::getString("NoPicksClassifiedsText"));
+ getChild<LLUICtrl>("picks_panel_text")->setValue(LLTrans::getString("NoPicksClassifiedsText"));
}
else
{
- childSetValue("picks_panel_text", LLTrans::getString("NoAvatarPicksClassifiedsText"));
+ getChild<LLUICtrl>("picks_panel_text")->setValue(LLTrans::getString("NoAvatarPicksClassifiedsText"));
}
}
}
@@ -460,22 +460,22 @@ void LLPanelPicks::onOpen(const LLSD& key)
BOOL self = (gAgent.getID() == id);
// only agent can edit her picks
- childSetEnabled("edit_panel", self);
- childSetVisible("edit_panel", self);
+ getChildView("edit_panel")->setEnabled(self);
+ getChildView("edit_panel")->setVisible( self);
// Disable buttons when viewing profile for first time
if(getAvatarId() != id)
{
- childSetEnabled(XML_BTN_INFO,FALSE);
- childSetEnabled(XML_BTN_TELEPORT,FALSE);
- childSetEnabled(XML_BTN_SHOW_ON_MAP,FALSE);
+ getChildView(XML_BTN_INFO)->setEnabled(FALSE);
+ getChildView(XML_BTN_TELEPORT)->setEnabled(FALSE);
+ getChildView(XML_BTN_SHOW_ON_MAP)->setEnabled(FALSE);
}
// and see a special title - set as invisible by default in xml file
if (self)
{
- childSetVisible("pick_title", !self);
- childSetVisible("pick_title_agent", self);
+ getChildView("pick_title")->setVisible( !self);
+ getChildView("pick_title_agent")->setVisible( self);
mPopupMenu->setItemVisible("pick_delete", TRUE);
mPopupMenu->setItemVisible("pick_edit", TRUE);
@@ -670,17 +670,17 @@ void LLPanelPicks::updateButtons()
if (getAvatarId() == gAgentID)
{
- childSetEnabled(XML_BTN_DELETE, has_selected);
+ getChildView(XML_BTN_DELETE)->setEnabled(has_selected);
}
- childSetEnabled(XML_BTN_INFO, has_selected);
- childSetEnabled(XML_BTN_TELEPORT, has_selected);
- childSetEnabled(XML_BTN_SHOW_ON_MAP, has_selected);
+ getChildView(XML_BTN_INFO)->setEnabled(has_selected);
+ getChildView(XML_BTN_TELEPORT)->setEnabled(has_selected);
+ getChildView(XML_BTN_SHOW_ON_MAP)->setEnabled(has_selected);
LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem());
if(c_item)
{
- childSetEnabled(XML_BTN_INFO, isClassifiedPublished(c_item));
+ getChildView(XML_BTN_INFO)->setEnabled(isClassifiedPublished(c_item));
}
}
@@ -701,8 +701,7 @@ void LLPanelPicks::buildPickPanel()
void LLPanelPicks::onClickPlusBtn()
{
- LLRect rect;
- childGetRect(XML_BTN_NEW, rect);
+ LLRect rect(getChildView(XML_BTN_NEW)->getRect());
mPlusMenu->updateParent(LLMenuGL::sMenuContainer);
mPlusMenu->setButtonRect(rect, this);
@@ -1080,7 +1079,7 @@ void LLPickItem::init(LLPickData* pick_data)
void LLPickItem::setPickName(const std::string& name)
{
mPickName = name;
- childSetValue("picture_name",name);
+ getChild<LLUICtrl>("picture_name")->setValue(name);
}
@@ -1101,7 +1100,7 @@ const LLUUID& LLPickItem::getSnapshotId()
void LLPickItem::setPickDesc(const std::string& descr)
{
- childSetValue("picture_descr",descr);
+ getChild<LLUICtrl>("picture_descr")->setValue(descr);
}
void LLPickItem::setPickId(const LLUUID& id)
@@ -1121,7 +1120,7 @@ const LLVector3d& LLPickItem::getPosGlobal()
const std::string LLPickItem::getDescription()
{
- return childGetValue("picture_descr").asString();
+ return getChild<LLUICtrl>("picture_descr")->getValue().asString();
}
void LLPickItem::update()
@@ -1148,10 +1147,15 @@ void LLPickItem::processProperties(void *data, EAvatarProcessorType type)
LLAvatarPropertiesProcessor::instance().removeObserver(mCreatorID, this);
}
+void set_child_visible(LLView* parent, const std::string& child_name, bool visible)
+{
+ parent->getChildView(child_name)->setVisible(visible);
+}
+
BOOL LLPickItem::postBuild()
{
- setMouseEnterCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", true));
- setMouseLeaveCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", false));
+ setMouseEnterCallback(boost::bind(&set_child_visible, this, "hovered_icon", true));
+ setMouseLeaveCallback(boost::bind(&set_child_visible, this, "hovered_icon", false));
return TRUE;
}
@@ -1159,7 +1163,7 @@ void LLPickItem::setValue(const LLSD& value)
{
if (!value.isMap()) return;;
if (!value.has("selected")) return;
- childSetVisible("selected_icon", value["selected"]);
+ getChildView("selected_icon")->setVisible( value["selected"]);
}
//////////////////////////////////////////////////////////////////////////
@@ -1205,8 +1209,8 @@ void LLClassifiedItem::processProperties(void* data, EAvatarProcessorType type)
BOOL LLClassifiedItem::postBuild()
{
- setMouseEnterCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", true));
- setMouseLeaveCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", false));
+ setMouseEnterCallback(boost::bind(&set_child_visible, this, "hovered_icon", true));
+ setMouseLeaveCallback(boost::bind(&set_child_visible, this, "hovered_icon", false));
return TRUE;
}
@@ -1214,7 +1218,7 @@ void LLClassifiedItem::setValue(const LLSD& value)
{
if (!value.isMap()) return;;
if (!value.has("selected")) return;
- childSetVisible("selected_icon", value["selected"]);
+ getChildView("selected_icon")->setVisible( value["selected"]);
}
void LLClassifiedItem::fillIn(LLPanelClassifiedEdit* panel)
@@ -1237,22 +1241,22 @@ void LLClassifiedItem::fillIn(LLPanelClassifiedEdit* panel)
void LLClassifiedItem::setClassifiedName(const std::string& name)
{
- childSetValue("name", name);
+ getChild<LLUICtrl>("name")->setValue(name);
}
void LLClassifiedItem::setDescription(const std::string& desc)
{
- childSetValue("description", desc);
+ getChild<LLUICtrl>("description")->setValue(desc);
}
void LLClassifiedItem::setSnapshotId(const LLUUID& snapshot_id)
{
- childSetValue("picture", snapshot_id);
+ getChild<LLUICtrl>("picture")->setValue(snapshot_id);
}
LLUUID LLClassifiedItem::getSnapshotId()
{
- return childGetValue("picture");
+ return getChild<LLUICtrl>("picture")->getValue();
}
//EOF