/
AIVocalSetChooserDialog.h
66 lines (46 loc) · 1.25 KB
/
AIVocalSetChooserDialog.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 "wxutil/dialog/DialogBase.h"
#include <set>
#include <map>
#include "wxutil/dataview/TreeView.h"
#include "AIVocalSetPreview.h"
class wxTextCtrl;
namespace ui
{
class AIVocalSetChooserDialog :
public wxutil::DialogBase
{
public:
typedef std::set<std::string> SetList;
private:
struct ListStoreColumns :
public wxutil::TreeModel::ColumnRecord
{
ListStoreColumns() :
name(add(wxutil::TreeModel::Column::String))
{}
wxutil::TreeModel::Column name;
};
ListStoreColumns _columns;
wxutil::TreeModel::Ptr _setStore;
wxutil::TreeView* _setView;
wxTextCtrl* _description;
// The name of the currently selected set
std::string _selectedSet;
static SetList _availableSets;
AIVocalSetPreview* _preview;
public:
AIVocalSetChooserDialog();
// Set the selection to a given entityDef
void setSelectedVocalSet(const std::string& setName);
// Get the currently selected set (is empty when nothing is selected)
std::string getSelectedVocalSet();
private:
void populateSetStore();
// Searches all entity classes for available sets
static void findAvailableSets();
void handleSetSelectionChanged();
void onSetSelectionChanged(wxDataViewEvent& ev);
void _onItemActivated( wxDataViewEvent& ev );
};
} // namespace ui