PageRenderTime 207ms CodeModel.GetById 85ms app.highlight 4ms RepoModel.GetById 117ms app.codeStats 0ms

/indra/newview/lltoolview.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 84 lines | 35 code | 16 blank | 33 comment | 0 complexity | 264fb5f8b17e384a8cd8e1761d323442 MD5 | raw file
 1/** 
 2 * @file lltoolview.h
 3 * @brief UI container for tools.
 4 *
 5 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLTOOLVIEW_H
28#define LL_LLTOOLVIEW_H
29
30// requires stdtypes.h
31#include "llpanel.h"
32
33// forward declares
34class LLTool;
35class LLButton;
36
37class LLToolView;
38
39
40// Utility class, container for the package of information we need about
41// each tool.  The package can either point directly to a tool, or indirectly
42// to another view of tools.
43class LLToolContainer
44{
45public:
46	LLToolContainer(LLToolView* parent);
47	~LLToolContainer();
48
49public:
50	LLToolView*		mParent;		// toolview that owns this container
51	LLButton*		mButton;
52	LLPanel*		mPanel;
53	LLTool*			mTool;			// if not NULL, this is a tool ref
54};
55
56
57// A view containing automatically arranged button icons representing
58// tools.  The icons sit on top of panels containing options for each
59// tool.
60class LLToolView
61:	public LLView
62{
63public:
64	LLToolView(const std::string& name, const LLRect& rect);
65	~LLToolView();
66
67	virtual void	draw();			// handle juggling tool button highlights, panel visibility
68
69	static void		onClickToolButton(void* container);
70
71	LLView*			getCurrentHoverView();
72
73private:
74	LLRect			getButtonRect(S32 button_index);	// return rect for button to add, zero-based index
75	LLToolContainer	*findToolContainer(LLTool *tool);
76
77
78private:
79	typedef std::vector<LLToolContainer*> contain_list_t;
80	contain_list_t 			mContainList;
81	S32						mButtonCount;			// used to compute rectangles
82};
83
84#endif