LLSliderCtrl Class Reference

#include <llsliderctrl.h>

Inheritance diagram for LLSliderCtrl:

Inheritance graph
[legend]
Collaboration diagram for LLSliderCtrl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLSliderCtrl (const LLString &name, const LLRect &rect, const LLString &label, const LLFontGL *font, S32 slider_left, S32 text_left, BOOL show_text, BOOL can_edit_text, BOOL volume, void(*commit_callback)(LLUICtrl *, void *), void *callback_userdata, F32 initial_value, F32 min_value, F32 max_value, F32 increment, const LLString &control_which=LLString::null)
virtual ~LLSliderCtrl ()
virtual EWidgetType getWidgetType () const
virtual LLString getWidgetTag () const
virtual LLXMLNodePtr getXML (bool save_children=true) const
F32 getValueF32 () const
void setValue (F32 v, BOOL from_event=FALSE)
virtual void setValue (const LLSD &value)
virtual LLSD getValue () const
virtual BOOL setLabelArg (const LLString &key, const LLStringExplicit &text)
virtual void setMinValue (LLSD min_value)
virtual void setMaxValue (LLSD max_value)
BOOL isMouseHeldDown ()
virtual void setEnabled (BOOL b)
virtual void clear ()
virtual void setPrecision (S32 precision)
void setMinValue (F32 min_value)
void setMaxValue (F32 max_value)
void setIncrement (F32 increment)
F32 getMinValue ()
F32 getMaxValue ()
void setLabel (const LLStringExplicit &label)
void setLabelColor (const LLColor4 &c)
void setDisabledLabelColor (const LLColor4 &c)
void setSliderMouseDownCallback (void(*slider_mousedown_callback)(LLUICtrl *caller, void *userdata))
void setSliderMouseUpCallback (void(*slider_mouseup_callback)(LLUICtrl *caller, void *userdata))
virtual void onTabInto ()
virtual void setTentative (BOOL b)
virtual void onCommit ()
virtual void setControlName (const LLString &control_name, LLView *context)
virtual LLString getControlName () const

Static Public Member Functions

static LLView * fromXML (LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
static void onSliderCommit (LLUICtrl *caller, void *userdata)
static void onSliderMouseDown (LLUICtrl *caller, void *userdata)
static void onSliderMouseUp (LLUICtrl *caller, void *userdata)
static void onEditorCommit (LLUICtrl *caller, void *userdata)
static void onEditorGainFocus (LLUICtrl *caller, void *userdata)
static void onEditorChangeFocus (LLUICtrl *caller, S32 direction, void *userdata)

Private Member Functions

void updateText ()
void reportInvalidData ()

Private Attributes

const LLFontGL * mFont
BOOL mShowText
BOOL mCanEditText
BOOL mVolumeSlider
S32 mPrecision
LLTextBox * mLabelBox
S32 mLabelWidth
F32 mValue
LLSlider * mSlider
LLLineEditor * mEditor
LLTextBox * mTextBox
LLColor4 mTextEnabledColor
LLColor4 mTextDisabledColor
void(* mSliderMouseUpCallback )(LLUICtrl *ctrl, void *userdata)
void(* mSliderMouseDownCallback )(LLUICtrl *ctrl, void *userdata)

Detailed Description

Definition at line 55 of file llsliderctrl.h.


Constructor & Destructor Documentation

LLSliderCtrl::LLSliderCtrl ( const LLString &  name,
const LLRect &  rect,
const LLString &  label,
const LLFontGL *  font,
S32  slider_left,
S32  text_left,
BOOL  show_text,
BOOL  can_edit_text,
BOOL  volume,
void(*)(LLUICtrl *, void *)  commit_callback,
void *  callback_userdata,
F32  initial_value,
F32  min_value,
F32  max_value,
F32  increment,
const LLString &  control_which = LLString::null 
)

Definition at line 56 of file llsliderctrl.cpp.

References LLView::addChild(), bottom, LLRectBase< Type >::getHeight(), LLRectBase< Type >::getWidth(), LLFontGL::getWidth(), left, MAX_STRING_LENGTH, mEditor, mLabelBox, LLView::mRect, mSlider, mTextBox, NULL, onEditorCommit(), onEditorGainFocus(), onSliderCommit(), LLLineEditor::prevalidateFloat(), S32, LLUICtrl::setFocusReceivedCallback(), LLView::setFollowsBottom(), LLView::setFollowsLeft(), LLLineEditor::setIgnoreTab(), SLIDERCTRL_SPACING, top, TRUE, and updateText().

Referenced by fromXML().

LLSliderCtrl::~LLSliderCtrl (  )  [virtual]

Definition at line 147 of file llsliderctrl.cpp.


Member Function Documentation

void LLSliderCtrl::clear (  )  [virtual]

Reimplemented from LLUICtrl.

Definition at line 198 of file llsliderctrl.cpp.

References f, mEditor, mTextBox, LLStringBase< char >::null, LLTextBox::setText(), LLLineEditor::setText(), and setValue().

LLView * LLSliderCtrl::fromXML ( LLXMLNodePtr  node,
LLView *  parent,
LLUICtrlFactory *  factory 
) [static]

Definition at line 476 of file llsliderctrl.cpp.

References LLView::createRect(), f, FALSE, LLRectBase< Type >::getWidth(), LLFontGL::getWidth(), LLUICtrl::initFromXML(), LLSliderCtrl(), NULL, S32, LLView::selectFont(), setPrecision(), LLFontGL::sSansSerifSmall, TRUE, and updateText().

LLString LLSliderCtrl::getControlName (  )  const [virtual]

Reimplemented from LLView.

Definition at line 431 of file llsliderctrl.cpp.

References LLView::getControlName(), and mSlider.

F32 LLSliderCtrl::getMaxValue (  )  [inline]

Definition at line 98 of file llsliderctrl.h.

References LLSlider::getMaxValue(), and mSlider.

Referenced by LLScrollingPanelParam::onHintHeldDown(), LLScrollingPanelParam::onHintMaxMouseUp(), and LLScrollingPanelParam::onHintMinMouseUp().

F32 LLSliderCtrl::getMinValue (  )  [inline]

Definition at line 97 of file llsliderctrl.h.

References LLSlider::getMinValue(), and mSlider.

Referenced by LLScrollingPanelParam::onHintHeldDown(), LLScrollingPanelParam::onHintMaxMouseUp(), and LLScrollingPanelParam::onHintMinMouseUp().

virtual LLSD LLSliderCtrl::getValue (  )  const [inline, virtual]

Reimplemented from LLUICtrl.

Definition at line 82 of file llsliderctrl.h.

References getValueF32().

Referenced by LLFloaterSnapshot::Impl::onCommitQuality(), LLScrollingPanelParam::onSliderMoved(), and LLDebugVarMessageBox::slider_changed().

F32 LLSliderCtrl::getValueF32 (  )  const

Definition at line 161 of file llsliderctrl.cpp.

References LLSlider::getValueF32(), and mSlider.

Referenced by getValue(), and updateText().

virtual LLString LLSliderCtrl::getWidgetTag (  )  const [inline, virtual]

Implements LLView.

Definition at line 74 of file llsliderctrl.h.

References LL_SLIDER_CTRL_TAG.

virtual EWidgetType LLSliderCtrl::getWidgetType (  )  const [inline, virtual]

Implements LLView.

Definition at line 73 of file llsliderctrl.h.

References WIDGET_TYPE_SLIDER.

LLXMLNodePtr LLSliderCtrl::getXML ( bool  save_children = true  )  const [virtual]

Reimplemented from LLUICtrl.

Definition at line 443 of file llsliderctrl.cpp.

References LLView::addColorXML(), LLSlider::getIncrement(), LLSlider::getInitialValue(), LLSlider::getMaxValue(), LLSlider::getMinValue(), LLTextBox::getText(), LLUICtrl::getXML(), mCanEditText, mLabelBox, mPrecision, mShowText, mSlider, mTextDisabledColor, mTextEnabledColor, mValue, mVolumeSlider, and TRUE.

BOOL LLSliderCtrl::isMouseHeldDown (  ) 

Definition at line 212 of file llsliderctrl.cpp.

References LLView::hasMouseCapture(), and mSlider.

void LLSliderCtrl::onCommit (  )  [virtual]

Reimplemented from LLUICtrl.

Definition at line 359 of file llsliderctrl.cpp.

References FALSE, mEditor, LLUICtrl::onCommit(), LLUICtrl::setTentative(), and setTentative().

static void LLSliderCtrl::onEditorChangeFocus ( LLUICtrl *  caller,
S32  direction,
void *  userdata 
) [static]

void LLSliderCtrl::onEditorCommit ( LLUICtrl *  caller,
void *  userdata 
) [static]

Definition at line 240 of file llsliderctrl.cpp.

References FALSE, llassert, LLLineEditor::postvalidateFloat(), TRUE, and LLLocale::USER_LOCALE.

Referenced by LLSliderCtrl().

void LLSliderCtrl::onEditorGainFocus ( LLUICtrl *  caller,
void *  userdata 
) [static]

Definition at line 153 of file llsliderctrl.cpp.

References llassert.

Referenced by LLSliderCtrl().

void LLSliderCtrl::onSliderCommit ( LLUICtrl *  caller,
void *  userdata 
) [static]

Definition at line 288 of file llsliderctrl.cpp.

References FALSE, llassert, and TRUE.

Referenced by LLSliderCtrl().

void LLSliderCtrl::onSliderMouseDown ( LLUICtrl *  caller,
void *  userdata 
) [static]

Definition at line 391 of file llsliderctrl.cpp.

Referenced by setSliderMouseDownCallback().

void LLSliderCtrl::onSliderMouseUp ( LLUICtrl *  caller,
void *  userdata 
) [static]

Definition at line 408 of file llsliderctrl.cpp.

Referenced by setSliderMouseUpCallback().

void LLSliderCtrl::onTabInto (  )  [virtual]

Reimplemented from LLUICtrl.

Definition at line 417 of file llsliderctrl.cpp.

References mEditor, and LLLineEditor::onTabInto().

void LLSliderCtrl::reportInvalidData (  )  [private]

Definition at line 425 of file llsliderctrl.cpp.

References make_ui_sound().

void LLSliderCtrl::setControlName ( const LLString &  control_name,
LLView *  context 
) [virtual]

Reimplemented from LLView.

Definition at line 437 of file llsliderctrl.cpp.

References mSlider, and LLView::setControlName().

void LLSliderCtrl::setDisabledLabelColor ( const LLColor4 &  c  )  [inline]

Definition at line 102 of file llsliderctrl.h.

References c, and mTextDisabledColor.

void LLSliderCtrl::setEnabled ( BOOL  b  )  [virtual]

Reimplemented from LLView.

Definition at line 326 of file llsliderctrl.cpp.

References mEditor, mLabelBox, mSlider, mTextBox, mTextDisabledColor, mTextEnabledColor, LLTextBox::setColor(), LLLineEditor::setEnabled(), and LLView::setEnabled().

void LLSliderCtrl::setIncrement ( F32  increment  )  [inline]

Definition at line 95 of file llsliderctrl.h.

References mSlider, and LLSlider::setIncrement().

Referenced by LLDebugVarMessageBox::show().

void LLSliderCtrl::setLabel ( const LLStringExplicit &  label  )  [inline]

Definition at line 100 of file llsliderctrl.h.

References mLabelBox, and LLTextBox::setText().

BOOL LLSliderCtrl::setLabelArg ( const LLString &  key,
const LLStringExplicit &  text 
) [virtual]

Reimplemented from LLUICtrl.

Definition at line 173 of file llsliderctrl.cpp.

References FALSE, LLView::getRect(), LLTextBox::getText(), LLFontGL::getWidth(), left, llclamp(), mFont, mLabelBox, mLabelWidth, LLRectBase< Type >::mLeft, LLRectBase< Type >::mRight, mSlider, S32, LLView::setRect(), LLTextBox::setTextArg(), and SLIDERCTRL_SPACING.

void LLSliderCtrl::setLabelColor ( const LLColor4 &  c  )  [inline]

Definition at line 101 of file llsliderctrl.h.

References c, and mTextEnabledColor.

void LLSliderCtrl::setMaxValue ( F32  max_value  )  [inline]

Definition at line 94 of file llsliderctrl.h.

References mSlider, and LLSlider::setMaxValue().

virtual void LLSliderCtrl::setMaxValue ( LLSD  max_value  )  [inline, virtual]

Reimplemented from LLUICtrl.

Definition at line 86 of file llsliderctrl.h.

References LLSD::asReal().

Referenced by LLDebugVarMessageBox::show().

void LLSliderCtrl::setMinValue ( F32  min_value  )  [inline]

Definition at line 93 of file llsliderctrl.h.

References mSlider, and LLSlider::setMinValue().

virtual void LLSliderCtrl::setMinValue ( LLSD  min_value  )  [inline, virtual]

Reimplemented from LLUICtrl.

Definition at line 85 of file llsliderctrl.h.

References LLSD::asReal().

Referenced by LLDebugVarMessageBox::show().

void LLSliderCtrl::setPrecision ( S32  precision  )  [virtual]

Definition at line 372 of file llsliderctrl.cpp.

References llendl, llerrs, mPrecision, and updateText().

Referenced by fromXML(), and LLDebugVarMessageBox::LLDebugVarMessageBox().

void LLSliderCtrl::setSliderMouseDownCallback ( void(*)(LLUICtrl *caller, void *userdata)  slider_mousedown_callback  ) 

Definition at line 384 of file llsliderctrl.cpp.

References mSlider, mSliderMouseDownCallback, onSliderMouseDown(), and LLSlider::setMouseDownCallback().

void LLSliderCtrl::setSliderMouseUpCallback ( void(*)(LLUICtrl *caller, void *userdata)  slider_mouseup_callback  ) 

Definition at line 401 of file llsliderctrl.cpp.

References mSlider, mSliderMouseUpCallback, onSliderMouseUp(), and LLSlider::setMouseUpCallback().

void LLSliderCtrl::setTentative ( BOOL  b  )  [virtual]

Reimplemented from LLUICtrl.

Definition at line 349 of file llsliderctrl.cpp.

References mEditor, and LLUICtrl::setTentative().

Referenced by onCommit().

virtual void LLSliderCtrl::setValue ( const LLSD &  value  )  [inline, virtual]

Reimplemented from LLView.

Definition at line 81 of file llsliderctrl.h.

References LLSD::asReal(), setValue(), and TRUE.

void LLSliderCtrl::setValue ( F32  v,
BOOL  from_event = FALSE 
)

Definition at line 166 of file llsliderctrl.cpp.

References LLSlider::getValueF32(), mSlider, mValue, LLSlider::setValue(), and updateText().

Referenced by clear(), LLDebugVarMessageBox::draw(), LLScrollingPanelParam::onHintHeldDown(), LLScrollingPanelParam::onHintMaxMouseUp(), LLScrollingPanelParam::onHintMinMouseUp(), setValue(), and LLDebugVarMessageBox::show().

void LLSliderCtrl::updateText (  )  [private]

Definition at line 217 of file llsliderctrl.cpp.

References format, getValueF32(), llformat(), mEditor, mPrecision, mTextBox, LLTextBox::setText(), LLLineEditor::setText(), and LLLocale::USER_LOCALE.

Referenced by fromXML(), LLSliderCtrl(), setPrecision(), and setValue().


Member Data Documentation

BOOL LLSliderCtrl::mCanEditText [private]

Definition at line 130 of file llsliderctrl.h.

Referenced by getXML().

LLLineEditor* LLSliderCtrl::mEditor [private]

Definition at line 139 of file llsliderctrl.h.

Referenced by clear(), LLSliderCtrl(), onCommit(), onTabInto(), setEnabled(), setTentative(), and updateText().

const LLFontGL* LLSliderCtrl::mFont [private]

Definition at line 128 of file llsliderctrl.h.

Referenced by setLabelArg().

LLTextBox* LLSliderCtrl::mLabelBox [private]

Definition at line 134 of file llsliderctrl.h.

Referenced by getXML(), LLSliderCtrl(), setEnabled(), setLabel(), and setLabelArg().

S32 LLSliderCtrl::mLabelWidth [private]

Definition at line 135 of file llsliderctrl.h.

Referenced by setLabelArg().

S32 LLSliderCtrl::mPrecision [private]

Definition at line 133 of file llsliderctrl.h.

Referenced by getXML(), setPrecision(), and updateText().

BOOL LLSliderCtrl::mShowText [private]

Definition at line 129 of file llsliderctrl.h.

Referenced by getXML().

LLSlider* LLSliderCtrl::mSlider [private]

Definition at line 138 of file llsliderctrl.h.

Referenced by getControlName(), getMaxValue(), getMinValue(), getValueF32(), getXML(), isMouseHeldDown(), LLSliderCtrl(), setControlName(), setEnabled(), setIncrement(), setLabelArg(), setMaxValue(), setMinValue(), setSliderMouseDownCallback(), setSliderMouseUpCallback(), and setValue().

void(* LLSliderCtrl::mSliderMouseDownCallback)(LLUICtrl *ctrl, void *userdata) [private]

Referenced by setSliderMouseDownCallback().

void(* LLSliderCtrl::mSliderMouseUpCallback)(LLUICtrl *ctrl, void *userdata) [private]

Referenced by setSliderMouseUpCallback().

LLTextBox* LLSliderCtrl::mTextBox [private]

Definition at line 140 of file llsliderctrl.h.

Referenced by clear(), LLSliderCtrl(), setEnabled(), and updateText().

LLColor4 LLSliderCtrl::mTextDisabledColor [private]

Definition at line 143 of file llsliderctrl.h.

Referenced by getXML(), setDisabledLabelColor(), and setEnabled().

LLColor4 LLSliderCtrl::mTextEnabledColor [private]

Definition at line 142 of file llsliderctrl.h.

Referenced by getXML(), setEnabled(), and setLabelColor().

F32 LLSliderCtrl::mValue [private]

Definition at line 137 of file llsliderctrl.h.

Referenced by getXML(), and setValue().

BOOL LLSliderCtrl::mVolumeSlider [private]

Definition at line 131 of file llsliderctrl.h.

Referenced by getXML().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:47 2010 for Second Life Viewer by  doxygen 1.4.7