GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
CheckBoxCreator.cpp
Go to the documentation of this file.
1#include "CheckBoxCreator.h"
2
4
5using namespace std;
6
7namespace gui_framework
8{
9 namespace utility
10 {
11 BaseComponent* CheckBoxCreator::create(const wstring& windowName, const utility::ComponentSettings& settings, const any& additionalData, BaseComposite* parent)
12 {
13 auto [text, onCheck, onClear, onClick, onCheckFunctionName, onCheckFunctionModule, onClearFunctionName, onClearFunctionModule, onClickFunctionName, onClickFunctionModule] =
14 any_cast<tuple<wstring, function<void()>, function<void()>, function<void()>, string, string, string, string, string, string>>(additionalData);
15
16 CheckBox* result = new CheckBox(windowName, text, settings, parent, nullptr, nullptr, nullptr);
17
18 if (onCheck)
19 {
20 result->setOnCheck(onCheck);
21 }
22 else if (onCheckFunctionName.size())
23 {
24 result->setOnCheck(onCheckFunctionName, onCheckFunctionModule);
25 }
26
27 if (onClear)
28 {
29 result->setOnClear(onClear);
30 }
31 else if (onClearFunctionName.size())
32 {
33 result->setOnCheck(onClearFunctionName, onClearFunctionModule);
34 }
35
36 if (onClick)
37 {
38 result->setOnClick(onClick);
39 }
40 else if (onClickFunctionName.size())
41 {
42 result->setOnClick(onClickFunctionName, onClickFunctionModule);
43 }
44
45 return result;
46 }
47 }
48}
Base class for all windows, controls, etc.
Base class for all windows that has children windows.
Standard check box.
Definition CheckBox.h:9
BaseComponent * create(const std::wstring &windowName, const utility::ComponentSettings &settings, const std::any &additionalData, BaseComposite *parent) override