lltoolview.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLTOOLVIEW_H
00033 #define LL_LLTOOLVIEW_H
00034 
00035 // requires stdtypes.h
00036 #include "linked_lists.h"
00037 #include "llpanel.h"
00038 
00039 // forward declares
00040 class LLTool;
00041 class LLButton;
00042 
00043 class LLToolView;
00044 
00045 
00046 // Utility class, container for the package of information we need about
00047 // each tool.  The package can either point directly to a tool, or indirectly
00048 // to another view of tools.
00049 class LLToolContainer
00050 {
00051 public:
00052         LLToolContainer(LLToolView* parent);
00053         ~LLToolContainer();
00054 
00055 public:
00056         LLToolView*             mParent;                // toolview that owns this container
00057         LLButton*               mButton;
00058         LLPanel*                mPanel;
00059         LLTool*                 mTool;                  // if not NULL, this is a tool ref
00060 };
00061 
00062 
00063 // A view containing automatically arranged button icons representing
00064 // tools.  The icons sit on top of panels containing options for each
00065 // tool.
00066 class LLToolView
00067 :       public LLView
00068 {
00069 public:
00070         LLToolView(const std::string& name, const LLRect& rect);
00071         ~LLToolView();
00072 
00073         virtual void    draw();                 // handle juggling tool button highlights, panel visibility
00074 
00075         static void             onClickToolButton(void* container);
00076 
00077         void                    addTool(const LLString& icon_off, const LLString& icon_on, LLPanel* panel, LLTool* tool, LLView* hoverView, const char* label);
00078 
00079         LLView*                 getCurrentHoverView();
00080 
00081 private:
00082         LLRect                  getButtonRect(S32 button_index);        // return rect for button to add, zero-based index
00083         LLToolContainer *findToolContainer(LLTool *tool);
00084 
00085 
00086 private:
00087         LLLinkedList
00088                 <LLToolContainer>       mContainList;
00089         S32                                             mButtonCount;                   // used to compute rectangles
00090 };
00091 
00092 #endif

Generated on Thu Jul 1 06:09:22 2010 for Second Life Viewer by  doxygen 1.4.7