GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
ImageButtonCreator.cpp
Go to the documentation of this file.
2
4
5using namespace std;
6
7namespace gui_framework
8{
9 namespace utility
10 {
11 BaseComponent* ImageButtonCreator::create(const wstring& windowName, const utility::ComponentSettings& settings, const any& additionalData, BaseComposite* parent)
12 {
13 auto [text, pathToImage, imageResource, resourceModuleName, imageWidth, imageHeight, dType, iType, onClick, onClickFunctionName, onClickFunctionModule] =
14 any_cast<tuple<wstring, filesystem::path, uint32_t, string, uint16_t, uint16_t, ImageButton::drawingType, ImageButton::imageType, function<void()>, string, string>>(additionalData);
15
16 if (pathToImage.empty())
17 {
18 return onClickFunctionName.empty() ?
19 new ImageButton(windowName, imageResource, dType, iType, imageWidth, imageHeight, settings, parent, onClick, resourceModuleName) :
20 new ImageButton(windowName, imageResource, dType, iType, imageWidth, imageHeight, settings, parent, onClickFunctionName, onClickFunctionModule, resourceModuleName);
21 }
22
23 return onClickFunctionName.empty() ?
24 new ImageButton(windowName, pathToImage, dType, iType, imageWidth, imageHeight, settings, parent, onClick) :
25 new ImageButton(windowName, pathToImage, dType, iType, imageWidth, imageHeight, settings, parent, onClickFunctionName, onClickFunctionModule);
26 }
27 }
28}
Base class for all windows, controls, etc.
Base class for all windows that has children windows.
Button with image.
Definition ImageButton.h:12
utility::BaseLoadableHolder::imageType imageType
Definition ImageButton.h:21
BaseComponent * create(const std::wstring &windowName, const utility::ComponentSettings &settings, const std::any &additionalData, BaseComposite *parent) override