GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
TabControlCreator.cpp
Go to the documentation of this file.
1#include "TabControlCreator.h"
2
4
5using namespace std;
6
7namespace gui_framework
8{
9 namespace utility
10 {
11 BaseComponent* TabControlCreator::create(const wstring& windowName, const utility::ComponentSettings& settings, const any& additionalData, BaseComposite* parent)
12 {
13 auto [data, imagesWidth, imagesHeight] = any_cast<tuple<vector<TabControl::tabData>, uint16_t, uint16_t>>(additionalData);
14
15 TabControl* result = new TabControl(windowName, settings, parent, imagesWidth, imagesHeight);
16
17 for (const auto& i : data)
18 {
19 if (i.text.size() && !i.pathToImage.empty())
20 {
21 if (i.functionName.empty())
22 {
23 result->appendTextAndImage(i.text, i.pathToImage, i.callback);
24 }
25 else
26 {
27 result->appendTextAndImage(i.text, i.pathToImage, i.functionName, i.moduleName);
28 }
29 }
30 else if (i.text.size())
31 {
32 if (i.functionName.empty())
33 {
34 result->appendText(i.text, i.callback);
35 }
36 else
37 {
38 result->appendText(i.text, i.functionName, i.moduleName);
39 }
40 }
41 else if (!i.pathToImage.empty())
42 {
43 if (i.functionName.empty())
44 {
45 result->appendImage(i.pathToImage, i.callback);
46 }
47 else
48 {
49 result->appendImage(i.pathToImage, i.functionName, i.moduleName);
50 }
51 }
52 }
53
54 return result;
55 }
56 }
57}
Base class for all windows, controls, etc.
Base class for all windows that has children windows.
Standard tab control.
Definition TabControl.h:12
BaseComponent * create(const std::wstring &windowName, const utility::ComponentSettings &settings, const std::any &additionalData, BaseComposite *parent) override