diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llui/llmultislider.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llui/llmultislider.cpp')
-rw-r--r-- | linden/indra/llui/llmultislider.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/linden/indra/llui/llmultislider.cpp b/linden/indra/llui/llmultislider.cpp index dfa36fa..227cf98 100644 --- a/linden/indra/llui/llmultislider.cpp +++ b/linden/indra/llui/llmultislider.cpp | |||
@@ -54,7 +54,7 @@ const S32 EXTRA_TRIANGLE_HEIGHT = -2; | |||
54 | S32 LLMultiSlider::mNameCounter = 0; | 54 | S32 LLMultiSlider::mNameCounter = 0; |
55 | 55 | ||
56 | LLMultiSlider::LLMultiSlider( | 56 | LLMultiSlider::LLMultiSlider( |
57 | const LLString& name, | 57 | const std::string& name, |
58 | const LLRect& rect, | 58 | const LLRect& rect, |
59 | void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), | 59 | void (*on_commit_callback)(LLUICtrl* ctrl, void* userdata), |
60 | void* callback_userdata, | 60 | void* callback_userdata, |
@@ -66,7 +66,7 @@ LLMultiSlider::LLMultiSlider( | |||
66 | BOOL allow_overlap, | 66 | BOOL allow_overlap, |
67 | BOOL draw_track, | 67 | BOOL draw_track, |
68 | BOOL use_triangle, | 68 | BOOL use_triangle, |
69 | const LLString& control_name) | 69 | const std::string& control_name) |
70 | : | 70 | : |
71 | LLUICtrl( name, rect, TRUE, on_commit_callback, callback_userdata, | 71 | LLUICtrl( name, rect, TRUE, on_commit_callback, callback_userdata, |
72 | FOLLOWS_LEFT | FOLLOWS_TOP), | 72 | FOLLOWS_LEFT | FOLLOWS_TOP), |
@@ -91,7 +91,7 @@ LLMultiSlider::LLMultiSlider( | |||
91 | mMouseUpCallback( NULL ) | 91 | mMouseUpCallback( NULL ) |
92 | { | 92 | { |
93 | mValue.emptyMap(); | 93 | mValue.emptyMap(); |
94 | mCurSlider = LLString::null; | 94 | mCurSlider = LLStringUtil::null; |
95 | 95 | ||
96 | // properly handle setting the starting thumb rect | 96 | // properly handle setting the starting thumb rect |
97 | // do it this way to handle both the operating-on-settings | 97 | // do it this way to handle both the operating-on-settings |
@@ -100,7 +100,7 @@ LLMultiSlider::LLMultiSlider( | |||
100 | setValue(getValue()); | 100 | setValue(getValue()); |
101 | } | 101 | } |
102 | 102 | ||
103 | void LLMultiSlider::setSliderValue(const LLString& name, F32 value, BOOL from_event) | 103 | void LLMultiSlider::setSliderValue(const std::string& name, F32 value, BOOL from_event) |
104 | { | 104 | { |
105 | // exit if not there | 105 | // exit if not there |
106 | if(!mValue.has(name)) { | 106 | if(!mValue.has(name)) { |
@@ -174,30 +174,30 @@ void LLMultiSlider::setValue(const LLSD& value) | |||
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | F32 LLMultiSlider::getSliderValue(const LLString& name) const | 177 | F32 LLMultiSlider::getSliderValue(const std::string& name) const |
178 | { | 178 | { |
179 | return (F32)mValue[name].asReal(); | 179 | return (F32)mValue[name].asReal(); |
180 | } | 180 | } |
181 | 181 | ||
182 | void LLMultiSlider::setCurSlider(const LLString& name) | 182 | void LLMultiSlider::setCurSlider(const std::string& name) |
183 | { | 183 | { |
184 | if(mValue.has(name)) { | 184 | if(mValue.has(name)) { |
185 | mCurSlider = name; | 185 | mCurSlider = name; |
186 | } | 186 | } |
187 | } | 187 | } |
188 | 188 | ||
189 | const LLString& LLMultiSlider::addSlider() | 189 | const std::string& LLMultiSlider::addSlider() |
190 | { | 190 | { |
191 | return addSlider(mInitialValue); | 191 | return addSlider(mInitialValue); |
192 | } | 192 | } |
193 | 193 | ||
194 | const LLString& LLMultiSlider::addSlider(F32 val) | 194 | const std::string& LLMultiSlider::addSlider(F32 val) |
195 | { | 195 | { |
196 | std::stringstream newName; | 196 | std::stringstream newName; |
197 | F32 initVal = val; | 197 | F32 initVal = val; |
198 | 198 | ||
199 | if(mValue.size() >= mMaxNumSliders) { | 199 | if(mValue.size() >= mMaxNumSliders) { |
200 | return LLString::null; | 200 | return LLStringUtil::null; |
201 | } | 201 | } |
202 | 202 | ||
203 | // create a new name | 203 | // create a new name |
@@ -206,7 +206,7 @@ const LLString& LLMultiSlider::addSlider(F32 val) | |||
206 | 206 | ||
207 | bool foundOne = findUnusedValue(initVal); | 207 | bool foundOne = findUnusedValue(initVal); |
208 | if(!foundOne) { | 208 | if(!foundOne) { |
209 | return LLString::null; | 209 | return LLStringUtil::null; |
210 | } | 210 | } |
211 | 211 | ||
212 | // add a new thumb rect | 212 | // add a new thumb rect |
@@ -269,7 +269,7 @@ bool LLMultiSlider::findUnusedValue(F32& initVal) | |||
269 | } | 269 | } |
270 | 270 | ||
271 | 271 | ||
272 | void LLMultiSlider::deleteSlider(const LLString& name) | 272 | void LLMultiSlider::deleteSlider(const std::string& name) |
273 | { | 273 | { |
274 | // can't delete last slider | 274 | // can't delete last slider |
275 | if(mValue.size() <= 0) { | 275 | if(mValue.size() <= 0) { |
@@ -282,7 +282,7 @@ void LLMultiSlider::deleteSlider(const LLString& name) | |||
282 | 282 | ||
283 | // set to the last created | 283 | // set to the last created |
284 | if(mValue.size() > 0) { | 284 | if(mValue.size() > 0) { |
285 | std::map<LLString, LLRect>::iterator mIt = mThumbRects.end(); | 285 | std::map<std::string, LLRect>::iterator mIt = mThumbRects.end(); |
286 | mIt--; | 286 | mIt--; |
287 | mCurSlider = mIt->first; | 287 | mCurSlider = mIt->first; |
288 | } | 288 | } |
@@ -365,7 +365,7 @@ BOOL LLMultiSlider::handleMouseDown(S32 x, S32 y, MASK mask) | |||
365 | else | 365 | else |
366 | { | 366 | { |
367 | // scroll through thumbs to see if we have a new one selected and select that one | 367 | // scroll through thumbs to see if we have a new one selected and select that one |
368 | std::map<LLString, LLRect>::iterator mIt = mThumbRects.begin(); | 368 | std::map<std::string, LLRect>::iterator mIt = mThumbRects.begin(); |
369 | for(; mIt != mThumbRects.end(); mIt++) { | 369 | for(; mIt != mThumbRects.end(); mIt++) { |
370 | 370 | ||
371 | // check if inside. If so, set current slider and continue | 371 | // check if inside. If so, set current slider and continue |
@@ -425,8 +425,8 @@ void LLMultiSlider::draw() | |||
425 | { | 425 | { |
426 | LLColor4 curThumbColor; | 426 | LLColor4 curThumbColor; |
427 | 427 | ||
428 | std::map<LLString, LLRect>::iterator mIt; | 428 | std::map<std::string, LLRect>::iterator mIt; |
429 | std::map<LLString, LLRect>::iterator curSldrIt; | 429 | std::map<std::string, LLRect>::iterator curSldrIt; |
430 | 430 | ||
431 | // Draw background and thumb. | 431 | // Draw background and thumb. |
432 | 432 | ||
@@ -582,7 +582,7 @@ LLXMLNodePtr LLMultiSlider::getXML(bool save_children) const | |||
582 | //static | 582 | //static |
583 | LLView* LLMultiSlider::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 583 | LLView* LLMultiSlider::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
584 | { | 584 | { |
585 | LLString name("multi_slider_bar"); | 585 | std::string name("multi_slider_bar"); |
586 | node->getAttributeString("name", name); | 586 | node->getAttributeString("name", name); |
587 | 587 | ||
588 | LLRect rect; | 588 | LLRect rect; |