summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lllayoutstack.h5
-rw-r--r--indra/llui/llradiogroup.cpp104
-rw-r--r--indra/llui/llradiogroup.h47
-rw-r--r--indra/llui/llsearcheditor.h14
-rw-r--r--indra/llui/llui.cpp79
-rw-r--r--indra/llui/llui.h12
-rw-r--r--indra/llui/lluictrlfactory.cpp12
-rw-r--r--indra/llui/lluictrlfactory.h69
-rw-r--r--indra/llui/lluiimage.cpp22
-rw-r--r--indra/llui/lluiimage.h3
-rw-r--r--indra/llui/llview.cpp6
11 files changed, 211 insertions, 162 deletions
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index abd5436018..c1af428674 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -45,9 +45,8 @@ public:
{
Optional<std::string> orientation;
Optional<S32> border_size;
- Optional<bool> animate;
- Optional<bool> clip;
- // mMinWidth and mMinHeight are calculated, not set in XML
+ Optional<bool> animate,
+ clip;
Params();
};
diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp
index 86bd2f05ce..74e30cd633 100644
--- a/indra/llui/llradiogroup.cpp
+++ b/indra/llui/llradiogroup.cpp
@@ -43,15 +43,43 @@
#include "llui.h"
#include "llfocusmgr.h"
#include "lluictrlfactory.h"
+#include "llsdutil.h"
static LLDefaultChildRegistry::Register<LLRadioGroup> r1("radio_group");
-static RadioGroupRegistry::Register<LLRadioCtrl> register_radio_ctrl("radio_item");
+/*
+ * An invisible view containing multiple mutually exclusive toggling
+ * buttons (usually radio buttons). Automatically handles the mutex
+ * condition by highlighting only one button at a time.
+ */
+class LLRadioCtrl : public LLCheckBoxCtrl
+{
+public:
+ typedef LLRadioGroup::ItemParams Params;
+ /*virtual*/ ~LLRadioCtrl();
+ /*virtual*/ void setValue(const LLSD& value);
+
+ /*virtual*/ BOOL postBuild();
+
+ LLSD getPayload() { return mPayload; }
+ // Ensure label is in an attribute, not the contents
+ static void setupParamsForExport(Params& p, LLView* parent);
+
+protected:
+ LLRadioCtrl(const LLRadioGroup::ItemParams& p);
+ friend class LLUICtrlFactory;
+
+ LLSD mPayload; // stores data that this item represents in the radio group
+};
+static LLWidgetNameRegistry::StaticRegistrar register_radio_item(&typeid(LLRadioGroup::ItemParams), "radio_item");
LLRadioGroup::Params::Params()
-: has_border("draw_border")
+: has_border("draw_border"),
+ items("item")
{
+ addSynonym(items, "radio_item");
+
name = "radio_group";
mouse_opaque = true;
follows.flags = FOLLOWS_LEFT | FOLLOWS_TOP;
@@ -76,6 +104,24 @@ LLRadioGroup::LLRadioGroup(const LLRadioGroup::Params& p)
}
}
+void LLRadioGroup::initFromParams(const Params& p)
+{
+ LLUICtrl::initFromParams(p);
+ for (LLInitParam::ParamIterator<ItemParams>::const_iterator it = p.items().begin();
+ it != p.items().end();
+ ++it)
+ {
+ LLRadioGroup::ItemParams item_params(*it);
+ item_params.font.setIfNotProvided(mFont); // apply radio group font by default
+ item_params.commit_callback.function = boost::bind(&LLRadioGroup::onClickButton, this, _1);
+ item_params.from_xui = p.from_xui;
+
+ LLRadioCtrl* item = LLUICtrlFactory::create<LLRadioCtrl>(item_params, this);
+ mRadioButtons.push_back(item);
+ }
+}
+
+
LLRadioGroup::~LLRadioGroup()
{
}
@@ -141,7 +187,7 @@ void LLRadioGroup::setIndexEnabled(S32 index, BOOL enabled)
BOOL LLRadioGroup::setSelectedIndex(S32 index, BOOL from_event)
{
- if (index < 0 || index >= (S32)mRadioButtons.size())
+ if (index < 0 || (S32)mRadioButtons.size() <= index )
{
return FALSE;
}
@@ -170,7 +216,7 @@ BOOL LLRadioGroup::setSelectedIndex(S32 index, BOOL from_event)
if (!from_event)
{
- setControlValue(getSelectedIndex());
+ setControlValue(getValue());
}
return TRUE;
@@ -235,27 +281,6 @@ BOOL LLRadioGroup::handleKeyHere(KEY key, MASK mask)
return handled;
}
-
-// When adding a child button, we need to ensure that the radio
-// group gets a message when the button is clicked.
-
-/*virtual*/
-bool LLRadioGroup::addChild(LLView* view, S32 tab_group)
-{
- bool res = LLView::addChild(view, tab_group);
- if (res)
- {
- LLRadioCtrl* radio_ctrl = dynamic_cast<LLRadioCtrl*>(view);
- if (radio_ctrl)
- {
- radio_ctrl->setFont(mFont);
- radio_ctrl->setCommitCallback(boost::bind(&LLRadioGroup::onClickButton, this, _1));
- mRadioButtons.push_back(radio_ctrl);
- }
- }
- return res;
-}
-
BOOL LLRadioGroup::handleMouseDown(S32 x, S32 y, MASK mask)
{
// grab focus preemptively, before child button takes mousecapture
@@ -302,13 +327,12 @@ void LLRadioGroup::onClickButton(LLUICtrl* ctrl)
void LLRadioGroup::setValue( const LLSD& value )
{
- std::string value_name = value.asString();
int idx = 0;
for (button_list_t::const_iterator iter = mRadioButtons.begin();
iter != mRadioButtons.end(); ++iter)
{
LLRadioCtrl* radio = *iter;
- if (radio->getName() == value_name)
+ if (llsd_equals(radio->getPayload(), value))
{
setSelectedIndex(idx);
idx = -1;
@@ -325,7 +349,7 @@ void LLRadioGroup::setValue( const LLSD& value )
}
else
{
- llwarns << "LLRadioGroup::setValue: value not found: " << value_name << llendl;
+ llwarns << "LLRadioGroup::setValue: value not found: " << value.asString() << llendl;
}
}
}
@@ -337,7 +361,7 @@ LLSD LLRadioGroup::getValue() const
for (button_list_t::const_iterator iter = mRadioButtons.begin();
iter != mRadioButtons.end(); ++iter)
{
- if (idx == index) return LLSD((*iter)->getName());
+ if (idx == index) return LLSD((*iter)->getPayload());
++idx;
}
return LLSD();
@@ -357,11 +381,10 @@ LLUUID LLRadioGroup::getCurrentID() const
BOOL LLRadioGroup::setSelectedByValue(const LLSD& value, BOOL selected)
{
S32 idx = 0;
- std::string value_string = value.asString();
for (button_list_t::const_iterator iter = mRadioButtons.begin();
iter != mRadioButtons.end(); ++iter)
{
- if((*iter)->getName() == value_string)
+ if(llsd_equals((*iter)->getPayload(), value))
{
setSelectedIndex(idx);
return TRUE;
@@ -380,11 +403,10 @@ LLSD LLRadioGroup::getSelectedValue()
BOOL LLRadioGroup::isSelected(const LLSD& value) const
{
S32 idx = 0;
- std::string value_string = value.asString();
for (button_list_t::const_iterator iter = mRadioButtons.begin();
iter != mRadioButtons.end(); ++iter)
{
- if((*iter)->getName() == value_string)
+ if(llsd_equals((*iter)->getPayload(), value))
{
if (idx == mSelectedIndex)
{
@@ -406,9 +428,21 @@ BOOL LLRadioGroup::operateOnAll(EOperation op)
return FALSE;
}
-LLRadioCtrl::LLRadioCtrl(const LLRadioCtrl::Params& p)
- : LLCheckBoxCtrl(p)
+LLRadioGroup::ItemParams::ItemParams()
+: value("value")
{
+ addSynonym(value, "initial_value");
+}
+
+LLRadioCtrl::LLRadioCtrl(const LLRadioGroup::ItemParams& p)
+: LLCheckBoxCtrl(p),
+ mPayload(p.value)
+{
+ // use name as default "Value" for backwards compatibility
+ if (!p.value.isProvided())
+ {
+ mPayload = p.name();
+ }
}
BOOL LLRadioCtrl::postBuild()
diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h
index 1e9b5115f8..b178bb36ca 100644
--- a/indra/llui/llradiogroup.h
+++ b/indra/llui/llradiogroup.h
@@ -37,35 +37,6 @@
#include "llcheckboxctrl.h"
#include "llctrlselectioninterface.h"
-
-/*
- * An invisible view containing multiple mutually exclusive toggling
- * buttons (usually radio buttons). Automatically handles the mutex
- * condition by highlighting only one button at a time.
- */
-class LLRadioCtrl : public LLCheckBoxCtrl
-{
-public:
- struct Params : public LLInitParam::Block<Params, LLCheckBoxCtrl::Params>
- {};
-
- /*virtual*/ ~LLRadioCtrl();
- /*virtual*/ void setValue(const LLSD& value);
-
- /*virtual*/ BOOL postBuild();
-
- // Ensure label is in an attribute, not the contents
- static void setupParamsForExport(Params& p, LLView* parent);
-
-protected:
- LLRadioCtrl(const Params& p);
- friend class LLUICtrlFactory;
-};
-
-
-struct RadioGroupRegistry : public LLChildRegistry<RadioGroupRegistry>
-{};
-
/*
* An invisible view containing multiple mutually exclusive toggling
* buttons (usually radio buttons). Automatically handles the mutex
@@ -76,25 +47,31 @@ class LLRadioGroup
{
public:
+ struct ItemParams : public LLInitParam::Block<ItemParams, LLCheckBoxCtrl::Params>
+ {
+ Optional<LLSD> value;
+ ItemParams();
+ };
+
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
{
- Optional<bool> has_border;
+ Optional<bool> has_border;
+ Multiple<ItemParams, AtLeast<1> > items;
Params();
};
- // my valid children are stored in this registry
- typedef RadioGroupRegistry child_registry_t;
-
protected:
LLRadioGroup(const Params&);
friend class LLUICtrlFactory;
public:
+
+ /*virtual*/ void initFromParams(const Params&);
+
virtual ~LLRadioGroup();
virtual BOOL postBuild();
- virtual bool addChild(LLView* view, S32 tab_group = 0);
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleKeyHere(KEY key, MASK mask);
@@ -134,7 +111,7 @@ public:
private:
const LLFontGL* mFont;
S32 mSelectedIndex;
- typedef std::vector<LLRadioCtrl*> button_list_t;
+ typedef std::vector<class LLRadioCtrl*> button_list_t;
button_list_t mRadioButtons;
BOOL mHasBorder;
diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h
index bd2d595174..714aca9337 100644
--- a/indra/llui/llsearcheditor.h
+++ b/indra/llui/llsearcheditor.h
@@ -50,15 +50,17 @@ class LLSearchEditor : public LLUICtrl
public:
struct Params : public LLInitParam::Block<Params, LLLineEditor::Params>
{
- Optional<LLButton::Params> search_button, clear_button;
- Optional<bool> search_button_visible, clear_button_visible;
+ Optional<LLButton::Params> search_button,
+ clear_button;
+ Optional<bool> search_button_visible,
+ clear_button_visible;
Optional<commit_callback_t> keystroke_callback;
Params()
- : search_button("search_button")
- , search_button_visible("search_button_visible")
- , clear_button("clear_button")
- , clear_button_visible("clear_button_visible")
+ : search_button("search_button"),
+ search_button_visible("search_button_visible"),
+ clear_button("clear_button"),
+ clear_button_visible("clear_button_visible")
{
name = "search_editor";
}
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 6603887905..67d3ed408b 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -1896,17 +1896,26 @@ namespace LLInitParam
control("")
{}
- LLUIColor TypedParam<LLUIColor>::getValueFromBlock() const
+ void TypedParam<LLUIColor>::setValueFromBlock() const
{
if (control.isProvided())
{
- return LLUIColorTable::instance().getColor(control);
+ mData.mValue = LLUIColorTable::instance().getColor(control);
}
else
{
- return LLColor4(red, green, blue, alpha);
+ mData.mValue = LLColor4(red, green, blue, alpha);
}
}
+
+ void TypedParam<LLUIColor>::setBlockFromValue()
+ {
+ LLColor4 color = mData.mValue.get();
+ red = color.mV[VRED];
+ green = color.mV[VGREEN];
+ blue = color.mV[VBLUE];
+ alpha = color.mV[VALPHA];
+ }
void TypeValues<LLUIColor>::declareValues()
{
@@ -1932,28 +1941,32 @@ namespace LLInitParam
addSynonym(name, "");
}
- const LLFontGL* TypedParam<const LLFontGL*>::getValueFromBlock() const
+ void TypedParam<const LLFontGL*>::setValueFromBlock() const
{
- if (name.isProvided())
+ const LLFontGL* res_fontp = LLFontGL::getFontByName(name);
+ if (res_fontp)
{
- const LLFontGL* res_fontp = LLFontGL::getFontByName(name);
- if (res_fontp)
- {
- return res_fontp;
- }
+ mData.mValue = res_fontp;
+ }
- U8 fontstyle = 0;
- fontstyle = LLFontGL::getStyleFromString(style());
- LLFontDescriptor desc(name(), size(), fontstyle);
- const LLFontGL* fontp = LLFontGL::getFont(desc);
- if (fontp)
- {
- return fontp;
- }
+ U8 fontstyle = 0;
+ fontstyle = LLFontGL::getStyleFromString(style());
+ LLFontDescriptor desc(name(), size(), fontstyle);
+ const LLFontGL* fontp = LLFontGL::getFont(desc);
+ if (fontp)
+ {
+ mData.mValue = fontp;
+ }
+ }
+
+ void TypedParam<const LLFontGL*>::setBlockFromValue()
+ {
+ if (mData.mValue)
+ {
+ name = LLFontGL::nameFromFont(mData.mValue);
+ size = LLFontGL::sizeFromFont(mData.mValue);
+ style = LLFontGL::getStringFromStyle(mData.mValue->getFontDesc().getStyle());
}
-
- // default to current value
- return mData.mValue;
}
TypedParam<LLRect>::TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count)
@@ -1966,7 +1979,7 @@ namespace LLInitParam
height("height")
{}
- LLRect TypedParam<LLRect>::getValueFromBlock() const
+ void TypedParam<LLRect>::setValueFromBlock() const
{
LLRect rect;
@@ -2027,7 +2040,17 @@ namespace LLInitParam
rect.mBottom = bottom;
rect.mTop = top;
}
- return rect;
+ mData.mValue = rect;
+ }
+
+ void TypedParam<LLRect>::setBlockFromValue()
+ {
+ left = mData.mValue.mLeft;
+ right = mData.mValue.mRight;
+ bottom = mData.mValue.mBottom;
+ top = mData.mValue.mTop;
+ width.setProvided(false);
+ height.setProvided(false);
}
TypedParam<LLCoordGL>::TypedParam(BlockDescriptor& descriptor, const char* name, LLCoordGL value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count)
@@ -2037,9 +2060,15 @@ namespace LLInitParam
{
}
- LLCoordGL TypedParam<LLCoordGL>::getValueFromBlock() const
+ void TypedParam<LLCoordGL>::setValueFromBlock() const
+ {
+ mData.mValue.set(x, y);
+ }
+
+ void TypedParam<LLCoordGL>::setBlockFromValue()
{
- return LLCoordGL(x, y);
+ x = mData.mValue.mX;
+ y = mData.mValue.mY;
}
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index 5ec07f1941..5840e76f5c 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -379,7 +379,8 @@ namespace LLInitParam
TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count);
- LLRect getValueFromBlock() const;
+ void setValueFromBlock() const;
+ void setBlockFromValue();
};
template<>
@@ -401,7 +402,8 @@ namespace LLInitParam
Optional<std::string> control;
TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count);
- LLUIColor getValueFromBlock() const;
+ void setValueFromBlock() const;
+ void setBlockFromValue();
};
// provide a better default for Optional<const LLFontGL*> than NULL
@@ -429,7 +431,8 @@ namespace LLInitParam
style;
TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL* const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count);
- const LLFontGL* getValueFromBlock() const;
+ void setValueFromBlock() const;
+ void setBlockFromValue();
};
template<>
@@ -467,7 +470,8 @@ namespace LLInitParam
y;
TypedParam(BlockDescriptor& descriptor, const char* name, LLCoordGL value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count);
- LLCoordGL getValueFromBlock() const;
+ void setValueFromBlock() const;
+ void setBlockFromValue();
};
}
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index 3643bf44f7..625d3c63e5 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -105,9 +105,12 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa
}
}
+static LLFastTimer::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children");
+
//static
void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node)
{
+ LLFastTimer ft(FTM_CREATE_CHILDREN);
if (node.isNull()) return;
for (LLXMLNodePtr child_node = node->getFirstChild(); child_node.notNull(); child_node = child_node->getNextSibling())
@@ -393,7 +396,6 @@ BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const std::string& na
//static
void LLUICtrlFactory::setCtrlParent(LLView* view, LLView* parent, S32 tab_group)
{
- if (tab_group < 0) tab_group = parent->getLastTabGroup();
parent->addChild(view, tab_group);
}
@@ -452,10 +454,4 @@ dummy_widget_creator_func_t* LLUICtrlFactory::getDefaultWidgetFunc(const std::ty
const std::string* LLUICtrlFactory::getWidgetTag(const std::type_info* widget_type)
{
return LLWidgetNameRegistry::instance().getValue(widget_type);
-}
-
-// static
-void LLUICtrlFactory::connect(LLView* parent, LLView* child)
-{
- parent->addChild(child);
-}
+} \ No newline at end of file
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 55d7d745eb..6dab9521bb 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -180,34 +180,52 @@ public:
void popFactoryFunctions();
template<typename T>
- static T* create(typename T::Params& params, LLView* parent = NULL)
+ static T* createWidget(typename T::Params& params, LLView* parent = NULL)
{
- //#pragma message("Generating LLUICtrlFactory::create")
- params.fillFrom(ParamDefaults<typename T::Params, 0>::instance().get());
- //S32 foo = "test";
+ T* widget = NULL;
if (!params.validateBlock())
{
llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl;
+ //return NULL;
+ }
+
+ {
+ LLFastTimer timer(FTM_WIDGET_CONSTRUCTION);
+ widget = new T(params);
+ }
+ {
+ LLFastTimer timer(FTM_INIT_FROM_PARAMS);
+ widget->initFromParams(params);
}
- T* widget = new T(params);
- widget->initFromParams(params);
+
if (parent)
{
- connect(parent, widget);
+ S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : parent->getLastTabGroup();
+ setCtrlParent(widget, parent, tab_group);
}
return widget;
}
- // fix for gcc template instantiation annoyance
- static void connect(LLView* parent, LLView* child);
-
+ template<typename T>
+ static T* create(typename T::Params& params, LLView* parent = NULL)
+ {
+ params.fillFrom(ParamDefaults<typename T::Params, 0>::instance().get());
+
+ T* widget = createWidget<T>(params, parent);
+ if (widget)
+ {
+ widget->postBuild();
+ }
+
+ return widget;
+ }
+
LLView* createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t&, LLXMLNodePtr output_node );
template<typename T>
static T* createFromFile(const std::string &filename, LLView *parent, const widget_registry_t& registry, LLXMLNodePtr output_node = NULL)
{
- //#pragma message("Generating LLUICtrlFactory::createFromFile")
T* widget = NULL;
std::string skinned_filename = findSkinnedFilename(filename);
@@ -272,7 +290,6 @@ fail:
{
LLFastTimer timer(FTM_WIDGET_SETUP);
- //#pragma message("Generating LLUICtrlFactory::defaultBuilder")
typename T::Params params(getDefaultParams<T>());
LLXUIParser::instance().readXUI(node, params, LLUICtrlFactory::getInstance()->getCurFileName());
@@ -292,34 +309,14 @@ fail:
// Apply layout transformations, usually munging rect
T::setupParams(params, parent);
- if (!params.validateBlock())
- {
- llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl;
- }
- T* widget;
- {
- LLFastTimer timer(FTM_WIDGET_CONSTRUCTION);
- widget = new T(params);
- }
- {
- LLFastTimer timer(FTM_INIT_FROM_PARAMS);
- widget->initFromParams(params);
- }
-
- if (parent)
- {
- S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1;
- setCtrlParent(widget, parent, tab_group);
- }
-
- typedef typename T::child_registry_t registry_t;
+ T* widget = createWidget<T>(params, parent);
- createChildren(widget, node, registry_t::instance(), output_node);
+ createChildren(widget, node, typename T::child_registry_t::instance(), output_node);
- if (!widget->postBuild())
+ if (widget && !widget->postBuild())
{
delete widget;
- return NULL;
+ widget = NULL;
}
return widget;
diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp
index f941f391eb..1dfc281d93 100644
--- a/indra/llui/lluiimage.cpp
+++ b/indra/llui/lluiimage.cpp
@@ -161,22 +161,32 @@ void LLUIImage::onImageLoaded()
namespace LLInitParam
{
- LLUIImage* TypedParam<LLUIImage*>::getValueFromBlock() const
+ void TypedParam<LLUIImage*>::setValueFromBlock() const
{
// The keyword "none" is specifically requesting a null image
// do not default to current value. Used to overwrite template images.
if (name() == "none")
{
- return NULL;
+ mData.mValue = NULL;
}
LLUIImage* imagep = LLUI::getUIImage(name());
- if (!imagep)
+ if (imagep)
{
- // default to current value
- imagep = mData.mValue;
+ mData.mValue = imagep;
+ }
+ }
+
+ void TypedParam<LLUIImage*>::setBlockFromValue()
+ {
+ if (mData.mValue == NULL)
+ {
+ name = "none";
+ }
+ else
+ {
+ name = mData.mValue->getName();
}
- return imagep;
}
diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h
index 5fa9610ab2..bdfc44262d 100644
--- a/indra/llui/lluiimage.h
+++ b/indra/llui/lluiimage.h
@@ -111,7 +111,8 @@ namespace LLInitParam
{
}
- LLUIImage* getValueFromBlock() const;
+ void setValueFromBlock() const;
+ void setBlockFromValue();
};
// Need custom comparison function for our test app, which only loads
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 8917e4b813..9f6fc1f298 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -2494,8 +2494,6 @@ void LLView::setupParams(LLView::Params& p, LLView* parent)
const S32 VPAD = 4;
const S32 MIN_WIDGET_HEIGHT = 10;
- p.from_xui(true);
-
// *NOTE: This will confuse export of floater/panel coordinates unless
// the default is also "topleft". JC
if (p.layout().empty() && parent)
@@ -2503,6 +2501,8 @@ void LLView::setupParams(LLView::Params& p, LLView* parent)
p.layout = parent->getLayout();
}
+ p.from_xui = true;
+
if (parent)
{
LLRect parent_rect = parent->getLocalRect();
@@ -2518,7 +2518,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent)
}
// convert negative or centered coordinates to parent relative values
- // Note: some of this logic matches the logic in TypedParam<LLRect>::getValueFromBlock()
+ // Note: some of this logic matches the logic in TypedParam<LLRect>::setValueFromBlock()
if (p.center_horiz)
{