GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
BaseCheckBox.h
Go to the documentation of this file.
1#pragma once
2
3#include "BaseButton.h"
4
5namespace gui_framework
6{
9 {
10 public:
11 inline static constexpr uint16_t checkBoxWidth = 200;
12 inline static constexpr uint16_t checkBoxHeight = 20;
13
14 protected:
15 std::function<void()> onCheck;
16 std::function<void()> onClear;
18 std::string onCheckModuleName;
20 std::string onClearModuleName;
21
22 private:
23 virtual LRESULT windowMessagesHandle(HWND handle, UINT message, WPARAM wparam, LPARAM lparam, bool& isUsed) final override;
24
25 public:
26 BaseCheckBox(const std::wstring& checkBoxName, const std::wstring& checkBoxText, const utility::ComponentSettings& settings, BaseComposite* parent, const std::function<void()>& onCheck, const std::function<void()>& onClear, const std::function<void()>& onClick = nullptr);
27
28 void setOnCheck(const std::function<void()>& onCheck);
29
30 void setOnCheck(const std::string& functionName, const std::string& moduleName);
31
32 void setOnClear(const std::function<void()>& onClear);
33
34 void setOnClear(const std::string& functionName, const std::string& moduleName);
35
36 const std::function<void()>& getOnCheck() const;
37
38 const std::function<void()>& getOnClear() const;
39
42 virtual size_t getHash() const override = 0;
43
44 virtual json::JSONBuilder getStructure() const override;
45
46 virtual ~BaseCheckBox() = default;
47 };
48}
#define GUI_FRAMEWORK_API
Base class for all buttons.
Definition BaseButton.h:15
Base class for all check boxes.
Definition BaseCheckBox.h:9
virtual size_t getHash() const override=0
Used as key in creators.
virtual ~BaseCheckBox()=default
void setOnCheck(const std::string &functionName, const std::string &moduleName)
void setOnClear(const std::string &functionName, const std::string &moduleName)
void setOnClear(const std::function< void()> &onClear)
void setOnCheck(const std::function< void()> &onCheck)
std::function< void()> onClear
std::function< void()> onCheck
Base class for all windows that has children windows.