GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
GroupBoxParser.cpp
Go to the documentation of this file.
1#include "GroupBoxParser.h"
2
3#include "Utility/Utility.h"
5
6using namespace std;
7
8namespace gui_framework
9{
10 namespace parsers
11 {
12 void GroupBoxParser::parse(const json::utility::jsonObject& description)
13 {
14 using json::utility::jsonObject;
15
16 BaseCompositeParser::parse(description);
17
18 const auto& children = description.getArray("children");
19 uint32_t codepage = interfaces::ISerializable::getCodepage();
20
21 data.reserve(children.size());
22
23 for (const auto& i : children)
24 {
25 const auto& [componentName, tem] = get<jsonObject>(i.data.front().second).data.front();
26
27 const auto& child = get<jsonObject>(tem);
28
29 auto& radioButtonData = data.emplace_back();
30
31 radioButtonData.functionName = child.getString("functionName");
32
33 radioButtonData.moduleName = child.getString("moduleName");
34
35 radioButtonData.radioButtonText = utility::to_wstring(child.getString("text"), codepage);
36
37 radioButtonData.radioButtonName = utility::to_wstring(componentName, codepage);
38
39 radioButtonData.x = static_cast<int>(child.getInt("desiredX"));
40
41 radioButtonData.y = static_cast<int>(child.getInt("desiredY"));
42
43 radioButtonData.width = static_cast<uint16_t>(child.getUnsignedInt("desiredWidth"));
44
45 radioButtonData.height = static_cast<uint16_t>(child.getUnsignedInt("desiredHeight"));
46 }
47 }
48 }
49}
wstring to_wstring(const string &stringToConvert, uint32_t codepage)
Definition Utility.cpp:82
virtual void parse(const json::utility::jsonObject &description) override
void parse(const json::utility::jsonObject &description) override
std::vector< GroupBox::radioButtonData > data