GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
ButtonDeserializer.cpp
Go to the documentation of this file.
2
6#include "GUIFramework.h"
7
8using namespace std;
9
10namespace gui_framework
11{
12 namespace deserializers
13 {
14 BaseComponent* ButtonDeserializer::deserialize(const string& componentName, const json::utility::jsonObject& description, BaseComposite* parent) const
15 {
16 using json::utility::jsonObject;
17
19
20 parser.parse(description);
21
22 Button* result = nullptr;
23 uint32_t codepage = interfaces::ISerializable::getCodepage();
26
27 result = static_cast<Button*>(creator->create(utility::to_wstring(componentName, codepage), parser.settings, creationData.getData(), parent));
28
29 result->setBackgroundColor(parser.backgroundColor[0], parser.backgroundColor[1], parser.backgroundColor[2]);
30
31 return result;
32 }
33 }
34}
std::unique_ptr< T > smartPointerType
Compatible smart pointer type.
Base class for all windows, controls, etc.
virtual void setBackgroundColor(uint8_t red, uint8_t green, uint8_t blue)
Base class for all windows that has children windows.
Standard button.
Definition Button.h:12
const std::unordered_map< size_t, smartPointerType< utility::BaseComponentCreator > > & getCreators() const
Get all current registered creators.
static GUIFramework & get()
Singleton instance access.
BaseComponent * deserialize(const std::string &componentName, const json::utility::jsonObject &description, BaseComposite *parent) const override
Created component pointer already handled by its parent.
Base templated class for component creators.
wstring to_wstring(const string &stringToConvert, uint32_t codepage)
Definition Utility.cpp:82
Parse Button specific properties.
void parse(const json::utility::jsonObject &description) override