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

An interface object that represents a transfer buffer for a TComboBox. More...

#include <owl/combobox.h>

Public Member Functions

 TComboBoxData ()
 Constructs a TComboBoxData object, initializes Strings and ItemDatas to empty arrays, and initializes Selection and SelIndex to 0.
 
 ~TComboBoxData ()
 Destructor for TComboBoxData. Deletes Strings, ItemDatas, and Selection.
 
 TComboBoxData (const TComboBoxData &tCBD)
 30.05.2007 - Submitted by Frank Rast: TComboBoxData needs a copy constructor because the default copy constructor does not deep copy the protected data of this class.
 
TComboBoxDataoperator= (const TComboBoxData &tCBD)
 
TStringArrayGetStrings ()
 Returns the array of strings (the Strings data member) to transfer to or from a combo box's associated list box.
 
TLParamArrayGetItemDatas ()
 Returns the array of DWORDs to transfer to or from a combo box's associated list box.
 
int GetSelIndex ()
 Returns the index (the SelIndex data member) of the selected item in the strings array.
 
tstringGetSelection ()
 Returns the currently selected string (the Selection data member) to transfer to or from a combo box.
 
void AddString (LPCTSTR str, bool isSelected=false)
 Adds the specified string to the array of Strings.
 
void AddString (const tstring &str, bool isSelected=false)
 
void AddStringItem (LPCTSTR str, LPARAM itemData, bool isSelected=false)
 Adds a given string and uint32 item to the "Strings" and "ItemDatas" array and copies the string into "Selection" if "isSelected" is true.
 
void AddStringItem (const tstring &str, LPARAM itemData, bool isSelected=false)
 
void Clear ()
 Flushes the Strings and ItemDatas members.
 
void Select (int index)
 Selects an item at a given index.
 
void SelectString (LPCTSTR str)
 Selects "str", marking the matching String entry (if any) as selected.
 
void SelectString (const tstring &str)
 
int GetSelCount () const
 Returns the number of items selected, either 0 or 1.
 
void ResetSelections ()
 Resets the index of the selected item and the currently selected string.
 
int GetSelStringLength () const
 Returns the length of the selection string excluding the terminating 0.
 
void GetSelString (TCHAR *buffer, int bufferSize) const
 Copies the selected string into Buffer. BufferSize includes the terminating 0.
 
const tstringGetSelString () const
 

Detailed Description

An interface object that represents a transfer buffer for a TComboBox.

Definition at line 182 of file combobox.h.

Constructor & Destructor Documentation

◆ TComboBoxData() [1/2]

owl::TComboBoxData::TComboBoxData ( )

Constructs a TComboBoxData object, initializes Strings and ItemDatas to empty arrays, and initializes Selection and SelIndex to 0.

Definition at line 25 of file combobox.cpp.

◆ ~TComboBoxData()

owl::TComboBoxData::~TComboBoxData ( )

Destructor for TComboBoxData. Deletes Strings, ItemDatas, and Selection.

Definition at line 35 of file combobox.cpp.

◆ TComboBoxData() [2/2]

owl::TComboBoxData::TComboBoxData ( const TComboBoxData & tCBD)

30.05.2007 - Submitted by Frank Rast: TComboBoxData needs a copy constructor because the default copy constructor does not deep copy the protected data of this class.

For the same reason a assignment operator is needed.

Definition at line 46 of file combobox.cpp.

Member Function Documentation

◆ AddString() [1/2]

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

Definition at line 202 of file combobox.h.

References AddString().

◆ AddString() [2/2]

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

Adds the specified string to the array of Strings.

If IsSelected is true, AddString deletes Selection and copies str into Selection.

Definition at line 82 of file combobox.cpp.

References owl::TMObjectArray< T, A >::Add(), Select(), and owl::TArrayBase::Size().

◆ AddStringItem() [1/2]

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

Definition at line 204 of file combobox.h.

References AddStringItem().

◆ AddStringItem() [2/2]

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

Adds a given string and uint32 item to the "Strings" and "ItemDatas" array and copies the string into "Selection" if "isSelected" is true.

Definition at line 95 of file combobox.cpp.

References AddString().

◆ Clear()

void owl::TComboBoxData::Clear ( )

Flushes the Strings and ItemDatas members.

Resets the index and selected string values.

Definition at line 69 of file combobox.cpp.

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

◆ GetItemDatas()

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

Returns the array of DWORDs to transfer to or from a combo box's associated list box.

Definition at line 664 of file combobox.h.

◆ GetSelCount()

int owl::TComboBoxData::GetSelCount ( ) const
inline

Returns the number of items selected, either 0 or 1.

Definition at line 687 of file combobox.h.

◆ GetSelection()

tstring & owl::TComboBoxData::GetSelection ( )
inline

Returns the currently selected string (the Selection data member) to transfer to or from a combo box.

Definition at line 680 of file combobox.h.

◆ GetSelIndex()

int owl::TComboBoxData::GetSelIndex ( )
inline

Returns the index (the SelIndex data member) of the selected item in the strings array.

Definition at line 672 of file combobox.h.

◆ GetSelString() [1/2]

const tstring & owl::TComboBoxData::GetSelString ( ) const
inline

Definition at line 214 of file combobox.h.

◆ GetSelString() [2/2]

void owl::TComboBoxData::GetSelString ( TCHAR * buffer,
int bufferSize ) const

Copies the selected string into Buffer. BufferSize includes the terminating 0.

Definition at line 147 of file combobox.cpp.

References _tcsncpy.

◆ GetSelStringLength()

int owl::TComboBoxData::GetSelStringLength ( ) const

Returns the length of the selection string excluding the terminating 0.

Definition at line 137 of file combobox.cpp.

◆ GetStrings()

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

Returns the array of strings (the Strings data member) to transfer to or from a combo box's associated list box.

Definition at line 656 of file combobox.h.

◆ operator=()

TComboBoxData & owl::TComboBoxData::operator= ( const TComboBoxData & tCBD)

Definition at line 54 of file combobox.cpp.

◆ ResetSelections()

void owl::TComboBoxData::ResetSelections ( )
inline

Resets the index of the selected item and the currently selected string.

Definition at line 694 of file combobox.h.

References _T.

◆ Select()

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

Selects an item at a given index.

Definition at line 106 of file combobox.cpp.

References owl::TArrayBase::Size().

◆ SelectString() [1/2]

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

Definition at line 209 of file combobox.h.

References SelectString().

◆ SelectString() [2/2]

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

Selects "str", marking the matching String entry (if any) as selected.

Definition at line 120 of file combobox.cpp.

References _tcscmp, and owl::TArrayBase::Size().


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