aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llbutton.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:27 -0500
committerJacek Antonelli2008-08-15 23:45:27 -0500
commita8a62201ba762e98dff92cf49033e577fc34d8d4 (patch)
tree11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/llui/llbutton.h
parentSecond Life viewer sources 1.18.6.4-RC (diff)
downloadmeta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz
Second Life viewer sources 1.19.0.0
Diffstat (limited to 'linden/indra/llui/llbutton.h')
-rw-r--r--linden/indra/llui/llbutton.h72
1 files changed, 28 insertions, 44 deletions
diff --git a/linden/indra/llui/llbutton.h b/linden/indra/llui/llbutton.h
index 6a2b4a1..7d50f40 100644
--- a/linden/indra/llui/llbutton.h
+++ b/linden/indra/llui/llbutton.h
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -114,11 +114,13 @@ public:
114 114
115 F32 getHeldDownTime() const { return mMouseDownTimer.getElapsedTimeF32(); } 115 F32 getHeldDownTime() const { return mMouseDownTimer.getElapsedTimeF32(); }
116 116
117 BOOL toggleState() { setToggleState( !mToggleState ); return mToggleState; } 117 BOOL getIsToggle() const { return mIsToggle; }
118 void setIsToggle(BOOL is_toggle) { mIsToggle = is_toggle; }
119 BOOL toggleState();
118 BOOL getToggleState() const { return mToggleState; } 120 BOOL getToggleState() const { return mToggleState; }
119 void setToggleState(BOOL b); 121 void setToggleState(BOOL b);
120 122
121 void setFlashing( BOOL b ) { mFlashing = b; } 123 void setFlashing( BOOL b );
122 BOOL getFlashing() const { return mFlashing; } 124 BOOL getFlashing() const { return mFlashing; }
123 125
124 void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } 126 void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; }
@@ -128,14 +130,11 @@ public:
128 const LLString getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); } 130 const LLString getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); }
129 const LLString getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); } 131 const LLString getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); }
130 132
131
132 // HACK to allow images to be freed when the caller knows he's done with it.
133 LLImageGL* getImageUnselected() const { return mImageUnselected; }
134
135 void setImageColor(const LLString& color_control); 133 void setImageColor(const LLString& color_control);
136 void setImages(const LLString &image_name, const LLString &selected_name);
137 void setImageColor(const LLColor4& c); 134 void setImageColor(const LLColor4& c);
138 135 virtual void setColor(const LLColor4& c);
136
137 void setImages(const LLString &image_name, const LLString &selected_name);
139 void setDisabledImages(const LLString &image_name, const LLString &selected_name); 138 void setDisabledImages(const LLString &image_name, const LLString &selected_name);
140 void setDisabledImages(const LLString &image_name, const LLString &selected_name, const LLColor4& c); 139 void setDisabledImages(const LLString &image_name, const LLString &selected_name, const LLColor4& c);
141 140
@@ -146,7 +145,7 @@ public:
146 void setDisabledSelectedLabelColor( const LLColor4& c ) { mDisabledSelectedLabelColor = c; } 145 void setDisabledSelectedLabelColor( const LLColor4& c ) { mDisabledSelectedLabelColor = c; }
147 146
148 void setImageOverlay(const LLString &image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white); 147 void setImageOverlay(const LLString &image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white);
149 LLPointer<LLImageGL> getImageOverlay() { return mImageOverlay; } 148 LLPointer<LLUIImage> getImageOverlay() { return mImageOverlay; }
150 149
151 150
152 virtual void setValue(const LLSD& value ); 151 virtual void setValue(const LLSD& value );
@@ -170,16 +169,8 @@ public:
170 169
171 static void onHeldDown(void *userdata); // to be called by gIdleCallbacks 170 static void onHeldDown(void *userdata); // to be called by gIdleCallbacks
172 171
173 void setFixedBorder(S32 width, S32 height) { mFixedWidth = width; mFixedHeight = height; }
174 void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; } 172 void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; }
175 173
176private:
177 void setImageUnselectedID(const LLUUID &image_id);
178 void setImageSelectedID(const LLUUID &image_id);
179 void setImageHoverSelectedID(const LLUUID &image_id);
180 void setImageHoverUnselectedID(const LLUUID &image_id);
181 void setImageDisabledID(const LLUUID &image_id);
182 void setImageDisabledSelectedID(const LLUUID &image_id);
183public: 174public:
184 void setImageUnselected(const LLString &image_name); 175 void setImageUnselected(const LLString &image_name);
185 void setImageSelected(const LLString &image_name); 176 void setImageSelected(const LLString &image_name);
@@ -187,6 +178,14 @@ public:
187 void setImageHoverUnselected(const LLString &image_name); 178 void setImageHoverUnselected(const LLString &image_name);
188 void setImageDisabled(const LLString &image_name); 179 void setImageDisabled(const LLString &image_name);
189 void setImageDisabledSelected(const LLString &image_name); 180 void setImageDisabledSelected(const LLString &image_name);
181
182 void setImageUnselected(LLPointer<LLUIImage> image);
183 void setImageSelected(LLPointer<LLUIImage> image);
184 void setImageHoverSelected(LLPointer<LLUIImage> image);
185 void setImageHoverUnselected(LLPointer<LLUIImage> image);
186 void setImageDisabled(LLPointer<LLUIImage> image);
187 void setImageDisabledSelected(LLPointer<LLUIImage> image);
188
190 void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } 189 void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; }
191 BOOL getCommitOnReturn() { return mCommitOnReturn; } 190 BOOL getCommitOnReturn() { return mCommitOnReturn; }
192 191
@@ -209,27 +208,27 @@ protected:
209 F32 mHeldDownDelay; // seconds, after which held-down callbacks get called 208 F32 mHeldDownDelay; // seconds, after which held-down callbacks get called
210 S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called 209 S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called
211 210
212 LLPointer<LLImageGL> mImageOverlay; 211 LLPointer<LLUIImage> mImageOverlay;
213 LLFontGL::HAlign mImageOverlayAlignment; 212 LLFontGL::HAlign mImageOverlayAlignment;
214 LLColor4 mImageOverlayColor; 213 LLColor4 mImageOverlayColor;
215 214
216 LLPointer<LLImageGL> mImageUnselected; 215 LLPointer<LLUIImage> mImageUnselected;
217 LLUIString mUnselectedLabel; 216 LLUIString mUnselectedLabel;
218 LLColor4 mUnselectedLabelColor; 217 LLColor4 mUnselectedLabelColor;
219 218
220 LLPointer<LLImageGL> mImageSelected; 219 LLPointer<LLUIImage> mImageSelected;
221 LLUIString mSelectedLabel; 220 LLUIString mSelectedLabel;
222 LLColor4 mSelectedLabelColor; 221 LLColor4 mSelectedLabelColor;
223 222
224 LLPointer<LLImageGL> mImageHoverSelected; 223 LLPointer<LLUIImage> mImageHoverSelected;
225 224
226 LLPointer<LLImageGL> mImageHoverUnselected; 225 LLPointer<LLUIImage> mImageHoverUnselected;
227 226
228 LLPointer<LLImageGL> mImageDisabled; 227 LLPointer<LLUIImage> mImageDisabled;
229 LLUIString mDisabledLabel; 228 LLUIString mDisabledLabel;
230 LLColor4 mDisabledLabelColor; 229 LLColor4 mDisabledLabelColor;
231 230
232 LLPointer<LLImageGL> mImageDisabledSelected; 231 LLPointer<LLUIImage> mImageDisabledSelected;
233 LLUIString mDisabledSelectedLabel; 232 LLUIString mDisabledSelectedLabel;
234 LLColor4 mDisabledSelectedLabelColor; 233 LLColor4 mDisabledSelectedLabelColor;
235 234
@@ -254,6 +253,7 @@ protected:
254 LLColor4 mImageColor; 253 LLColor4 mImageColor;
255 LLColor4 mDisabledImageColor; 254 LLColor4 mDisabledImageColor;
256 255
256 BOOL mIsToggle;
257 BOOL mToggleState; 257 BOOL mToggleState;
258 BOOL mScaleImage; 258 BOOL mScaleImage;
259 259
@@ -267,9 +267,6 @@ protected:
267 S32 mLeftHPad; 267 S32 mLeftHPad;
268 S32 mRightHPad; 268 S32 mRightHPad;
269 269
270 S32 mFixedWidth;
271 S32 mFixedHeight;
272
273 F32 mHoverGlowStrength; 270 F32 mHoverGlowStrength;
274 F32 mCurGlowStrength; 271 F32 mCurGlowStrength;
275 272
@@ -278,22 +275,9 @@ protected:
278 275
279 LLString mHelpURL; 276 LLString mHelpURL;
280 277
281 LLPointer<LLImageGL> mImagep; 278 LLPointer<LLUIImage> mImagep;
282
283 static LLFrameTimer sFlashingTimer;
284};
285 279
286class LLSquareButton 280 LLFrameTimer mFlashingTimer;
287: public LLButton
288{
289public:
290 LLSquareButton(const LLString& name, const LLRect& rect,
291 const LLString& label,
292 const LLFontGL *font = NULL,
293 const LLString& control_name = LLString(),
294 void (*click_callback)(void*) = NULL,
295 void *callback_data = NULL,
296 const LLString& selected_label = LLString::null );
297}; 281};
298 282
299// Helpful functions 283// Helpful functions