31#if !defined ListView_InsertColumnW
32#define ListView_InsertColumnW(hwnd, iCol, pcol) \
33 static_cast<int>(SNDMSG((hwnd), LVM_INSERTCOLUMNW, WPARAM(int(iCol)), reinterpret_cast<LPARAM>(pcol)))
36#if !defined ListView_InsertItemW
37#define ListView_InsertItemW(hwnd, pitem) \
38 static_cast<int>(SNDMSG((hwnd), LVM_INSERTITEMW, 0, reinterpret_cast<LPARAM>(pitem)))
41#if !defined ListView_SetItemW
42#define ListView_SetItemW(hwnd, pitem) \
43 static_cast<bool>(SNDMSG((hwnd), LVM_SETITEMW, 0, reinterpret_cast<LPARAM>(pitem)))
48 HWND hwnd_lv,
const std::wstring& col1,
const std::wstring& col2)
56 const std::wstring& column1_title,
57 const std::wstring& column2_title) :
59 hwnd_list_view_(hwnd_list_view),
60 column1_title_(column1_title),
61 column2_title_(column2_title),
77 for (
const auto&
group : gl)
79 if (!
group.second.empty())
82 for (
const auto& item :
group.second)
83 insert_item(item.title_, item.value_, item.editable_);
90 HIMAGELIST h_ils = ImageList_Create(16,15,ILC_MASK, 7, 0);
92 ImageList_AddMasked(h_ils, h_bmp,
RGB(255, 0, 255));
105 lvc.pszText =
const_cast<wchar_t*
>(
header.c_str());
107 lvc.fmt = LVCFMT_LEFT;
112 lvc.pszText =
const_cast<wchar_t*
>(
header.c_str());
122 ZeroMemory(&lvg,
sizeof(lvg));
124 lvg.cbSize =
sizeof(lvg);
125 lvg.mask = LVGF_HEADER | LVGF_STATE | LVGF_GROUPID;
126 lvg.pszHeader =
const_cast<wchar_t*
>(
name.c_str());
127 lvg.cchHeader =
static_cast<int>(
name.size() + 1);
129 lvg.state = LVGS_NORMAL;
130 lvg.uAlign = LVGA_HEADER_CENTER;
142 lvi.mask = LVIF_TEXT | LVIF_GROUPID;
145 lvi.pszText =
const_cast<wchar_t*
>(title.c_str());
148 if (title.length() > 0)
150 lvi.mask |= LVIF_IMAGE;
160 lvi.mask = LVIF_TEXT;
162 lvi.pszText =
const_cast<wchar_t*
>(
value.c_str());
constexpr sal_Int8 header[]
virtual ~list_view_builder()
HWND get_list_view() const
virtual void insert_item(const std::wstring &title, const std::wstring &value, bool is_editable)
list_view_builder(HWND hwnd_list_view, const std::wstring &column1_title, const std::wstring &column2_title)
virtual void insert_group(const std::wstring &title)
virtual void setup_list_view()
void build(statistic_group_list_t &gl)
std::vector< statistic_group_t > statistic_group_list_t
#define ListView_InsertColumnW(hwnd, iCol, pcol)
#define ListView_InsertItemW(hwnd, pitem)
list_view_builder_ptr create_list_view_builder(HWND hwnd_lv, const std::wstring &col1, const std::wstring &col2)
#define ListView_SetItemW(hwnd, pitem)
std::unique_ptr< list_view_builder > list_view_builder_ptr
#define IDB_PROPERTY_IMAGES
#define IDS_PROPERTY_VALUE
std::wstring GetResString(int ResId)
Retrieve a string from the resources of this module.
HMODULE GetCurrentModuleHandle()