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
3using namespace std;
4
5namespace gui_framework
6{
7 namespace parsers
8 {
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}
wstring to_wstring(const string &stringToConvert, uint32_t codepage)
Definition Utility.cpp:82
void parse(const json::utility::jsonObject &description) override
std::vector< std::pair< std::wstring, BaseMainWindow::Function > > items
void parse(const json::utility::jsonObject &description) override