summaryrefslogtreecommitdiff
path: root/public/dme_controls/AttributeColorPickerPanel.h
blob: 99e669d8231c520f4fc17f79c5c37c9dd8cb4237 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//

#ifndef ATTRIBUTECOLORPICKERPANEL_H
#define ATTRIBUTECOLORPICKERPANEL_H

#ifdef _WIN32
#pragma once
#endif

#include "dme_controls/AttributeTextPanel.h"


//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class CDmElement;

namespace vgui
{
	class Button;
}


//-----------------------------------------------------------------------------
// CAttributeColorPickerPanel
//-----------------------------------------------------------------------------
class CAttributeColorPickerPanel : public CAttributeTextPanel
{
	DECLARE_CLASS_SIMPLE( CAttributeColorPickerPanel, CAttributeTextPanel );

public:
	CAttributeColorPickerPanel( vgui::Panel *parent, const AttributeWidgetInfo_t &info );

	// Inherited from Panel
	virtual void	OnCommand( const char *cmd );
	virtual void	PerformLayout();
	virtual void	Refresh();
	virtual void	ApplySchemeSettings(IScheme *pScheme);

private:
	MESSAGE_FUNC_PARAMS( OnPreview, "ColorPickerPreview", data );
	MESSAGE_FUNC_PARAMS( OnPicked, "ColorPickerPicked", data );
	MESSAGE_FUNC( OnCancelled, "ColorPickerCancel" );
	void UpdateButtonColor();

	vgui::Button	*m_pOpen;
	Color			m_InitialColor;
};


#endif // ATTRIBUTECOLORPICKERPANEL_H