GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
BaseTabControl.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace gui_framework
7{
10 {
11 public:
13 {
14 std::wstring text;
15 std::filesystem::path pathToImage;
16 std::function<void()> callback;
17 std::string functionName;
18 std::string moduleName;
19
20 tabData() = default;
21
22 tabData(const std::wstring& text, const std::filesystem::path& pathToImage, const std::function<void()>& callback);
23
24 tabData(const std::wstring& text, const std::filesystem::path& pathToImage, const std::string& functionName, const std::string& moduleName);
25
26 tabData(const tabData&) = default;
27
28 tabData(tabData&&) noexcept = default;
29
30 tabData& operator = (const tabData&) = default;
31
32 tabData& operator = (tabData&&) noexcept = default;
33
34 ~tabData() = default;
35 };
36
37 protected:
38 utility::ImagesHolder images;
39 std::vector<std::function<void()>> callbacks;
40 std::vector<tabData> tabs;
41
42 protected:
43 virtual LRESULT windowMessagesHandle(HWND handle, UINT message, WPARAM wparam, LPARAM lparam, bool& isUsed) override;
44
45 public:
46 BaseTabControl(const std::wstring& tabControlName, const utility::ComponentSettings& settings, uint16_t imagesWidth, uint16_t imagesHeight, BaseComposite* parent);
47
48 virtual LRESULT appendText(const std::wstring& text, const std::function<void()>& onClick) final;
49
57 virtual LRESULT appendText(const std::wstring& text, const std::string& functionName, const std::string& moduleName) final;
58
59 virtual LRESULT insertText(size_t index, const std::wstring& text, const std::function<void()>& onClick) final;
60
69 virtual LRESULT insertText(size_t index, const std::wstring& text, const std::string& functionName, const std::string& moduleName) final;
70
75 virtual LRESULT appendImage(const std::filesystem::path& pathToImage, const std::function<void()>& onClick) final;
76
83 virtual LRESULT appendImage(const std::filesystem::path& pathToImage, const std::string& functionName, const std::string& moduleName) final;
84
90 virtual LRESULT insertImage(size_t index, const std::filesystem::path& pathToImage, const std::function<void()>& onClick) final;
91
99 virtual LRESULT insertImage(size_t index, const std::filesystem::path& pathToImage, const std::string& functionName, const std::string& moduleName) final;
100
106 virtual LRESULT appendTextAndImage(const std::wstring& text, const std::filesystem::path& pathToImage, const std::function<void()>& onClick) final;
107
115 virtual LRESULT appendTextAndImage(const std::wstring& text, const std::filesystem::path& pathToImage, const std::string& functionName, const std::string& moduleName) final;
116
123 virtual LRESULT insertTextAndImage(size_t index, const std::wstring& text, const std::filesystem::path& pathToImage, const std::function<void()>& onClick) final;
124
133 virtual LRESULT insertTextAndImage(size_t index, const std::wstring& text, const std::filesystem::path& pathToImage, const std::string& functionName, const std::string& moduleName) final;
134
135 virtual bool removeTab(size_t index) final;
136
137 virtual bool clear() final;
138
139 virtual size_t size() const final;
140
147 virtual bool setItem(size_t index, const std::function<void()>& callback, const std::wstring& text = L"", const std::filesystem::path& pathToImage = L"") final;
148
159 virtual bool setItem(size_t index, const std::string& functionName, const std::string& moduleName, const std::wstring& text = L"", const std::filesystem::path& pathToImage = L"") final;
160
163 virtual LRESULT setSelection(size_t index) final;
164
169 virtual const tabData& getItem(size_t index) const final;
170
171 virtual LRESULT getSelectedTab() const final;
172
173 virtual uint16_t getImagesWidth() const final;
174
175 virtual uint16_t getImagesHeight() const final;
176
182 virtual void setBackgroundColor(uint8_t red, uint8_t green, uint8_t blue) final override;
183
189 virtual void setTextColor(uint8_t red, uint8_t green, uint8_t blue) final override;
190
193 virtual size_t getHash() const override = 0;
194
195 virtual json::JSONBuilder getStructure() const override;
196
197 virtual ~BaseTabControl() = default;
198 };
199}
#define GUI_FRAMEWORK_API
Base class for all windows, controls, etc.
Base class for all windows that has children windows.
Base class for all tab controls.
tabData(tabData &&) noexcept=default
tabData(const tabData &)=default
tabData(const std::wstring &text, const std::filesystem::path &pathToImage, const std::function< void()> &callback)
tabData(const std::wstring &text, const std::filesystem::path &pathToImage, const std::string &functionName, const std::string &moduleName)