| 1 |
#include "bitmap_picker_property.h" |
| 2 |
#include <json_node.h> |
| 3 |
|
| 4 |
BitmapPickerProperty::BitmapPickerProperty(const wxString& label, const wxString& path, const wxString& tooltip) |
| 5 |
: PropertyBase(tooltip) |
| 6 |
{ |
| 7 |
wxString tip; |
| 8 |
tip << GetTooltip(); |
| 9 |
|
| 10 |
SetTooltip(tip); |
| 11 |
SetLabel(label); |
| 12 |
SetValue(path); |
| 13 |
} |
| 14 |
|
| 15 |
BitmapPickerProperty::~BitmapPickerProperty() {} |
| 16 |
|
| 17 |
PropertyeType BitmapPickerProperty::GetType() { return PT_BITMAP; } |
| 18 |
|
| 19 |
wxString BitmapPickerProperty::GetValue() const { return m_path; } |
| 20 |
|
| 21 |
JSONElement BitmapPickerProperty::Serialize() const |
| 22 |
{ |
| 23 |
JSONElement json = JSONElement::createObject(); |
| 24 |
json.addProperty(wxT("type"), wxT("bitmapPicker")); |
| 25 |
DoBaseSerialize(json); |
| 26 |
json.addProperty(wxT("m_path"), m_path); |
| 27 |
return json; |
| 28 |
} |
| 29 |
|
| 30 |
void BitmapPickerProperty::SetValue(const wxString& value) { m_path = value; } |
| 31 |
|
| 32 |
void BitmapPickerProperty::UnSerialize(const JSONElement& json) |
| 33 |
{ |
| 34 |
DoBaseUnSerialize(json); |
| 35 |
m_path = json.namedObject(wxT("m_path")).toString(); |
| 36 |
} |