OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
listbox.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1991, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Definition of class TListBox and TlistBoxData. This defines the basic
7/// behavior of all list box controls.
8//----------------------------------------------------------------------------
9
10#if !defined(OWL_LISTBOX_H)
11#define OWL_LISTBOX_H
12
13#include <owl/private/defs.h>
14#if defined(BI_HAS_PRAGMA_ONCE)
15# pragma once
16#endif
17
18#include <owl/control.h>
19#include <owl/contain.h>
20#include <owl/template.h>
21
22
23namespace owl {
24
25class _OWLCLASS TListBoxData;
26
27#include <owl/preclass.h>
28
29//
30/// \addtogroup ctrl
31/// @{
32/// \class TListBox
33// ~~~~~ ~~~~~~~~
34/// An interface object that represents a corresponding list box element. A TListBox
35/// must be used to create a list box control in a parent TWindow. A TListBox can be
36/// used to facilitate communication between your application and the list box
37/// controls of a TDialog object. TListBox's member functions also serve instances
38/// of its derived class TComboBox. From within MDI child windows, you can access a
39/// TListBox object by using TFrameWindow::GetClientWindow. TListBox is a streamable
40/// class.
41//
43{
44 public:
45 TListBox(TWindow* parent, int id, int x, int y, int w, int h, TModule* module = 0);
46 TListBox(TWindow* parent, int resourceId, TModule* module = 0);
47 TListBox(THandle hWnd, TModule* module = 0);
48
49 /// \name List box attributes
50 /// @{
51 virtual int GetCount() const;
52 virtual int FindString(LPCTSTR str, int startIndex = -1) const;
53 int FindString(const tstring& str, int startIndex = -1) const {return FindString(str.c_str(), startIndex);}
54 virtual int FindStringExact(LPCTSTR str, int startIndex = -1) const;
55 int FindStringExact(const tstring& str, int startIndex = -1) const {return FindStringExact(str.c_str(), startIndex);}
56 virtual int SetSelStringExact(LPCTSTR str, int startIndex = -1); //DLN added
57 int SetSelStringExact(const tstring& str, int startIndex = -1) {return SetSelStringExact(str.c_str(), startIndex);}
58 virtual int GetTopIndex() const;
59 virtual int SetTopIndex(int index);
60 bool SetTabStops(int numTabs, int * tabs);
61
62 virtual int GetHorizontalExtent() const;
63 virtual void SetHorizontalExtent(int horzExtent);
64 void SetColumnWidth(int width);
65 int GetCaretIndex() const;
66 int SetCaretIndex(int index, bool partScrollOk);
67 bool IsSelected(int index) const;
68 bool SetSelected(int index, bool selected = true);
69 /// @}
70
71 /// \name Query individual list items
72 /// @{
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;
77 virtual int SetItemData(int index, LPARAM itemData);
78
79 int GetItemRect(int index, TRect& rect) const;
80 virtual int GetItemHeight(int index) const;
81 virtual int SetItemHeight(int index, int height);
82 /// @}
83
84 /// \name Operations on the list box itself
85 /// @{
86 virtual void ClearList();
87 virtual int DirectoryList(uint attrs, LPCTSTR fileSpec);
89 /// @}
90
91 /// \name Operations on individual list box items
92 /// @{
93 virtual int AddString(LPCTSTR str);
94 int AddString(const tstring& str) {return AddString(str.c_str());}
95 virtual int InsertString(LPCTSTR str, int index);
96 int InsertString(const tstring& str, int index) {return InsertString(str.c_str(), index);}
97 virtual int ReplaceString(LPCTSTR str, int index);
98 int ReplaceString(const tstring& str, int index) {return ReplaceString(str.c_str(), index);}
99 virtual int DeleteString(int index);
100 /// @}
101
102 /// \name Single selection list boxes only (combos overload these)
103 /// @{
104 virtual int GetSelIndex() const;
105 virtual int SetSelIndex(int index);
106 virtual int GetSelString(LPTSTR str, int maxChars) const;
107 tstring GetSelString() const;
108 virtual int SetSelString(LPCTSTR str, int startIndex = -1);
109 int SetSelString(const tstring& str, int startIndex = -1) {return SetSelString(str.c_str(), startIndex);}
110 /// @}
111
112 /// \name Multiple selection list boxes only
113 /// @{
114 int GetSelCount() const;
115 int GetSelStrings(LPTSTR* strs, int maxCount, int maxChars) const;
116 TStringArray GetSelStrings () const;
117 int SetSelStrings(LPCTSTR* prefixes, int numSelections, bool shouldSet);
118 int SetSelStrings(const TStringArray& prefixes, bool shouldSet);
119 int GetSelIndexes(int* indexes, int maxCount) const;
120 TIntArray GetSelIndexes () const;
121 int SetSelIndexes(int* indexes, int numSelections, bool shouldSet);
122 int SetSelIndexes(const TIntArray&, bool shouldSet);
123 bool GetSel(int index) const;
124 int SetSel(int index, bool select);
125 int SetSelItemRange(bool select, int first, int last);
126
127 int GetAnchorIndex() const;
128 int SetAnchorIndex(int index);
129 /// @}
130
131 uint32 ItemFromPoint(TPoint& p);
132 int InitStorage(int numItemsToAdd, uint32 memoryToAllocate);
133
134 // Safe overload
135 //
137
138 protected:
139
140 // Override TWindow virtual member functions
141 //
142 virtual uint Transfer(void* buffer, TTransferDirection direction);
143 virtual auto GetWindowClassName() -> TWindowClassName;
144
145 private:
146 // Hidden to prevent accidental copying or assignment
147 //
148 TListBox(const TListBox&);
150
152};
153
155
156//
157// List box notification macros. methods are: void method()
158//
159// EV_LBN_DBLCLK(id, method)
160// EV_LBN_ERRSPACE(id, method)
161// EV_LBN_KILLFOCUS(id, method)
162// EV_LBN_SELCANCEL(id, method)
163// EV_LBN_SELCHANGE(id, method)
164// EV_LBN_SETFOCUS(id, method)
165
166//
167/// \class TListBoxData
168// ~~~~~ ~~~~~~~~~~~~
169/// Used to transfer the contents of a list box.
171 public:
172 TListBoxData();
174
175 TStringArray& GetStrings();
176 TLParamArray& GetItemDatas();
177 TIntArray& GetSelIndices();
178
179 void AddString(LPCTSTR str, bool isSelected = false);
180 void AddString(const tstring& str, bool isSelected = false) {AddString(str.c_str(), isSelected);}
181 void AddStringItem(LPCTSTR str, LPARAM itemData, bool isSelected = false);
182 void AddStringItem(const tstring& str, LPARAM itemData, bool isSelected = false) {AddStringItem(str.c_str(), itemData, isSelected);}
183 void Clear();
184
185 void Select(int index);
186 void SelectString(LPCTSTR str);
187 void SelectString(const tstring& str) {SelectString(str.c_str());}
188 int GetSelCount() const;
189 void ResetSelections();
190 int GetSelStringLength(int index = 0) const;
191 void GetSelString(LPTSTR buffer, int bufferSize, int index = 0) const;
192 void GetSelString(tstring& str, int index = 0) const;
193 tstring GetSelString(int index = 0) const;
194
196 TStringArray* Strings; ///< Contains all strings in listbox
197 TLParamArray* ItemDatas; ///< Contains all custom data associated with the items in the listbox
198 TIntArray* SelIndices; ///< Contains all selection indices
199};
200
201/// @}
202
203#include <owl/posclass.h>
204
205// --------------------------------------------------------------------------
206// Inline implementations
207//
208
209//
210/// Returns the index of the first item displayed at the top of the list box.
211inline int TListBox::GetTopIndex() const {
213 return static_cast<int>(CONST_CAST(TListBox*,this)->SendMessage(LB_GETTOPINDEX));
214}
215
216//
217/// The system scrolls the list box contents so that either the specified item
218/// appears at the top of the list box or the maximum scroll range has been reached.
219inline int TListBox::SetTopIndex(int index) {
221 return static_cast<int>(SendMessage(LB_SETTOPINDEX, index));
222}
223
224//
225/// Sets tab stops. numTabs is the number of tab stops. tabs is the array of
226/// integers representing the tab positions.
227inline bool TListBox::SetTabStops(int numTabs, int * tabs) {
229 return static_cast<bool>(SendMessage(LB_SETTABSTOPS, numTabs, TParam2(tabs)));
230}
231
232//
233/// Returns the number of pixels by which the list box can be scrolled horizontally.
236 return static_cast<int>(CONST_CAST(TListBox*,this)->SendMessage(LB_GETHORIZONTALEXTENT));
237}
238
239//
240/// Sets the number of pixels by which the list box can be scrolled horizontally.
245
246//
247/// Sets the width in pixels of the items in the list box.
248inline void TListBox::SetColumnWidth(int width) {
251}
252
253//
254/// Returns the index of the currently focused list-box item. For single-selection
255/// list boxes, the return value is the index of the selected item, if one is
256/// selected.
257inline int TListBox::GetCaretIndex() const {
259 return static_cast<int>(CONST_CAST(TListBox*,this)->SendMessage(LB_GETCARETINDEX));
260}
261
262//
263/// Sets the focus to the item specified at index. If partScrollOk is false, the
264/// item is scrolled until it is fully visible; if partScrollOk is true, the item is
265/// scrolled until it is at least partially visible.
266inline int TListBox::SetCaretIndex(int index, bool partScrollOk) {
268 return static_cast<int>(SendMessage(LB_SETCARETINDEX, index, MkParam2(partScrollOk,0)));
269}
270
271//
272/// Returns the custom value associated with the item at index set by SetItemData.
273//
274inline LPARAM TListBox::GetItemData(int index) const {
276 return static_cast<LPARAM>(const_cast<TListBox*>(this)->SendMessage(LB_GETITEMDATA, index));
277}
278
279//
280/// Sets the custom value associated with the list box item at the specified index position.
281//
282inline int TListBox::SetItemData(int index, LPARAM itemData) {
284 return static_cast<int>(SendMessage(LB_SETITEMDATA, index, itemData));
285}
286
287//
288/// Returns the dimensions of the rectangle that surrounds a list-box item currently
289/// displayed in the list-box window.
290inline int TListBox::GetItemRect(int index, TRect& rect) const {
292 return static_cast<int>(CONST_CAST(TListBox*,this)->
293 SendMessage(LB_GETITEMRECT, index, TParam2(reinterpret_cast<TRect *>(&rect))));
294}
295
296//
297/// Returns the height in pixels of the specified list box item.
298inline int TListBox::GetItemHeight(int index) const {
300 return static_cast<int>(CONST_CAST(TListBox*,this)->
302}
303
304//
305/// Sets the height in pixels of the items in the list box. If the index or height
306/// is invalid, the return value is LB_ERR.
307inline int TListBox::SetItemHeight(int index, int height) {
309 return static_cast<int>(SendMessage(LB_SETITEMHEIGHT, index, MkParam2(height, 0)));
310}
311
312//
313/// Adds a list of file names to a list box.
314///
315/// fileSpec points to the null-terminated string that specifies the filename to add
316/// to the list. If the filename contains wildcards (for example, *.*), all files
317/// that match the wildcards and have the attributes specified by the uAttrs
318/// parameter are added to the list.
319///
320/// attrs can be any combination of:
321/// - \c \b DDL_ARCHIVE Includes archived files.
322/// - \c \b DDL_DIRECTORY Includes subdirectories. Subdirectory names are enclosed in square
323/// brackets ([ ]).
324/// - \c \b DDL_DRIVES Includes drives. Drives are listed in the form [-x-], where x is
325/// the drive letter.
326/// - \c \b DDL_EXCLUSIVE Includes only files with the specified attributes. By default,
327/// read-write files are listed even if DDL_READWRITE is not specified.
328/// - \c \b DDL_HIDDEN Includes hidden files.
329/// - \c \b DDL_READONLY Includes read-only files.
330/// - \c \b DDL_READWRITE Includes read-write files with no additional attributes.
331/// - \c \b DDL_SYSTEM Includes system files.
332//
335 return static_cast<int>(SendMessage(LB_DIR, attrs, TParam2(fileSpec)));
336}
337
338//
339/// Adds str to the list box, returning its position in the list (0 is the first
340/// position). Returns a negative value if an error occurs. The list items are
341/// automatically sorted unless the style LBS_SORT is not used for list box
342/// creation.
343//
346 return static_cast<int>(SendMessage(LB_ADDSTRING, 0, TParam2(str)));
347}
348
349//
350/// Inserts str in the list box at the position supplied in index, and returns the
351/// item's actual position (starting at 0) in the list. A negative value is returned
352/// if an error occurs. The list is not resorted. If index is -1, the string is
353/// appended to the end of the list.
354//
355inline int TListBox::InsertString(LPCTSTR str, int index) {
357 return static_cast<int>(SendMessage(LB_INSERTSTRING, index, TParam2(str)));
358}
359
360//
361/// Deletes the item in the list at the position (starting at 0) supplied in index.
362/// DeleteString returns the number of remaining list items, or a negative value if
363/// an error occurs.
364//
365inline int TListBox::DeleteString(int index) {
367 return static_cast<int>(SendMessage(LB_DELETESTRING, index));
368}
369
370//
371/// Clears all the entries in the associated listbox
372//
377
378//
379/// Returns the number of items in the list box, or a negative value if an error
380/// occurs.
381//
382//
383inline int TListBox::GetCount() const {
385 return static_cast<int>(CONST_CAST(TListBox*,this)->SendMessage(LB_GETCOUNT));
386}
387
388//
389/// Returns the index of the first string in the associated listbox which
390/// begins with the passed string
391//
392/// Searches for a match beginning at the passed startIndex. If a match is
393/// not found after the last string has been compared, the search continues
394/// from the beginning of the list until a match is found or until the list
395/// has been completely traversed
396///
397/// Searches from beginning of list when -1 is passed as the startIndex.
398///
399/// Returns the index of the selected string, a negative if an error occurs.
400//
401inline int TListBox::FindString(LPCTSTR find, int startIndex) const {
403 return static_cast<int>(CONST_CAST(TListBox*,this)->
405}
406
407//
408/// Selects the item that matches the given string exactly.
409/// DLN added
410//
413 int index = static_cast<int>(SendMessage(LB_FINDSTRINGEXACT, startIndex, reinterpret_cast<TParam2>(find)));
414 return SetSelIndex(index);
415}
416
417//
418/// Return the index of the first string in the list part
419/// which is exactly same as the passed string.
420//
421/// Search for a exact match at the passed startIndex. If a match is not
422/// found after the last string has been compared, the search continues from
423/// the beginning of the list until a match is found or until the list has been
424/// completely traversed.
425//
426/// Search from beginning of list when -1 is passed as the startIndex
427//
428/// Return the index of the selected string. A negative value is returned if an
429/// error occurs
430//
431/// \note If you create the list box with an owner-drawn style but without the
432/// LBS_HASSTRINGS style, what FindStringExact does depends on whether your
433/// application uses the LBS_SORT style. If you use the LBS_SORT style,
434/// WM_COMPAREITEM messages are sent to the owner of the combo box to determine
435/// which item matches the specified string. If you do not use the LBS_SORT style,
436/// FindStringExact searches for a list item that matches the value of the find
437/// parameter.
438//
439inline int TListBox::FindStringExact(LPCTSTR find, int startIndex) const {
441 return static_cast<int>(CONST_CAST(TListBox*,this)->
443}
444
445//
446/// Retrieves the contents of the string at the passed index of the
447/// associated listbox. Returns the length of the string (in bytes
448/// excluding the terminating 0), a negative if the passed index is not valid
449///
450/// \note The buffer must be large enough for the string and the terminating 0
451//
452inline int TListBox::GetString(LPTSTR str, int index) const {
454 return static_cast<int>(CONST_CAST(TListBox*,this)->
455 SendMessage(LB_GETTEXT, index, TParam2(str)));
456}
457
458
459//
460/// Returns the string length (excluding the terminating NULL) of the item at the
461/// position index supplied in Index. Returns a negative value in the case of an
462/// error.
463//
464inline int TListBox::GetStringLen(int index) const {
466 return static_cast<int>(CONST_CAST(TListBox*,this)->SendMessage(LB_GETTEXTLEN, index));
467}
468
469
470//
471/// Returns the selection state of the list-box item at location index. Returns true
472/// if the list-box item is selected, false if not selected.
473//
474inline bool TListBox::GetSel(int index) const {
476 return static_cast<bool>(CONST_CAST(TListBox*,this)->SendMessage(LB_GETSEL, index));
477}
478
479//
480/// For multiple-selection list boxes. Selects or deselects an item at the position specified in
481/// index or all items if index is -1.
482//
483inline int TListBox::SetSel(int index, bool select) {
485 return (int)SendMessage(LB_SETSEL, select, MkParam2(index, 0));
486}
487
488//
489/// Selects the range of items specified from first to last.
490//
491inline int TListBox::SetSelItemRange(bool select, int first, int last) {
493 return (int)SendMessage(LB_SELITEMRANGE, select, MkParam2(first, last));
494}
495
496//
497/// Retrieve the zero-based index of the item nearest the specified
498/// point in a list box.
504//
505/// Allocates memory for storing list box items. An application sends
506/// this message before adding a large number of items to a list box.
507///
508/// numItemsToAdd specifies the number of items to add. Windows 95: The wParam
509/// parameter is limited to 16-bit values. This means list boxes cannot contain more
510/// than 32,767 items. Although the number of items is restricted, the total size in
511/// bytes of the items in a listbox is limited only by available memory.
512///
513/// memoryToAllocate specifies the amount of memory, in bytes, to allocate for item
514/// strings.
515///
516/// The return value is the maximum number of items that the memory object can store
517/// before another memory reallocation is needed, if successful. It is LB_ERRSPACE
518/// if not enough memory is available.
519///
520/// \note LB_INITSTORAGE Remarks:
521/// - Windows 95: This message helps speed up the initialization of list boxes that
522/// have a large number of items (more than 100). It reserves the specified amount
523/// of memory so that subsequent LB_ADDSTRING, LB_INSERTSTRING, LB_DIR, and
524/// LB_ADDFILE messages take the shortest possible time. You can use estimates for
525/// the cItems and cb parameters. If you overestimate, the extra memory is
526/// allocated; if you underestimate, the normal allocation is used for items that
527/// exceed the requested amount.
528/// - Windows NT: This message is not needed on Windows NT. It does not reserve the
529/// specified amount of memory, because available memory is virtually unlimited. The
530/// return value is always the value specified in the numItemsToAdd parameter.
531//
537
538//
539/// Retrieve the index of the anchor item -- that is, the item from
540/// which a multiple selection starts. A multiple selection spans all items from the
541/// anchor item to the caret item.
542//
543inline int TListBox::GetAnchorIndex() const
544{
546 return static_cast<int>(CONST_CAST(TListBox*,this)->SendMessage(LB_GETANCHORINDEX, 0, 0));
547}
548
549//
550/// Set the anchor item -- that is, the item from which a multiple
551/// selection starts. A multiple selection spans all items from the anchor item to
552/// the caret item. Returns 0 on success; LB_ERR on failure.
553inline int TListBox::SetAnchorIndex(int index)
554{
556 return static_cast<int>(SendMessage(LB_SETANCHORINDEX, index, 0));
557}
558
559//
560/// Returns a reference to a TStringArray object containing the strings.
562 return *Strings;
563}
564
565//
566/// Returns a reference to the ItemDatas array.
568 return *ItemDatas;
569}
570
571//
572/// Returns a reference to the SelIndices array.
574 return *SelIndices;
575}
576
577} // OWL namespace
578
579
580#endif // OWL_LISTBOX_H
#define PRECONDITION(condition)
Definition checks.h:227
virtual int AddString(LPCTSTR str)
Adds str to the list box, returning its position in the list (0 is the first position).
Definition listbox.h:344
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...
Definition listbox.h:355
TControl unifies its derived control classes, such as TScrollBar, TControlGadget, and TButton.
Definition control.h:38
Used to transfer the contents of a list box.
Definition listbox.h:170
TIntArray & GetSelIndices()
Returns a reference to the SelIndices array.
Definition listbox.h:573
TStringArray & GetStrings()
Returns a reference to a TStringArray object containing the strings.
Definition listbox.h:561
TLParamArray & GetItemDatas()
Returns a reference to the ItemDatas array.
Definition listbox.h:567
void AddStringItem(const tstring &str, LPARAM itemData, bool isSelected=false)
Definition listbox.h:182
void AddString(const tstring &str, bool isSelected=false)
Definition listbox.h:180
void SelectString(const tstring &str)
Definition listbox.h:187
An interface object that represents a corresponding list box element.
Definition listbox.h:43
virtual int SetItemData(int index, LPARAM itemData)
Sets the custom value associated with the list box item at the specified index position.
Definition listbox.h:282
virtual LPARAM GetItemData(int index) const
Returns the custom value associated with the item at index set by SetItemData.
Definition listbox.h:274
int GetItemRect(int index, TRect &rect) const
Returns the dimensions of the rectangle that surrounds a list-box item currently displayed in the lis...
Definition listbox.h:290
virtual int DirectoryList(uint attrs, LPCTSTR fileSpec)
Adds a list of file names to a list box.
Definition listbox.h:333
virtual int SetSelIndex(int index)
For single-selection list boxes.
Definition listbox.cpp:589
virtual void SetHorizontalExtent(int horzExtent)
Sets the number of pixels by which the list box can be scrolled horizontally.
Definition listbox.h:241
virtual int AddString(LPCTSTR str)
Adds str to the list box, returning its position in the list (0 is the first position).
Definition listbox.h:344
int FindStringExact(const tstring &str, int startIndex=-1) const
Definition listbox.h:55
bool SetTabStops(int numTabs, int *tabs)
Sets tab stops.
Definition listbox.h:227
virtual int GetStringLen(int index) const
Returns the string length (excluding the terminating NULL) of the item at the position index supplied...
Definition listbox.h:464
void Transfer(TListBoxData &data, TTransferDirection direction)
Definition listbox.h:136
int DirectoryList(uint attrs, const tstring &fileSpec)
Definition listbox.h:88
virtual int SetTopIndex(int index)
The system scrolls the list box contents so that either the specified item appears at the top of the ...
Definition listbox.h:219
bool GetSel(int index) const
Returns the selection state of the list-box item at location index.
Definition listbox.h:474
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.
Definition listbox.h:401
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...
Definition listbox.h:355
virtual int GetHorizontalExtent() const
Returns the number of pixels by which the list box can be scrolled horizontally.
Definition listbox.h:234
int InsertString(const tstring &str, int index)
Definition listbox.h:96
void SetColumnWidth(int width)
Sets the width in pixels of the items in the list box.
Definition listbox.h:248
int FindString(const tstring &str, int startIndex=-1) const
Definition listbox.h:53
int SetCaretIndex(int index, bool partScrollOk)
Sets the focus to the item specified at index.
Definition listbox.h:266
virtual int GetCount() const
Returns the number of items in the list box, or a negative value if an error occurs.
Definition listbox.h:383
virtual int SetItemHeight(int index, int height)
Sets the height in pixels of the items in the list box.
Definition listbox.h:307
int SetAnchorIndex(int index)
Set the anchor item – that is, the item from which a multiple selection starts.
Definition listbox.h:553
virtual int SetSelStringExact(LPCTSTR str, int startIndex=-1)
Selects the item that matches the given string exactly.
Definition listbox.h:411
virtual int DeleteString(int index)
Deletes the item in the list at the position (starting at 0) supplied in index.
Definition listbox.h:365
int SetSelItemRange(bool select, int first, int last)
Selects the range of items specified from first to last.
Definition listbox.h:491
uint32 ItemFromPoint(TPoint &p)
Retrieve the zero-based index of the item nearest the specified point in a list box.
Definition listbox.h:499
virtual void ClearList()
Clears all the entries in the associated listbox.
Definition listbox.h:373
int AddString(const tstring &str)
Definition listbox.h:94
int GetAnchorIndex() const
Retrieve the index of the anchor item – that is, the item from which a multiple selection starts.
Definition listbox.h:543
int SetSelStringExact(const tstring &str, int startIndex=-1)
Definition listbox.h:57
int SetSel(int index, bool select)
For multiple-selection list boxes.
Definition listbox.h:483
int SetSelString(const tstring &str, int startIndex=-1)
Definition listbox.h:109
int InitStorage(int numItemsToAdd, uint32 memoryToAllocate)
Allocates memory for storing list box items.
Definition listbox.h:532
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.
Definition listbox.h:439
virtual int GetTopIndex() const
Returns the index of the first item displayed at the top of the list box.
Definition listbox.h:211
virtual int GetString(TCHAR *str, int index) const
Retrieves the contents of the string at the passed index of the associated listbox.
Definition listbox.h:452
virtual int GetItemHeight(int index) const
Returns the height in pixels of the specified list box item.
Definition listbox.h:298
int ReplaceString(const tstring &str, int index)
Definition listbox.h:98
int GetCaretIndex() const
Returns the index of the currently focused list-box item.
Definition listbox.h:257
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
Definition module.h:47
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
Definition window.cpp:3288
HWND THandle
TWindow encapsulates an HWND.
Definition window.h:418
HWND GetHandle() const
Returns the handle of the window.
Definition window.h:2020
Definition of container classes used and made available by OWL.
Definition of class TControl.
#define DECLARE_STREAMABLE_OWL(cls, ver)
Definition objstrm.h:1529
#define DECLARE_STREAMABLE_INLINES(cls)
Definition objstrm.h:1538
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Definition window.h:92
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
unsigned long uint32
Definition number.h:34
LPARAM TParam2
Second parameter type.
Definition dispatch.h:55
TParam2 MkParam2(const T1 &lo, const T2 &hi)
Definition dispatch.h:65
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
#define protected_data
Definition defs.h:208
#define CONST_CAST(targetType, object)
Definition defs.h:273
#define _OWLCLASS
Definition defs.h:338
Definition of container classes used and made available by OWL.