GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
ImageButton.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace gui_framework
7{
10 public BaseButton,
12 {
13 public:
14 enum class drawingType
15 {
16 image,
17 text,
18 textAndImage
19 };
20
22
23 private:
24 std::filesystem::path pathToImage;
25 std::any image;
26 std::string resourceModuleName;
27 drawingType dType;
28 imageType iType;
29 uint32_t imageResource;
30 uint16_t imageWidth;
31 uint16_t imageHeight;
32
33 private:
34 void drawImage();
35
36 public:
37 ImageButton(const std::wstring& buttonName, const std::filesystem::path& pathToImage, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight, const utility::ComponentSettings& settings, BaseComposite* parent, const std::function<void()>& onClick = nullptr);
38
39 ImageButton(const std::wstring& buttonName, const std::filesystem::path& pathToImage, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight, const utility::ComponentSettings& settings, BaseComposite* parent, const std::string& functionName, const std::string& moduleName);
40
41 ImageButton(const std::wstring& buttonName, uint32_t imageResources, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight, const utility::ComponentSettings& settings, BaseComposite* parent, const std::function<void()>& onClick = nullptr, const std::string& resourceModuleName = "");
42
43 ImageButton(const std::wstring& buttonName, uint32_t imageResources, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight, const utility::ComponentSettings& settings, BaseComposite* parent, const std::string& functionName, const std::string& moduleName, const std::string& resourceModuleName = "");
44
45 void setImage(const std::filesystem::path& pathToImage, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight);
46
47 void setImage(uint32_t imageResource, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight, const std::string& resourceModuleName);
48
49 const std::filesystem::path& getPathToImage() const;
50
51 uint16_t getImageWidth() const;
52
53 uint16_t getImageHeight() const;
54
55 drawingType getDrawingType() const;
56
57 imageType getImageType() const;
58
59 size_t getHash() const override;
60
61 json::JSONBuilder getStructure() const override;
62
64 };
65}
#define GUI_FRAMEWORK_API
Base class for all buttons.
Definition BaseButton.h:15
Base class for all windows that has children windows.
Button with image.
Definition ImageButton.h:12
ImageButton(const std::wstring &buttonName, uint32_t imageResources, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight, const utility::ComponentSettings &settings, BaseComposite *parent, const std::function< void()> &onClick=nullptr, const std::string &resourceModuleName="")
void setImage(const std::filesystem::path &pathToImage, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight)
void setImage(uint32_t imageResource, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight, const std::string &resourceModuleName)
ImageButton(const std::wstring &buttonName, const std::filesystem::path &pathToImage, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight, const utility::ComponentSettings &settings, BaseComposite *parent, const std::string &functionName, const std::string &moduleName)
ImageButton(const std::wstring &buttonName, uint32_t imageResources, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight, const utility::ComponentSettings &settings, BaseComposite *parent, const std::string &functionName, const std::string &moduleName, const std::string &resourceModuleName="")
ImageButton(const std::wstring &buttonName, const std::filesystem::path &pathToImage, drawingType dType, imageType iType, uint16_t imageWidth, uint16_t imageHeight, const utility::ComponentSettings &settings, BaseComposite *parent, const std::function< void()> &onClick=nullptr)
Provides resize, setBlockResize, getBlockResize methods.