GUIFramework 1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
BaseListIconListView.cpp
Go to the documentation of this file.
2
5
6using namespace std;
7
8namespace gui_framework
9{
10 BaseListIconListView::BaseListIconListView(const wstring& listViewName, const utility::ComponentSettings& settings, BaseComposite* parent, utility::iconListViewType type, uint16_t iconsWidth, uint16_t iconsHeight, size_t count) :
12 (
13 listViewName,
14 settings,
15 styles::ListIconListViewStyles(type),
16 parent
17 ),
18 IIconListView(handle, icons),
19 icons(iconsWidth, iconsHeight, count)
20 {
21 SendMessageW(handle, LVM_SETIMAGELIST, type == utility::iconListViewType::icon ? LVSIL_NORMAL : LVSIL_SMALL, reinterpret_cast<LPARAM>(icons.getImageList()));
22 }
23
24 void BaseListIconListView::setTextColor(uint8_t red, uint8_t green, uint8_t blue)
25 {
26 __utility::throwNotImplementedException(__FUNCTION__, "BaseListIconListView"sv);
27 }
28
29 json::JSONBuilder BaseListIconListView::getStructure() const
30 {
31 using json::utility::jsonObject;
32
33 uint32_t codepage = ISerializable::getCodepage();
34 json::JSONBuilder builder = BaseListView::getStructure();
35 jsonObject& current = get<jsonObject>(builder[utility::to_string(windowName, codepage)]);
36 vector<jsonObject> values;
37 size_t size = this->size();
38
39 current.data.push_back({ "imagesWidth"s, static_cast<uint64_t>(icons.getImagesWidth()) });
40 current.data.push_back({ "imagesHeight"s, static_cast<uint64_t>(icons.getImagesHeight()) });
41
42 if (size)
43 {
44 for (size_t i = 0; i < size; i++)
45 {
46 json::utility::appendArray(this->getIconPath(i).string(), values);
47 }
48
49 current.data.push_back({ "listViewIconValues"s, move(values) });
50 }
51
52 return builder;
53 }
54}
virtual json::JSONBuilder getStructure() const override
const std::wstring windowName
Base class for all windows that has children windows.
BaseListIconListView(const std::wstring &listViewName, const utility::ComponentSettings &settings, BaseComposite *parent, utility::iconListViewType type, uint16_t iconsWidth, uint16_t iconsHeight, size_t count=standard_sizes::defaultImagesCount)
virtual void setTextColor(uint8_t red, uint8_t green, uint8_t blue) override
Not implemented.
virtual json::JSONBuilder getStructure() const override
Base class for all list views in list mode.
virtual std::filesystem::path getIconPath(size_t index) const
virtual uint16_t getImagesWidth() const final
virtual HIMAGELIST getImageList() const final
virtual uint16_t getImagesHeight() const final
void throwNotImplementedException(string_view methodName, string_view className)
Definition Utility.cpp:186
string to_string(wstring_view stringToConvert, uint32_t codepage)
Definition Utility.cpp:41