19#if defined(__BORLANDC__)
49 *
static_cast<LVFINDINFO*
>(
this) = findInfo;
50 if ((flags & LVFI_STRING) || (flags & LVFI_PARTIAL))
82 flags &= ~LVFI_PARTIAL;
96 flags |= LVFI_PARTIAL;
154 CHECK(bufferSize > 0);
155 Buffer.resize(bufferSize);
196 if (mask_ & LVIF_TEXT)
198 CHECK(bufferSize > 0);
199 Buffer.resize(bufferSize);
202 ctl.
GetItem(*
this, index, subitemIndex);
237 *
static_cast<LVITEM*
>(
this) = item;
238 if ((mask & LVIF_TEXT) && (pszText != LPSTR_TEXTCALLBACK) && pszText)
251 return operator =(
static_cast<const LVITEM&
>(item));
268 if (!(mask & LVIF_TEXT) || (pszText == LPSTR_TEXTCALLBACK) || (cchTextMax <= 0))
return nullptr;
272 LPTSTR i = std::find(pszText, pszText + cchTextMax,
_T(
'\0'));
273 size_t n = i - pszText;
274 size_t m =
static_cast<size_t>(cchTextMax);
276 if (n == m)
throw TXOwl(
_T(
"TLvItem::GetText: Buffer overflow"));
298 if (bufferSize == 0)
throw TXOwl(
_T(
"TLvItem::GetText: Buffer size is 0"));
302 buffer[0] =
_T(
'\0');
309 size_t textLength =
_tcslen(pszText);
310 CHECK(textLength <
static_cast<size_t>(cchTextMax));
311 WARN(textLength >= bufferSize,
_T(
"TLvItem::GetText: Truncation"));
312 size_t n = std::min(textLength, bufferSize - 1);
313 std::copy(pszText, pszText + n, buffer);
314 buffer[n] =
_T(
'\0');
334 cchTextMax = bufferSize;
353 throw TXOwl(
_T(
"TLvItem::SetText: The text argument is too large (>INT_MAX)"));
355 Buffer.assign(text.begin(), text.end());
405 iSubItem = subitemIndex;
416 return (mask & LVIF_PARAM) ? lParam : 0;
441 return (mask & LVIF_IMAGE) ? iImage : -1;
466 return (mask & LVIF_STATE) ? state : 0;
492 return ((mask & LVIF_STATE) && (stateMask & LVIS_STATEIMAGEMASK)) ? (state >> 12) - 1 : -1;
506 stateMask |= LVIS_STATEIMAGEMASK;
507 state = INDEXTOSTATEIMAGEMASK(stateIndex + 1);
518 return (mask & LVIF_INDENT) ? iIndent : -1;
543 memset(
static_cast<LVITEM*
>(
this), 0,
sizeof(LVITEM));
570 if (mask_ & LVCF_TEXT)
572 CHECK(bufferSize > 0);
573 Buffer.resize(bufferSize);
610 if (mask_ & LVCF_TEXT)
612 CHECK(bufferSize > 0);
613 Buffer.resize(bufferSize);
651 *
static_cast<LVCOLUMN*
>(
this) = column;
652 if ((mask & LVCF_TEXT) && pszText)
665 return operator =(
static_cast<const LVCOLUMN&
>(column));
685 cchTextMax = bufferSize;
704 throw TXOwl(
_T(
"TLvColumn::SetText: The text argument is too large (>INT_MAX)"));
706 Buffer.assign(text.begin(), text.end());
724 fmt =
static_cast<int>(how);
757 mask |= LVCF_SUBITEM;
758 iSubItem = subitemIndex;
791 return (mask & LVCF_WIDTH) ? cx : -1;
802 return (mask & LVCF_SUBITEM) ? iSubItem : -1;
813 return (mask & LVCF_IMAGE) ? iImage : -1;
838 return (mask & LVCF_ORDER) ? iOrder : -1;
863 memset(
static_cast<LVCOLUMN*
>(
this), 0,
sizeof(LVCOLUMN));
874 cbSize =
sizeof(LVTILEVIEWINFO);
876 dwFlags = LVTVIF_AUTOSIZE;
879 rcLabelMargin = {0, 0, 0, 0};
890 cbSize =
sizeof(LVTILEVIEWINFO);
891 dwMask = LVTVIM_COLUMNS;
892 dwFlags = LVTVIF_AUTOSIZE;
895 rcLabelMargin = {0, 0, 0, 0};
906 cbSize =
sizeof(LVTILEVIEWINFO);
907 dwMask = LVTVIM_LABELMARGIN;
908 dwFlags = LVTVIF_AUTOSIZE;
911 rcLabelMargin = labelMargin;
925 cbSize =
sizeof(LVTILEVIEWINFO);
926 dwMask = LVTVIM_COLUMNS | LVTVIM_LABELMARGIN;
927 dwFlags = LVTVIF_AUTOSIZE;
930 rcLabelMargin = labelMargin;
941 cbSize =
sizeof(LVTILEVIEWINFO);
942 dwMask = LVTVIM_TILESIZE;
943 dwFlags =
static_cast<DWORD
>(fixedSize);
946 rcLabelMargin = {0, 0, 0, 0};
959 cbSize =
sizeof(LVTILEVIEWINFO);
960 dwMask = LVTVIM_TILESIZE | LVTVIM_COLUMNS;
961 dwFlags =
static_cast<DWORD
>(fixedSize);
964 rcLabelMargin = {0, 0, 0, 0};
977 cbSize =
sizeof(LVTILEVIEWINFO);
978 dwMask = LVTVIM_TILESIZE | LVTVIM_LABELMARGIN;
979 dwFlags =
static_cast<DWORD
>(fixedSize);
982 rcLabelMargin = labelMargin;
998 cbSize =
sizeof(LVTILEVIEWINFO);
999 dwMask = LVTVIM_TILESIZE | LVTVIM_COLUMNS | LVTVIM_LABELMARGIN;
1000 dwFlags =
static_cast<DWORD
>(fixedSize);
1003 rcLabelMargin = labelMargin;
1014 dwFlags = LVTVIF_AUTOSIZE;
1015 dwMask &= ~static_cast<DWORD>(LVTVIM_TILESIZE);
1029 dwFlags =
static_cast<DWORD
>(fixedSize);
1031 dwMask |= LVTVIM_TILESIZE;
1045 dwMask |= LVTVIM_COLUMNS;
1057 dwMask &= ~static_cast<DWORD>(LVTVIM_COLUMNS);
1070 rcLabelMargin = labelMargin;
1071 dwMask |= LVTVIM_LABELMARGIN;
1082 rcLabelMargin = {0, 0, 0, 0};
1083 dwMask &= ~static_cast<DWORD>(LVTVIM_LABELMARGIN);
1109 TControl(parent, id, 0, x, y, w, h, module)
1121 TControl(parent, resourceId, module)
1245 if (subitemIndex != -1)
1246 item.iSubItem = subitemIndex;
1262 auto r =
GetItem(item, index, subitemIndex);
1263 WARN(!r,
_T(
"TListViewCtrl::GetItem failed for index ") << index <<
_T(
".") << subitemIndex);
InUse(r);
1283 if (index != -1 || subitemIndex != -1)
1289 if (subitemIndex != -1)
1290 temp.iSubItem = subitemIndex;
1327 return static_cast<int>(
SendMessage(LVM_GETITEMCOUNT));
1392 WARN(!r,
_T(
"TListViewCtrl::GetItemPosition failed for index ") << index);
InUse(r);
1413 WARN(
true,
_T(
"TListViewCtrl::SetItemPosition: Use TListViewCtrl::SetItemPosition32 instead to avoid possible exception"));
1415 throw TXOwl(
_T(
"TListViewCtrl:SetItemPosition: Argument is outside valid range"));
1470 WARN(!r,
_T(
"TListViewCtrl::GetItemRect failed for index ") << index);
InUse(r);
1507 item.stateMask = mask;
1626 return SetItemText(index, subitemIndex, text.c_str());
1763 struct TListCompareThunk
1769 int CALLBACK OwlListViewCompare(LPARAM itemData1, LPARAM itemData2, LPARAM lParam)
1771 TListCompareThunk* ct =
reinterpret_cast<TListCompareThunk*
>(lParam);
1772 return ct->This->Compare(itemData1, itemData2, ct->ItemData);
1798 TListCompareThunk ct;
1799 ct.This = &comparator;
1800 ct.ItemData = lParam;
1816 TListCompareThunk ct;
1817 ct.This = &comparator;
1818 ct.ItemData = lParam;
1890 return static_cast<int>(
SendMessage(LVM_GETSELECTEDCOUNT));
1918 for (count = 0; count < maxCount; ++count)
1923 if (index == -1)
break;
1924 indexes[count] = index;
1998 for (count = 0; count < maxCount; ++count)
2003 if (index == -1)
break;
2004 GetItemText(index, subitemIndex, strs[count], maxChars);
2040 if ((
GetStyle() & LVS_SINGLESEL) && select && (count > 1))
2043 for (
int i = 0; i < count; i++)
2044 if (!
SetSel(indexes[i], select))
2067 if ((
GetStyle() & LVS_SINGLESEL) && select && (first < last))
2070 for (
int i = first; i <= last; i++)
2088 return static_cast<int>(
SendMessage(LVM_GETSELECTEDCOLUMN));
2170 return static_cast<COLORREF
>(
SendMessage(LVM_GETBKCOLOR));
2202 return static_cast<COLORREF
>(
SendMessage(LVM_GETTEXTBKCOLOR));
2234 return static_cast<COLORREF
>(
SendMessage(LVM_GETTEXTCOLOR));
2300 return static_cast<int>(
SendMessage(LVM_GETTOPINDEX));
2331 return reinterpret_cast<HWND
>(
SendMessage(LVM_GETEDITCONTROL));
2591 return static_cast<int>(
SendMessage(LVM_GETCOUNTPERPAGE));
2610 auto size =
static_cast<int>(
SendMessage(LVM_GETISEARCHSTRING));
2611 if (!size)
return s;
2635 for (
auto i = 0; i < n; ++i)
2676 throw TXOwl(
_T(
"TListViewCtrl:GetApproxRect: Argument is outside valid range"));
2678 return TPoint(
static_cast<LPARAM
>(r));
2757 return reinterpret_cast<HWND
>(
SendMessage(LVM_GETHEADER));
2773 return reinterpret_cast<HCURSOR
>(
SendMessage(LVM_GETHOTCURSOR));
2805 return static_cast<int>(
SendMessage(LVM_GETHOTITEM));
2841 rect = {
static_cast<int>((type ==
SelectBounds) ?
Bounds : type), subitemIndex, 0, 0 };
2908 if ((y != -1) && ((x < 0) || (y < 0)))
2909 throw TXOwl(
_T(
"TListViewCtrl:SetIconSpacing: Argument is outside valid range"));
3049 return static_cast<int>(
SendMessage(LVM_GETSELECTIONMARK));
3091 rect = {
static_cast<int>((type ==
SelectBounds) ?
Bounds : type), subitemIndex, 0, 0 };
3092 LVITEMINDEX itemIndex = { index, group };
3112 LVITEMINDEX itemIndex = { index, group };
3131 LVITEMINDEX itemIndex = { index, group };
3185 info.mask = LVFF_ITEMCOUNT;
3187 WARN(!r,
_T(
"TListViewCtrl::GetFooterInfo failed"));
InUse(r);
3188 return static_cast<int>(info.cItems);
3218 std::wstring s(1024, L
'\0');
3224 item.mask = LVFIF_TEXT;
3225 item.pszText = &s[0];
3226 item.cchTextMax =
static_cast<int>(s.size());
3228 WARN(!r,
_T(
"TListViewCtrl::GetFooterItem failed for index ") << index);
InUse(r);
3229 s.resize(
wcslen(s.data()));
3246 item.mask = LVFIF_STATE;
3247 item.stateMask =
static_cast<UINT
>(mask);
3252 WARN(!r,
_T(
"TListViewCtrl::GetFooterItem failed for index ") << index);
InUse(r);
3283 WARN(!r,
_T(
"TListViewCtrl::GetFooterItemRect failed for index ") << index);
InUse(r);
3311 WARN(!r,
_T(
"TListViewCtrl::GetFooterRect failed"));
InUse(r);
3324 auto g = LVGROUP{
sizeof(LVGROUP), mask};
3325 const auto r =
static_cast<int>(
SendMessage(LVM_GETGROUPINFO, groupId,
reinterpret_cast<TParam2>(&g)));
3326 WARN(r < 0,
_T(
"TListViewCtrl::GetGroupInfo failed"));
InUse(r);
3417 return reinterpret_cast<HWND
>(
SendMessage(LVM_GETTOOLTIPS));
3465 LVSETINFOTIP lvSetInfoTip = {
sizeof(LVSETINFOTIP), 0,
const_cast<LPWSTR
>(text ? text : L
""), index, subitemIndex };
3479 LPWSTR wtext =
nullptr;
3487 auto wsize = ::MultiByteToWideChar(CP_ACP, 0, text, -1,
nullptr, 0);
3490 WARN(
true,
_T(
"TListViewCtrl::SetInfoTip ::MultiByteToWideChar returned zero size for text string"));
3496 wtext =
new wchar_t [wsize];
3499 WARN(
true,
_T(
"TListViewCtrl::SetInfoTip Memory for wide char buffer failed"));
3505 if (!::MultiByteToWideChar(CP_ACP, 0, text, -1, wtext, wsize))
3507 WARN(
true,
_T(
"TListViewCtrl::SetInfoTip ::MultiByteToWideChar conversion failed for text string"));
3515 auto ret =
SetInfoTip(wtext, index, subitemIndex);
3519 if (wtext)
delete [] wtext;
3533 return SetInfoTip(text.c_str(), index, subitemIndex);
3694#if defined(OWL5_COMPAT)
3737 return FindItem(index, *findInfo);
#define WARN(condition, message)
#define PRECONDITION(condition)
Class wrapper for management of color values.
TColor()
Construct a null color.
TControl(TWindow *parent, int id, LPCTSTR title, int x, int y, int w, int h, TModule *module=nullptr)
Invokes TWindow's constructor, passing it parent (parent window), title (caption text),...
@ sfiIcon
Represents ICONMETRICS::lfFont.
TDefaultGuiFont(TSystemFontId=sfiLegacyDefault)
Create a wrapper for the given system font.
Pure virtual base class for comparing sort items.
Encapsulates the ListView control, a window that displays a collection of items, each item consisting...
auto GetNextItem(int index, uint flags=TNextItemCode::All) const -> int
Searches for a list-view item that has the specified properties and bears the specified relationship ...
auto GetHoverTime() const -> uint32
Retrieves the amount of time that the mouse cursor must hover over an item before it is selected.
auto GetSubItemRect(TRect &rect, int subitemIndex=0, int index=0, TItemRectType type=Bounds) const -> bool
Retrieves the bounding rectangle for a subitem in a list-view control when in report view.
auto EditLabel(int index) -> HWND
Begins in-place editing of the list-view item's text.
auto DeleteAllItems() -> bool
Deletes all items from the list.
auto GetFocusItem() -> int
Retrieves the item index of the item that has the focus.
auto GetTopIndex() const -> int
Retrieves the topmost visible item index when in list or report view.
auto GetNextSelIndex(int index=-1) const -> int
Searches for the next selected item after a given index.
auto SetColumnOrder(int count, const int *array) -> bool
Sets the current left-to-right order of columns in a list-view control.
auto SetSelIndexes(int *indexes, int numSelections, bool select) -> bool
Selects or deselects items.
auto CalculateColumnWidth(LPCTSTR text, int padding=12) const -> int
Calculates a suitable column pixel width for the given string.
auto DeleteItem(int index) -> bool
Deletes an item from the list.
auto GetUnicodeFormat() const -> bool
Queries whether the Unicode character set is being used instead of ANSI.
auto GetApproxRect(int x=-1, int y=-1, int count=-1) const -> TSize
Calculates the approximate width and height required to display a given number of items.
auto GetItemIndexRect(int index, int group, int subitemIndex, TRect &rect, TItemRectType type) const -> bool
Sets the bounding rectangle for a subitem.
auto IsItemVisible(int index) const -> bool
Queries whether an item is visible.
auto GetNextItemIndex(int index, int group, uint flags=TNextItemCode::All) const -> int
Searches for a list-view item that has the specified properties and bears the specified relationship ...
auto GetNumOfWorkAreas() const -> uint
Retrieves the number of working areas in a list-view control.
auto GetSelIndexes(int *indexes, int maxCount) const -> int
Retrieves the indexes of the selected items.
auto GetViewRect(TRect &rect) const -> bool
Retrieves the bounding rectangle of all items in the list-view control when in icon or small icon vie...
auto GetISearchString() const -> tstring
Retrieves the incremental search string.
auto GetExtStyle() const -> uint32
Retrieves the extended styles that are currently in use for a given list-view control.
auto GetCountPerPage() const -> int
Calculates the number of items that can fit vertically in the visible area of a list-view control whe...
auto SetItemIndexState(const TLvItem &item, int index, int group) -> bool
Sets the state of a list-view item.
auto SetTileViewInfo(const TLvTileViewInfo &tileViewInfo) -> bool
Sets tile view information.
auto GetStringWidth(LPCTSTR text) const -> int
Calculates the exact width in pixels of the given string using the control's current font.
auto GetBkColor() const -> TColor
Retrieves the background color of a list-view control.
auto SetItemCount(int numItems, TSetItemCountBehavior behavior=Unspecified) -> bool
Sets the number of items that the list-view control will ultimately contain.
auto GetSelIndex() const -> int
Retrieves the selected item index.
auto GetEmptyText() const -> tstring
Retrieves the string to display when the list-view control appears empty.
auto GetTileViewInfo(TLvTileViewInfo &tileViewInfo) const -> void
Retrieves tile view information.
auto GetEditControl() const -> HWND
Retrieves the handle to the edit control used to edit a list-view item's text.
auto SortItemsEx(const TCompareFunc &Comparator, LPARAM lParam=0) -> bool
Sorts the list items.
auto GetItemPosition(int index, TPoint &pt) const -> bool
Retrieves the position of a list-view item.
auto AddItem(const TLvItem &item) -> int
Adds a new item to the end of the list.
auto GetHotItem() const -> int
Retrieves the index of the hot item.
auto SetItemPosition(int index, const TPoint &pt) -> bool
Sets the position of a list-view item.
auto Arrange(TArrangeCode code) -> bool
Arranges items in icon view.
TViewType
Describes the type of views.
auto GetItemCount() const -> int
Retrieves the number of items in the list-view control.
TImageListType
Describes the type of image list for use with the list window control.
auto SetFocusItem(int index, bool focused=true) -> bool
Sets or removes the focus for an item.
auto GetImageList(TImageListType type) const -> HIMAGELIST
Retrieves the handle to an image list used for drawing list-view items.
virtual auto GetWindowClassName() -> TWindowClassName
auto GetColumnOrder(int count, int *array) const -> bool
Retrieves the current left-to-right order of columns in a list-view control.
auto GetSelString(tchar *str, int maxChars, int subitemIndex=0) const -> bool
Retrieves the selected item or item subitem text.
auto GetSelectionMark() const -> int
Retrieves the selection mark from a list-view control.
auto GetSelCount(void) const -> int
Retrieves the number of selected items.
auto SortItems(const TCompareFunc &Comparator, LPARAM lParam=0) -> bool
Sorts the list items.
auto GetItemState(int index, uint mask) const -> TLvItem::TListState
Retrieves the current state for an item.
auto FindItem(int index, const TLvFindInfo &findInfo) const -> int
Searches for an item with the specified characteristics.
auto SetColumn(int colNum, const TLvColumn &column) -> bool
Sets the attributes of a list-view control's column.
auto GetToolTips() const -> HWND
Retrieves the handle of the tooltip control that the list-view control uses to display tooltips.
auto InsertItem(const TLvItem &item, int index=-1) -> int
Inserts a new item to the list.
TSetItemCountBehavior
Describes the behavior for the control when setting the item count.
auto SetIconSpacing(int x, int y) -> TSize
Sets the spacing between icons in list-view controls that have the LVS_ICON style.
TArrangeCode
TArrangeCode is used to describe how to arrange the items in a list window control.
auto GetColumnWidth(int colNum) const -> int
Retrieves the width of a column in report or list view.
auto GetOutlineColor() const -> TColor
Retrieves the list-view control border color.
auto SubItemHitTest(TLvHitTestInfo &info) const -> int
Determines which list-view item or subitem is at a given position.
auto SetTextBkColor(const TColor &c) -> bool
Sets the background color of text in a list-view control.
auto GetFooterItemText(int index) const -> std::wstring
Footer item text string return overload for GetFooterItem(int, TLvFooterItem&) const .
TListViewCtrl(TWindow *parent, int id, int x, int y, int w, int h, TModule *module=0)
Constructor that simply passes the parameters to the parent TControl::TControl(TWindow*,...
auto HitTest(TLvHitTestInfo &) const -> int
Determines whether a list-view item is at a specified position.
auto GetGroupInfo(int groupId, uint mask=0xFFFFFFFF) -> LVGROUP
Gets group information.
auto SetHotItem(int index) -> int
Sets the index of the hot item.
auto Update(int index) -> bool
Updates a list-view item.
auto GetTileInfo(PLVTILEINFO lvTileInfo) const -> void
Retrieves information about a tile in a list-view control.
auto SetTileInfo(PLVTILEINFO lvTileInfo) -> bool
Sets information about a tile in a list-view control.
auto GetTextBkColor() const -> TColor
Retrieves the text background color of a list-view control.
auto GetOrigin(TPoint &pt) const -> bool
Retrieves the current view origin for a list-view control.
auto CancelEditLabel() -> void
Cancels an item text editing operation.
auto GetFooterInfo(TLvFooterInfo &info) const -> bool
Retrieves information about the footer of a list-view control.
auto SetItemState(int index, TLvItem::TListState state, uint mask) -> bool
Sets the current state for an item.
auto SetTextColor(const TColor &c) -> bool
Sets the color of text in a list-view control.
auto SetSel(int index, bool select) -> bool
Selects or deselects an item.
TItemRectType
Describes the type of rectangle boundaries to retrieve.
@ Bounds
Entire boundary (icon and label).
@ SelectBounds
Union of Icon+Label but no colmns.
auto SetExtStyle(uint32 mask, uint32 style) -> uint32
Sets the extended styles to use for a given list-view control.
auto SetImageList(HIMAGELIST list, TImageListType type) -> HIMAGELIST
Assigns an image list to a list-view control.
auto MapIndexToId(int index) const -> TItemId
Associates a unique identifier with an item.
auto Scroll(int dx, int dy) -> bool
Scrolls the content of a list-view control.
auto DeleteColumn(int colNum) -> bool
Deletes a column in a list-view control.
auto SetInfoTip(LPCWSTR text, int index, int subitemIndex=0) -> bool
Sets tooltip text in delayed response to the LVN_GETINFOTIP notification.
auto SetBkColor(const TColor &c) -> bool
Sets the background color of a list-view control.
auto GetView() const -> TViewType
Retrieves the view type.
auto RedrawItems(int startIndex, int endIndex) -> bool
Forces a list-view control to redraw a range of items.
auto IsSelected(int index) const -> bool
Queries if an item is selected.
auto SetSelItemRange(bool select, int first, int last) -> bool
Selects or deselects a range of items.
auto SetBkImage(const TLvBkImage &bkimg) -> bool
Sets the background image in a list-view control.
auto GetItemText(int index, TLvItem &item) const -> int
Retrieves the text of the item.
auto GetSelStrings(tchar **strs, int maxCount, int maxChars, int subitemIndex=0) const -> int
Retrieves the item or subitem strings of the selected items.
auto GetHotCursor() const -> HCURSOR
Retrieves the cursor handle used when the pointer is over an item while hot tracking is enabled.
auto MapIdToIndex(TItemId id) const -> int
Retrieves the current index for the item with the given unique identifier.
auto SetToolTips(THandle handle) -> HWND
Sets the handle of the tooltip control that the list-view control uses to display tooltips.
auto GetColumn(int colNum, TLvColumn &column) const -> bool
Retrieves the attributes of a list-view control's column.
auto GetSelectedColumn() const -> int
Retrieves the currently selected column number.
auto GetCallBackMask() const -> TLvItem::TListState
Retrieves the callback mask for a list-view control.
auto EnsureVisible(int index, bool partialOk) -> bool
Ensures that a list-view item is either partially or entirely visible, scrolling the list-view contro...
auto SetSelectedColumn(int colNum) -> void
Sets the selected column number.
auto GetFooterRect(TRect &rect) const -> bool
Retrieves the coordinates of the footer for a list-view control.
auto SetOutlineColor(const TColor &color) -> TColor
Sets the list-view control border color.
auto SetWorkAreas(int count, TRect *areas) -> void
Sets the working areas for a list-view control.
auto GetItemSpacing(bool smallIcon) const -> TSize
Retrieves the amount of horizontal and vertical spacing between items.
auto GetWorkAreas(int count, TRect *areas) const -> void
Retrieves the working areas from a list-view control.
auto GetFooterItem(int index, TLvFooterItem &item) const -> bool
Retrieves information for a footer item in a list-view control.
auto GetItemRect(int index, TRect &rect, TItemRectType type) const -> bool
Retrieves the bounding rectangle of a list-view item.
TParam1 TItemId
Defines the type of a unique identifier for an item.
auto InsertColumn(int colNum, const TLvColumn &column) -> int
Inserts a new column in a list-view control.
auto SetItemPosition32(int index, const TPoint &pt) -> void
Sets the position of a list-view item.
auto SetHotCursor(HCURSOR cur) -> HCURSOR
Sets the cursor handle to use when the pointer is over an item while hot tracking is enabled.
auto GetTextColor() const -> TColor
Retrieves the text color of a list-view control.
auto SetColumnWidth(int colNum, int width) -> bool
Sets the width of a column in report or list view.
auto SetView(TViewType viewType) -> bool
Sets the view type.
auto SetItemText(int index, const TLvItem &item) -> bool
Sets the text of a list-view item or subitem.
TNextItemCode
Describes the next item to retrieve from the current item.
auto GetItem(TLvItem &item, int index=-1, int subitemIndex=-1) const -> bool
Retrieves a list-view item's attributes.
auto GetBkImage(TLvBkImage &bkimg) const -> bool
Retrieves the background image in a list-view control.
auto GetFooterItemState(int index, TLvFooterItem::TState mask=TLvFooterItem::All) const -> TLvFooterItem::TState
Footer item state return overload for GetFooterItem(int, TLvFooterItem&) const .
auto GetHeaderCtrl() const -> HWND
Retrieves the handle to the header control used by the list-view control.
auto SetUnicodeFormat(bool useUnicode=true) -> bool
Sets whether the Unicode character set is being used instead of ANSI.
auto SetSelectionMark(int index) -> int
Sets the selection mark for a list-view control.
auto GetFooterItems() const -> int
Footer item count return overload for GetFooterInfo(TLvFooterInfo&) const .
auto SetCallBackMask(TLvItem::TListState mask) -> bool
Sets the callback mask for a list-view control.
auto CreateDragImage(int index, TPoint *upLeft) -> HIMAGELIST
Creates a drag image list for an item.
auto SetItem(const TLvItem &item, int index=-1, int subitemIndex=-1) -> bool
Sets a list-view item's attributes.
auto SetHoverTime(uint32 tm) -> uint32
Sets the amount of time that the mouse cursor must hover over an item before it is selected.
auto GetFooterItemRect(int index, TRect &rect) const -> bool
Retrieves the coordinates of a footer for an item in a list-view control.
Encapsulates structure LVCOLUMN, used to pass or retrieve column attributes in a TListViewCtrl.
auto SetText(const tstring &text) -> void
Copies the given text into the internal text buffer.
TLvColumn(uint mask_=lvcfAll, int subitemIndex=0, int bufferSize=1000)
Constructs an empty parameter package.
auto operator=(const LVCOLUMN &column) -> TLvColumn &
Overloads the assignment operator to perform a deep copy using a separate string buffer if applicable...
auto GetWidth() const -> int
Retrieves the current width for the column.
auto GetFormat() const -> TFormat
Retrieves the current alignment format for the column.
auto SetTextBuffer(TCHAR *buffer, int bufferSize) -> void
Overrides the internal buffer and assigns an external text buffer.
TFormat
TFormat is used to describe the alignment of a column in a list window.
@ Unspecified
Unspecified.
auto GetImage() const -> int
Retrieves the current image index used for the column.
auto GetSubItem() const -> int
Retrieves the current subitem used for the column.
auto SetSubItem(int subitemIndex) -> void
Sets the subitem index.
auto SetOrder(int order) -> void
Sets the column order offset.
auto SetFormat(TFormat how) -> void
Sets the alignment format for the column.
auto SetWidth(int width, const tstring &text=tstring()) -> void
Sets the width of the column.
auto SetImage(int image) -> void
Sets the image index within the image list to use.
auto Init() -> void
Initializes member data; used by internal routines.
auto GetOrder() const -> int
Retrieves the current column order offset used for the column.
auto GetText() const -> LPCTSTR
Retrieves the current text for the column.
Encapsulates structure LVFINDINFO, used to find an item in a TListViewCtrl.
auto SetPartial(const tstring &text) -> void
Sets a string to be used for a partial search.
auto SetString(const tstring &text) -> void
Sets a string to be used for the search.
tstring Text
String used for searching.
auto SetData(LPARAM param) -> void
Sets extra application-specific information.
TLvFindInfo()
Constructs with an empty string and parameter.
auto SetSubstring(const tstring &text) -> void
Sets a string to be used for an exact search.
auto SetWrap(bool wrap=true) -> void
Sets the setting for wrap-around during a search.
Encapsulates structure LVHITTESTINFO, used to contain information about a hit test in a TListViewCtrl...
Encapsulates structure LVITEM, used to describe an item in a TListViewCtrl.
auto GetState() const -> int
Retrieves the current state used for the item.
auto SetItemData(LPARAM param) -> void
Sets the application-defined data.
auto SetImageIndex(int image) -> void
Sets the image index within the image list to use.
auto SetIndent(int indent) -> void
Sets the number of image widths to indent the item.
auto GetText() const -> LPCTSTR
Retrieves the current text for the item.
TListState
TListState is used to describe the state of an item.
@ Focus
Only one item has focus.
@ Unspecified
Unspecified state.
@ Selected
Marked as selected.
TLvItem(uint mask_=lvifAll, bool allocTextBuffer=true, int bufferSize=1000)
Constructs an empty parameter package.
auto GetStateImage() const -> int
Retrieves the current state image index used for the item.
auto SetText(const tstring &text) -> void
Copies the given text into the internal text buffer.
auto SetTextBuffer(TCHAR *buffer, int bufferSize) -> void
Overrides the internal buffer and assigns an external text buffer.
auto GetIndent() const -> int
Retrieves the current number of image widths to indent the item.
auto SetSubItem(int subitemIndex) -> void
Sets the subitem index.
void Init()
Initializes member data; used by internal routines.
auto GetIndex() const -> int
Retrieves the item index.
auto GetItemData() const -> LPARAM
Retrieves the application-defined data.
auto SetStateImage(int stateIndex) -> void
Sets the state image index to use.
auto SetState(TListState state) -> void
Sets the state to use.
auto GetImageIndex() const -> int
Retrieves the current image index used for the item.
auto operator=(const LVITEM &item) -> TLvItem &
Overloads the assignment operator to perform a deep copy using a separate string buffer if applicable...
auto SetIndex(int index) -> void
Sets the item index.
auto GetSubItem() const -> int
Retrieves the subitem index.
Encapsulates structure LVTILEVIEWINFO, used to pass or retrieve tile view information in a TListViewC...
auto SetMaxTextLines(int lines) -> void
Sets the specified maximum number of text lines in each item label.
TTileSize
TTileSize describes the sizing of tiles in a list view control.
auto SetSizeAutomatic() -> void
Sets the tile view size to automatic.
auto SetLabelMargin(const TRect &labelMargin) -> void
Sets the specified coordinates of the label margin.
TLvTileViewInfo()
Constructs an automatic-sized tile view.
auto RemoveLabelMargin() -> void
Removes the specified coordinates of the label margin.
auto RemoveMaxTextLines() -> void
Removes the specified maximum number of text lines in each item label.
auto SetTileSize(const TSize &size) -> void
Sets the specified tile size.
auto SetSizeFixed(const TSize &size, TTileSize fixedSize) -> void
Sets the tile view size to fixed-width and/or fixed-height.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPoint is a support class, derived from tagPOINT.
TPoint()
Constructs an uninitialized point.
TRect is a mathematical class derived from tagRect.
The tagSIZE struct is defined as.
TSize()
Default constructor that does nothing.
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
uint32 GetStyle() const
Gets the style bits of the underlying window or the 'Style' member of the attribute structure associa...
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
HWND THandle
TWindow encapsulates an HWND.
HWND GetHandle() const
Returns the handle of the window.
size_t __stdcall wcslen(const wchar_t *str)
TXOwl(const tstring &msg, uint resId=0)
An OWL exception with a given message for displaying and an unsigned Id that can be used for identifi...
Definition of TListViewCtrl class.
Object Windows Library (OWLNext Core).
void InitializeCommonControls(uint controlFlags)
Wrapper for the Windows API function InitCommmonControlsEx.
uint16 HiUint16(LRESULT r)
void InUse(const T &arg)
Handy utility to avoid compiler warnings about unused parameters.
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.
uint16 LoUint16(LRESULT r)
TParam2 MkParam2(const T1 &lo, const T2 &hi)
bool IsRepresentable(U v)
Helper function for testing for integer truncations.
LRESULT TResult
Result type.
Definition of TSystem, a system information provider class.