/
SkinEditorTreeView.h
37 lines (29 loc) · 1 KB
/
SkinEditorTreeView.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
#pragma once
#include <sigc++/connection.h>
#include "wxutil/dataview/DeclarationTreeView.h"
#include "wxutil/dataview/ThreadedDeclarationTreePopulator.h"
namespace ui
{
/**
* Specialised skin declaration tree view used in the Skin Editor
* Monitors the decl manager signals for newly created or renamed/removed skins
* and automatically adjusts the tree elements.
*/
class SkinEditorTreeView :
public wxutil::DeclarationTreeView
{
private:
constexpr static const char* const SKIN_ICON = "icon_skin.png";
const Columns& _columns;
// Subscriptions to the material manager
sigc::connection _declRenamed;
sigc::connection _declRemoved;
public:
SkinEditorTreeView(wxWindow* parent, const Columns& columns, long style = wxDV_SINGLE);
~SkinEditorTreeView() override;
virtual void Populate();
private:
void onDeclarationRenamed(decl::Type type, const std::string& oldName, const std::string& newName);
void onDeclarationRemoved(decl::Type type, const std::string& name);
};
}