GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
HorizontalTrackbarControlDeserializer.cpp
Go to the documentation of this file.
2
5#include "GUIFramework.h"
7
8using namespace std;
9
10namespace gui_framework
11{
12 namespace deserializers
13 {
14 BaseComponent* HorizontalTrackbarControlDeserializer::deserialize(const std::string & componentName, const json::utility::jsonObject&description, BaseComposite * parent) const
15 {
16 using json::utility::jsonObject;
17
19
20 parser.parse(description);
21
22 HorizontalTrackbarControl* result = nullptr;
23 uint32_t codepage = interfaces::ISerializable::getCodepage();
26
27 result = static_cast<HorizontalTrackbarControl*>(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 result->setMinRange(parser.minRange);
32
33 result->setMaxRange(parser.maxRange);
34
35 result->setSelectionStart(parser.selectionStart);
36
37 result->setSelectionEnd(parser.selectionEnd);
38
39 return result;
40 }
41 }
42}
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.
virtual void setMinRange(int min) final
virtual void setMaxRange(int max) final
virtual void setSelectionStart(int startPosition) final
virtual void setSelectionEnd(int endPosition) final
const std::unordered_map< size_t, smartPointerType< utility::BaseComponentCreator > > & getCreators() const
Get all current registered creators.
static GUIFramework & get()
Singleton instance access.
Standard horizontal trackbar control.
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 TrackbarControl specific properties.
void parse(const json::utility::jsonObject &description) override