diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llui/llslider.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/llui/llslider.cpp')
-rw-r--r-- | linden/indra/llui/llslider.cpp | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/linden/indra/llui/llslider.cpp b/linden/indra/llui/llslider.cpp index e03603d..02841ee 100644 --- a/linden/indra/llui/llslider.cpp +++ b/linden/indra/llui/llslider.cpp | |||
@@ -82,15 +82,6 @@ LLSlider::LLSlider( | |||
82 | mDragStartThumbRect = mThumbRect; | 82 | mDragStartThumbRect = mThumbRect; |
83 | } | 83 | } |
84 | 84 | ||
85 | EWidgetType LLSlider::getWidgetType() const | ||
86 | { | ||
87 | return WIDGET_TYPE_SLIDER_BAR; | ||
88 | } | ||
89 | |||
90 | LLString LLSlider::getWidgetTag() const | ||
91 | { | ||
92 | return LL_SLIDER_TAG; | ||
93 | } | ||
94 | 85 | ||
95 | void LLSlider::setValue(F32 value, BOOL from_event) | 86 | void LLSlider::setValue(F32 value, BOOL from_event) |
96 | { | 87 | { |
@@ -118,7 +109,7 @@ void LLSlider::updateThumbRect() | |||
118 | S32 thumb_width = mThumbImage->getWidth(); | 109 | S32 thumb_width = mThumbImage->getWidth(); |
119 | S32 thumb_height = mThumbImage->getHeight(); | 110 | S32 thumb_height = mThumbImage->getHeight(); |
120 | S32 left_edge = (thumb_width / 2); | 111 | S32 left_edge = (thumb_width / 2); |
121 | S32 right_edge = mRect.getWidth() - (thumb_width / 2); | 112 | S32 right_edge = getRect().getWidth() - (thumb_width / 2); |
122 | 113 | ||
123 | S32 x = left_edge + S32( t * (right_edge - left_edge) ); | 114 | S32 x = left_edge + S32( t * (right_edge - left_edge) ); |
124 | mThumbRect.mLeft = x - (thumb_width / 2); | 115 | mThumbRect.mLeft = x - (thumb_width / 2); |
@@ -140,18 +131,13 @@ void LLSlider::setValueAndCommit(F32 value) | |||
140 | } | 131 | } |
141 | 132 | ||
142 | 133 | ||
143 | F32 LLSlider::getValueF32() const | ||
144 | { | ||
145 | return mValue; | ||
146 | } | ||
147 | |||
148 | BOOL LLSlider::handleHover(S32 x, S32 y, MASK mask) | 134 | BOOL LLSlider::handleHover(S32 x, S32 y, MASK mask) |
149 | { | 135 | { |
150 | if( hasMouseCapture() ) | 136 | if( hasMouseCapture() ) |
151 | { | 137 | { |
152 | S32 thumb_half_width = mThumbImage->getWidth()/2; | 138 | S32 thumb_half_width = mThumbImage->getWidth()/2; |
153 | S32 left_edge = thumb_half_width; | 139 | S32 left_edge = thumb_half_width; |
154 | S32 right_edge = mRect.getWidth() - (thumb_half_width); | 140 | S32 right_edge = getRect().getWidth() - (thumb_half_width); |
155 | 141 | ||
156 | x += mMouseOffset; | 142 | x += mMouseOffset; |
157 | x = llclamp( x, left_edge, right_edge ); | 143 | x = llclamp( x, left_edge, right_edge ); |
@@ -231,10 +217,10 @@ BOOL LLSlider::handleMouseDown(S32 x, S32 y, MASK mask) | |||
231 | return TRUE; | 217 | return TRUE; |
232 | } | 218 | } |
233 | 219 | ||
234 | BOOL LLSlider::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) | 220 | BOOL LLSlider::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) |
235 | { | 221 | { |
236 | BOOL handled = FALSE; | 222 | BOOL handled = FALSE; |
237 | if( getVisible() && mEnabled && !called_from_parent ) | 223 | if( getVisible() && getEnabled() && !called_from_parent ) |
238 | { | 224 | { |
239 | switch(key) | 225 | switch(key) |
240 | { | 226 | { |
@@ -272,14 +258,14 @@ void LLSlider::draw() | |||
272 | 258 | ||
273 | LLRect rect(mDragStartThumbRect); | 259 | LLRect rect(mDragStartThumbRect); |
274 | 260 | ||
275 | F32 opacity = mEnabled ? 1.f : 0.3f; | 261 | F32 opacity = getEnabled() ? 1.f : 0.3f; |
276 | LLColor4 center_color = (mThumbCenterColor % opacity); | 262 | LLColor4 center_color = (mThumbCenterColor % opacity); |
277 | LLColor4 track_color = (mTrackColor % opacity); | 263 | LLColor4 track_color = (mTrackColor % opacity); |
278 | 264 | ||
279 | // Track | 265 | // Track |
280 | LLRect track_rect(mThumbImage->getWidth() / 2, | 266 | LLRect track_rect(mThumbImage->getWidth() / 2, |
281 | getLocalRect().getCenterY() + (mTrackImage->getHeight() / 2), | 267 | getLocalRect().getCenterY() + (mTrackImage->getHeight() / 2), |
282 | mRect.getWidth() - mThumbImage->getWidth() / 2, | 268 | getRect().getWidth() - mThumbImage->getWidth() / 2, |
283 | getLocalRect().getCenterY() - (mTrackImage->getHeight() / 2) ); | 269 | getLocalRect().getCenterY() - (mTrackImage->getHeight() / 2) ); |
284 | 270 | ||
285 | gl_draw_scaled_image_with_border(track_rect.mLeft, track_rect.mBottom, 3, 3, track_rect.getWidth(), track_rect.getHeight(), | 271 | gl_draw_scaled_image_with_border(track_rect.mLeft, track_rect.mBottom, 3, 3, track_rect.getWidth(), track_rect.getHeight(), |
@@ -334,14 +320,14 @@ LLXMLNodePtr LLSlider::getXML(bool save_children) const | |||
334 | node->createChild("min_val", TRUE)->setFloatValue(getMinValue()); | 320 | node->createChild("min_val", TRUE)->setFloatValue(getMinValue()); |
335 | node->createChild("max_val", TRUE)->setFloatValue(getMaxValue()); | 321 | node->createChild("max_val", TRUE)->setFloatValue(getMaxValue()); |
336 | node->createChild("increment", TRUE)->setFloatValue(getIncrement()); | 322 | node->createChild("increment", TRUE)->setFloatValue(getIncrement()); |
337 | node->createChild("volume", TRUE)->setBoolValue(getVolumeSlider()); | 323 | node->createChild("volume", TRUE)->setBoolValue(mVolumeSlider); |
338 | 324 | ||
339 | return node; | 325 | return node; |
340 | } | 326 | } |
341 | 327 | ||
342 | 328 | ||
343 | //static | 329 | //static |
344 | LLView* LLSlider::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 330 | LLView* LLSlider::fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory) |
345 | { | 331 | { |
346 | LLString name("slider_bar"); | 332 | LLString name("slider_bar"); |
347 | node->getAttributeString("name", name); | 333 | node->getAttributeString("name", name); |