OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
listbox.cpp
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/// Implementation of class TListBox and TListBoxData.
7//----------------------------------------------------------------------------
8#include <owl/pch.h>
9
10#include <owl/listbox.h>
11#include <stdlib.h>
12#include <vector>
13
14using namespace std;
15
16namespace owl {
17
19
20// Let the compiler know that the following template instances will be defined elsewhere.
21//#pragma option -Jgx
22
23
24#define MULTIPLESEL (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)
25
26//
27// TListBoxData constructor
28/// Constructs Strings and SelStrings. Initializes SelCount to 0.
29//
31{
32 Strings = new TStringArray;
33 ItemDatas = new TLParamArray;
34 SelIndices = new TIntArray;
35}
36
37//
38// TListBoxData destructor
39/// Deletes the space allocated for Strings and SelStrings.
40//
42{
43 delete Strings;
44 delete ItemDatas;
45 delete SelIndices;
46}
47//
48/// Resets the list box by flushing the ItemDatas and Strings arrays and calling
49/// ResetSelections.
51{
52 Strings->Flush();
53 ItemDatas->Flush();
55}
56//
57/// Returns the number of items in SelIndices.
59{
60 return SelIndices->Size();
61}
62//
63/// Flushes SelIndices.
65{
66 SelIndices->Flush();
67}
68
69//
70/// Adds the specified string to Strings. If IsSelected is true, the string is
71/// selected.
72//
73void
76 Strings->Add(str);
77 if (isSelected)
78 Select(Strings->Size()-1);
79}
80
81//
82/// Adds a string to the Strings array, optionally selects it, and adds itemData to
83/// the ItemDatas array.
84//
85void
91
92//
93/// Selects the string at the given index.
94//
95void
97{
98 if (index != LB_ERR && SelIndices->Find(index) == SelIndices->NPOS)
99 SelIndices->Add(index);
100}
101
102//
103/// Adds the index of the string matching str to SelIndices.
104//
105void
107{
108 for (uint i = 0; i < Strings->Size(); i++)
109 if (_tcscmp((*Strings)[i].c_str(), str) == 0) {
110 Select(i);
111 break;
112 }
113}
114
115//
116/// Returns the length (excluding the terminating NULL) of the string at the
117/// specified index in SelIndices.
118//
119int
121{
122 return index >= 0 && index < GetSelCount() ?
123 static_cast<int>((*Strings)[(*SelIndices)[index]].length()) :
124 -1;
125}
126
127//
128/// Locates the string at the specified index in SelIndices and copies it into
129/// buffer. bufferSize includes the terminating NULL.
130//
131void
133{
134 if (bufferSize > 0) {
136 *buffer = 0;
137
138 else {
139 _tcsncpy(buffer, (*Strings)[(*SelIndices)[index]].c_str(), bufferSize-1);
140 buffer[bufferSize - 1] = 0;
141 }
142 }
143}
144
145//
146/// Locates the string at the specified index in SelIndices and copies it into str.
147//
148void
150{
151 if (index >= 0 && index < GetSelCount())
152 str = (*Strings)[(*SelIndices)[index]];
153 else
154 str = _T("");
155}
156
157//----------------------------------------------------------------------------
158
159//
160// Constructor for TListBox
161//
162//
163/// Constructs a list box object with the supplied parent window (parent) library ID
164/// (module), position (x, y) relative to the origin of the parent window's client
165/// area, width (w), and height (h). Invokes a TControl constructor. Adds
166/// LBS_STANDARD to the default styles for the list box to provide it with
167/// - A border (WS_BORDER)
168/// - A vertical scroll bar (WS_VSCROLL)
169/// - Automatic alphabetic sorting of list items (LBS_SORT)
170/// - Parent window notification upon selection (LBS_NOTIFY)
171/// The TListBox member functions that are described as being for single-selection
172/// list boxes are inherited by TComboBox and can also be used by combo boxes. Also,
173/// these member functions return -1 for multiple-selection list boxes.
174//
176 int id,
177 int x, int y, int w, int h,
178 TModule* module)
179:
180 TControl(parent, id, nullptr, x, y, w, h, module)
181{
182 Attr.Style |= LBS_STANDARD;
183 Attr.ExStyle |= WS_EX_CLIENTEDGE; // Creates 3d sunken inside edge
184}
185
186//
187/// Constructs a TListBox object to be associated with a list box control of a
188/// TDialog object. Invokes the TControl constructor with similar parameters. The
189/// module parameter must correspond to a list box resource that you define.
190//
192 int resourceId,
193 TModule* module)
194:
195 TControl(parent, resourceId, module)
196{
197}
198
199//
200/// Constructs a TListBox object to encapsulate (alias) an existing control.
201//
203:
204 TControl(hWnd, module)
205{
206}
207
208//
209/// Returns the name of TListBox's registration class, "LISTBOX".
210//
212{
213 return TWindowClassName{_T("LISTBOX")};
214}
215
216//
217//
218/// Transfers the items and selection(s) of the list box to or from a transfer
219/// buffer if tdSetData or tdGetData, respectively, is passed as the direction.
220/// buffer is expected to point to a pointer to a TListBoxData structure.
221///
222/// Transfer returns the size of the TListBoxData structure. To retrieve the size
223/// without transferring data, your application must pass tdSizeData as the
224/// direction.
225//
226uint
228{
229 if (!buffer && direction != tdSizeData) return 0;
230 long style = GetStyle();
232
233 if (direction == tdGetData) {
234
235 // First, clear out Strings array and fill with contents of list box
236 //
237 listBoxData->Clear();
238
239 // Pre-calculate max string length so that one big buffer can be used
240 //
241 int count = GetCount();
242 int maxStrLen = 0;
243 int i;
244 for (i = 0; i < count; i++) {
245 int strLen = GetStringLen(i);
246 if (strLen > maxStrLen)
248 }
249
250 // Get each string and item data in the listbox & add to listboxdata
251 //
253 for (i = 0; i < GetCount(); i++) {
255 listBoxData->AddStringItem(tmpStr, GetItemData(i), false);
256 }
257
258 // Update transfer data with new selected item(s)
259 //
260 listBoxData->ResetSelections();
261
262 if (!(style & MULTIPLESEL)) {
263 // Single selection
264 //
265 listBoxData->Select(GetSelIndex());
266 }
267 else {
268 // Multiple selection
269 //
270 int selCount = GetSelCount();
271 if (selCount > 0) {
272 int* selections = new int[selCount];
273
275
276 // Select each item by index
277 //
278 for (int selIndex = 0; selIndex < selCount; selIndex++)
280
281 delete[] selections;
282 }
283 }
284 }
285 else if (direction == tdSetData) {
286 ClearList();
287
288 // Add each string, item data and selections in listBoxData to list box
289 //
290 const int noSelection = -1;
291 uint selCount = listBoxData->GetSelCount(); // for multi selection
292 int selIndex = noSelection; // for single selection
293 for (uint i = 0; i < listBoxData->GetStrings().Size(); i++) {
294 // Index may be different from i when the listbox is sorted.
295 //
296 int index = AddString(listBoxData->GetStrings()[i]);
297 if(i < listBoxData->GetItemDatas().Size())
298 SetItemData(index, listBoxData->GetItemDatas()[i]);
299 if (style & MULTIPLESEL) {
300 for (uint j = 0; j < selCount; j++)
301 if (listBoxData->GetSelIndices()[j] == static_cast<int>(i)) {
302 SetSel(index, true);
303 break;
304 }
305 }
306 else {
307 if (selCount && static_cast<uint>(listBoxData->GetSelIndices()[0]) == i)
308 selIndex = index;
309 else
310 // Inserted something before item and the item to select has been
311 // pushed further down in the list.
312 //
313 if (selIndex != noSelection && index <= selIndex)
314 selIndex++;
315 }
316 }
317 if (selIndex != noSelection && !(style & MULTIPLESEL))
319 }
320
321 return sizeof(TListBoxData);
322}
323
324#if 0 // Obsoleted by FindStringExact
325
326//
327/// Returns the index of the first string in the associated listbox
328/// which is the same as the passed string
329//
330/// Starting at the line number passed in searchIndex, searches the list box for an
331/// exact match with the string str. If a match is not found after the last string
332/// has been compared, the search continues from the beginning of the list until a
333/// match has been found or until the list has been completely traversed. Searches
334/// from the beginning of the list when -1 is supplied as searchIndex. Returns the
335/// index of the first string found if successful, or a negative value if an error
336/// occurs.
337///
338int
339TListBox::FindExactString(LPCTSTR findStr, int startIndex) const
340{
341 bool found = false;
343 do {
344 if (startIndex > -1) {
346
348
349 if (_tcscmp(tmpStr, findStr) == 0)
350 found = true;
351 else
353 }
354 } while (!found && startIndex != firstMatch);
355
356 return found ? startIndex : -1;
357}
358
359#endif
360
361//
362/// For single-selection list boxes. Retrieves the currently selected item, putting
363/// up to maxChars of it in str. GetSelString returns one of the following: the
364/// string length, a negative value if an error occurs, or -1 if no string is
365/// selected. For multiple-selection list boxes, it returns -1.
366//
367/// \note Since the Windows function is not passed a size parameter, we have to
368/// allocate a string to hold the largest string (gotten from a query), and
369/// copy a part of it
370//
371int
373{
374 int index = GetSelIndex();
375
376 if (index > -1) {
377 int length = GetStringLen(index);
378
379 if (maxChars >= length)
380 return GetString(str, index);
381 else if(length > 0){
383 GetString(tmpStr, index);
384 _tcsncpy(str, tmpStr, maxChars);
385 return maxChars;
386 }
387 }
388 return -1;
389}
390
391//
392/// Returns the number of selected items in the single- or multiple-selection list
393/// box or combo box.
394//
395int
397{
398 if (!(GetStyle() & MULTIPLESEL))
399 return GetSelIndex() < 0 ? 0 : 1;
400
401 // Multiple-selection list box
402 //
403 return static_cast<int>(CONST_CAST(TListBox*,this)->SendMessage(LB_GETSELCOUNT));
404}
405
406//
407/// For multiple-selection list boxes, retrieves the total number of selected items
408/// for a multiselection list and copies them into the buffer. The strs parameter is
409/// an array of pointers to chars. Each of the pointers to the buffers is of
410/// maxChars. maxCount is the size of the array.
411///
412/// Returns the number of items put into Strings. -1 is returned if this is
413/// not a multiple-selection list box
414///
415/// \note Since the Windows function is not passed a size parameter, we have to
416/// allocate a string to hold the largest string (gotten from a query), and
417/// copy a part of it
418//
419int
421{
422 if (!(GetStyle() & MULTIPLESEL))
423 return -1;
424
425 int i = GetSelCount();
426
427 if (i < maxCount)
428 maxCount = i;
429
430 if (maxCount > 0) {
431 int* selections = new int[maxCount];
432
434
435 for (int selIndex = 0; selIndex < maxCount; selIndex++) {
437
438 if (maxChars >= tmpStrLen)
440
441 else if(tmpStrLen > 0) {
445 }
446 }
447 delete[] selections;
448 }
449 return maxCount;
450}
451
452//
453/// Container-aware overload
454//
457{
458 TStringArray s;
460 for (int i = 0; i != static_cast<int>(selections.size()); ++i)
462 return s;
463}
464
465//
466/// For single-selection list boxes. Forces the selection of the first item
467/// beginning with the text supplied in str that appears beyond the position
468/// (starting at 0) supplied in SearchIndex. If startIndex is -1, the entire list
469/// is searched, beginning with the first item. SetSelString returns the position of
470/// the newly selected item, or a negative value in the case of an error.
471//
472int
474{
475 if (!(GetStyle() & MULTIPLESEL))
476 return static_cast<int>(SendMessage(LB_SELECTSTRING, startIndex, TParam2(findStr)));
477 return -1;
478}
479
480//
481/// For multiple-selection list boxes, selects the strings in the associated list
482/// box that begin with the prefixes specified in the prefixes array. For each
483/// string the search begins at the beginning of the list and continues until a
484/// match is found or until the list has been completely traversed. If shouldSet is
485/// true, the matched strings are selected and highlighted; if shouldSet is false,
486/// the highlight is removed from the matched strings and they are no longer
487/// selected. Returns the number of strings successfully selected or deselected (-1
488/// for single-selection list boxes and combo boxes). If numSelections is less than
489/// 0, all strings are selected or deselected, and a negative value is returned on
490/// failure.
491//
492int
494{
495 if (!(GetStyle() & MULTIPLESEL))
496 return -1;
497
498 if (numSelections < 0)
499 return SetSel(-1, shouldSet);
500
501 int successes = 0;
502 for (int i = 0; i < numSelections; i++) {
503 int selIndex;
504 if ((selIndex = FindString(strs[i], -1)) > -1)
505 if (SetSel(selIndex, shouldSet) > -1)
506 successes++;
507 }
508 return successes;
509}
510
511//
512/// Container-aware overload
513//
514int
516{
517 if (!(GetStyle() & MULTIPLESEL))
518 return -1;
519
520 int successes = 0;
521 for (int i = 0; i < static_cast<int>(strs.size()); i++)
522 {
523 int selIndex = FindString(strs[i], -1);
524 if (selIndex > -1)
525 if (SetSel(selIndex, shouldSet) > -1)
526 successes++;
527 }
528 return successes;
529}
530
531//
532/// For single-selection list boxes. Returns the non-negative index (starting at 0)
533/// of the currently selected item, or a negative value if no item is selected.
534///
535/// \note A negative value is returned if this is a multiple-selection list box
536//
537int
539{
540 if (!(GetStyle() & MULTIPLESEL))
541 return static_cast<int>(CONST_CAST(TListBox*,this)->SendMessage(LB_GETCURSEL));
542 return -1;
543}
544
545//
546/// For multiple-selection list boxes. Fills the indexes array with the indexes of
547/// up to maxCount selected strings. Returns the number of items put in indexes (-1
548/// for single-selection list boxes and combo boxes).
549//
550int
552{
553 if (!(GetStyle() & MULTIPLESEL))
554 return -1;
555 return static_cast<int>(CONST_CAST(TListBox*,this)->SendMessage(LB_GETSELITEMS,
556 maxCount,
557 TParam2(indexes)));
558}
559
560//
561/// Container-aware overload.
562/// For multiple-selection list boxes.
563/// \note An empty container is returned if this is a single-selection list box.
564//
567{
569 if (!(GetStyle() & MULTIPLESEL)) return selections;
570 int selCount = GetSelCount();
571 if (selCount > 0)
572 {
573 std::vector<int> buf(selCount);
574 int n = GetSelIndexes(&buf[0], static_cast<int>(buf.size()));
575 CHECK(n == static_cast<int>(buf.size()));
576 for (int i = 0; i != n; ++i)
577 selections.Add(buf[i]);
578 }
579 return selections;
580}
581
582//
583/// For single-selection list boxes. Forces the selection of the item at the
584/// position (starting at 0) supplied in index. If index is -1, the list box is
585/// cleared of any selection. SetSelIndex returns a negative number if an error
586/// occurs.
587//
588int
590{
591 if (!(GetStyle() & MULTIPLESEL))
592 return static_cast<int>(SendMessage(LB_SETCURSEL, index));
593 return -1;
594}
595
596//
597/// For multiple-selection list boxes. Selects or deselects the strings in the
598/// associated list box at the indexes specified in the Indexes array. If ShouldSet
599/// is true, the indexed strings are selected and highlighted; if ShouldSet is false
600/// the highlight is removed and they are no longer selected. Returns the number of
601/// strings successfully selected or deselected (-1 for single-selection list boxes
602/// and combo boxes). If NumSelections is less than 0, all strings are selected or
603/// deselected, and a negative value is returned on failure.
604//
605int
607{
608 int successes = 0;
609
610 if (!(GetStyle() & MULTIPLESEL))
611 return -1; // including if it's a combobox
612
613 if (numSelections < 0)
614 return static_cast<int>(SendMessage(LB_SETSEL, shouldSet, -1));
615
616 else {
617 for (int i = 0; i < numSelections; i++)
618 if (static_cast<int>(SendMessage(LB_SETSEL, shouldSet, indexes[i])) > -1)
619 successes++;
620 }
621 return successes;
622}
623
624//
625/// Container-aware overload
626//
627int
629{
630 if (!(GetStyle() & MULTIPLESEL))
631 return -1; // including if it's a combobox
632
633 int successes = 0;
634 for (int i = 0; i < static_cast<int>(indexes.size()); i++)
635 if (static_cast<int>(SendMessage(LB_SETSEL, shouldSet, indexes[i])) > -1)
636 successes++;
637 return successes;
638}
639
640//
641/// Returns true if the index is selected.
642bool TListBox::IsSelected(int index) const
643{
645 if (GetStyle() & MULTIPLESEL) return SendMessage(LB_GETSEL, TParam1(index)) > 0;
646 return GetSelIndex() == index;
647}
648
649//
650/// Sets the selection state for the item at the specified index, and returns
651/// true if successful.
652bool TListBox::SetSelected(int index, bool selected)
653{
656 return (SetSelIndex(selected ? index : -1) >= 0) || (index == -1) || !selected;
657}
658
659//
660/// Replaces the item in the list at the position supplied in index, and returns that
661/// item's actual position (starting at 0) in the list. A negative value is returned
662/// if an error occurs. The list is not resorted.
663//
665{
666 auto isSel = IsSelected(index);
667 auto ret = DeleteString(index);
668 if (ret >= 0)
669 {
670 ret = InsertString(str, index);
671 if ((ret >= 0) && isSel) SetSelected(index);
672 }
673 return ret;
674}
675
676//
677/// For use with CopyText
678//
679struct TListBoxGetString
680{
681 const TListBox& listbox;
682 int index;
683 TListBoxGetString(const TListBox& c, int index_) : listbox(c), index(index_) {}
684
685 int operator()(LPTSTR buf, int buf_size)
686 {return listbox.GetString(buf, index);}
687};
688
689//
690/// String-aware overload
691//
693{
694 return CopyText(GetStringLen(index), TListBoxGetString(*this, index));
695}
696
697//
698/// String-aware overload
699//
701{
702 int i = GetSelIndex();
703 return (i < 0) ? tstring() : GetString(i);
704}
705
707{
708 tstring s;
709 GetSelString(s, index);
710 return s;
711}
712
713
714
716
717#if OWL_PERSISTENT_STREAMS
718
719//
720// Reads an instance of TListBox from the supplied ipstream
721//
722void*
723TListBox::Streamer::Read(ipstream& is, uint32 /*version*/) const
724{
725 ReadBaseObject((TControl*)GetObject(), is);
726 return GetObject();
727}
728
729//
730// Writes the TListBox to the supplied opstream
731//
732void
733TListBox::Streamer::Write(opstream& os) const
734{
735 WriteBaseObject((TControl*)GetObject(), os);
736}
737
738#endif
739
740} // OWL namespace
741/* ========================================================================== */
742
#define MULTIPLESEL
Definition checklst.cpp:27
#define CHECK(condition)
Definition checks.h:239
#define PRECONDITION(condition)
Definition checks.h:227
uint Size() const
Definition template.h:601
static const auto NPOS
Definition template.h:608
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
void AddString(LPCTSTR str, bool isSelected=false)
Adds the specified string to Strings.
Definition listbox.cpp:74
void Clear()
Resets the list box by flushing the ItemDatas and Strings arrays and calling ResetSelections.
Definition listbox.cpp:50
~TListBoxData()
Deletes the space allocated for Strings and SelStrings.
Definition listbox.cpp:41
TListBoxData()
Constructs Strings and SelStrings. Initializes SelCount to 0.
Definition listbox.cpp:30
int GetSelCount() const
Returns the number of items in SelIndices.
Definition listbox.cpp:58
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.
Definition listbox.cpp:86
int GetSelStringLength(int index=0) const
Returns the length (excluding the terminating NULL) of the string at the specified index in SelIndice...
Definition listbox.cpp:120
void SelectString(LPCTSTR str)
Adds the index of the string matching str to SelIndices.
Definition listbox.cpp:106
void Select(int index)
Selects the string at the given index.
Definition listbox.cpp:96
void GetSelString(TCHAR *buffer, int bufferSize, int index=0) const
Locates the string at the specified index in SelIndices and copies it into buffer.
Definition listbox.cpp:132
void ResetSelections()
Flushes SelIndices.
Definition listbox.cpp:64
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 int ReplaceString(LPCTSTR str, int index)
Replaces the item in the list at the position supplied in index, and returns that item's actual posit...
Definition listbox.cpp:664
virtual LPARAM GetItemData(int index) const
Returns the custom value associated with the item at index set by SetItemData.
Definition listbox.h:274
tstring GetSelString() const
String-aware overload.
Definition listbox.cpp:700
virtual int SetSelIndex(int index)
For single-selection list boxes.
Definition listbox.cpp:589
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 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 SetSelIndexes(int *indexes, int numSelections, bool shouldSet)
For multiple-selection list boxes.
Definition listbox.cpp:606
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 GetCount() const
Returns the number of items in the list box, or a negative value if an error occurs.
Definition listbox.h:383
TListBox(TWindow *parent, int id, int x, int y, int w, int h, TModule *module=0)
Constructs a list box object with the supplied parent window (parent) library ID (module),...
Definition listbox.cpp:175
virtual int DeleteString(int index)
Deletes the item in the list at the position (starting at 0) supplied in index.
Definition listbox.h:365
bool IsSelected(int index) const
Returns true if the index is selected.
Definition listbox.cpp:642
TIntArray GetSelIndexes() const
Container-aware overload.
Definition listbox.cpp:566
virtual auto GetWindowClassName() -> TWindowClassName
Returns the name of TListBox's registration class, "LISTBOX".
Definition listbox.cpp:211
int GetSelCount() const
Returns the number of selected items in the single- or multiple-selection list box or combo box.
Definition listbox.cpp:396
virtual void ClearList()
Clears all the entries in the associated listbox.
Definition listbox.h:373
int SetSel(int index, bool select)
For multiple-selection list boxes.
Definition listbox.h:483
bool SetSelected(int index, bool selected=true)
Sets the selection state for the item at the specified index, and returns true if successful.
Definition listbox.cpp:652
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 SetSelString(LPCTSTR str, int startIndex=-1)
For single-selection list boxes.
Definition listbox.cpp:473
TStringArray GetSelStrings() const
Container-aware overload.
Definition listbox.cpp:456
int SetSelStrings(LPCTSTR *prefixes, int numSelections, bool shouldSet)
For multiple-selection list boxes, selects the strings in the associated list box that begin with the...
Definition listbox.cpp:493
virtual int GetSelIndex() const
For single-selection list boxes.
Definition listbox.cpp:538
int Add(const T &t)
Definition template.h:1139
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
int Find(R t) const
Definition template.h:1468
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
uint32 GetStyle() const
Gets the style bits of the underlying window or the 'Style' member of the attribute structure associa...
Definition window.cpp:3558
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
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Definition objstrm.h:391
#define _tcscmp
Definition cygwin.h:75
#define _tcsncpy
Definition cygwin.h:80
#define _T(x)
Definition cygwin.h:51
void ReadBaseObject(Base *base, ipstream &in)
Definition objstrm.h:1159
#define IMPLEMENT_STREAMABLE1(cls, base1)
Definition objstrm.h:1725
void WriteBaseObject(Base *base, opstream &out)
Definition objstrm.h:1150
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Definition window.h:92
@ tdSizeData
Return the size of data transferred by the class.
Definition window.h:95
@ tdSetData
Set data from the buffer into the window.
Definition window.h:94
@ tdGetData
Get data from the window into the buffer.
Definition window.h:93
Definition of class TListBox and TlistBoxData.
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
TTypedArray< int, int, TStandardAllocator > TIntArray
Definition contain.h:33
TObjectArray< tstring > TStringArray
Definition contain.h:37
char tchar
Definition defs.h:77
LPARAM TParam2
Second parameter type.
Definition dispatch.h:55
tstring CopyText(int size, TGetText get_text)
Copies text from a C-string (null-terminated character array) into a string object,...
Definition defs.h:317
WPARAM TParam1
First parameter type.
Definition dispatch.h:54
TTypedArray< LPARAM, LPARAM, TStandardAllocator > TLParamArray
Definition contain.h:43
OWL_DIAGINFO
Definition animctrl.cpp:14
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
#define CONST_CAST(targetType, object)
Definition defs.h:273
#define WS_EX_CLIENTEDGE
Definition wsysinc.h:33