summaryrefslogtreecommitdiff
path: root/tools/vcdblock/infotargetpropertiespanel.h
blob: b43b62b0d9c056386e344ed0a8b0fcd4baa91cce (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//===========================================================================//

#ifndef INFOTARGETPROPERTIESPANEL_H
#define INFOTARGETPROPERTIESPANEL_H
#ifdef _WIN32
#pragma once
#endif

#include "vgui_controls/editablepanel.h"
#include "tier1/utlstring.h"
#include "datamodel/dmehandle.h"


//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class CVcdBlockDoc;
class CDmeVMFEntity;
class CScrollableEditablePanel;

namespace vgui
{
	class ComboBox;
	class Button;
	class TextEntry;
	class ListPanel;
	class CheckButton;
	class RadioButton;
}


//-----------------------------------------------------------------------------
// Panel that shows all entities in the level
//-----------------------------------------------------------------------------
class CInfoTargetPropertiesPanel : public vgui::EditablePanel
{
	DECLARE_CLASS_SIMPLE( CInfoTargetPropertiesPanel, vgui::EditablePanel );

public:
	CInfoTargetPropertiesPanel( CVcdBlockDoc *pDoc, vgui::Panel* pParent );   // standard constructor

	// Sets the object to look at
	void SetObject( CDmeVMFEntity *pEntity );

private:
	// Populates the info_target fields
	void PopulateInfoTargetFields();

	// Text to attribute...
	void TextEntryToAttribute( vgui::TextEntry *pEntry, const char *pAttributeName );
	void TextEntriesToVector( vgui::TextEntry *pEntry[3], const char *pAttributeName );

	// Updates entity state when text fields change
	void UpdateInfoTarget();

	// Messages handled
	MESSAGE_FUNC_PARAMS( OnTextChanged, "TextChanged", kv );

	CVcdBlockDoc *m_pDoc;

	vgui::EditablePanel *m_pInfoTargetScroll;
	vgui::EditablePanel *m_pInfoTarget;

	vgui::TextEntry *m_pTargetName;
	vgui::TextEntry *m_pTargetPosition[3];
	vgui::TextEntry *m_pTargetOrientation[3];

	CDmeHandle< CDmeVMFEntity > m_hEntity;
};


#endif // INFOTARGETPROPERTIESPANEL_H