aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llspinctrl.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llui/llspinctrl.h
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-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 '')
-rw-r--r--linden/indra/llui/llspinctrl.h37
1 files changed, 14 insertions, 23 deletions
diff --git a/linden/indra/llui/llspinctrl.h b/linden/indra/llui/llspinctrl.h
index c5a36f5..f1f971e 100644
--- a/linden/indra/llui/llspinctrl.h
+++ b/linden/indra/llui/llspinctrl.h
@@ -1,6 +1,6 @@
1/** 1/**
2 * @file llspinctrl.h 2 * @file llspinctrl.h
3 * @brief LLSpinCtrl base class 3 * @brief Typical spinner with "up" and "down" arrow buttons.
4 * 4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$ 5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 * 6 *
@@ -47,15 +47,6 @@ const S32 SPINCTRL_SPACING = 2; // space between label right and button
47const S32 SPINCTRL_HEIGHT = 2 * SPINCTRL_BTN_HEIGHT; 47const S32 SPINCTRL_HEIGHT = 2 * SPINCTRL_BTN_HEIGHT;
48const S32 SPINCTRL_DEFAULT_LABEL_WIDTH = 10; 48const S32 SPINCTRL_DEFAULT_LABEL_WIDTH = 10;
49 49
50//
51// Classes
52//
53class LLFontGL;
54class LLButton;
55class LLTextBox;
56class LLLineEditor;
57class LLUICtrlFactory;
58
59 50
60class LLSpinCtrl 51class LLSpinCtrl
61: public LLUICtrl 52: public LLUICtrl
@@ -70,31 +61,33 @@ public:
70 const LLString& control_name = LLString(), 61 const LLString& control_name = LLString(),
71 S32 label_width = SPINCTRL_DEFAULT_LABEL_WIDTH ); 62 S32 label_width = SPINCTRL_DEFAULT_LABEL_WIDTH );
72 63
73 virtual ~LLSpinCtrl(); 64 virtual ~LLSpinCtrl() {} // Children all cleaned up by default view destructor.
74 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SPINNER; } 65 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SPINNER; }
75 virtual LLString getWidgetTag() const { return LL_SPIN_CTRL_TAG; } 66 virtual LLString getWidgetTag() const { return LL_SPIN_CTRL_TAG; }
76 virtual LLXMLNodePtr getXML(bool save_children = true) const; 67 virtual LLXMLNodePtr getXML(bool save_children = true) const;
77 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); 68 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory);
78 69
79 virtual void setValue(const LLSD& value ); 70 virtual void setValue(const LLSD& value );
80 virtual LLSD getValue() const; 71 virtual LLSD getValue() const { return mValue; }
81 F32 get() { return (F32)getValue().asReal(); } 72 F32 get() const { return (F32)getValue().asReal(); }
82 void set(F32 value) { setValue(value); mInitialValue = value; } 73 void set(F32 value) { setValue(value); mInitialValue = value; }
83 74
84 virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); } 75 virtual void setMinValue(LLSD min_value) { setMinValue((F32)min_value.asReal()); }
85 virtual void setMaxValue(LLSD max_value) { setMaxValue((F32)max_value.asReal()); } 76 virtual void setMaxValue(LLSD max_value) { setMaxValue((F32)max_value.asReal()); }
86 77
87 BOOL isMouseHeldDown(); 78 BOOL isMouseHeldDown() const;
88 79
89 virtual void setEnabled( BOOL b ); 80 virtual void setEnabled( BOOL b );
90 virtual void setFocus( BOOL b ); 81 virtual void setFocus( BOOL b );
91 virtual void clear(); 82 virtual void clear();
92 virtual BOOL isDirty() const; 83 virtual BOOL isDirty() const { return( mValue != mInitialValue ); }
93 84
94 virtual void setPrecision(S32 precision); 85 virtual void setPrecision(S32 precision);
95 virtual void setMinValue(F32 min) { mMinValue = min; } 86 virtual void setMinValue(F32 min) { mMinValue = min; }
96 virtual void setMaxValue(F32 max) { mMaxValue = max; } 87 virtual void setMaxValue(F32 max) { mMaxValue = max; }
97 virtual void setIncrement(F32 inc) { mIncrement = inc; } 88 virtual void setIncrement(F32 inc) { mIncrement = inc; }
89 virtual F32 getMinValue() { return mMinValue ; }
90 virtual F32 getMaxValue() { return mMaxValue ; }
98 91
99 void setLabel(const LLStringExplicit& label); 92 void setLabel(const LLStringExplicit& label);
100 void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } 93 void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; }
@@ -119,12 +112,10 @@ public:
119 static void onUpBtn(void *userdata); 112 static void onUpBtn(void *userdata);
120 static void onDownBtn(void *userdata); 113 static void onDownBtn(void *userdata);
121 114
122protected: 115private:
123 void updateEditor(); 116 void updateEditor();
124 void reportInvalidData(); 117 void reportInvalidData();
125 118
126protected:
127
128 F32 mValue; 119 F32 mValue;
129 F32 mInitialValue; 120 F32 mInitialValue;
130 F32 mMaxValue; 121 F32 mMaxValue;
@@ -132,14 +123,14 @@ protected:
132 F32 mIncrement; 123 F32 mIncrement;
133 124
134 S32 mPrecision; 125 S32 mPrecision;
135 LLTextBox* mLabelBox; 126 class LLTextBox* mLabelBox;
136 127
137 LLLineEditor* mEditor; 128 class LLLineEditor* mEditor;
138 LLColor4 mTextEnabledColor; 129 LLColor4 mTextEnabledColor;
139 LLColor4 mTextDisabledColor; 130 LLColor4 mTextDisabledColor;
140 131
141 LLButton* mUpBtn; 132 class LLButton* mUpBtn;
142 LLButton* mDownBtn; 133 class LLButton* mDownBtn;
143 134
144 BOOL mbHasBeenSet; 135 BOOL mbHasBeenSet;
145}; 136};