diff options
Diffstat (limited to 'linden/indra/llui/llbutton.h')
-rw-r--r-- | linden/indra/llui/llbutton.h | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/linden/indra/llui/llbutton.h b/linden/indra/llui/llbutton.h index 7d50f40..18f4e07 100644 --- a/linden/indra/llui/llbutton.h +++ b/linden/indra/llui/llbutton.h | |||
@@ -52,10 +52,14 @@ extern S32 LLBUTTON_V_PAD; | |||
52 | extern S32 BTN_HEIGHT_SMALL; | 52 | extern S32 BTN_HEIGHT_SMALL; |
53 | extern S32 BTN_HEIGHT; | 53 | extern S32 BTN_HEIGHT; |
54 | 54 | ||
55 | |||
56 | // All button widths should be rounded up to this size | 55 | // All button widths should be rounded up to this size |
57 | extern S32 BTN_GRID; | 56 | extern S32 BTN_GRID; |
58 | 57 | ||
58 | // | ||
59 | // Helpful functions | ||
60 | // | ||
61 | S32 round_up(S32 grid, S32 value); | ||
62 | |||
59 | 63 | ||
60 | class LLUICtrlFactory; | 64 | class LLUICtrlFactory; |
61 | 65 | ||
@@ -124,6 +128,7 @@ public: | |||
124 | BOOL getFlashing() const { return mFlashing; } | 128 | BOOL getFlashing() const { return mFlashing; } |
125 | 129 | ||
126 | void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } | 130 | void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } |
131 | LLFontGL::HAlign getHAlign() const { return mHAlign; } | ||
127 | void setLeftHPad( S32 pad ) { mLeftHPad = pad; } | 132 | void setLeftHPad( S32 pad ) { mLeftHPad = pad; } |
128 | void setRightHPad( S32 pad ) { mRightHPad = pad; } | 133 | void setRightHPad( S32 pad ) { mRightHPad = pad; } |
129 | 134 | ||
@@ -162,6 +167,7 @@ public: | |||
162 | void setFont(const LLFontGL *font) | 167 | void setFont(const LLFontGL *font) |
163 | { mGLFont = ( font ? font : LLFontGL::sSansSerif); } | 168 | { mGLFont = ( font ? font : LLFontGL::sSansSerif); } |
164 | void setScaleImage(BOOL scale) { mScaleImage = scale; } | 169 | void setScaleImage(BOOL scale) { mScaleImage = scale; } |
170 | BOOL getScaleImage() const { return mScaleImage; } | ||
165 | 171 | ||
166 | void setDropShadowedText(BOOL b) { mDropShadowedText = b; } | 172 | void setDropShadowedText(BOOL b) { mDropShadowedText = b; } |
167 | 173 | ||
@@ -171,9 +177,10 @@ public: | |||
171 | 177 | ||
172 | void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; } | 178 | void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; } |
173 | 179 | ||
174 | public: | ||
175 | void setImageUnselected(const LLString &image_name); | 180 | void setImageUnselected(const LLString &image_name); |
181 | const LLString& getImageUnselectedName() const { return mImageUnselectedName; } | ||
176 | void setImageSelected(const LLString &image_name); | 182 | void setImageSelected(const LLString &image_name); |
183 | const LLString& getImageSelectedName() const { return mImageSelectedName; } | ||
177 | void setImageHoverSelected(const LLString &image_name); | 184 | void setImageHoverSelected(const LLString &image_name); |
178 | void setImageHoverUnselected(const LLString &image_name); | 185 | void setImageHoverUnselected(const LLString &image_name); |
179 | void setImageDisabled(const LLString &image_name); | 186 | void setImageDisabled(const LLString &image_name); |
@@ -187,14 +194,29 @@ public: | |||
187 | void setImageDisabledSelected(LLPointer<LLUIImage> image); | 194 | void setImageDisabledSelected(LLPointer<LLUIImage> image); |
188 | 195 | ||
189 | void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } | 196 | void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } |
190 | BOOL getCommitOnReturn() { return mCommitOnReturn; } | 197 | BOOL getCommitOnReturn() const { return mCommitOnReturn; } |
198 | |||
199 | void setHelpURLCallback(const LLString &help_url); | ||
200 | const LLString& getHelpURL() const { return mHelpURL; } | ||
191 | 201 | ||
192 | void setHelpURLCallback(std::string help_url); | ||
193 | LLString getHelpURL() { return mHelpURL; } | ||
194 | protected: | 202 | protected: |
203 | |||
195 | virtual void drawBorder(const LLColor4& color, S32 size); | 204 | virtual void drawBorder(const LLColor4& color, S32 size); |
196 | 205 | ||
197 | protected: | 206 | void setImageUnselectedID(const LLUUID &image_id); |
207 | const LLUUID& getImageUnselectedID() const { return mImageUnselectedID; } | ||
208 | void setImageSelectedID(const LLUUID &image_id); | ||
209 | const LLUUID& getImageSelectedID() const { return mImageSelectedID; } | ||
210 | void setImageHoverSelectedID(const LLUUID &image_id); | ||
211 | void setImageHoverUnselectedID(const LLUUID &image_id); | ||
212 | void setImageDisabledID(const LLUUID &image_id); | ||
213 | void setImageDisabledSelectedID(const LLUUID &image_id); | ||
214 | const LLPointer<LLUIImage>& getImageUnselected() const { return mImageUnselected; } | ||
215 | const LLPointer<LLUIImage>& getImageSelected() const { return mImageSelected; } | ||
216 | |||
217 | LLFrameTimer mMouseDownTimer; | ||
218 | |||
219 | private: | ||
198 | 220 | ||
199 | void (*mClickedCallback)(void* data ); | 221 | void (*mClickedCallback)(void* data ); |
200 | void (*mMouseDownCallback)(void *data); | 222 | void (*mMouseDownCallback)(void *data); |
@@ -203,7 +225,6 @@ protected: | |||
203 | 225 | ||
204 | const LLFontGL *mGLFont; | 226 | const LLFontGL *mGLFont; |
205 | 227 | ||
206 | LLFrameTimer mMouseDownTimer; | ||
207 | S32 mMouseDownFrame; | 228 | S32 mMouseDownFrame; |
208 | F32 mHeldDownDelay; // seconds, after which held-down callbacks get called | 229 | F32 mHeldDownDelay; // seconds, after which held-down callbacks get called |
209 | S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called | 230 | S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called |
@@ -232,7 +253,6 @@ protected: | |||
232 | LLUIString mDisabledSelectedLabel; | 253 | LLUIString mDisabledSelectedLabel; |
233 | LLColor4 mDisabledSelectedLabelColor; | 254 | LLColor4 mDisabledSelectedLabelColor; |
234 | 255 | ||
235 | |||
236 | LLUUID mImageUnselectedID; | 256 | LLUUID mImageUnselectedID; |
237 | LLUUID mImageSelectedID; | 257 | LLUUID mImageSelectedID; |
238 | LLUUID mImageHoverSelectedID; | 258 | LLUUID mImageHoverSelectedID; |
@@ -280,7 +300,4 @@ protected: | |||
280 | LLFrameTimer mFlashingTimer; | 300 | LLFrameTimer mFlashingTimer; |
281 | }; | 301 | }; |
282 | 302 | ||
283 | // Helpful functions | ||
284 | S32 round_up(S32 grid, S32 value); | ||
285 | |||
286 | #endif // LL_LLBUTTON_H | 303 | #endif // LL_LLBUTTON_H |