aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llbutton.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/llbutton.h')
-rw-r--r--linden/indra/llui/llbutton.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/linden/indra/llui/llbutton.h b/linden/indra/llui/llbutton.h
index fe906a6..44e8776 100644
--- a/linden/indra/llui/llbutton.h
+++ b/linden/indra/llui/llbutton.h
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 * 6 *
7 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement 10 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -94,6 +95,8 @@ public:
94 virtual BOOL handleHover(S32 x, S32 y, MASK mask); 95 virtual BOOL handleHover(S32 x, S32 y, MASK mask);
95 virtual void draw(); 96 virtual void draw();
96 97
98 virtual void onMouseCaptureLost();
99
97 // HACK: "committing" a button is the same as clicking on it. 100 // HACK: "committing" a button is the same as clicking on it.
98 virtual void onCommit(); 101 virtual void onCommit();
99 102
@@ -104,7 +107,7 @@ public:
104 void setMouseDownCallback( void (*cb)(void *data) ) { mMouseDownCallback = cb; } // mouse down within button 107 void setMouseDownCallback( void (*cb)(void *data) ) { mMouseDownCallback = cb; } // mouse down within button
105 void setMouseUpCallback( void (*cb)(void *data) ) { mMouseUpCallback = cb; } // mouse up, EVEN IF NOT IN BUTTON 108 void setMouseUpCallback( void (*cb)(void *data) ) { mMouseUpCallback = cb; } // mouse up, EVEN IF NOT IN BUTTON
106 void setHeldDownCallback( void (*cb)(void *data) ) { mHeldDownCallback = cb; } // Mouse button held down and in button 109 void setHeldDownCallback( void (*cb)(void *data) ) { mHeldDownCallback = cb; } // Mouse button held down and in button
107 void setHeldDownDelay( F32 seconds) { mHeldDownDelay = seconds; } 110 void setHeldDownDelay( F32 seconds, S32 frames = 0) { mHeldDownDelay = seconds; mHeldDownFrameDelay = frames; }
108 111
109 F32 getHeldDownTime() const { return mMouseDownTimer.getElapsedTimeF32(); } 112 F32 getHeldDownTime() const { return mMouseDownTimer.getElapsedTimeF32(); }
110 113
@@ -159,7 +162,6 @@ public:
159 void setBorderEnabled(BOOL b) { mBorderEnabled = b; } 162 void setBorderEnabled(BOOL b) { mBorderEnabled = b; }
160 163
161 static void onHeldDown(void *userdata); // to be called by gIdleCallbacks 164 static void onHeldDown(void *userdata); // to be called by gIdleCallbacks
162 static void onMouseCaptureLost(LLMouseHandler* old_captor);
163 165
164 void setFixedBorder(S32 width, S32 height) { mFixedWidth = width; mFixedHeight = height; } 166 void setFixedBorder(S32 width, S32 height) { mFixedWidth = width; mFixedHeight = height; }
165 void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; } 167 void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; }
@@ -181,6 +183,8 @@ public:
181 void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } 183 void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; }
182 BOOL getCommitOnReturn() { return mCommitOnReturn; } 184 BOOL getCommitOnReturn() { return mCommitOnReturn; }
183 185
186 void setHelpURLCallback(std::string help_url);
187 LLString getHelpURL() { return mHelpURL; }
184protected: 188protected:
185 virtual void drawBorder(const LLColor4& color, S32 size); 189 virtual void drawBorder(const LLColor4& color, S32 size);
186 190
@@ -194,7 +198,9 @@ protected:
194 const LLFontGL *mGLFont; 198 const LLFontGL *mGLFont;
195 199
196 LLFrameTimer mMouseDownTimer; 200 LLFrameTimer mMouseDownTimer;
201 S32 mMouseDownFrame;
197 F32 mHeldDownDelay; // seconds, after which held-down callbacks get called 202 F32 mHeldDownDelay; // seconds, after which held-down callbacks get called
203 S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called
198 204
199 LLPointer<LLImageGL> mImageUnselected; 205 LLPointer<LLImageGL> mImageUnselected;
200 LLUIString mUnselectedLabel; 206 LLUIString mUnselectedLabel;
@@ -259,6 +265,8 @@ protected:
259 BOOL mNeedsHighlight; 265 BOOL mNeedsHighlight;
260 BOOL mCommitOnReturn; 266 BOOL mCommitOnReturn;
261 267
268 LLString mHelpURL;
269
262 LLPointer<LLImageGL> mImagep; 270 LLPointer<LLImageGL> mImagep;
263 271
264 static LLFrameTimer sFlashingTimer; 272 static LLFrameTimer sFlashingTimer;