aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llmenugl.h
diff options
context:
space:
mode:
authorMcCabe Maxsted2011-04-11 20:11:26 -0700
committerMcCabe Maxsted2011-04-11 20:28:01 -0700
commit84ba6c134cd7f75e8f3be86b444c9e7f57660c18 (patch)
tree45b96492d1b93ae17a94e0bca7f44d3c2d3f0c31 /linden/indra/llui/llmenugl.h
parentFixed #599: 'Account History'/'Manage My Account' use SL-specific URLs (since... (diff)
downloadmeta-impy-84ba6c134cd7f75e8f3be86b444c9e7f57660c18.zip
meta-impy-84ba6c134cd7f75e8f3be86b444c9e7f57660c18.tar.gz
meta-impy-84ba6c134cd7f75e8f3be86b444c9e7f57660c18.tar.bz2
meta-impy-84ba6c134cd7f75e8f3be86b444c9e7f57660c18.tar.xz
Applied customizableTranslationMenu.patch by Grandma Bates for #533: Right Click menus are transparent on the login screen and #534: Right click menus aren't translatable
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/llmenugl.h114
1 files changed, 112 insertions, 2 deletions
diff --git a/linden/indra/llui/llmenugl.h b/linden/indra/llui/llmenugl.h
index 63f9d55..9a9d1b0 100644
--- a/linden/indra/llui/llmenugl.h
+++ b/linden/indra/llui/llmenugl.h
@@ -70,6 +70,57 @@ typedef BOOL (*check_callback)(void*);
70// contents. Put the contents of the label in the provided parameter. 70// contents. Put the contents of the label in the provided parameter.
71typedef void (*label_callback)(std::string&,void*); 71typedef void (*label_callback)(std::string&,void*);
72 72
73
74
75//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76// Class LLCallbackInformation
77//
78// The LLCallbackInformation class is used to keep track of callback
79// information for menus that might be requested at a future time.
80//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81
82class LLCallbackInformation
83{
84
85public :
86
87 // Constants used for keeping track of what type of callback is required.
88 static const U8 LL_MENU_ITEM_CALL_GL_NONE = 0;
89 static const U8 LL_MENU_ITEM_CALL_GL_ON_CLICK = 1;
90 static const U8 LL_MENU_ITEM_CALL_GL_ON_ENABLE = 2;
91 static const U8 LL_MENU_ITEM_CALL_GL_TRANSLATE = 3;
92
93
94 LLCallbackInformation(U8 theType=LLCallbackInformation::LL_MENU_ITEM_CALL_GL_NONE,
95 const std::string& theName = LLStringUtil::null,
96 const std::string& userData = LLStringUtil::null);
97 ~LLCallbackInformation() {};
98
99 void setTypeOfCallback(U8 theType) {typeOfCallback = theType; }
100 void setCallbackName(const std::string& name) {callbackName = name; }
101 void setCallbackUserData(const std::string& userdata) {callbackUserData = userdata; }
102
103 U8 getTypeOfCallback() {return(typeOfCallback); }
104 const std::string& getCallbackName() {return(callbackName); }
105 const std::string& getCallbackUserData() {return(callbackUserData); }
106
107 BOOL isTypeMatch(U8 type) { return(type == typeOfCallback);}
108 BOOL isNameMatch(const std::string& name) { return(name == callbackName);}
109
110protected:
111
112private:
113
114 U8 typeOfCallback;
115 std::string callbackName;
116 std::string callbackUserData;
117
118};
119
120
121
122
123
73//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 124//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74// Class LLMenuItemGL 125// Class LLMenuItemGL
75// 126//
@@ -79,6 +130,7 @@ typedef void (*label_callback)(std::string&,void*);
79class LLMenuItemGL : public LLView 130class LLMenuItemGL : public LLView
80{ 131{
81public: 132public:
133
82 // static functions to control the global color scheme. 134 // static functions to control the global color scheme.
83 static void setEnabledColor( const LLColor4& color ) { sEnabledColor = color; } 135 static void setEnabledColor( const LLColor4& color ) { sEnabledColor = color; }
84 static const LLColor4& getEnabledColor() { return sEnabledColor; } 136 static const LLColor4& getEnabledColor() { return sEnabledColor; }
@@ -90,7 +142,7 @@ public:
90 static const LLColor4& getHighlightFGColor() { return sHighlightForeground; } 142 static const LLColor4& getHighlightFGColor() { return sHighlightForeground; }
91 143
92 LLMenuItemGL( const std::string& name, const std::string& label, KEY key = KEY_NONE, MASK = MASK_NONE ); 144 LLMenuItemGL( const std::string& name, const std::string& label, KEY key = KEY_NONE, MASK = MASK_NONE );
93 virtual ~LLMenuItemGL() {}; 145 virtual ~LLMenuItemGL();
94 146
95 virtual void setValue(const LLSD& value) { setLabel(value.asString()); } 147 virtual void setValue(const LLSD& value) { setLabel(value.asString()); }
96 148
@@ -174,6 +226,14 @@ public:
174 void setDrawTextDisabled(BOOL disabled) { mDrawTextDisabled = disabled; } 226 void setDrawTextDisabled(BOOL disabled) { mDrawTextDisabled = disabled; }
175 BOOL getDrawTextDisabled() const { return mDrawTextDisabled; } 227 BOOL getDrawTextDisabled() const { return mDrawTextDisabled; }
176 228
229 // functionality for adding callbacks after the menu is constucted
230 void addCallbackType(U8 theType,const std::string& name,const std::string& userdata);
231
232 virtual BOOL setCtrlResponse(U8 llMenuItemCallType,
233 const std::string& name,
234 void* user_data,
235 void *callback_fcn) = 0;
236
177protected: 237protected:
178 void setHover(BOOL hover) { mGotHover = hover; } 238 void setHover(BOOL hover) { mGotHover = hover; }
179 239
@@ -194,6 +254,11 @@ protected:
194 LLUIString mDrawBranchLabel; 254 LLUIString mDrawBranchLabel;
195 255
196 BOOL mHighlight; 256 BOOL mHighlight;
257
258 // variables used for tracking callback types that will be
259 // requested after the widget is in place.
260 std::vector<LLCallbackInformation*> mFutureCallbackRequests;
261
197private: 262private:
198 static LLColor4 sEnabledColor; 263 static LLColor4 sEnabledColor;
199 static LLColor4 sDisabledColor; 264 static LLColor4 sDisabledColor;
@@ -214,6 +279,7 @@ private:
214 BOOL mDrawTextDisabled; 279 BOOL mDrawTextDisabled;
215 280
216 KEY mJumpKey; 281 KEY mJumpKey;
282
217}; 283};
218 284
219 285
@@ -262,6 +328,7 @@ public:
262 KEY key = KEY_NONE, MASK mask = MASK_NONE, 328 KEY key = KEY_NONE, MASK mask = MASK_NONE,
263 BOOL enabled = TRUE, 329 BOOL enabled = TRUE,
264 on_disabled_callback on_disabled_c = NULL); 330 on_disabled_callback on_disabled_c = NULL);
331
265 virtual LLXMLNodePtr getXML(bool save_children = true) const; 332 virtual LLXMLNodePtr getXML(bool save_children = true) const;
266 333
267 virtual std::string getType() const { return "call"; } 334 virtual std::string getType() const { return "call"; }
@@ -288,6 +355,13 @@ public:
288 355
289 //virtual void draw(); 356 //virtual void draw();
290 357
358 // Functionality for tracking callback types for setting after widget is in place.
359 virtual BOOL setCtrlResponse(U8 llMenuItemCallType,
360 const std::string& name,
361 void* user_data,
362 void *callback_fcn);
363
364
291 365
292private: 366private:
293 menu_callback mCallback; 367 menu_callback mCallback;
@@ -382,6 +456,12 @@ public:
382 // LLView Functionality 456 // LLView Functionality
383 //virtual void draw( void ); 457 //virtual void draw( void );
384 458
459 virtual BOOL setCtrlResponse(U8 llMenuItemCallType,
460 const std::string& name,
461 void* user_data,
462 void *callback_fcn) { return FALSE; } ;
463
464
385private: 465private:
386 BOOL* mToggle; 466 BOOL* mToggle;
387}; 467};
@@ -434,8 +514,10 @@ public:
434 514
435 // background colors 515 // background colors
436 static void setDefaultBackgroundColor( const LLColor4& color ) { sDefaultBackgroundColor = color; } 516 static void setDefaultBackgroundColor( const LLColor4& color ) { sDefaultBackgroundColor = color; }
437 void setBackgroundColor( const LLColor4& color ) { mBackgroundColor = color; } 517 void setBackgroundColor( const LLColor4& color );
518 void setBorderColor( const LLColor4& color );
438 const LLColor4& getBackgroundColor() const { return mBackgroundColor; } 519 const LLColor4& getBackgroundColor() const { return mBackgroundColor; }
520 const LLColor4& getBorderColor() const { return mBorderColor; }
439 void setBackgroundVisible( BOOL b ) { mBgVisible = b; } 521 void setBackgroundVisible( BOOL b ) { mBgVisible = b; }
440 void setCanTearOff(BOOL tear_off, LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>()); 522 void setCanTearOff(BOOL tear_off, LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>());
441 523
@@ -525,6 +607,8 @@ public:
525 static BOOL getKeyboardMode() { return sKeyboardMode; } 607 static BOOL getKeyboardMode() { return sKeyboardMode; }
526 608
527 static class LLMenuHolderGL* sMenuContainer; 609 static class LLMenuHolderGL* sMenuContainer;
610
611 BOOL setCtrlResponse(U8 llMenuItemCallType,const std::string& name,void* user_data,void *callback_fcn);
528 612
529protected: 613protected:
530 void createSpilloverBranch(); 614 void createSpilloverBranch();
@@ -547,6 +631,7 @@ private:
547 static BOOL sKeyboardMode; 631 static BOOL sKeyboardMode;
548 632
549 LLColor4 mBackgroundColor; 633 LLColor4 mBackgroundColor;
634 LLColor4 mBorderColor;
550 BOOL mBgVisible; 635 BOOL mBgVisible;
551 LLMenuItemGL* mParentMenuItem; 636 LLMenuItemGL* mParentMenuItem;
552 LLUIString mLabel; 637 LLUIString mLabel;
@@ -623,6 +708,12 @@ public:
623 708
624 virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; 709 virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const;
625 710
711 virtual BOOL setCtrlResponse(U8 llMenuItemCallType,
712 const std::string& name,
713 void* user_data,
714 void *callback_fcn);
715
716
626private: 717private:
627 LLHandle<LLView> mBranch; 718 LLHandle<LLView> mBranch;
628}; // end class LLMenuItemBranchGL 719}; // end class LLMenuItemBranchGL
@@ -668,6 +759,12 @@ public:
668 void show(S32 x, S32 y, BOOL mouse_down); 759 void show(S32 x, S32 y, BOOL mouse_down);
669 void hide(BOOL item_selected); 760 void hide(BOOL item_selected);
670 761
762 virtual BOOL setCtrlResponse(U8 llMenuItemCallType,
763 const std::string& name,
764 void* user_data,
765 void *callback_fcn) { return FALSE; } ;
766
767
671private: 768private:
672 LLMenuItemGL *pieItemFromXY(S32 x, S32 y); 769 LLMenuItemGL *pieItemFromXY(S32 x, S32 y);
673 S32 pieItemIndexFromXY(S32 x, S32 y); 770 S32 pieItemIndexFromXY(S32 x, S32 y);
@@ -729,6 +826,12 @@ public:
729 826
730 void resetMenuTrigger() { mAltKeyTrigger = FALSE; } 827 void resetMenuTrigger() { mAltKeyTrigger = FALSE; }
731 828
829 virtual BOOL setCtrlResponse(U8 llMenuItemCallType,
830 const std::string& name,
831 void* user_data,
832 void *callback_fcn) { return FALSE; } ;
833
834
732private: 835private:
733 void checkMenuTrigger(); 836 void checkMenuTrigger();
734 837
@@ -814,6 +917,12 @@ public:
814 virtual void draw(void); 917 virtual void draw(void);
815 virtual U32 getNominalHeight() const; 918 virtual U32 getNominalHeight() const;
816 919
920 virtual BOOL setCtrlResponse(U8 llMenuItemCallType,
921 const std::string& name,
922 void* user_data,
923 void *callback_fcn) { return FALSE; } ;
924
925
817private: 926private:
818 LLHandle<LLFloater> mParentHandle; 927 LLHandle<LLFloater> mParentHandle;
819}; 928};
@@ -832,4 +941,5 @@ private:
832 LLEditMenuHandlerMgr() {}; 941 LLEditMenuHandlerMgr() {};
833}; 942};
834 943
944
835#endif // LL_LLMENUGL_H 945#endif // LL_LLMENUGL_H