#include <llspinctrl.h>
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 LLXMLNodePtr | getXML (bool save_children=true) const |
virtual void | forceSetValue (const LLSD &value) |
virtual void | setValue (const LLSD &value) |
virtual LLSD | getValue () const |
F32 | get () const |
void | set (F32 value) |
virtual void | setMinValue (LLSD min_value) |
virtual void | setMaxValue (LLSD max_value) |
BOOL | isMouseHeldDown () const |
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) |
virtual F32 | getMinValue () |
virtual F32 | getMaxValue () |
virtual F32 | getIncrement () |
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) |
virtual void | draw () |
Static Public Member Functions | |
static LLView * | fromXML (LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory) |
static void | onEditorCommit (LLUICtrl *caller, void *userdata) |
static void | onEditorGainFocus (LLFocusableElement *caller, void *userdata) |
static void | onEditorChangeFocus (LLUICtrl *caller, S32 direction, void *userdata) |
static void | onUpBtn (void *userdata) |
static void | onDownBtn (void *userdata) |
Private Member Functions | |
void | updateEditor () |
void | reportInvalidData () |
Private Attributes | |
F32 | mValue |
F32 | mInitialValue |
F32 | mMaxValue |
F32 | mMinValue |
F32 | mIncrement |
S32 | mPrecision |
class LLTextBox * | mLabelBox |
class LLLineEditor * | mEditor |
LLColor4 | mTextEnabledColor |
LLColor4 | mTextDisabledColor |
class LLButton * | mUpBtn |
class LLButton * | mDownBtn |
BOOL | mbHasBeenSet |
Definition at line 51 of file llspinctrl.h.
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 57 of file llspinctrl.cpp.
References LLView::addChild(), FALSE, LLRectBase< Type >::getHeight(), LLView::getRect(), LLLineEditor::LLLineEditor(), MAX_STRING_LENGTH, mDownBtn, mEditor, mLabelBox, LLRectBase< Type >::mRight, mUpBtn, NULL, onDownBtn(), onEditorCommit(), onEditorGainFocus(), onUpBtn(), LLLineEditor::prevalidateFloat(), S32, LLFocusableElement::setFocusReceivedCallback(), LLView::setFollowsBottom(), LLView::setFollowsLeft(), LLButton::setHeldDownCallback(), LLLineEditor::setIgnoreTab(), LLUICtrl::setTabStop(), LLView::setUseBoundingRect(), SPINCTRL_BTN_HEIGHT, SPINCTRL_BTN_WIDTH, SPINCTRL_SPACING, LLFontGL::sSansSerif, TRUE, and updateEditor().
Referenced by fromXML().
virtual LLSpinCtrl::~LLSpinCtrl | ( | ) | [inline, virtual] |
Definition at line 64 of file llspinctrl.h.
LLXMLNodePtr LLSpinCtrl::getXML | ( | bool | save_children = true |
) | const [virtual] |
Reimplemented from LLUICtrl.
Definition at line 468 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.
LLView * LLSpinCtrl::fromXML | ( | LLXMLNodePtr | node, | |
LLView * | parent, | |||
class LLUICtrlFactory * | factory | |||
) | [static] |
Reimplemented from LLUICtrl.
Definition at line 495 of file llspinctrl.cpp.
References LLView::createRect(), LLRectBase< Type >::getWidth(), LLUICtrl::initFromXML(), llmin(), LLSpinCtrl(), NULL, S32, LLView::selectFont(), and setPrecision().
void LLSpinCtrl::forceSetValue | ( | const LLSD & | value | ) | [virtual] |
Definition at line 253 of file llspinctrl.cpp.
References LLSD::asReal(), mbHasBeenSet, mValue, TRUE, and updateEditor().
Referenced by LLFloaterSnapshot::Impl::resetSnapshotSizeOnUI().
void LLSpinCtrl::setValue | ( | const LLSD & | value | ) | [virtual] |
Reimplemented from LLView.
Definition at line 237 of file llspinctrl.cpp.
References LLSD::asReal(), LLUICtrl::hasFocus(), mbHasBeenSet, mEditor, mValue, TRUE, and updateEditor().
Referenced by clear(), LLPanelLandMedia::refresh(), set(), LLFloaterDayCycle::syncMenu(), and LLFloaterSettingsDebug::updateControl().
virtual LLSD LLSpinCtrl::getValue | ( | ) | const [inline, virtual] |
Reimplemented from LLUICtrl.
Definition at line 71 of file llspinctrl.h.
References mValue.
Referenced by get(), LLFloaterDayCycle::onTimeRateChanged(), and updateEditor().
F32 LLSpinCtrl::get | ( | ) | const [inline] |
Definition at line 72 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(), LLPanelFace::sendGlow(), LLPanelObject::sendPosition(), LLPanelObject::sendRotation(), LLPanelObject::sendScale(), LLPanelGroupVoting::impl::sendStartGroupProposal(), and LLPanelGroupVoting::impl::setEnableCreateProposal().
void LLSpinCtrl::set | ( | F32 | value | ) | [inline] |
Definition at line 73 of file llspinctrl.h.
References mInitialValue, and setValue().
Referenced by LLPanelGroupGeneral::apply(), LLInventoryViewFinder::draw(), LLPanelObject::getState(), LLPanelObject::getVolumeParams(), LLFloaterDayCycle::onDeleteKey(), LLFloaterEditUI::refresh(), LLFloaterEditUI::refreshCore(), LLPanelObject::sendPosition(), LLPanelGroupVoting::impl::setEnableCreateProposal(), LLPanelGroupVoting::impl::setEnableVoteProposal(), LLPanelGroupGeneral::update(), and LLInventoryViewFinder::updateElementsFromFilter().
virtual void LLSpinCtrl::setMinValue | ( | LLSD | min_value | ) | [inline, virtual] |
Reimplemented from LLUICtrl.
Definition at line 75 of file llspinctrl.h.
References LLSD::asReal().
Referenced by LLPanelObject::getState(), and LLFloaterSettingsDebug::updateControl().
virtual void LLSpinCtrl::setMaxValue | ( | LLSD | max_value | ) | [inline, virtual] |
Reimplemented from LLUICtrl.
Definition at line 76 of file llspinctrl.h.
References LLSD::asReal().
Referenced by LLPanelObject::getState(), LLPanelGroupVoting::impl::setEnableCreateProposal(), and LLFloaterSettingsDebug::updateControl().
BOOL LLSpinCtrl::isMouseHeldDown | ( | ) | const |
Definition at line 363 of file llspinctrl.cpp.
References LLView::hasMouseCapture(), mDownBtn, and mUpBtn.
void LLSpinCtrl::setEnabled | ( | BOOL | b | ) | [virtual] |
Reimplemented from LLView.
Definition at line 349 of file llspinctrl.cpp.
References mEditor, LLLineEditor::setEnabled(), and LLView::setEnabled().
Referenced by LLPanelObject::getState(), LLPanelGroupGeneral::postBuild(), LLPanelLandMedia::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 343 of file llspinctrl.cpp.
References mEditor, LLLineEditor::setFocus(), and LLUICtrl::setFocus().
void LLSpinCtrl::clear | ( | void | ) | [virtual] |
Reimplemented from LLUICtrl.
Definition at line 265 of file llspinctrl.cpp.
References LLLineEditor::clear(), FALSE, mbHasBeenSet, mEditor, mMinValue, and setValue().
Referenced by LLPanelObject::getState().
virtual BOOL LLSpinCtrl::isDirty | ( | ) | const [inline, virtual] |
Reimplemented from LLUICtrl.
Definition at line 83 of file llspinctrl.h.
References mInitialValue, and mValue.
void LLSpinCtrl::setPrecision | ( | S32 | precision | ) | [virtual] |
Definition at line 378 of file llspinctrl.cpp.
References llendl, llerrs, mPrecision, and updateEditor().
Referenced by fromXML(), LLFloaterEditUI::LLFloaterEditUI(), LLPanelGroupGeneral::postBuild(), LLPanelFace::postBuild(), and LLFloaterSettingsDebug::updateControl().
virtual void LLSpinCtrl::setMinValue | ( | F32 | min | ) | [inline, virtual] |
virtual void LLSpinCtrl::setMaxValue | ( | F32 | max | ) | [inline, virtual] |
virtual void LLSpinCtrl::setIncrement | ( | F32 | inc | ) | [inline, virtual] |
Definition at line 88 of file llspinctrl.h.
References mIncrement.
Referenced by LLPanelObject::getState(), and LLFloaterSettingsDebug::updateControl().
virtual F32 LLSpinCtrl::getMinValue | ( | ) | [inline, virtual] |
virtual F32 LLSpinCtrl::getMaxValue | ( | ) | [inline, virtual] |
virtual F32 LLSpinCtrl::getIncrement | ( | ) | [inline, virtual] |
void LLSpinCtrl::setLabel | ( | const LLStringExplicit & | label | ) |
Definition at line 390 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 94 of file llspinctrl.h.
References mTextEnabledColor.
Referenced by LLPanelObject::draw().
void LLSpinCtrl::setDisabledLabelColor | ( | const LLColor4 & | c | ) | [inline] |
void LLSpinCtrl::onTabInto | ( | ) | [virtual] |
Reimplemented from LLUICtrl.
Definition at line 402 of file llspinctrl.cpp.
References mEditor, and LLLineEditor::onTabInto().
void LLSpinCtrl::setTentative | ( | BOOL | b | ) | [virtual] |
Reimplemented from LLUICtrl.
Definition at line 356 of file llspinctrl.cpp.
References mEditor, and LLUICtrl::setTentative().
Referenced by onCommit().
void LLSpinCtrl::onCommit | ( | ) | [virtual] |
Reimplemented from LLUICtrl.
Definition at line 370 of file llspinctrl.cpp.
References FALSE, mValue, LLUICtrl::onCommit(), LLView::setControlValue(), and setTentative().
void LLSpinCtrl::forceEditorCommit | ( | ) |
Definition at line 337 of file llspinctrl.cpp.
References mEditor, and onEditorCommit().
Reimplemented from LLView.
Definition at line 423 of file llspinctrl.cpp.
References onDownBtn(), onUpBtn(), and TRUE.
Reimplemented from LLView.
Definition at line 441 of file llspinctrl.cpp.
References FALSE, LLUICtrl::hasFocus(), KEY_DOWN, KEY_ESCAPE, KEY_UP, mEditor, onDownBtn(), onUpBtn(), LLLineEditor::setFocus(), TRUE, and updateEditor().
void LLSpinCtrl::draw | ( | void | ) | [virtual] |
Reimplemented from LLView.
Definition at line 413 of file llspinctrl.cpp.
References LLView::draw(), LLView::getEnabled(), mLabelBox, mTextDisabledColor, mTextEnabledColor, and LLTextBox::setColor().
void LLSpinCtrl::onEditorCommit | ( | LLUICtrl * | caller, | |
void * | userdata | |||
) | [static] |
Definition at line 291 of file llspinctrl.cpp.
References FALSE, llassert, mMinValue, LLLineEditor::postvalidateFloat(), TRUE, and LLLocale::USER_LOCALE.
Referenced by forceEditorCommit(), and LLSpinCtrl().
void LLSpinCtrl::onEditorGainFocus | ( | LLFocusableElement * | caller, | |
void * | userdata | |||
) | [static] |
Definition at line 229 of file llspinctrl.cpp.
References llassert.
Referenced by LLSpinCtrl().
static void LLSpinCtrl::onEditorChangeFocus | ( | LLUICtrl * | caller, | |
S32 | direction, | |||
void * | userdata | |||
) | [static] |
void LLSpinCtrl::onUpBtn | ( | void * | userdata | ) | [static] |
Definition at line 163 of file llspinctrl.cpp.
References clamp_precision(), and llmin().
Referenced by handleKeyHere(), handleScrollWheel(), and LLSpinCtrl().
void LLSpinCtrl::onDownBtn | ( | void * | userdata | ) | [static] |
Definition at line 196 of file llspinctrl.cpp.
References clamp_precision(), and llmax().
Referenced by handleKeyHere(), handleScrollWheel(), and LLSpinCtrl().
void LLSpinCtrl::updateEditor | ( | ) | [private] |
Definition at line 274 of file llspinctrl.cpp.
References clamp_precision(), indra::ipc::russ::format(), getValue(), llformat(), mEditor, mPrecision, LLLineEditor::setText(), and LLLocale::USER_LOCALE.
Referenced by forceSetValue(), handleKeyHere(), LLSpinCtrl(), setPrecision(), and setValue().
void LLSpinCtrl::reportInvalidData | ( | ) | [private] |
Definition at line 408 of file llspinctrl.cpp.
References make_ui_sound().
F32 LLSpinCtrl::mValue [private] |
Definition at line 120 of file llspinctrl.h.
Referenced by forceSetValue(), getValue(), isDirty(), onCommit(), and setValue().
F32 LLSpinCtrl::mInitialValue [private] |
F32 LLSpinCtrl::mMaxValue [private] |
Definition at line 122 of file llspinctrl.h.
Referenced by getMaxValue(), getXML(), and setMaxValue().
F32 LLSpinCtrl::mMinValue [private] |
Definition at line 123 of file llspinctrl.h.
Referenced by clear(), getMinValue(), getXML(), onEditorCommit(), and setMinValue().
F32 LLSpinCtrl::mIncrement [private] |
Definition at line 124 of file llspinctrl.h.
Referenced by getIncrement(), getXML(), and setIncrement().
S32 LLSpinCtrl::mPrecision [private] |
Definition at line 126 of file llspinctrl.h.
Referenced by getXML(), setPrecision(), and updateEditor().
class LLTextBox* LLSpinCtrl::mLabelBox [private] |
Definition at line 127 of file llspinctrl.h.
Referenced by draw(), getXML(), LLSpinCtrl(), and setLabel().
class LLLineEditor* LLSpinCtrl::mEditor [private] |
Definition at line 129 of file llspinctrl.h.
Referenced by clear(), forceEditorCommit(), handleKeyHere(), LLSpinCtrl(), onTabInto(), setEnabled(), setFocus(), setTentative(), setValue(), and updateEditor().
LLColor4 LLSpinCtrl::mTextEnabledColor [private] |
LLColor4 LLSpinCtrl::mTextDisabledColor [private] |
Definition at line 131 of file llspinctrl.h.
Referenced by draw(), getXML(), and setDisabledLabelColor().
class LLButton* LLSpinCtrl::mUpBtn [private] |
class LLButton* LLSpinCtrl::mDownBtn [private] |
BOOL LLSpinCtrl::mbHasBeenSet [private] |
Definition at line 136 of file llspinctrl.h.
Referenced by clear(), forceSetValue(), and setValue().