/
PrefabPopulator.h
54 lines (38 loc) · 1.14 KB
/
PrefabPopulator.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
#pragma once
#include <wx/thread.h>
#include "ifilesystem.h"
#include "wxutil/VFSTreePopulator.h"
#include "PrefabSelector.h"
namespace ui
{
class PrefabPopulator :
public wxutil::VFSTreePopulator::Visitor,
public wxThread
{
private:
const PrefabSelector::TreeColumns& _columns;
// The tree store to populate
wxutil::TreeModel::Ptr _treeStore;
// The event handler to notify on completion
wxEvtHandler* _finishedHandler;
// The helper class, doing the tedious treeview insertion for us.
wxutil::VFSTreePopulator _treePopulator;
wxIcon _prefabIcon;
wxIcon _folderIcon;
std::string _prefabBasePath;
public:
PrefabPopulator(const PrefabSelector::TreeColumns& columns,
wxEvtHandler* finishedHandler,
const std::string& prefabBasePath);
~PrefabPopulator(); // waits for thread to finish
// Returns the prefab path as used in the constructor
const std::string& getPrefabPath() const;
void populate();
void visit(wxutil::TreeModel& store, wxutil::TreeModel::Row& row,
const std::string& path, bool isExplicit);
protected:
// Thread entry point
ExitCode Entry();
void visitFile(const vfs::FileInfo& fileInfo);
};
}