-
Notifications
You must be signed in to change notification settings - Fork 47
/
EClassTree.h
66 lines (50 loc) · 1.71 KB
/
EClassTree.h
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
#pragma once
#include "icommandsystem.h"
#include "wxutil/dialog/DialogBase.h"
#include "wxutil/dataview/TreeView.h"
#include "wxutil/dataview/DeclarationTreeView.h"
class EntityClassAttribute;
namespace ui
{
class EClassTree :
public wxutil::DialogBase
{
private:
// The EClass treeview widget and underlying liststore
wxutil::DeclarationTreeView::Columns _eclassColumns;
wxutil::DeclarationTreeView* _eclassView;
struct PropertyListColumns :
public wxutil::TreeModel::ColumnRecord
{
PropertyListColumns() :
name(add(wxutil::TreeModel::Column::String)),
value(add(wxutil::TreeModel::Column::String)),
inherited(add(wxutil::TreeModel::Column::Boolean))
{}
wxutil::TreeModel::Column name;
wxutil::TreeModel::Column value;
wxutil::TreeModel::Column inherited;
};
// The treeview and liststore for the property pane
PropertyListColumns _propertyColumns;
wxutil::TreeModel::Ptr _propertyStore;
wxutil::TreeView* _propertyView;
// Private constructor, traverses the entity classes
EClassTree();
public:
// Shows the singleton class (static command target)
static void ShowDialog(const cmd::ArgumentList& args);
private:
// Constructs and adds all the dialog widgets
void populateWindow();
void createEClassTreeView(wxWindow* parent); // EClass Tree
void createPropertyTreeView(wxWindow* parent); // Property Tree
// Loads the spawnargs into the right treeview
void addToListStore(const EntityClassAttribute& attr, bool inherited);
void updatePropertyView(const std::string& eclassName);
void handleSelectionChange();
// callbacks
void onSelectionChanged(wxDataViewEvent& ev);
void onTreeViewPopulationFinished(wxutil::ResourceTreeView::PopulationFinishedEvent& ev);
};
} // namespace ui