/
ParticleChooserDialog.h
77 lines (62 loc) · 1.97 KB
/
ParticleChooserDialog.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
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include "wxutil/decl/DeclarationSelectorDialog.h"
#include "ParticleSelector.h"
#include <string>
#include <sigc++/trackable.h>
class wxRadioButton;
namespace ui
{
/**
* \brief
* Chooser dialog for selection and preview of particle systems.
*/
class ParticleChooserDialog :
public wxutil::DeclarationSelectorDialog,
public sigc::trackable
{
private:
ParticleSelector* _selector;
wxRadioButton* _funcEmitter;
wxRadioButton* _funcSmoke;
private:
// Constructor creates elements
ParticleChooserDialog(bool showClassnameSelector);
std::string getSelectedClassname();
public:
struct SelectionResult
{
std::string selectedParticle;
std::string selectedClassname;
};
/**
* Display the dialog and return the name of the selected
* particle system, or the empty string if none was selected.
*
* @param currentParticle
* The particle name which should be highlighted in the list when the dialog
* is first displayed. If this value is left at the default value of "", no
* particle will be selected.
*
* @returns
* The name of the particle selected by the user, or an empty string if the
* choice was cancelled or invalid.
*/
static std::string ChooseParticle(const std::string& currentParticle = "");
/**
* Display the dialog and return the name of the selected
* particle system, or the empty string if none was selected.
*
* @param currentParticle
* The particle name which should be highlighted in the list when the dialog
* is first displayed. If this value is left at the default value of "", no
* particle will be selected.
*
* @returns
* The name of the particle selected by the user, or an empty string if the
* choice was cancelled or invalid.
*/
static SelectionResult ChooseParticleAndEmitter(const std::string& currentParticle = "");
private:
static SelectionResult RunDialog(bool showClassnameSelector, std::string currentParticle);
};
}