diff options
Diffstat (limited to 'indra/llui/llmenugl.h')
-rwxr-xr-x[-rw-r--r--] | indra/llui/llmenugl.h | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 67b3e1fbe6..51df5df1f8 100644..100755 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -478,6 +478,12 @@ public: // remove all items on the menu void empty( void ); + // erase group of items from menu + void erase( S32 begin, S32 end, bool arrange = true ); + + // add new item at position + void insert( S32 begin, LLView * ctrl, bool arrange = true ); + void setItemLastSelected(LLMenuItemGL* item); // must be in menu U32 getItemCount(); // number of menu items LLMenuItemGL* getItem(S32 number); // 0 = first item @@ -519,6 +525,9 @@ public: void resetScrollPositionOnShow(bool reset_scroll_pos) { mResetScrollPositionOnShow = reset_scroll_pos; } bool isScrollPositionOnShowReset() { return mResetScrollPositionOnShow; } + // add a context menu branch + BOOL appendContextSubMenu(LLMenuGL *menu); + protected: void createSpilloverBranch(); void cleanupSpilloverBranch(); @@ -528,6 +537,10 @@ protected: // add a menu - this will create a cascading menu virtual BOOL appendMenu( LLMenuGL* menu ); + // Used in LLContextMenu and in LLTogleableMenu + // to add an item of context menu branch + bool addContextChild(LLView* view, S32 tab_group); + // TODO: create accessor methods for these? typedef std::list< LLMenuItemGL* > item_list_t; item_list_t mItems; @@ -668,8 +681,6 @@ public: // can't set visibility directly, must call show or hide virtual void setVisible (BOOL visible); - virtual void draw (); - virtual void show (S32 x, S32 y, LLView* spawning_view = NULL); virtual void hide (); @@ -679,8 +690,6 @@ public: virtual bool addChild (LLView* view, S32 tab_group = 0); - BOOL appendContextSubMenu(LLContextMenu *menu); - LLHandle<LLContextMenu> getHandle() { return getDerivedHandle<LLContextMenu>(); } LLView* getSpawningView() const { return mSpawningViewHandle.get(); } @@ -693,6 +702,37 @@ protected: LLHandle<LLView> mSpawningViewHandle; }; +//----------------------------------------------------------------------------- +// class LLContextMenuBranch +// A branch to another context menu +//----------------------------------------------------------------------------- +class LLContextMenuBranch : public LLMenuItemGL +{ +public: + struct Params : public LLInitParam::Block<Params, LLMenuItemGL::Params> + { + Mandatory<LLContextMenu*> branch; + }; + + LLContextMenuBranch(const Params&); + + virtual ~LLContextMenuBranch() + {} + + // called to rebuild the draw label + virtual void buildDrawLabel( void ); + + // onCommit() - do the primary funcationality of the menu item. + virtual void onCommit( void ); + + LLContextMenu* getBranch() { return mBranch.get(); } + void setHighlight( BOOL highlight ); + +protected: + void showSubMenu(); + + LLHandle<LLContextMenu> mBranch; +}; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |