summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llmultislider.cpp8
-rw-r--r--indra/llui/llmultislider.h3
-rw-r--r--indra/llui/llmultisliderctrl.cpp11
-rw-r--r--indra/llui/llmultisliderctrl.h2
4 files changed, 20 insertions, 4 deletions
diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp
index 9a7b6f9f6b..ed93b3d44c 100644
--- a/indra/llui/llmultislider.cpp
+++ b/indra/llui/llmultislider.cpp
@@ -354,17 +354,17 @@ const std::string& LLMultiSlider::addSlider(F32 val)
return mCurSlider;
}
-void LLMultiSlider::addSlider(F32 val, const std::string& name)
+bool LLMultiSlider::addSlider(F32 val, const std::string& name)
{
F32 initVal = val;
if(mValue.size() >= mMaxNumSliders) {
- return;
+ return false;
}
bool foundOne = findUnusedValue(initVal);
if(!foundOne) {
- return;
+ return false;
}
// add a new thumb rect
@@ -383,6 +383,8 @@ void LLMultiSlider::addSlider(F32 val, const std::string& name)
// move the slider
setSliderValue(mCurSlider, initVal, TRUE);
+
+ return true;
}
bool LLMultiSlider::findUnusedValue(F32& initVal)
diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h
index 52c6d1ddef..50cf62e9c5 100644
--- a/indra/llui/llmultislider.h
+++ b/indra/llui/llmultislider.h
@@ -96,7 +96,7 @@ public:
bool findUnusedValue(F32& initVal);
const std::string& addSlider();
const std::string& addSlider(F32 val);
- void addSlider(F32 val, const std::string& name);
+ bool addSlider(F32 val, const std::string& name);
void deleteSlider(const std::string& name);
void deleteCurSlider() { deleteSlider(mCurSlider); }
void clear();
@@ -109,6 +109,7 @@ public:
S32 getMaxNumSliders() { return mMaxNumSliders; }
S32 getCurNumSliders() { return mValue.size(); }
+ F32 getOverlapThreshold() { return mOverlapThreshold; }
bool canAddSliders() { return mValue.size() < mMaxNumSliders; }
protected:
diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp
index 972567ef9b..20e2b569f1 100644
--- a/indra/llui/llmultisliderctrl.cpp
+++ b/indra/llui/llmultisliderctrl.cpp
@@ -293,6 +293,17 @@ const std::string& LLMultiSliderCtrl::addSlider(F32 val)
return name;
}
+bool LLMultiSliderCtrl::addSlider(F32 val, const std::string& name)
+{
+ bool res = mMultiSlider->addSlider(val, name);
+ if (res)
+ {
+ mCurValue = mMultiSlider->getCurSliderValue();
+ updateText();
+ }
+ return res;
+}
+
void LLMultiSliderCtrl::deleteSlider(const std::string& name)
{
mMultiSlider->deleteSlider(name);
diff --git a/indra/llui/llmultisliderctrl.h b/indra/llui/llmultisliderctrl.h
index c370ebf505..75715d6043 100644
--- a/indra/llui/llmultisliderctrl.h
+++ b/indra/llui/llmultisliderctrl.h
@@ -112,6 +112,7 @@ public:
/// for adding and deleting sliders
const std::string& addSlider();
const std::string& addSlider(F32 val);
+ bool addSlider(F32 val, const std::string& name);
void deleteSlider(const std::string& name);
void deleteCurSlider() { deleteSlider(mMultiSlider->getCurSlider()); }
@@ -120,6 +121,7 @@ public:
S32 getMaxNumSliders() { return mMultiSlider->getMaxNumSliders(); }
S32 getCurNumSliders() { return mMultiSlider->getCurNumSliders(); }
+ F32 getOverlapThreshold() { return mMultiSlider->getOverlapThreshold(); }
bool canAddSliders() { return mMultiSlider->canAddSliders(); }
void setLabel(const std::string& label) { if (mLabelBox) mLabelBox->setText(label); }