GUIFramework
1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
MainWindowParser.cpp
Go to the documentation of this file.
1
#include "
MainWindowParser.h
"
2
3
using namespace
std;
4
5
namespace
gui_framework
6
{
7
namespace
parsers
8
{
9
MainWindowParser::MainWindowParser
() :
10
trayIconResource(NULL),
11
alwaysShowTrayIcon(false)
12
{
13
14
}
15
16
void
MainWindowParser::parse
(
const
json::utility::jsonObject& description)
17
{
18
SeparateWindowParser::parse
(description);
19
20
if
(description.contains(
"trayIconResource"
, json::utility::variantTypeEnum::jInt64_t))
21
{
22
uint32_t codepage =
interfaces::ISerializable::getCodepage
();
23
24
trayIconResource
=
static_cast<
uint16_t
>
(description.getInt(
"trayIconResource"
));
25
alwaysShowTrayIcon
= description.getBool(
"alwaysShowTrayIcon"
);
26
27
if
(description.contains(
"items"
, json::utility::variantTypeEnum::jJSONArray))
28
{
29
for
(
const
json::utility::jsonObject& item : description.getArray(
"items"
))
30
{
31
items
.emplace_back
32
(
33
utility::to_wstring
(item.getString(
"text"
), codepage),
34
BaseMainWindow::Function
(item.getString(
"functionName"
), item.getString(
"moduleName"
))
35
);
36
}
37
}
38
}
39
}
40
}
41
}
MainWindowParser.h
gui_framework::interfaces::ISerializable::getCodepage
static uint32_t getCodepage()
Definition
ISerializable.h:25
gui_framework::utility::to_wstring
wstring to_wstring(const string &stringToConvert, uint32_t codepage)
Definition
Utility.cpp:82
gui_framework
Definition
BaseComponent.cpp:21
gui_framework::BaseMainWindow::Function
Definition
BaseMainWindow.h:14
gui_framework::parsers::MainWindowParser::parse
void parse(const json::utility::jsonObject &description) override
Definition
MainWindowParser.cpp:16
gui_framework::parsers::MainWindowParser::alwaysShowTrayIcon
bool alwaysShowTrayIcon
Definition
MainWindowParser.h:15
gui_framework::parsers::MainWindowParser::MainWindowParser
MainWindowParser()
Definition
MainWindowParser.cpp:9
gui_framework::parsers::MainWindowParser::trayIconResource
uint16_t trayIconResource
Definition
MainWindowParser.h:13
gui_framework::parsers::MainWindowParser::items
std::vector< std::pair< std::wstring, BaseMainWindow::Function > > items
Definition
MainWindowParser.h:14
gui_framework::parsers::SeparateWindowParser::parse
void parse(const json::utility::jsonObject &description) override
Definition
SeparateWindowParser.cpp:9
GUIFramework
src
Deserialization
Parsers
MainWindowParser.cpp
Generated by
1.12.0