LLSpinCtrl Class Reference

#include <llspinctrl.h>

Inheritance diagram for LLSpinCtrl:

Inheritance graph
[legend]
Collaboration diagram for LLSpinCtrl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLSpinCtrl (const LLString &name, const LLRect &rect, const LLString &label, const LLFontGL *font, void(*commit_callback)(LLUICtrl *, void *), void *callback_userdata, F32 initial_value, F32 min_value, F32 max_value, F32 increment, const LLString &control_name=LLString(), S32 label_width=SPINCTRL_DEFAULT_LABEL_WIDTH)
virtual ~LLSpinCtrl ()
virtual EWidgetType getWidgetType () const
virtual LLString getWidgetTag () const
virtual LLXMLNodePtr getXML (bool save_children=true) const
virtual void setValue (const LLSD &value)
virtual LLSD getValue () const
F32 get ()
void set (F32 value)
virtual void setMinValue (LLSD min_value)
virtual void setMaxValue (LLSD max_value)
BOOL isMouseHeldDown ()
virtual void setEnabled (BOOL b)
virtual void setFocus (BOOL b)
virtual void clear ()
virtual BOOL isDirty () const
virtual void setPrecision (S32 precision)
virtual void setMinValue (F32 min)
virtual void setMaxValue (F32 max)
virtual void setIncrement (F32 inc)
void setLabel (const LLStringExplicit &label)
void setLabelColor (const LLColor4 &c)
void setDisabledLabelColor (const LLColor4 &c)
virtual void onTabInto ()
virtual void setTentative (BOOL b)
virtual void onCommit ()
void forceEditorCommit ()
virtual BOOL handleScrollWheel (S32 x, S32 y, S32 clicks)
virtual BOOL handleKeyHere (KEY key, MASK mask, BOOL called_from_parent)
virtual void draw ()

Static Public Member Functions

static LLViewfromXML (LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
static void onEditorCommit (LLUICtrl *caller, void *userdata)
static void onEditorGainFocus (LLUICtrl *caller, void *userdata)
static void onEditorChangeFocus (LLUICtrl *caller, S32 direction, void *userdata)
static void onUpBtn (void *userdata)
static void onDownBtn (void *userdata)

Protected Member Functions

void updateEditor ()
void reportInvalidData ()

Protected Attributes

F32 mValue
F32 mInitialValue
F32 mMaxValue
F32 mMinValue
F32 mIncrement
S32 mPrecision
LLTextBoxmLabelBox
LLLineEditormEditor
LLColor4 mTextEnabledColor
LLColor4 mTextDisabledColor
LLButtonmUpBtn
LLButtonmDownBtn
BOOL mbHasBeenSet

Detailed Description

Definition at line 60 of file llspinctrl.h.


Constructor & Destructor Documentation

LLSpinCtrl::LLSpinCtrl ( const LLString name,
const LLRect rect,
const LLString label,
const LLFontGL font,
void(*)(LLUICtrl *, void *)  commit_callback,
void callback_userdata,
F32  initial_value,
F32  min_value,
F32  max_value,
F32  increment,
const LLString control_name = LLString(),
S32  label_width = SPINCTRL_DEFAULT_LABEL_WIDTH 
)

Definition at line 56 of file llspinctrl.cpp.

References LLView::addChild(), bottom, FALSE, LLRectBase< Type >::getHeight(), LLRectBase< Type >::getWidth(), MAX_STRING_LENGTH, mDownBtn, mEditor, mLabelBox, LLView::mRect, mUpBtn, NULL, onDownBtn(), onEditorCommit(), onEditorGainFocus(), onUpBtn(), LLLineEditor::prevalidateFloat(), S32, LLView::setFollowsBottom(), LLView::setFollowsLeft(), LLButton::setHeldDownCallback(), LLView::setSpanChildren(), LLUICtrl::setTabStop(), SPINCTRL_BTN_HEIGHT, SPINCTRL_BTN_WIDTH, SPINCTRL_SPACING, LLFontGL::sSansSerif, top, TRUE, and updateEditor().

Referenced by fromXML().

LLSpinCtrl::~LLSpinCtrl (  )  [virtual]

Definition at line 143 of file llspinctrl.cpp.


Member Function Documentation

void LLSpinCtrl::clear (  )  [virtual]

Reimplemented from LLUICtrl.

Definition at line 261 of file llspinctrl.cpp.

References LLLineEditor::clear(), FALSE, mbHasBeenSet, mEditor, mMinValue, and setValue().

Referenced by LLPanelObject::getState().

void LLSpinCtrl::draw (  )  [virtual]

Reimplemented from LLView.

Definition at line 411 of file llspinctrl.cpp.

References LLView::draw(), LLView::mEnabled, mLabelBox, mTextDisabledColor, mTextEnabledColor, and LLTextBox::setColor().

void LLSpinCtrl::forceEditorCommit (  ) 

Definition at line 333 of file llspinctrl.cpp.

References mEditor, and onEditorCommit().

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

Definition at line 496 of file llspinctrl.cpp.

References LLView::createRect(), LLRectBase< Type >::getWidth(), LLUICtrl::initFromXML(), llmin(), LLSpinCtrl(), NULL, S32, LLView::selectFont(), and setPrecision().

F32 LLSpinCtrl::get (  )  [inline]

Definition at line 81 of file llspinctrl.h.

References LLSD::asReal(), and getValue().

Referenced by LLPanelGroupGeneral::apply(), LLPanelFaceSetTEFunctor::apply(), LLInventoryViewFinder::draw(), LLPanelObject::getVolumeParams(), LLFloaterEditUI::onCommitHeight(), LLFloaterEditUI::onCommitWidth(), LLPanelFace::sendAlpha(), LLPanelObject::sendPosition(), LLPanelObject::sendRotation(), LLPanelObject::sendScale(), LLPanelGroupVoting::impl::sendStartGroupProposal(), and LLPanelGroupVoting::impl::setEnableCreateProposal().

LLSD LLSpinCtrl::getValue (  )  const [virtual]

Reimplemented from LLUICtrl.

Definition at line 256 of file llspinctrl.cpp.

References mValue.

Referenced by get(), and updateEditor().

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

Implements LLView.

Definition at line 75 of file llspinctrl.h.

References LL_SPIN_CTRL_TAG.

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

Implements LLView.

Definition at line 74 of file llspinctrl.h.

References WIDGET_TYPE_SPINNER.

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

Reimplemented from LLUICtrl.

Definition at line 469 of file llspinctrl.cpp.

References LLView::addColorXML(), LLView::getRect(), LLTextBox::getText(), LLRectBase< Type >::getWidth(), LLUICtrl::getXML(), mIncrement, mInitialValue, mLabelBox, mMaxValue, mMinValue, mPrecision, mTextDisabledColor, mTextEnabledColor, and TRUE.

BOOL LLSpinCtrl::handleKeyHere ( KEY  key,
MASK  mask,
BOOL  called_from_parent 
) [virtual]

Reimplemented from LLView.

Definition at line 442 of file llspinctrl.cpp.

References FALSE, LLUICtrl::hasFocus(), KEY_DOWN, KEY_ESCAPE, KEY_UP, mEditor, onDownBtn(), onUpBtn(), LLLineEditor::setFocus(), TRUE, and updateEditor().

BOOL LLSpinCtrl::handleScrollWheel ( S32  x,
S32  y,
S32  clicks 
) [virtual]

Reimplemented from LLView.

Definition at line 421 of file llspinctrl.cpp.

References LLView::mEnabled, onDownBtn(), onUpBtn(), and TRUE.

BOOL LLSpinCtrl::isDirty (  )  const [virtual]

Reimplemented from LLUICtrl.

Definition at line 554 of file llspinctrl.cpp.

References mInitialValue, and mValue.

BOOL LLSpinCtrl::isMouseHeldDown (  ) 

Definition at line 359 of file llspinctrl.cpp.

References LLView::hasMouseCapture(), mDownBtn, and mUpBtn.

void LLSpinCtrl::onCommit (  )  [virtual]

Reimplemented from LLUICtrl.

Definition at line 366 of file llspinctrl.cpp.

References FALSE, mValue, LLUICtrl::onCommit(), LLView::setControlValue(), and setTentative().

void LLSpinCtrl::onDownBtn ( void userdata  )  [static]

Definition at line 200 of file llspinctrl.cpp.

References clamp_precision(), and llmax().

Referenced by handleKeyHere(), handleScrollWheel(), and LLSpinCtrl().

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

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

Definition at line 287 of file llspinctrl.cpp.

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

Referenced by forceEditorCommit(), and LLSpinCtrl().

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

Definition at line 233 of file llspinctrl.cpp.

References llassert.

Referenced by LLSpinCtrl().

void LLSpinCtrl::onTabInto (  )  [virtual]

Reimplemented from LLUICtrl.

Definition at line 400 of file llspinctrl.cpp.

References mEditor, and LLLineEditor::onTabInto().

void LLSpinCtrl::onUpBtn ( void userdata  )  [static]

Definition at line 167 of file llspinctrl.cpp.

References clamp_precision(), and llmin().

Referenced by handleKeyHere(), handleScrollWheel(), and LLSpinCtrl().

void LLSpinCtrl::reportInvalidData (  )  [protected]

Definition at line 406 of file llspinctrl.cpp.

References make_ui_sound().

void LLSpinCtrl::set ( F32  value  )  [inline]

Definition at line 82 of file llspinctrl.h.

References mInitialValue, and setValue().

Referenced by LLPanelGroupGeneral::apply(), LLInventoryViewFinder::draw(), LLPanelObject::getState(), LLPanelObject::getVolumeParams(), LLPanelLandAccess::refresh(), LLFloaterEditUI::refresh(), LLFloaterEditUI::refreshCore(), LLPanelObject::sendPosition(), LLPanelGroupVoting::impl::setEnableCreateProposal(), LLPanelGroupVoting::impl::setEnableVoteProposal(), LLPanelGroupGeneral::update(), and LLInventoryViewFinder::updateElementsFromFilter().

void LLSpinCtrl::setDisabledLabelColor ( const LLColor4 c  )  [inline]

Definition at line 101 of file llspinctrl.h.

References c, and mTextDisabledColor.

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

Reimplemented from LLView.

Definition at line 345 of file llspinctrl.cpp.

References mEditor, LLLineEditor::setEnabled(), and LLView::setEnabled().

Referenced by LLPanelObject::getState(), LLPanelGroupGeneral::postBuild(), LLPanelLandAccess::refresh(), LLFloaterEditUI::refresh(), LLPanelGroupVoting::impl::setEnableCreateProposal(), LLPanelGroupVoting::impl::setEnableListProposals(), LLPanelGroupVoting::impl::setEnableVoteProposal(), and LLPanelGroupGeneral::update().

void LLSpinCtrl::setFocus ( BOOL  b  )  [virtual]

Reimplemented from LLUICtrl.

Definition at line 339 of file llspinctrl.cpp.

References mEditor, LLLineEditor::setFocus(), and LLUICtrl::setFocus().

virtual void LLSpinCtrl::setIncrement ( F32  inc  )  [inline, virtual]

Definition at line 97 of file llspinctrl.h.

References mIncrement.

Referenced by LLPanelObject::getState(), and LLFloaterSettingsDebug::updateControl().

void LLSpinCtrl::setLabel ( const LLStringExplicit label  ) 

Definition at line 388 of file llspinctrl.cpp.

References LLView::getName(), llendl, llwarns, mLabelBox, and LLTextBox::setText().

Referenced by LLFloaterSettingsDebug::updateControl().

void LLSpinCtrl::setLabelColor ( const LLColor4 c  )  [inline]

Definition at line 100 of file llspinctrl.h.

References c, and mTextEnabledColor.

Referenced by LLPanelObject::draw().

virtual void LLSpinCtrl::setMaxValue ( F32  max  )  [inline, virtual]

Definition at line 96 of file llspinctrl.h.

References mMaxValue.

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

Reimplemented from LLUICtrl.

Definition at line 85 of file llspinctrl.h.

References LLSD::asReal().

Referenced by LLPanelObject::getState(), LLPanelGroupVoting::impl::setEnableCreateProposal(), and LLFloaterSettingsDebug::updateControl().

virtual void LLSpinCtrl::setMinValue ( F32  min  )  [inline, virtual]

Definition at line 95 of file llspinctrl.h.

References mMinValue.

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

Reimplemented from LLUICtrl.

Definition at line 84 of file llspinctrl.h.

References LLSD::asReal().

Referenced by LLPanelObject::getState(), and LLFloaterSettingsDebug::updateControl().

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

Definition at line 376 of file llspinctrl.cpp.

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

Referenced by fromXML(), LLFloaterEditUI::LLFloaterEditUI(), LLPanelGroupGeneral::postBuild(), LLPanelFace::postBuild(), and LLFloaterSettingsDebug::updateControl().

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

Reimplemented from LLUICtrl.

Definition at line 352 of file llspinctrl.cpp.

References mEditor, and LLUICtrl::setTentative().

Referenced by onCommit().

void LLSpinCtrl::setValue ( const LLSD value  )  [virtual]

Reimplemented from LLView.

Definition at line 241 of file llspinctrl.cpp.

References LLSD::asReal(), LLUICtrl::hasFocus(), mbHasBeenSet, mEditor, mValue, TRUE, updateEditor(), and v.

Referenced by clear(), set(), and LLFloaterSettingsDebug::updateControl().

void LLSpinCtrl::updateEditor (  )  [protected]

Definition at line 270 of file llspinctrl.cpp.

References clamp_precision(), format, getValue(), llformat(), mEditor, mPrecision, LLLineEditor::setText(), and LLLocale::USER_LOCALE.

Referenced by handleKeyHere(), LLSpinCtrl(), setPrecision(), and setValue().


Member Data Documentation

BOOL LLSpinCtrl::mbHasBeenSet [protected]

Definition at line 144 of file llspinctrl.h.

Referenced by clear(), and setValue().

LLButton* LLSpinCtrl::mDownBtn [protected]

Definition at line 142 of file llspinctrl.h.

Referenced by isMouseHeldDown(), and LLSpinCtrl().

LLLineEditor* LLSpinCtrl::mEditor [protected]

Definition at line 137 of file llspinctrl.h.

Referenced by clear(), forceEditorCommit(), handleKeyHere(), LLSpinCtrl(), onTabInto(), setEnabled(), setFocus(), setTentative(), setValue(), and updateEditor().

F32 LLSpinCtrl::mIncrement [protected]

Definition at line 132 of file llspinctrl.h.

Referenced by getXML(), and setIncrement().

F32 LLSpinCtrl::mInitialValue [protected]

Definition at line 129 of file llspinctrl.h.

Referenced by getXML(), isDirty(), and set().

LLTextBox* LLSpinCtrl::mLabelBox [protected]

Definition at line 135 of file llspinctrl.h.

Referenced by draw(), getXML(), LLSpinCtrl(), and setLabel().

F32 LLSpinCtrl::mMaxValue [protected]

Definition at line 130 of file llspinctrl.h.

Referenced by getXML(), and setMaxValue().

F32 LLSpinCtrl::mMinValue [protected]

Definition at line 131 of file llspinctrl.h.

Referenced by clear(), getXML(), onEditorCommit(), and setMinValue().

S32 LLSpinCtrl::mPrecision [protected]

Definition at line 134 of file llspinctrl.h.

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

LLColor4 LLSpinCtrl::mTextDisabledColor [protected]

Definition at line 139 of file llspinctrl.h.

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

LLColor4 LLSpinCtrl::mTextEnabledColor [protected]

Definition at line 138 of file llspinctrl.h.

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

LLButton* LLSpinCtrl::mUpBtn [protected]

Definition at line 141 of file llspinctrl.h.

Referenced by isMouseHeldDown(), and LLSpinCtrl().

F32 LLSpinCtrl::mValue [protected]

Definition at line 128 of file llspinctrl.h.

Referenced by getValue(), isDirty(), onCommit(), and setValue().


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