OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TListBoxData Class Reference

Used to transfer the contents of a list box. More...

#include <owl/listbox.h>

Public Member Functions

 TListBoxData ()
 Constructs Strings and SelStrings. Initializes SelCount to 0.
 
 ~TListBoxData ()
 Deletes the space allocated for Strings and SelStrings.
 
TStringArrayGetStrings ()
 Returns a reference to a TStringArray object containing the strings.
 
TLParamArrayGetItemDatas ()
 Returns a reference to the ItemDatas array.
 
TIntArrayGetSelIndices ()
 Returns a reference to the SelIndices array.
 
void AddString (LPCTSTR str, bool isSelected=false)
 Adds the specified string to Strings.
 
void AddString (const tstring &str, bool isSelected=false)
 
void AddStringItem (LPCTSTR str, LPARAM itemData, bool isSelected=false)
 Adds a string to the Strings array, optionally selects it, and adds itemData to the ItemDatas array.
 
void AddStringItem (const tstring &str, LPARAM itemData, bool isSelected=false)
 
void Clear ()
 Resets the list box by flushing the ItemDatas and Strings arrays and calling ResetSelections.
 
void Select (int index)
 Selects the string at the given index.
 
void SelectString (LPCTSTR str)
 Adds the index of the string matching str to SelIndices.
 
void SelectString (const tstring &str)
 
int GetSelCount () const
 Returns the number of items in SelIndices.
 
void ResetSelections ()
 Flushes SelIndices.
 
int GetSelStringLength (int index=0) const
 Returns the length (excluding the terminating NULL) of the string at the specified index in SelIndices.
 
void GetSelString (TCHAR *buffer, int bufferSize, int index=0) const
 Locates the string at the specified index in SelIndices and copies it into buffer.
 
void GetSelString (tstring &str, int index=0) const
 Locates the string at the specified index in SelIndices and copies it into str.
 
tstring GetSelString (int index=0) const
 

Detailed Description

Used to transfer the contents of a list box.

Definition at line 170 of file listbox.h.

Constructor & Destructor Documentation

◆ TListBoxData()

owl::TListBoxData::TListBoxData ( )

Constructs Strings and SelStrings. Initializes SelCount to 0.

Definition at line 30 of file listbox.cpp.

◆ ~TListBoxData()

owl::TListBoxData::~TListBoxData ( )

Deletes the space allocated for Strings and SelStrings.

Definition at line 41 of file listbox.cpp.

Member Function Documentation

◆ AddString() [1/2]

void owl::TListBoxData::AddString ( const tstring & str,
bool isSelected = false )
inline

Definition at line 180 of file listbox.h.

References AddString().

◆ AddString() [2/2]

void owl::TListBoxData::AddString ( LPCTSTR str,
bool isSelected = false )

Adds the specified string to Strings.

If IsSelected is true, the string is selected.

Definition at line 74 of file listbox.cpp.

◆ AddStringItem() [1/2]

void owl::TListBoxData::AddStringItem ( const tstring & str,
LPARAM itemData,
bool isSelected = false )
inline

Definition at line 182 of file listbox.h.

References AddStringItem().

◆ AddStringItem() [2/2]

void owl::TListBoxData::AddStringItem ( LPCTSTR str,
LPARAM itemData,
bool isSelected = false )

Adds a string to the Strings array, optionally selects it, and adds itemData to the ItemDatas array.

Definition at line 86 of file listbox.cpp.

References AddString().

◆ Clear()

void owl::TListBoxData::Clear ( )

Resets the list box by flushing the ItemDatas and Strings arrays and calling ResetSelections.

Definition at line 50 of file listbox.cpp.

References owl::TMObjectArray< T, A >::Flush(), and ResetSelections().

◆ GetItemDatas()

TLParamArray & owl::TListBoxData::GetItemDatas ( )
inline

Returns a reference to the ItemDatas array.

Definition at line 567 of file listbox.h.

◆ GetSelCount()

int owl::TListBoxData::GetSelCount ( ) const

Returns the number of items in SelIndices.

Definition at line 58 of file listbox.cpp.

References owl::TArrayBase::Size().

◆ GetSelIndices()

TIntArray & owl::TListBoxData::GetSelIndices ( )
inline

Returns a reference to the SelIndices array.

Definition at line 573 of file listbox.h.

◆ GetSelString() [1/3]

tstring owl::TListBoxData::GetSelString ( int index = 0) const

Definition at line 706 of file listbox.cpp.

References GetSelString().

◆ GetSelString() [2/3]

void owl::TListBoxData::GetSelString ( TCHAR * buffer,
int bufferSize,
int index = 0 ) const

Locates the string at the specified index in SelIndices and copies it into buffer.

bufferSize includes the terminating NULL.

Definition at line 132 of file listbox.cpp.

References _tcsncpy, and GetSelCount().

◆ GetSelString() [3/3]

void owl::TListBoxData::GetSelString ( tstring & str,
int index = 0 ) const

Locates the string at the specified index in SelIndices and copies it into str.

Definition at line 149 of file listbox.cpp.

References _T, and GetSelCount().

◆ GetSelStringLength()

int owl::TListBoxData::GetSelStringLength ( int index = 0) const

Returns the length (excluding the terminating NULL) of the string at the specified index in SelIndices.

Definition at line 120 of file listbox.cpp.

References GetSelCount().

◆ GetStrings()

TStringArray & owl::TListBoxData::GetStrings ( )
inline

Returns a reference to a TStringArray object containing the strings.

Definition at line 561 of file listbox.h.

◆ ResetSelections()

void owl::TListBoxData::ResetSelections ( )

Flushes SelIndices.

Definition at line 64 of file listbox.cpp.

References owl::TTypedArray< T, R, A >::Flush().

◆ Select()

void owl::TListBoxData::Select ( int index)

Selects the string at the given index.

Definition at line 96 of file listbox.cpp.

References owl::TTypedArray< T, R, A >::Add(), owl::TTypedArray< T, R, A >::Find(), and owl::TArrayBase::NPOS.

◆ SelectString() [1/2]

void owl::TListBoxData::SelectString ( const tstring & str)
inline

Definition at line 187 of file listbox.h.

References SelectString().

◆ SelectString() [2/2]

void owl::TListBoxData::SelectString ( LPCTSTR str)

Adds the index of the string matching str to SelIndices.

Definition at line 106 of file listbox.cpp.


The documentation for this class was generated from the following files: