PageRenderTime 83ms CodeModel.GetById 40ms app.highlight 6ms RepoModel.GetById 34ms app.codeStats 0ms

/indra/newview/llscrollingpanelparam.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 85 lines | 44 code | 14 blank | 27 comment | 0 complexity | cb2e76a7c4f1aa5d267710c1a394137c MD5 | raw file
 1/** 
 2 * @file llscrollingpanelparam.h
 3 * @brief the scrolling panel containing a list of visual param 
 4 *  	  panels
 5 *
 6 * $LicenseInfo:firstyear=2009&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27
28#ifndef LL_SCROLLINGPANELPARAM_H
29#define LL_SCROLLINGPANELPARAM_H
30
31#include "llscrollingpanelparambase.h"
32
33class LLViewerJointMesh;
34class LLViewerVisualParam;
35class LLWearable;
36class LLVisualParamHint;
37class LLViewerVisualParam;
38class LLJoint;
39
40class LLScrollingPanelParam : public LLScrollingPanelParamBase
41{
42public:
43	LLScrollingPanelParam( const LLPanel::Params& panel_params,
44			       LLViewerJointMesh* mesh, LLViewerVisualParam* param, BOOL allow_modify, LLWearable* wearable, LLJoint* jointp, BOOL use_hints = TRUE );
45	virtual ~LLScrollingPanelParam();
46
47	virtual void		draw();
48	virtual void		setVisible( BOOL visible );
49	virtual void		updatePanel(BOOL allow_modify);
50
51	static void			onSliderMouseDown(LLUICtrl* ctrl, void* userdata);
52	static void			onSliderMouseUp(LLUICtrl* ctrl, void* userdata);
53
54	static void			onHintMinMouseDown(void* userdata);
55	static void			onHintMinHeldDown(void* userdata);
56	static void			onHintMaxMouseDown(void* userdata);
57	static void			onHintMaxHeldDown(void* userdata);
58	static void			onHintMinMouseUp(void* userdata);
59	static void			onHintMaxMouseUp(void* userdata);
60
61	void				onHintMouseDown( LLVisualParamHint* hint );
62	void				onHintHeldDown( LLVisualParamHint* hint );
63
64	F32					weightToPercent( F32 weight );
65	F32					percentToWeight( F32 percent );
66
67public:
68	// Constants for LLPanelVisualParam
69	const static F32 PARAM_STEP_TIME_THRESHOLD;
70	
71	const static S32 PARAM_HINT_WIDTH;
72	const static S32 PARAM_HINT_HEIGHT;
73
74public:
75	LLPointer<LLVisualParamHint>	mHintMin;
76	LLPointer<LLVisualParamHint>	mHintMax;
77	static S32 			sUpdateDelayFrames;
78	
79protected:
80	LLTimer				mMouseDownTimer;	// timer for how long mouse has been held down on a hint.
81	F32					mLastHeldTime;
82	BOOL mAllowModify;
83}; 
84
85#endif