10#if !defined(OWL_LISTBOX_H)
14#if defined(BI_HAS_PRAGMA_ONCE)
51 virtual int GetCount()
const;
58 virtual int GetTopIndex()
const;
59 virtual int SetTopIndex(
int index);
62 virtual int GetHorizontalExtent()
const;
63 virtual void SetHorizontalExtent(
int horzExtent);
64 void SetColumnWidth(
int width);
65 int GetCaretIndex()
const;
67 bool IsSelected(
int index)
const;
68 bool SetSelected(
int index,
bool selected =
true);
73 virtual int GetStringLen(
int index)
const;
74 virtual int GetString(
LPTSTR str,
int index)
const;
75 tstring GetString(
int index)
const;
76 virtual LPARAM GetItemData(
int index)
const;
79 int GetItemRect(
int index,
TRect&
rect)
const;
80 virtual int GetItemHeight(
int index)
const;
81 virtual int SetItemHeight(
int index,
int height);
86 virtual void ClearList();
97 virtual int ReplaceString(
LPCTSTR str,
int index);
99 virtual int DeleteString(
int index);
104 virtual int GetSelIndex()
const;
105 virtual int SetSelIndex(
int index);
114 int GetSelCount()
const;
123 bool GetSel(
int index)
const;
124 int SetSel(
int index,
bool select);
125 int SetSelItemRange(
bool select,
int first,
int last);
127 int GetAnchorIndex()
const;
128 int SetAnchorIndex(
int index);
185 void Select(
int index);
186 void SelectString(
LPCTSTR str);
188 int GetSelCount()
const;
189 void ResetSelections();
190 int GetSelStringLength(
int index = 0)
const;
192 void GetSelString(
tstring& str,
int index = 0)
const;
193 tstring GetSelString(
int index = 0)
const;
#define PRECONDITION(condition)
virtual int AddString(LPCTSTR str)
Adds str to the list box, returning its position in the list (0 is the first position).
virtual int InsertString(LPCTSTR str, int index)
Inserts str in the list box at the position supplied in index, and returns the item's actual position...
TControl unifies its derived control classes, such as TScrollBar, TControlGadget, and TButton.
Used to transfer the contents of a list box.
TIntArray & GetSelIndices()
Returns a reference to the SelIndices array.
TStringArray & GetStrings()
Returns a reference to a TStringArray object containing the strings.
TLParamArray & GetItemDatas()
Returns a reference to the ItemDatas array.
void AddStringItem(const tstring &str, LPARAM itemData, bool isSelected=false)
void AddString(const tstring &str, bool isSelected=false)
void SelectString(const tstring &str)
An interface object that represents a corresponding list box element.
virtual int SetItemData(int index, LPARAM itemData)
Sets the custom value associated with the list box item at the specified index position.
virtual LPARAM GetItemData(int index) const
Returns the custom value associated with the item at index set by SetItemData.
int GetItemRect(int index, TRect &rect) const
Returns the dimensions of the rectangle that surrounds a list-box item currently displayed in the lis...
virtual int DirectoryList(uint attrs, LPCTSTR fileSpec)
Adds a list of file names to a list box.
virtual int SetSelIndex(int index)
For single-selection list boxes.
virtual void SetHorizontalExtent(int horzExtent)
Sets the number of pixels by which the list box can be scrolled horizontally.
virtual int AddString(LPCTSTR str)
Adds str to the list box, returning its position in the list (0 is the first position).
int FindStringExact(const tstring &str, int startIndex=-1) const
bool SetTabStops(int numTabs, int *tabs)
Sets tab stops.
virtual int GetStringLen(int index) const
Returns the string length (excluding the terminating NULL) of the item at the position index supplied...
void Transfer(TListBoxData &data, TTransferDirection direction)
int DirectoryList(uint attrs, const tstring &fileSpec)
virtual int SetTopIndex(int index)
The system scrolls the list box contents so that either the specified item appears at the top of the ...
bool GetSel(int index) const
Returns the selection state of the list-box item at location index.
virtual int FindString(LPCTSTR str, int startIndex=-1) const
Returns the index of the first string in the associated listbox which begins with the passed string.
virtual int InsertString(LPCTSTR str, int index)
Inserts str in the list box at the position supplied in index, and returns the item's actual position...
virtual int GetHorizontalExtent() const
Returns the number of pixels by which the list box can be scrolled horizontally.
int InsertString(const tstring &str, int index)
void SetColumnWidth(int width)
Sets the width in pixels of the items in the list box.
int FindString(const tstring &str, int startIndex=-1) const
int SetCaretIndex(int index, bool partScrollOk)
Sets the focus to the item specified at index.
virtual int GetCount() const
Returns the number of items in the list box, or a negative value if an error occurs.
virtual int SetItemHeight(int index, int height)
Sets the height in pixels of the items in the list box.
int SetAnchorIndex(int index)
Set the anchor item – that is, the item from which a multiple selection starts.
virtual int SetSelStringExact(LPCTSTR str, int startIndex=-1)
Selects the item that matches the given string exactly.
virtual int DeleteString(int index)
Deletes the item in the list at the position (starting at 0) supplied in index.
int SetSelItemRange(bool select, int first, int last)
Selects the range of items specified from first to last.
uint32 ItemFromPoint(TPoint &p)
Retrieve the zero-based index of the item nearest the specified point in a list box.
virtual void ClearList()
Clears all the entries in the associated listbox.
int AddString(const tstring &str)
int GetAnchorIndex() const
Retrieve the index of the anchor item – that is, the item from which a multiple selection starts.
int SetSelStringExact(const tstring &str, int startIndex=-1)
int SetSel(int index, bool select)
For multiple-selection list boxes.
int SetSelString(const tstring &str, int startIndex=-1)
int InitStorage(int numItemsToAdd, uint32 memoryToAllocate)
Allocates memory for storing list box items.
virtual int FindStringExact(LPCTSTR str, int startIndex=-1) const
Return the index of the first string in the list part which is exactly same as the passed string.
virtual int GetTopIndex() const
Returns the index of the first item displayed at the top of the list box.
virtual int GetString(TCHAR *str, int index) const
Retrieves the contents of the string at the passed index of the associated listbox.
virtual int GetItemHeight(int index) const
Returns the height in pixels of the specified list box item.
int ReplaceString(const tstring &str, int index)
int GetCaretIndex() const
Returns the index of the currently focused list-box item.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
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...
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.
Definition of container classes used and made available by OWL.
Definition of class TControl.
#define DECLARE_STREAMABLE_OWL(cls, ver)
#define DECLARE_STREAMABLE_INLINES(cls)
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Object Windows Library (OWLNext Core)
LPARAM TParam2
Second parameter type.
TParam2 MkParam2(const T1 &lo, const T2 &hi)
#define CONST_CAST(targetType, object)
Definition of container classes used and made available by OWL.