aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llmenugl.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/llmenugl.h')
-rw-r--r--linden/indra/llui/llmenugl.h90
1 files changed, 46 insertions, 44 deletions
diff --git a/linden/indra/llui/llmenugl.h b/linden/indra/llui/llmenugl.h
index e7b009a..8561f1b 100644
--- a/linden/indra/llui/llmenugl.h
+++ b/linden/indra/llui/llmenugl.h
@@ -67,7 +67,7 @@ typedef BOOL (*check_callback)(void*);
67// This callback is potentially used by LLMenuItemCallGL. If provided, 67// This callback is potentially used by LLMenuItemCallGL. If provided,
68// this function is called whenever it's time to determine the label's 68// this function is called whenever it's time to determine the label's
69// contents. Put the contents of the label in the provided parameter. 69// contents. Put the contents of the label in the provided parameter.
70typedef void (*label_callback)(LLString&,void*); 70typedef void (*label_callback)(std::string&,void*);
71 71
72//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73// Class LLMenuItemGL 73// Class LLMenuItemGL
@@ -88,13 +88,13 @@ public:
88 static void setHighlightFGColor( const LLColor4& color ) { sHighlightForeground = color; } 88 static void setHighlightFGColor( const LLColor4& color ) { sHighlightForeground = color; }
89 static const LLColor4& getHighlightFGColor() { return sHighlightForeground; } 89 static const LLColor4& getHighlightFGColor() { return sHighlightForeground; }
90 90
91 LLMenuItemGL( const LLString& name, const LLString& label, KEY key = KEY_NONE, MASK = MASK_NONE ); 91 LLMenuItemGL( const std::string& name, const std::string& label, KEY key = KEY_NONE, MASK = MASK_NONE );
92 92
93 virtual void setValue(const LLSD& value) { setLabel(value.asString()); } 93 virtual void setValue(const LLSD& value) { setLabel(value.asString()); }
94 94
95 virtual LLXMLNodePtr getXML(bool save_children = true) const; 95 virtual LLXMLNodePtr getXML(bool save_children = true) const;
96 96
97 virtual LLString getType() const { return "item"; } 97 virtual std::string getType() const { return "item"; }
98 98
99 virtual BOOL handleHover(S32 x, S32 y, MASK mask); 99 virtual BOOL handleHover(S32 x, S32 y, MASK mask);
100 100
@@ -122,8 +122,8 @@ public:
122 122
123 // change the label 123 // change the label
124 void setLabel( const LLStringExplicit& label ) { mLabel = label; } 124 void setLabel( const LLStringExplicit& label ) { mLabel = label; }
125 LLString getLabel( void ) const { return mLabel.getString(); } 125 std::string getLabel( void ) const { return mLabel.getString(); }
126 virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); 126 virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text );
127 127
128 // Get the parent menu for this item 128 // Get the parent menu for this item
129 virtual class LLMenuGL* getMenu(); 129 virtual class LLMenuGL* getMenu();
@@ -177,7 +177,7 @@ protected:
177 177
178 // This function appends the character string representation of 178 // This function appends the character string representation of
179 // the current accelerator key and mask to the provided string. 179 // the current accelerator key and mask to the provided string.
180 void appendAcceleratorString( LLString& st ) const; 180 void appendAcceleratorString( std::string& st ) const;
181 181
182 KEY mAcceleratorKey; 182 KEY mAcceleratorKey;
183 MASK mAcceleratorMask; 183 MASK mAcceleratorMask;
@@ -226,15 +226,15 @@ class LLMenuItemCallGL : public LLMenuItemGL, public LLObservable
226{ 226{
227public: 227public:
228 // normal constructor 228 // normal constructor
229 LLMenuItemCallGL( const LLString& name, 229 LLMenuItemCallGL( const std::string& name,
230 menu_callback clicked_cb, 230 menu_callback clicked_cb,
231 enabled_callback enabled_cb = NULL, 231 enabled_callback enabled_cb = NULL,
232 void* user_data = NULL, 232 void* user_data = NULL,
233 KEY key = KEY_NONE, MASK mask = MASK_NONE, 233 KEY key = KEY_NONE, MASK mask = MASK_NONE,
234 BOOL enabled = TRUE, 234 BOOL enabled = TRUE,
235 on_disabled_callback on_disabled_cb = NULL); 235 on_disabled_callback on_disabled_cb = NULL);
236 LLMenuItemCallGL( const LLString& name, 236 LLMenuItemCallGL( const std::string& name,
237 const LLString& label, 237 const std::string& label,
238 menu_callback clicked_cb, 238 menu_callback clicked_cb,
239 enabled_callback enabled_cb = NULL, 239 enabled_callback enabled_cb = NULL,
240 void* user_data = NULL, 240 void* user_data = NULL,
@@ -243,8 +243,8 @@ public:
243 on_disabled_callback on_disabled_cb = NULL); 243 on_disabled_callback on_disabled_cb = NULL);
244 244
245 // constructor for when you want to trap the arrange method. 245 // constructor for when you want to trap the arrange method.
246 LLMenuItemCallGL( const LLString& name, 246 LLMenuItemCallGL( const std::string& name,
247 const LLString& label, 247 const std::string& label,
248 menu_callback clicked_cb, 248 menu_callback clicked_cb,
249 enabled_callback enabled_cb, 249 enabled_callback enabled_cb,
250 label_callback label_cb, 250 label_callback label_cb,
@@ -252,7 +252,7 @@ public:
252 KEY key = KEY_NONE, MASK mask = MASK_NONE, 252 KEY key = KEY_NONE, MASK mask = MASK_NONE,
253 BOOL enabled = TRUE, 253 BOOL enabled = TRUE,
254 on_disabled_callback on_disabled_c = NULL); 254 on_disabled_callback on_disabled_c = NULL);
255 LLMenuItemCallGL( const LLString& name, 255 LLMenuItemCallGL( const std::string& name,
256 menu_callback clicked_cb, 256 menu_callback clicked_cb,
257 enabled_callback enabled_cb, 257 enabled_callback enabled_cb,
258 label_callback label_cb, 258 label_callback label_cb,
@@ -262,11 +262,11 @@ public:
262 on_disabled_callback on_disabled_c = NULL); 262 on_disabled_callback on_disabled_c = NULL);
263 virtual LLXMLNodePtr getXML(bool save_children = true) const; 263 virtual LLXMLNodePtr getXML(bool save_children = true) const;
264 264
265 virtual LLString getType() const { return "call"; } 265 virtual std::string getType() const { return "call"; }
266 266
267 267
268 void setEnabledControl(LLString enabled_control, LLView *context); 268 void setEnabledControl(std::string enabled_control, LLView *context);
269 void setVisibleControl(LLString enabled_control, LLView *context); 269 void setVisibleControl(std::string enabled_control, LLView *context);
270 270
271 void setMenuCallback(menu_callback callback, void* data) { mCallback = callback; mUserData = data; }; 271 void setMenuCallback(menu_callback callback, void* data) { mCallback = callback; mUserData = data; };
272 menu_callback getMenuCallback() const { return mCallback; } 272 menu_callback getMenuCallback() const { return mCallback; }
@@ -310,34 +310,34 @@ class LLMenuItemCheckGL
310: public LLMenuItemCallGL 310: public LLMenuItemCallGL
311{ 311{
312public: 312public:
313 LLMenuItemCheckGL( const LLString& name, 313 LLMenuItemCheckGL( const std::string& name,
314 const LLString& label, 314 const std::string& label,
315 menu_callback callback, 315 menu_callback callback,
316 enabled_callback enabled_cb, 316 enabled_callback enabled_cb,
317 check_callback check, 317 check_callback check,
318 void* user_data, 318 void* user_data,
319 KEY key = KEY_NONE, MASK mask = MASK_NONE ); 319 KEY key = KEY_NONE, MASK mask = MASK_NONE );
320 LLMenuItemCheckGL( const LLString& name, 320 LLMenuItemCheckGL( const std::string& name,
321 menu_callback callback, 321 menu_callback callback,
322 enabled_callback enabled_cb, 322 enabled_callback enabled_cb,
323 check_callback check, 323 check_callback check,
324 void* user_data, 324 void* user_data,
325 KEY key = KEY_NONE, MASK mask = MASK_NONE ); 325 KEY key = KEY_NONE, MASK mask = MASK_NONE );
326 LLMenuItemCheckGL( const LLString& name, 326 LLMenuItemCheckGL( const std::string& name,
327 const LLString& label, 327 const std::string& label,
328 menu_callback callback, 328 menu_callback callback,
329 enabled_callback enabled_cb, 329 enabled_callback enabled_cb,
330 LLString control_name, 330 std::string control_name,
331 LLView *context, 331 LLView *context,
332 void* user_data, 332 void* user_data,
333 KEY key = KEY_NONE, MASK mask = MASK_NONE ); 333 KEY key = KEY_NONE, MASK mask = MASK_NONE );
334 virtual LLXMLNodePtr getXML(bool save_children = true) const; 334 virtual LLXMLNodePtr getXML(bool save_children = true) const;
335 335
336 void setCheckedControl(LLString checked_control, LLView *context); 336 void setCheckedControl(std::string checked_control, LLView *context);
337 337
338 virtual void setValue(const LLSD& value); 338 virtual void setValue(const LLSD& value);
339 339
340 virtual LLString getType() const { return "check"; } 340 virtual std::string getType() const { return "check"; }
341 341
342 // called to rebuild the draw label 342 // called to rebuild the draw label
343 virtual void buildDrawLabel( void ); 343 virtual void buildDrawLabel( void );
@@ -358,15 +358,15 @@ private:
358class LLMenuItemToggleGL : public LLMenuItemGL 358class LLMenuItemToggleGL : public LLMenuItemGL
359{ 359{
360public: 360public:
361 LLMenuItemToggleGL( const LLString& name, const LLString& label, 361 LLMenuItemToggleGL( const std::string& name, const std::string& label,
362 BOOL* toggle, 362 BOOL* toggle,
363 KEY key = KEY_NONE, MASK mask = MASK_NONE ); 363 KEY key = KEY_NONE, MASK mask = MASK_NONE );
364 364
365 LLMenuItemToggleGL( const LLString& name, 365 LLMenuItemToggleGL( const std::string& name,
366 BOOL* toggle, 366 BOOL* toggle,
367 KEY key = KEY_NONE, MASK mask = MASK_NONE ); 367 KEY key = KEY_NONE, MASK mask = MASK_NONE );
368 368
369 virtual LLString getType() const { return "toggle"; } 369 virtual std::string getType() const { return "toggle"; }
370 370
371 // called to rebuild the draw label 371 // called to rebuild the draw label
372 virtual void buildDrawLabel( void ); 372 virtual void buildDrawLabel( void );
@@ -401,8 +401,8 @@ class LLMenuGL
401 // let branching menu items use my protected traversal methods 401 // let branching menu items use my protected traversal methods
402 friend class LLMenuItemBranchGL; 402 friend class LLMenuItemBranchGL;
403public: 403public:
404 LLMenuGL( const LLString& name, const LLString& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>()); 404 LLMenuGL( const std::string& name, const std::string& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>());
405 LLMenuGL( const LLString& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>() ); 405 LLMenuGL( const std::string& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>() );
406 virtual ~LLMenuGL( void ); 406 virtual ~LLMenuGL( void );
407 virtual LLXMLNodePtr getXML(bool save_children = true) const; 407 virtual LLXMLNodePtr getXML(bool save_children = true) const;
408 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); 408 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
@@ -419,12 +419,12 @@ public:
419 419
420 virtual BOOL handleAcceleratorKey(KEY key, MASK mask); 420 virtual BOOL handleAcceleratorKey(KEY key, MASK mask);
421 421
422 LLMenuGL* getChildMenuByName(const LLString& name, BOOL recurse) const; 422 LLMenuGL* getChildMenuByName(const std::string& name, BOOL recurse) const;
423 423
424 BOOL clearHoverItem(); 424 BOOL clearHoverItem();
425 425
426 // return the name label 426 // return the name label
427 const LLString& getLabel( void ) const { return mLabel.getString(); } 427 const std::string& getLabel( void ) const { return mLabel.getString(); }
428 void setLabel(const LLStringExplicit& label) { mLabel = label; } 428 void setLabel(const LLStringExplicit& label) { mLabel = label; }
429 429
430 // background colors 430 // background colors
@@ -438,7 +438,7 @@ public:
438 virtual BOOL append( LLMenuItemGL* item ); 438 virtual BOOL append( LLMenuItemGL* item );
439 439
440 // add a separator to this menu 440 // add a separator to this menu
441 virtual BOOL appendSeparator( const LLString &separator_name = "separator" ); 441 virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null );
442 442
443 // add a menu - this will create a cascading menu 443 // add a menu - this will create a cascading menu
444 virtual BOOL appendMenu( LLMenuGL* menu ); 444 virtual BOOL appendMenu( LLMenuGL* menu );
@@ -449,12 +449,12 @@ public:
449 // setItemEnabled() - pass the name and the enable flag for a 449 // setItemEnabled() - pass the name and the enable flag for a
450 // menu item. TRUE will make sure it's enabled, FALSE will disable 450 // menu item. TRUE will make sure it's enabled, FALSE will disable
451 // it. 451 // it.
452 void setItemEnabled( const LLString& name, BOOL enable ); 452 void setItemEnabled( const std::string& name, BOOL enable );
453 453
454 // propagate message to submenus 454 // propagate message to submenus
455 void setEnabledSubMenus(BOOL enable); 455 void setEnabledSubMenus(BOOL enable);
456 456
457 void setItemVisible( const LLString& name, BOOL visible); 457 void setItemVisible( const std::string& name, BOOL visible);
458 458
459 // sets the left,bottom corner of menu, useful for popups 459 // sets the left,bottom corner of menu, useful for popups
460 void setLeftAndBottom(S32 left, S32 bottom); 460 void setLeftAndBottom(S32 left, S32 bottom);
@@ -499,7 +499,7 @@ public:
499 void setDropShadowed( const BOOL shadowed ); 499 void setDropShadowed( const BOOL shadowed );
500 500
501 void setParentMenuItem( LLMenuItemGL* parent_menu_item ) { mParentMenuItem = parent_menu_item; } 501 void setParentMenuItem( LLMenuItemGL* parent_menu_item ) { mParentMenuItem = parent_menu_item; }
502 LLMenuItemGL* getParentMenuItem() { return mParentMenuItem; } 502 LLMenuItemGL* getParentMenuItem() const { return mParentMenuItem; }
503 503
504 void setTornOff(BOOL torn_off); 504 void setTornOff(BOOL torn_off);
505 BOOL getTornOff() { return mTornOff; } 505 BOOL getTornOff() { return mTornOff; }
@@ -561,11 +561,11 @@ private:
561class LLMenuItemBranchGL : public LLMenuItemGL 561class LLMenuItemBranchGL : public LLMenuItemGL
562{ 562{
563public: 563public:
564 LLMenuItemBranchGL( const LLString& name, const LLString& label, LLMenuGL* branch, 564 LLMenuItemBranchGL( const std::string& name, const std::string& label, LLMenuGL* branch,
565 KEY key = KEY_NONE, MASK mask = MASK_NONE ); 565 KEY key = KEY_NONE, MASK mask = MASK_NONE );
566 virtual LLXMLNodePtr getXML(bool save_children = true) const; 566 virtual LLXMLNodePtr getXML(bool save_children = true) const;
567 567
568 virtual LLString getType() const { return "menu"; } 568 virtual std::string getType() const { return "menu"; }
569 569
570 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); 570 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
571 571
@@ -606,7 +606,7 @@ public:
606 606
607 virtual void openMenu(); 607 virtual void openMenu();
608 608
609 virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; 609 virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const;
610 610
611private: 611private:
612 LLMenuGL* mBranch; 612 LLMenuGL* mBranch;
@@ -623,8 +623,8 @@ class LLPieMenu
623: public LLMenuGL 623: public LLMenuGL
624{ 624{
625public: 625public:
626 LLPieMenu(const LLString& name, const LLString& label); 626 LLPieMenu(const std::string& name, const std::string& label);
627 LLPieMenu(const LLString& name); 627 LLPieMenu(const std::string& name);
628 virtual ~LLPieMenu() {} 628 virtual ~LLPieMenu() {}
629 629
630 void initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory); 630 void initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory);
@@ -642,7 +642,7 @@ public:
642 virtual void drawBackground(LLMenuItemGL* itemp, LLColor4& color); 642 virtual void drawBackground(LLMenuItemGL* itemp, LLColor4& color);
643 643
644 virtual BOOL append(LLMenuItemGL* item); 644 virtual BOOL append(LLMenuItemGL* item);
645 virtual BOOL appendSeparator( const LLString &separator_name = "separator" ); 645 virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null );
646 646
647 BOOL appendPieMenu(LLPieMenu *menu); 647 BOOL appendPieMenu(LLPieMenu *menu);
648 648
@@ -682,7 +682,7 @@ private:
682class LLMenuBarGL : public LLMenuGL 682class LLMenuBarGL : public LLMenuGL
683{ 683{
684public: 684public:
685 LLMenuBarGL( const LLString& name ); 685 LLMenuBarGL( const std::string& name );
686 virtual ~LLMenuBarGL(); 686 virtual ~LLMenuBarGL();
687 virtual LLXMLNodePtr getXML(bool save_children = true) const; 687 virtual LLXMLNodePtr getXML(bool save_children = true) const;
688 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); 688 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
@@ -690,6 +690,8 @@ public:
690 virtual BOOL handleAcceleratorKey(KEY key, MASK mask); 690 virtual BOOL handleAcceleratorKey(KEY key, MASK mask);
691 virtual BOOL handleKeyHere(KEY key, MASK mask); 691 virtual BOOL handleKeyHere(KEY key, MASK mask);
692 virtual BOOL handleJumpKey(KEY key); 692 virtual BOOL handleJumpKey(KEY key);
693 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
694 virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
693 695
694 // rearrange the child rects so they fit the shape of the menu 696 // rearrange the child rects so they fit the shape of the menu
695 // bar. 697 // bar.
@@ -698,7 +700,7 @@ public:
698 virtual BOOL jumpKeysActive(); 700 virtual BOOL jumpKeysActive();
699 701
700 // add a vertical separator to this menu 702 // add a vertical separator to this menu
701 virtual BOOL appendSeparator( const LLString &separator_name = "separator" ); 703 virtual BOOL appendSeparator( const std::string &separator_name = LLStringUtil::null );
702 704
703 // add a menu - this will create a drop down menu. 705 // add a menu - this will create a drop down menu.
704 virtual BOOL appendMenu( LLMenuGL* menu ); 706 virtual BOOL appendMenu( LLMenuGL* menu );
@@ -727,7 +729,7 @@ class LLMenuHolderGL : public LLPanel
727{ 729{
728public: 730public:
729 LLMenuHolderGL(); 731 LLMenuHolderGL();
730 LLMenuHolderGL(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows = FOLLOWS_NONE); 732 LLMenuHolderGL(const std::string& name, const LLRect& rect, BOOL mouse_opaque, U32 follows = FOLLOWS_NONE);
731 virtual ~LLMenuHolderGL() {} 733 virtual ~LLMenuHolderGL() {}
732 734
733 virtual BOOL hideMenus(); 735 virtual BOOL hideMenus();
@@ -789,7 +791,7 @@ class LLMenuItemTearOffGL : public LLMenuItemGL
789public: 791public:
790 LLMenuItemTearOffGL( LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>()); 792 LLMenuItemTearOffGL( LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>());
791 793
792 virtual LLString getType() const { return "tearoff_menu"; } 794 virtual std::string getType() const { return "tearoff_menu"; }
793 795
794 virtual void doIt(void); 796 virtual void doIt(void);
795 virtual void draw(void); 797 virtual void draw(void);