summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelpicks.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-08-24 18:37:53 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-08-24 18:37:53 +0100
commit6ba23344c95157793af9e4154933ae8df61630e8 (patch)
treee12956cbe7a0082bbaaa545cb80d9e86b13f88e8 /indra/newview/llpanelpicks.cpp
parent01d06a3572c533f810f8f42e7ae9c55051f34aaf (diff)
parent46e6135eef90b7ff0f08b12384a9aafc1a3e91e1 (diff)
merge heads. whew.
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 ff069e34b7..a5c3c9faef 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -212,7 +212,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());
@@ -231,7 +231,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];
@@ -318,11 +318,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"));
}
}
}
@@ -454,22 +454,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);
@@ -664,17 +664,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));
}
}
@@ -695,8 +695,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);
@@ -1074,7 +1073,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);
}
@@ -1095,7 +1094,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)
@@ -1115,7 +1114,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()
@@ -1142,10 +1141,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;
}
@@ -1153,7 +1157,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"]);
}
//////////////////////////////////////////////////////////////////////////
@@ -1199,8 +1203,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;
}
@@ -1208,7 +1212,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)
@@ -1231,22 +1235,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