OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Encapsulates structure LVITEM, used to describe an item in a TListViewCtrl. More...
#include <owl/listviewctrl.h>
Public Types | |
enum | TListState { Unspecified = 0 , Focus = LVIS_FOCUSED , Selected = LVIS_SELECTED , Cut = LVIS_CUT , DropHilited = LVIS_DROPHILITED , Activating = LVIS_ACTIVATING , OverlayMask = LVIS_OVERLAYMASK , StateImageMask = LVIS_STATEIMAGEMASK } |
TListState is used to describe the state of an item. More... | |
enum | TMaskFlag { lvifAll = 0xFFFFFFFF } |
Flags for setting the initialisation mask. More... | |
Public Member Functions | |
Constructors | |
TLvItem (uint mask_=lvifAll, bool allocTextBuffer=true, int bufferSize=1000) | |
Constructs an empty parameter package. | |
TLvItem (const tstring &text, int subitemIndex=0) | |
Constructs a parameter package with the given text. | |
TLvItem (const TListViewCtrl &ctl, int index, int subitemIndex, uint mask_=lvifAll, int bufferSize=1000) | |
Constructs a parameter package based on the item attributes of an existing control. | |
TLvItem (const LVITEM &item) | |
Constructs a parameter package from an existing parameter package. | |
TLvItem (const TLvItem &item) | |
Constructs a parameter package from an existing parameter package. | |
Overload operations | |
auto | operator= (const LVITEM &item) -> TLvItem & |
Overloads the assignment operator to perform a deep copy using a separate string buffer if applicable. | |
auto | operator= (const TLvItem &item) -> TLvItem & |
Copies the given parameter package. | |
Text operations | |
auto | GetText () const -> LPCTSTR |
Retrieves the current text for the column. | |
auto | GetText (TCHAR *buffer, size_t bufferSize) const -> void |
Copies the current text for the column. | |
auto | SetTextBuffer (TCHAR *buffer, int bufferSize) -> void |
Overrides the internal buffer and assigns an external text buffer. | |
auto | SetText (const tstring &text) -> void |
Copies the given text into the internal text buffer. | |
Index is the 0-based "row" | |
auto | GetIndex () const -> int |
Retrieves the item index. | |
auto | SetIndex (int index) -> void |
Sets the item index. | |
Column number | |
auto | GetSubItem () const -> int |
Retrieves the subitem index. | |
auto | SetSubItem (int subitemIndex) -> void |
Sets the subitem index. | |
Extra data | |
auto | GetItemData () const -> LPARAM |
Retrieves the application-defined data. | |
auto | SetItemData (LPARAM param) -> void |
Sets the application-defined data. | |
ImageList index | |
auto | GetImageIndex () const -> int |
Retrieves the current image index used for the item. | |
auto | SetImageIndex (int image) -> void |
Sets the image index within the image list to use. | |
Item state | |
auto | GetState () const -> int |
Retrieves the current state used for the item. | |
auto | SetState (TListState state) -> void |
Sets the state to use. | |
ImageList index for the state image | |
auto | GetStateImage () const -> int |
Retrieves the current state image index used for the item. | |
auto | SetStateImage (int stateIndex) -> void |
Sets the state image index to use. | |
Set/Get indent (Version 4.70) | |
auto | GetIndent () const -> int |
Retrieves the current number of image widths to indent the item. | |
auto | SetIndent (int indent) -> void |
Sets the number of image widths to indent the item. | |
Protected Types | |
typedef std::vector< tchar > | TBuffer |
Protected Member Functions | |
void | Init () |
Initializes member data; used by internal routines. | |
Protected Attributes | |
TBuffer | Buffer |
Encapsulates structure LVITEM, used to describe an item in a TListViewCtrl.
Contains information about the item's icon, label, state and application-defined value. This class is a thin encapsulation used to pass or retrieve item attributes. The class manages an internal text buffer so that the user is freed from manual text buffer management.
Definition at line 180 of file listviewctrl.h.
|
protected |
Definition at line 288 of file listviewctrl.h.
TListState is used to describe the state of an item.
Definition at line 188 of file listviewctrl.h.
Flags for setting the initialisation mask.
Enumerator | |
---|---|
lvifAll |
Definition at line 204 of file listviewctrl.h.
|
explicit |
Constructs an empty parameter package.
This constructor is typically used to retrieve information about an existing column. For example,
[in] | mask_ | is the mask to use. |
[in] | allocTextBuffer | if true, then a character buffer is allocated, and pszText is set to point to it. |
[in] | bufferSize | is the size of the text characters to allocate and use if allocTextBuffer is true. |
Definition at line 149 of file listviewctrl.cpp.
References Buffer, CHECK, Init(), and SetTextBuffer().
Constructs a parameter package with the given text.
The given text is copied to the internal buffer, and pszText will point to the internal copy. For example,
[in] | text | is the string to use. |
[in] | subitemIndex | is the subitem index to use. |
Definition at line 175 of file listviewctrl.cpp.
References Init(), SetSubItem(), and SetText().
owl::TLvItem::TLvItem | ( | const TListViewCtrl & | ctl, |
int | index, | ||
int | subitemIndex, | ||
uint | mask_ = lvifAll, | ||
int | bufferSize = 1000 ) |
Constructs a parameter package based on the item attributes of an existing control.
[in] | ctl | is an existing list-view control from which to copy. |
[in] | index | is the item index of the existing list-view control to use for copying. |
[in] | subitemIndex | is the subitem index to use. |
[in] | mask_ | is the mask to use for copying. |
[in] | bufferSize | is the size of the text characters to allocate and use, provided the mask includes LVIF_TEXT. |
Definition at line 191 of file listviewctrl.cpp.
References Buffer, CHECK, Init(), PRECONDITION, and SetTextBuffer().
owl::TLvItem::TLvItem | ( | const LVITEM & | item | ) |
Constructs a parameter package from an existing parameter package.
A deep copy is performed; see the assignment operator for const LVITEM&
for details.
[in] | item | is an existing list-view item class from which to copy. |
Definition at line 212 of file listviewctrl.cpp.
owl::TLvItem::TLvItem | ( | const TLvItem & | item | ) |
Constructs a parameter package from an existing parameter package.
A deep copy is performed; see the copy assignment operator for details.
[in] | item | is an existing list-view item class from which to copy. |
Definition at line 224 of file listviewctrl.cpp.
Retrieves the current image index used for the item.
Definition at line 439 of file listviewctrl.cpp.
Retrieves the current number of image widths to indent the item.
Definition at line 516 of file listviewctrl.cpp.
Retrieves the application-defined data.
Definition at line 414 of file listviewctrl.cpp.
Retrieves the current state used for the item.
Definition at line 464 of file listviewctrl.cpp.
Retrieves the current state image index used for the item.
Definition at line 490 of file listviewctrl.cpp.
Retrieves the subitem index.
Definition at line 390 of file listviewctrl.cpp.
Retrieves the current text for the column.
Definition at line 264 of file listviewctrl.cpp.
Copies the current text for the column.
[out] | buffer | upon return will contain the text string. |
[in] | bufferSize | specifies the maximum number of characters to copy; to determine an adequate size use (_tcslen(GetText()) + 1). |
Definition at line 290 of file listviewctrl.cpp.
References _T, _tcslen, CHECK, PRECONDITION, and WARN.
|
protected |
Initializes member data; used by internal routines.
Definition at line 541 of file listviewctrl.cpp.
Overloads the assignment operator to perform a deep copy using a separate string buffer if applicable.
[in] | item | is an existing list-view item class from which to copy. |
Definition at line 235 of file listviewctrl.cpp.
Copies the given parameter package.
A deep copy is performed; see the assignment operator for const LVITEM&
for details.
Definition at line 249 of file listviewctrl.cpp.
Sets the image index within the image list to use.
[in] | image | is the image index to use. |
Definition at line 452 of file listviewctrl.cpp.
Sets the number of image widths to indent the item.
[in] | indent | the number of image widths to use. |
Definition at line 529 of file listviewctrl.cpp.
Sets the item index.
[in] | index | the item index. |
Definition at line 379 of file listviewctrl.cpp.
Sets the application-defined data.
[in] | param | the application-defined data. |
Definition at line 427 of file listviewctrl.cpp.
auto owl::TLvItem::SetState | ( | TListState | newState | ) | -> void |
Sets the state to use.
[in] | newState | is the state to use. |
Definition at line 477 of file listviewctrl.cpp.
Sets the state image index to use.
[in] | stateIndex | is the state image index to use. |
Definition at line 503 of file listviewctrl.cpp.
Sets the subitem index.
[in] | subitemIndex | the subitem index. |
Definition at line 403 of file listviewctrl.cpp.
Copies the given text into the internal text buffer.
Sets the pszText and cchTextMax members of LVITEM, and enables the LVIF_TEXT flag.
[in] | text | is the string to copy. |
Definition at line 350 of file listviewctrl.cpp.
References _T.
Overrides the internal buffer and assigns an external text buffer.
Sets the pszText and cchTextMax members of LVITEM, and enables the LVIF_TEXT flag.
[in] | buffer | pointer to a text string buffer to use. |
[in] | bufferSize | specifies the size of the text string buffer. |
Definition at line 330 of file listviewctrl.cpp.
|
protected |
Definition at line 289 of file listviewctrl.h.