Debian Codegraph @

wxcrafter/src/font_property.cpp

raw
1 #include "font_property.h"
2 #include "FontPickerDlg.h"
3 #include "wxgui_helpers.h"
4 #include <wx/app.h>
5
6 const wxEventType wxEVT_FONT_UPDATE = wxNewEventType();
7
8 FontProperty::FontProperty(const wxString& label, const wxString& font, const wxString& tooltip)
9 : PropertyBase(tooltip)
10 {
11 SetLabel(label);
12 m_value = font;
13 }
14
15 FontProperty::~FontProperty() {}
16
17 wxString FontProperty::GetValue() const { return m_value; }
18
19 JSONElement FontProperty::Serialize() const
20 {
21 JSONElement json = JSONElement::createObject();
22 json.addProperty(wxT("type"), wxT("font"));
23 DoBaseSerialize(json);
24 json.addProperty(wxT("m_value"), m_value);
25 return json;
26 }
27
28 void FontProperty::UnSerialize(const JSONElement& json)
29 {
30 DoBaseUnSerialize(json);
31 m_value = json.namedObject(wxT("m_value")).toString();
32 }
33
34 void FontProperty::SetValue(const wxString& value) { m_value = value; }