9 void ITextListView::onRemove(
size_t index)
11 textData.erase(index);
14 LVITEMW ITextListView::makeItem(wstring_view text,
size_t index)
18 item.mask = LVIF_TEXT;
19 item.pszText =
const_cast<wchar_t*
>(text.data());
20 item.cchTextMax =
static_cast<int>(text.size());
21 item.iItem =
static_cast<int>(index);
39 return this->
insertTextItem(localization::WTextLocalization::get()[localizationKey], this->
size());
44 LRESULT result = this->
addItem(this->makeItem(text, index));
48 textData[
static_cast<size_t>(result)] = text.size();
56 return this->
insertTextItem(localization::WTextLocalization::get()[localizationKey], this->
size());
61 return this->
setItem(this->makeItem(text, index));
66 return this->
changeTextItem(localization::WTextLocalization::get()[localizationKey], index);
76 text.resize(textData.at(index) + 1);
78 catch (
const out_of_range&)
83 item.iItem =
static_cast<int>(index);
84 item.mask = LVIF_TEXT;
85 item.pszText = text.data();
86 item.cchTextMax =
static_cast<int>(text.size());
Provides adding, deleting, setting, getting items for other list view interfaces.
virtual void getItem(LVITEMW &item) const
virtual size_t size() const final
virtual LRESULT addItem(const LVITEMW &item)
virtual LRESULT setItem(const LVITEMW &item)
ITextListView(HWND handle)
virtual std::wstring getItemText(size_t index) const
virtual LRESULT insertTextItem(std::wstring_view text, size_t index)
virtual LRESULT addTextItem(const std::wstring &text)
virtual LRESULT changeTextItem(std::wstring_view text, size_t index)