1 /*
2 	GWEN
3 	Copyright (c) 2010 Facepunch Studios
4 	See license in Gwen.h
5 */
6 
7 #pragma once
8 #ifndef GWEN_CONTROLS_PROPERTYTREE_H
9 #define GWEN_CONTROLS_PROPERTYTREE_H
10 
11 #include "Gwen/Controls/Base.h"
12 #include "Gwen/Controls/Label.h"
13 #include "Gwen/Gwen.h"
14 #include "Gwen/Skin.h"
15 #include "Gwen/Controls/TreeControl.h"
16 #include "Gwen/Controls/Properties.h"
17 
18 namespace Gwen
19 {
20 namespace Controls
21 {
22 class PropertyTreeNode : public TreeNode
23 {
24 public:
GWEN_CONTROL_INLINE(PropertyTreeNode,TreeNode)25 	GWEN_CONTROL_INLINE(PropertyTreeNode, TreeNode)
26 	{
27 	}
28 
Render(Skin::Base * skin)29 	virtual void Render(Skin::Base* skin)
30 	{
31 		skin->DrawPropertyTreeNode(this, m_InnerPanel->X(), m_InnerPanel->Y());
32 	}
33 };
34 
35 class PropertyTree : public TreeControl
36 {
37 public:
GWEN_CONTROL_INLINE(PropertyTree,TreeControl)38 	GWEN_CONTROL_INLINE(PropertyTree, TreeControl)
39 	{
40 	}
41 
Add(const UnicodeString & text)42 	Properties* Add(const UnicodeString& text)
43 	{
44 		TreeNode* node = new PropertyTreeNode(this);
45 		node->SetText(text);
46 		node->Dock(Pos::Top);
47 
48 		Properties* props = new Properties(node);
49 		props->Dock(Pos::Top);
50 
51 		return props;
52 	}
53 };
54 
55 }  // namespace Controls
56 }  // namespace Gwen
57 #endif
58