| 1 |
#ifndef CHOICEPROPERTY_H |
| 2 |
#define CHOICEPROPERTY_H |
| 3 |
|
| 4 |
#include "property_base.h" |
| 5 |
#include <wx/arrstr.h> |
| 6 |
|
| 7 |
class ChoiceProperty : public PropertyBase |
| 8 |
{ |
| 9 |
wxArrayString m_options; |
| 10 |
int m_selection; |
| 11 |
|
| 12 |
public: |
| 13 |
ChoiceProperty(const wxString& label, const wxArrayString& options, int selection, const wxString& tip); |
| 14 |
ChoiceProperty(); |
| 15 |
virtual ~ChoiceProperty(); |
| 16 |
|
| 17 |
void SetOptions(const wxArrayString& options) { this->m_options = options; } |
| 18 |
void SetSelection(int selection); |
| 19 |
|
| 20 |
virtual wxArrayString GetOptions() const { return m_options; } |
| 21 |
int GetSelection() const { return m_selection; } |
| 22 |
bool IsEmpty() const { return m_options.IsEmpty(); } |
| 23 |
void Add(const wxString& value); |
| 24 |
|
| 25 |
virtual wxString GetValue() const; |
| 26 |
virtual void SetValue(const wxString& value); |
| 27 |
|
| 28 |
// Serialization methods |
| 29 |
virtual JSONElement Serialize() const; |
| 30 |
virtual void UnSerialize(const JSONElement& json); |
| 31 |
|
| 32 |
virtual PropertyeType GetType() { return PT_CHOICE; } |
| 33 |
}; |
| 34 |
|
| 35 |
#endif // CHOICEPROPERTY_H |