aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llmenugl.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/llmenugl.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/linden/indra/llui/llmenugl.h b/linden/indra/llui/llmenugl.h
index 8561f1b..d981e78 100644
--- a/linden/indra/llui/llmenugl.h
+++ b/linden/indra/llui/llmenugl.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$ 5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2001-2008, Linden Research, Inc. 7 * Copyright (c) 2001-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -89,6 +89,7 @@ public:
89 static const LLColor4& getHighlightFGColor() { return sHighlightForeground; } 89 static const LLColor4& getHighlightFGColor() { return sHighlightForeground; }
90 90
91 LLMenuItemGL( const std::string& name, const std::string& 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 virtual ~LLMenuItemGL() {};
92 93
93 virtual void setValue(const LLSD& value) { setLabel(value.asString()); } 94 virtual void setValue(const LLSD& value) { setLabel(value.asString()); }
94 95
@@ -561,8 +562,11 @@ private:
561class LLMenuItemBranchGL : public LLMenuItemGL 562class LLMenuItemBranchGL : public LLMenuItemGL
562{ 563{
563public: 564public:
564 LLMenuItemBranchGL( const std::string& name, const std::string& label, LLMenuGL* branch, 565 LLMenuItemBranchGL( const std::string& name, const std::string& label, LLHandle<LLView> branch,
565 KEY key = KEY_NONE, MASK mask = MASK_NONE ); 566 KEY key = KEY_NONE, MASK mask = MASK_NONE );
567
568 virtual ~LLMenuItemBranchGL();
569
566 virtual LLXMLNodePtr getXML(bool save_children = true) const; 570 virtual LLXMLNodePtr getXML(bool save_children = true) const;
567 571
568 virtual std::string getType() const { return "menu"; } 572 virtual std::string getType() const { return "menu"; }
@@ -589,11 +593,11 @@ public:
589 593
590 virtual BOOL handleKeyHere(KEY key, MASK mask); 594 virtual BOOL handleKeyHere(KEY key, MASK mask);
591 595
592 virtual BOOL isActive() const { return isOpen() && mBranch->getHighlightedItem(); } 596 virtual BOOL isActive() const { return isOpen() && getBranch()->getHighlightedItem(); }
593 597
594 virtual BOOL isOpen() const { return mBranch->isOpen(); } 598 virtual BOOL isOpen() const { return getBranch() && getBranch()->isOpen(); }
595 599
596 LLMenuGL *getBranch() const { return mBranch; } 600 LLMenuGL *getBranch() const { return (LLMenuGL*)(mBranch.get()); }
597 601
598 virtual void updateBranchParent( LLView* parentp ); 602 virtual void updateBranchParent( LLView* parentp );
599 603
@@ -602,14 +606,14 @@ public:
602 606
603 virtual void draw(); 607 virtual void draw();
604 608
605 virtual void setEnabledSubMenus(BOOL enabled) { mBranch->setEnabledSubMenus(enabled); } 609 virtual void setEnabledSubMenus(BOOL enabled) { if(getBranch()) getBranch()->setEnabledSubMenus(enabled); }
606 610
607 virtual void openMenu(); 611 virtual void openMenu();
608 612
609 virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; 613 virtual LLView* getChildView(const std::string& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const;
610 614
611private: 615private:
612 LLMenuGL* mBranch; 616 LLHandle<LLView> mBranch;
613}; // end class LLMenuItemBranchGL 617}; // end class LLMenuItemBranchGL
614 618
615 619