PageRenderTime 34ms CodeModel.GetById 13ms app.highlight 15ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/newview/lldebugmessagebox.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 89 lines | 47 code | 13 blank | 29 comment | 0 complexity | cec0ccb9b84b3bbc9ff6ef6f526c68dc MD5 | raw file
 1/** 
 2 * @file lldebugmessagebox.h
 3 * @brief Debug message box.
 4 *
 5 * $LicenseInfo:firstyear=2002&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
28#ifndef LL_LLDEBUGMESSAGEBOX_H
29#define LL_LLDEBUGMESSAGEBOX_H
30
31#include "lldarray.h"
32#include "llfloater.h"
33#include "v3math.h"
34#include "lltextbox.h"
35#include "llstring.h"
36#include "llframetimer.h"
37#include <vector>
38#include <map>
39
40class LLSliderCtrl;
41
42//----------------------------------------------------------------------------
43// LLDebugVarMessageBox
44//----------------------------------------------------------------------------
45
46typedef enum e_debug_var_type
47{
48	VAR_TYPE_F32,
49	VAR_TYPE_S32,
50	VAR_TYPE_VEC2,
51	VAR_TYPE_VEC3,
52	VAR_TYPE_VEC4,
53	VAR_TYPE_COUNT
54} EDebugVarType;
55
56class LLDebugVarMessageBox : public LLFloater
57{
58protected:
59	LLDebugVarMessageBox(const std::string& title, EDebugVarType var_type, void *var);
60	~LLDebugVarMessageBox();
61
62	static LLDebugVarMessageBox* show(const std::string& title, EDebugVarType var_type, void *var);
63	void sliderChanged(const LLSD& data);
64	void onAnimateClicked(const LLSD& data);
65
66public:
67	static void show(const std::string& title, F32 *var, F32 max_value = 100.f, F32 increment = 0.1f);
68	static void show(const std::string& title, S32 *var, S32 max_value = 255, S32 increment = 1);
69	static void show(const std::string& title, LLVector2 *var, LLVector2 max_value = LLVector2(100.f, 100.f), LLVector2 increment = LLVector2(0.1f, 0.1f));
70	static void show(const std::string& title, LLVector3 *var, LLVector3 max_value = LLVector3(100.f, 100.f, 100.f), LLVector3 increment = LLVector3(0.1f, 0.1f, 0.1f));
71	//static void show(const std::string& title, LLVector4 *var, LLVector4 max_value = LLVector4(100.f, 100.f, 100.f, 100.f), LLVector4 increment = LLVector4(0.1f, 0.1f, 0.1f, 0.1f));	
72		
73	virtual void	draw();
74
75protected:
76	EDebugVarType	mVarType;
77	void*			mVarData;
78	LLSliderCtrl*	mSlider1;
79	LLSliderCtrl*	mSlider2;
80	LLSliderCtrl*	mSlider3;
81	LLButton*		mAnimateButton;
82	LLTextBox*		mText;
83	std::string		mTitle;
84	BOOL			mAnimate;
85
86	static std::map<std::string, LLDebugVarMessageBox*> sInstances;
87};
88
89#endif // LL_LLMESSAGEBOX_H