summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llscrolllistctrl.cpp6
-rw-r--r--indra/llui/llspinctrl.cpp12
-rw-r--r--indra/llui/llspinctrl.h2
-rw-r--r--indra/llui/lluictrlfactory.cpp17
-rw-r--r--indra/llui/lluictrlfactory.h4
5 files changed, 31 insertions, 10 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 4e640eac2a..05888fe382 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -1117,9 +1117,7 @@ BOOL LLScrollListCtrl::selectItemRange( S32 first_index, S32 last_index )
if( itemp->getEnabled() )
{
selectItem(itemp, FALSE);
- success = TRUE;
- if (!success)
- mOriginalSelection = first_index;
+ success = TRUE;
}
}
else
@@ -1198,7 +1196,7 @@ void LLScrollListCtrl::deleteItems(const LLSD& sd)
mLastSelected = NULL;
}
delete itemp;
- mItemList.erase(iter++);
+ iter = mItemList.erase(iter);
}
else
{
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index a39b74a610..36b84c741f 100644
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -249,6 +249,18 @@ void LLSpinCtrl::setValue(const LLSD& value )
}
}
+//no matter if Editor has the focus, update the value
+void LLSpinCtrl::forceSetValue(const LLSD& value )
+{
+ F32 v = (F32)value.asReal();
+ if (mValue != v || !mbHasBeenSet)
+ {
+ mbHasBeenSet = TRUE;
+ mValue = v;
+
+ updateEditor();
+ }
+}
void LLSpinCtrl::clear()
{
diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h
index 21d297fa16..eb9c60d442 100644
--- a/indra/llui/llspinctrl.h
+++ b/indra/llui/llspinctrl.h
@@ -66,6 +66,7 @@ public:
virtual LLXMLNodePtr getXML(bool save_children = true) const;
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory);
+ virtual void forceSetValue(const LLSD& value ) ;
virtual void setValue(const LLSD& value );
virtual LLSD getValue() const { return mValue; }
F32 get() const { return (F32)getValue().asReal(); }
@@ -87,6 +88,7 @@ public:
virtual void setIncrement(F32 inc) { mIncrement = inc; }
virtual F32 getMinValue() { return mMinValue ; }
virtual F32 getMaxValue() { return mMaxValue ; }
+ virtual F32 getIncrement() { return mIncrement ; }
void setLabel(const LLStringExplicit& label);
void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; }
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index c75c6714f8..c2dc9a1e90 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -104,10 +104,17 @@ static LLRegisterWidget<LLUICtrlLocate> r2("pad");
// LLUICtrlFactory()
//-----------------------------------------------------------------------------
LLUICtrlFactory::LLUICtrlFactory()
+ : mDummyPanel(NULL)
{
setupPaths();
}
+LLUICtrlFactory::~LLUICtrlFactory()
+{
+ delete mDummyPanel;
+ mDummyPanel = NULL;
+}
+
void LLUICtrlFactory::setupPaths()
{
LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml");
@@ -428,10 +435,6 @@ void LLUICtrlFactory::rebuild()
LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node)
{
- // panel for holding dummy widgets, so they have a parent for layout purposes, etc.
- // does not manage lifetime of child widgets
- static LLPanel dummy_panel;
-
LLString ctrl_type = node->getName()->mString;
LLString::toLower(ctrl_type);
@@ -445,7 +448,11 @@ LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node)
if (parent == NULL)
{
- parent = &dummy_panel;
+ if (mDummyPanel == NULL)
+ {
+ mDummyPanel = new LLPanel;
+ }
+ parent = mDummyPanel;
}
LLView *ctrl = func(node, parent, this);
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 651bfa7b88..cd4fa8cacf 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -46,7 +46,7 @@ class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
public:
LLUICtrlFactory();
// do not call! needs to be public so run-time can clean up the singleton
- virtual ~LLUICtrlFactory() {}
+ virtual ~LLUICtrlFactory();
void setupPaths();
@@ -88,6 +88,8 @@ private:
std::deque<const LLCallbackMap::map_t*> mFactoryStack;
static std::vector<LLString> mXUIPaths;
+
+ LLPanel* mDummyPanel;
};