OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
checklst.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4//
5// Portions Copyright (C) 1997, 98 by Dieter Windau from TCheckListBox class
6// EMail: dieter.windau@kvwl.de
7// Web: http://www.members.aol.com/SoftEngage
8//
9// Added Constructors to work with TCheckListItemArray -- 07/16/1998
10// Merged with OWL class and revised by Yura Bidus -- 06/17/1998,
11//
12/// \file
13/// Implements TCheckList and TCheckListItem
14//----------------------------------------------------------------------------
15#include <owl/pch.h>
16
17#include <owl/checklst.h>
18#include <owl/commctrl.h>
19#include <owl/uihelper.h>
20#include <string.h>
21
22namespace owl {
23
26
27#define MULTIPLESEL (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)
28
29
30# if defined(BI_COMP_BORLANDC)
31# pragma warn -inl
32# endif
34{
35 SelIndices = new TIntArray; // Contains State of every item
36}
37//-----------------------------------------------------------------------------
39{
40 delete SelIndices;
41}
42# if defined(BI_COMP_BORLANDC)
43# pragma warn .inl
44# endif
45//-----------------------------------------------------------------------------
46int
48{
49 int index = Items.Add(new TCheckListItem(str));
50 if(isSelected)
51 SelIndices->Add(index);
52 return index;
53}
54//-----------------------------------------------------------------------------
55int
57{
58 TCheckListItem* item = new TCheckListItem(str);
59 item->SetData(itemData);
60 int index = Items.Add(item);
61 if(isSelected)
62 SelIndices->Add(index);
63 return index;
64}
65//-----------------------------------------------------------------------------
66void
68{
69 Items.Flush(del);
71}
72//-----------------------------------------------------------------------------
73void
75{
76 SelIndices->Add(index);
77}
78//-----------------------------------------------------------------------------
79void
81{
82 for (int i = 0; i < static_cast<int>(Items.size()); ++i)
83 if (Items[i]->GetText() == str)
84 {
85 SelIndices->Add(i);
86 break;
87 }
88}
89//-----------------------------------------------------------------------------
90int
92{
93 return SelIndices->size();
94}
95//-----------------------------------------------------------------------------
96void
98{
99 SelIndices->Flush();
100}
101
102//
103/// Creates a checklist.
104/// \note The constructor does not take ownership of the items. The lifetime and memory of the
105/// items must be handled by the caller, which must ensure the items outlive the checklist.
106//
107TCheckList::TCheckList(TWindow* parent, int id, int x, int y, int w, int h,
108 TCheckListItem* items, int numItems,
109 TModule* module)
110:
111 TListBox(parent, id, x, y, w, h, module)
112{
114 Attr.Style &= ~LBS_HASSTRINGS;
115 Attr.Style &= ~LBS_SORT;
116
117 for(int i = 0; i < numItems; i++)
118 Items.Add(&items[i]);
119
121
122 TRACEX(OwlControl, OWL_CDLEVEL, "TCheckList constructed @" << (void*)this);
123}
124
125//
126/// Creates a checklist.
127/// \note The constructor does not take ownership of the items. The lifetime and memory of the
128/// items must be handled by the caller, which must ensure the items outlive the checklist.
129//
130TCheckList::TCheckList(TWindow* parent, int id, int x, int y, int w, int h,
131 TCheckListArray& items, TModule* module)
132:
133 TListBox(parent, id, x, y, w, h, module)
134{
136 Attr.Style &= ~LBS_HASSTRINGS;
137 Attr.Style &= ~LBS_SORT;
138
139 for(int i = 0; i < static_cast<int>(items.Size()); i++)
140 Items.Add(items[i]);
141
143
144 TRACEX(OwlControl, OWL_CDLEVEL, "TCheckList constructed @" << (void*)this);
145}
146
147//
148/// Creates a checklist based on the given resource identifier.
149/// \note The constructor does not take ownership of the items. The lifetime and memory of the
150/// items must be handled by the caller, which must ensure the items outlive the checklist.
151//
153 TCheckListItem* items, int numItems,
154 TModule* module)
155:
156 TListBox(parent, resourceId, module)
157{
158 for(int i = 0; i < numItems; i++)
159 Items.Add(&items[i]);
160
162
163 TRACEX(OwlControl, OWL_CDLEVEL, "TCheckList constructed from resource @" << (void*)this);
164}
165
166//
167/// Creates a checklist based on the given resource identifier.
168/// \note The constructor does not take ownership of the items. The lifetime and memory of the
169/// items must be handled by the caller, which must ensure the items outlive the checklist.
170//
172 TModule* module)
173:
174 TListBox(parent, resourceId, module)
175{
176 for(int i = 0; i < static_cast<int>(items.Size()); i++)
177 Items.Add(items[i]);
178
180
181 TRACEX(OwlControl, OWL_CDLEVEL, "TCheckList constructed from resource @" << (void*)this);
182}
183
184//
185/// Destructs the checklist.
186/// \note The destructor does not delete the associated TCheckListItem objects. The owner of the
187/// checklist is responsible for the lifetime and destruction of the items.
188//
190{
191 TRACEX(OwlControl, OWL_CDLEVEL, "TCheckList destructed @" << (void*)this);
192}
193
198
199//
200/// Adds the item into the checklist.
201//
202/// Adds string of item to the list box, returning its position in the list
203/// (0 is the first position). Returns a negative value if an error occurs.
204/// The list items are automatically sorted unless the style LBS_SORT
205/// is not used for list box creation.
206/// \note This function does not take ownership of the item. The lifetime and memory of the item
207/// must be handled by the caller, which must ensure the item outlives the checklist box.
208//
209int
211{
212 if(item){
213 if (GetStyle() & LBS_SORT){
214 int i=0;
215 while(i < static_cast<int>(Items.Size())){
216 if(*Items[i] > *item)
217 break;
218 i++;
219 }
220 if(i >= static_cast<int>(Items.Size()))
221 i = -1;
222 return InsertItem(item, i);
223 }
224 else{
225 if(GetHandle() && AddString(reinterpret_cast<LPTSTR>(item)) < 0)
226 return -1;
227 return Items.Add(item);
228 }
229 }
230 return -1;
231}
232
233//
234/// Inserts the item into the checklist box at the given position.
235//
236/// Inserts string of item in the list box at the position supplied in index,
237/// and returns the item's actual position (starting at 0) in the list.
238/// A negative value is returned if an error occurs. The list is not resorted.
239/// If index is -1, the string is appended to the end of the list.
240/// \note This function does not take ownership of the item. The lifetime and memory of the item
241/// must be handled by the caller, which must ensure the item outlives the checklist box.
242//
243int
245{
246 if(item){
247 if(GetHandle() && InsertString(reinterpret_cast<LPCTSTR>(item), idx) < 0)
248 return -1;
249 if(idx == -1)
250 idx = Items.Add(item);
251 else
252 Items.AddAt(item, idx);
253 return idx;
254 }
255 return -1;
256}
257
258//
259/// Detaches the item in the list at the given position (starting at 0).
260/// Returns the address of the associated TCheckListBoxItem, or nullptr if an error occurs.
261/// \note The caller is responsible for deleting the returned item.
262//
265{
266 TCheckListItem* item = GetItem(idx);
267 if(item){
268 Items.DetachItem(item);
269 if(GetHandle())
271 return item;
272 }
273 return nullptr;
274}
275
276//
277/// Toggles the checked state when the space key is pressed.
278//
279void
280TCheckList::EvChar(uint key, uint /*repeatCount*/, uint /*flags*/)
281{
283
284 if (item && item->IsEnabled() && key == _T(' ')) {
285 item->Toggle();
286 Update();
287 }
288// else /??? Eat char ???????????
289// TListBox::EvChar(key, repeatCount, flags);
290}
291
292//
293/// Toggles the checked state when the mouse is clicked in the checkbox.
294//
295void
297{
300 if(item && item->IsEnabled() && point.x < CheckList_BoxWidth){
301 item->Toggle();
302 Update();
303 // Inform parent of change with BN_CLICKED message
304 if(GetParentO())
306 MkParam2(Attr.Id, BN_CLICKED),
307 TParam2(GetHandle()));
308 }
309}
310
311int SortCheckList(const void *a, const void *b)
312{
313 return _tcscmp((*(TCheckListItem**)a)->Text.c_str(),
314 (*(TCheckListItem**)b)->Text.c_str());
315}
316
317static void SortArray(TCheckListItem** items, uint size)
318{
319 qsort(reinterpret_cast<void*>(items), static_cast<size_t>(size), sizeof(TCheckListItem*), SortCheckList);
320}
321
322//
323/// Adds the strings into the listbox.
324//
325void
327{
328 TRACEX(OwlControl, 1, "TCheckList::SetupWindow() @" << (void*)this);
329
330 // Call the base class
331 //
333
334 // if sorted ListBox
335 if ((GetStyle() & LBS_SORT)){
336 if(Items.Size())
337 SortArray(&Items[0],Items.Size());
338 for (uint i = 0; i < Items.Size(); i++)
339 InsertString(reinterpret_cast<LPCTSTR>(Items[i]), i);
340 }
341 else{
342 for (uint i = 0; i < Items.Size(); i++)
343 AddString(reinterpret_cast<LPCTSTR>(Items[i]));
344 }
345}
346
347void
349{
351 Items.Flush();
352}
353
354//
355/// Refreshes the window.
356//
357void
369
370//
371/// Repaints the item entirely.
372//
373void
378
379//
380// Repaints the item entirely.
381//
382void
387
388//
389/// Repaints the item entirely.
390//
391void
396
397//
398/// Paints the item entirely.
399//
400void
402{
403 TCheckListItem* item = GetItem(drawInfo.itemID);
404 if (item == nullptr)
405 return;
406
407 const bool disabled = !item->IsEnabled() || (drawInfo.itemState & ODS_DISABLED);
408
409 // Prepare DC
410 //
411 TDC dc(drawInfo.hDC);
412
413 // Erase entire line
414 //
415 TRect rect(drawInfo.rcItem);
417 dc.FillRect(rect, bkgnd);
418
419 // Draw checkbox
420 //
421 TRect checkboxRect(rect.left+1,rect.top+1,
422 rect.left+CheckList_BoxWidth,rect.bottom-1);
423
424 // Draw checkbox in 3D Windows Style
425 //
426 uint state;
427 if (item->IsIndeterminate())
428 state = TUIPart::Button3State|TUIPart::Checked;//TUIPart::Pushed;
429 else
430 state = TUIPart::ButtonCheck;
431
432 if(item->IsChecked())
433 state |= TUIPart::Checked;
434
435 if (disabled)
436 state |= TUIPart::Inactive;
437
438 TUIPart().Paint(dc, checkboxRect, TUIPart::uiButton, static_cast<TUIPart::TState>(state));
439
440 // Draw select state with hightlight color
441 //
443 textRect.left = checkboxRect.right + 2;
444
445 if (disabled)
446 {
449 }
450 else if (drawInfo.itemState & ODS_SELECTED)
451 {
456 }
457 else
458 {
461 }
462
463 // Draw Text
464 //
465 textRect.left++;
466 PaintText(dc, textRect, item->Text);
467 textRect.left--;
468
469 // Draw focus and selected states
470 //
471 if (drawInfo.itemState & ODS_FOCUS)
473}
474
475//
476/// Returns the item at the specified index.
477//
480{
481 if(GetHandle()){
483 return nullptr;
484 return reinterpret_cast<TCheckListItem*>(GetItemData(index));
485 }
486 else{
487 if (index < 0 || index >= static_cast<int>(Items.Size()))
488 return nullptr;
489 return Items[index];
490 }
491}
492
493uint
495{
496 if (!buffer && direction != tdSizeData) return 0;
497 long style = GetStyle();
498 TCheckListData* checkListData = reinterpret_cast<TCheckListData*>(buffer);
499
500 if (direction == tdGetData){
501 // First, clear out Strings array and fill with contents of list box
502 //
503 checkListData->Clear(false);
504
505 int count = GetCount();
506 for(int i =0; i < count; i++)
507 checkListData->AddItem(GetItem(i));
508
509 // Update transfer data with new selected item(s)
510 //
511 checkListData->ResetSelections();
512
513 if (!(style & MULTIPLESEL)) {
514 // Single selection
515 //
516 checkListData->Select(GetSelIndex());
517 }
518 else {
519 // Multiple selection
520 //
521 int selCount = GetSelCount();
522 if (selCount > 0) {
524
526
527 // Select each item by index
528 //
529 for (int selIndex = 0; selIndex < selCount; selIndex++)
531 }
532 }
533 }
534 else if (direction == tdSetData){
535 ClearList();
536
537 // Add each string, item data and selections in listBoxData to list box
538 //
539 const int noSelection = -1;
540 uint selCount = checkListData->GetSelCount(); // for multi selection
541 int selIndex = noSelection; // for single selection
542 for (uint i = 0; i < checkListData->ItemCount(); i++){
543 // Index may be different from i when the listbox is sorted.
544 //
545 int index = AddString(reinterpret_cast<LPCTSTR>(checkListData->GetItem(i)));
546 if (style & MULTIPLESEL) {
547 for (uint j = 0; j < selCount; j++)
548 if (checkListData->GetSelIndices()[j] == static_cast<int>(i)) {
549 SetSel(index, true);
550 break;
551 }
552 }
553 else {
554 if (selCount && static_cast<uint>(checkListData->GetSelIndices()[0]) == i)
555 selIndex = index;
556 else
557 // Inserted something before item and the item to select has been
558 // pushed further down in the list.
559 //
560 if (selIndex != noSelection && index <= selIndex)
561 selIndex++;
562 }
563 }
564 if (selIndex != noSelection && !(style & MULTIPLESEL))
566 }
567 return sizeof(TCheckListData);
568}
569
570//----------------------------------------------------------------------------
571
572//
573/// Sets tab stops.
574/// If numTabs > 0 and tabs == 0, the function returns false.
575/// \note Doesn't send LB_SETTABSTOP, because the checklist is ownerdrawn.
576//
577bool
579{
581
582 TabStops.Flush();
583
584 if (numTabs == 0){
585 // Set Default Tabstops
586 //
589 return true;
590 }
591 else if (numTabs == 1 && tabs != nullptr){
592 // Set all tabs to the same width defined in tabs
593 //
594 int nBaseUnit = (tabs[0] * GetAverageCharWidths())/4;
596 return true;
597 }
598 else if(numTabs > 1 && tabs != nullptr){
599 // Set all tabs to different width defined in tabs
600 //
602 int nPrevStop = 0;
603 for(int i=0; i<numTabs; i++){
604 nStop = (tabs[i] * nBaseUnit) / 4;
605 if(nStop > nPrevStop){
608 }
609 else
610 return false;
611 }
612 return true;
613 }
614 else
615 return false;
616}
617
618void
620{
621 // If the listbox has the LBS_USETABSTOPS style, set the default tab stops
622 // Can't do this in constuctor, because the window font is not valid
623 //
624 SetTabStops();
626}
627
628void
630{
631 dc.TextRect(textRect);
632 dc.TabbedTextOut(textRect.TopLeft(), text, -1, TabStops.Size(), &TabStops[0], textRect.left);
633}
634
635int
644
645//----------------------------------------------------------------------------
646// TCheckListItem
647//
648
649//
650/// Toggles the state of the item.
651/// If the item has three states, the cycle goes from unchecked -> checked -> indeterminate -> back to unchecked.
652/// Otherwise the state toggles between unchecked and checked.
653//
654void
656{
657 if (!IsEnabled())
658 return;
659 if (HasThreeStates) {
660 if (IsIndeterminate())
661 Uncheck();
662 else if (IsChecked())
664 else
665 Check();
666 }
667 else {
668 if (IsChecked())
669 Uncheck();
670 else
671 Check();
672 }
673}
674
675//
676/// Checks the item.
677//
678void
680{
681 if (IsEnabled())
682 State = BF_CHECKED;
683}
684
685//
686/// Unchecks the item.
687//
688void
690{
691 if (IsEnabled())
692 State = BF_UNCHECKED;
693}
694
695//
696/// Makes the item indeterminate.
697//
698void
700{
701 if (IsEnabled()){
702 State = BF_GRAYED;
703 HasThreeStates = true;
704 }
705}
706
707//
708/// Sets the three-state property.
709//
710void
712{
713 if (IsEnabled()){
714 HasThreeStates = hasThreeStates;
716 Check();
717 }
718}
719
720//
721/// Returns the text of the item.
722//
723const tstring&
725{
726 return Text;
727}
728
731{
732 Text = d.Text;
733 State = d.State;
734 HasThreeStates = d.HasThreeStates;
735 Enabled = d.Enabled;
736 return *this;
737}
738
739bool
741{
742 return (Text==d.Text && State == d.State &&
743 HasThreeStates == d.HasThreeStates && Enabled == d.Enabled);
744}
745
746} // OWL namespace
747//////////////////////////////////////////////
#define MULTIPLESEL
Definition checklst.cpp:27
Definition of class TCheckList, an ownerdrawn listbox to select multiple items.
#define PRECONDITION(condition)
Definition checks.h:227
#define DIAG_DECLARE_GROUP(group)
Definition checks.h:404
#define TRACEX(group, level, message)
Definition checks.h:263
uint Size() const
Definition template.h:672
uint size() const
Definition template.h:679
The GDI Brush class is derived from TGdiObject.
Definition gdiobjec.h:180
void SelectString(const tstring &str)
Definition checklst.cpp:80
int AddStringItem(const tstring &str, UINT_PTR itemData, bool isSelected=false)
Definition checklst.cpp:56
void Clear(bool del=true)
Definition checklst.cpp:67
int AddString(const tstring &str, bool isSelected=false)
Definition checklst.cpp:47
void Select(int index)
Definition checklst.cpp:74
int GetSelCount() const
Definition checklst.cpp:91
TCheckList is an owner-drawn list box to select multiple items.
Definition checklst.h:114
void ODAFocus(DRAWITEMSTRUCT &) override
Repaints the item entirely.
Definition checklst.cpp:374
void EvLButtonDown(uint modKeys, const TPoint &point)
Toggles the checked state when the mouse is clicked in the checkbox.
Definition checklst.cpp:296
void ODADrawEntire(DRAWITEMSTRUCT &) override
Repaints the item entirely.
Definition checklst.cpp:392
~TCheckList() override
Destructs the checklist.
Definition checklst.cpp:189
void SetupWindow() override
Adds the strings into the listbox.
Definition checklst.cpp:326
void ODASelect(DRAWITEMSTRUCT &) override
Definition checklst.cpp:383
virtual uint Transfer(TCheckListData &data, TTransferDirection direction)
Safe overload.
Definition checklst.h:134
void Update()
Refreshes the window.
Definition checklst.cpp:358
TCheckListItem * DetachItem(int idx)
Detaches the item in the list at the given position (starting at 0).
Definition checklst.cpp:264
TCheckListItem * GetItem(int idx)
Returns the item at the specified index.
Definition checklst.cpp:479
void PaintItem(DRAWITEMSTRUCT &)
Paints the item entirely.
Definition checklst.cpp:401
virtual void PaintText(TDC &, const TRect &, const tstring &)
Definition checklst.h:239
void EvChar(uint key, uint repeatCount, uint flags)
Toggles the checked state when the space key is pressed.
Definition checklst.cpp:280
TCheckList(TWindow *parent, int id, int x, int y, int w, int h, TCheckListItem *=0, int numItems=0, TModule *=0)
Creates a checklist.
Definition checklst.cpp:107
int InsertItem(TCheckListItem *item, int idx)
Inserts the item into the checklist box at the given position.
Definition checklst.cpp:244
void ClearList() override
Definition checklst.cpp:348
Each item displayed and manipulated by TCheckList.
Definition checklst.h:43
void Toggle()
Toggles the state of the item.
Definition checklst.cpp:655
void SetThreeStates(bool)
Sets the three-state property.
Definition checklst.cpp:711
bool operator==(const TCheckListItem &d) const
Definition checklst.cpp:740
bool IsEnabled() const
Returns true if the item is enabled.
Definition checklst.h:414
bool IsChecked() const
Returns true if the item has been checked.
Definition checklst.h:369
void Uncheck()
Unchecks the item.
Definition checklst.cpp:689
void SetData(UINT_PTR data)
Sets the user-defined data for this item.
Definition checklst.h:440
const tstring & GetText()
Returns the text of the item.
Definition checklst.cpp:724
TCheckListItem & operator=(const TCheckListItem &d)
Definition checklst.cpp:730
void Check()
Checks the item.
Definition checklst.cpp:679
bool IsIndeterminate() const
Returns true if the item is in the indeterminate state.
Definition checklst.h:387
void SetIndeterminate()
Makes the item indeterminate.
Definition checklst.cpp:699
static const TColor SysGrayText
The symbolic system color value for grayed (disabled) text.
Definition color.h:341
static const TColor SysHighlightText
The symbolic system color value for text selected in a control.
Definition color.h:338
static const TColor SysHighlight
The symbolic system color value for items selected in a control.
Definition color.h:337
static const TColor SysWindowText
The symbolic system color value for text in every window.
Definition color.h:332
static const TColor SysWindow
The symbolic system color value for the background of each window.
Definition color.h:329
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
bool FillRect(int x1, int y1, int x2, int y2, const TBrush &brush)
Fills the given rectangle on this DC using the specified brush.
Definition dc.h:1802
bool TextRect(int x1, int y1, int x2, int y2)
Fills the given rectangle, clipping any text to the rectangle.
Definition dc.h:1878
bool DrawFocusRect(int x1, int y1, int x2, int y2)
Draws the given rectangle on this DC in the style used to indicate focus.
Definition dc.h:1854
virtual TColor SetBkColor(const TColor &color)
Sets the current background color of this DC to the given color value or the nearest available.
Definition dc.cpp:405
virtual bool TabbedTextOut(const TPoint &p, const tstring &str, int count, int numPositions, const int *positions, int tabOrigin, TSize &size)
Draws up to count characters of the given null-terminated string in the current font on this DC.
Definition dc.cpp:634
virtual TColor SetTextColor(const TColor &color)
Sets the current text color of this DC to the given color value.
Definition dc.cpp:417
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
Definition gdiobjec.h:296
LOGFONT GetObject() const
Returns information about this font object.
Definition font.cpp:238
An interface object that represents a corresponding list box element.
Definition listbox.h:43
virtual LPARAM GetItemData(int index) const
Returns the custom value associated with the item at index set by SetItemData.
Definition listbox.h:274
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 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
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
virtual int DeleteString(int index)
Deletes the item in the list at the position (starting at 0) supplied in index.
Definition listbox.h:365
TIntArray GetSelIndexes() const
Container-aware overload.
Definition listbox.cpp:566
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
virtual int GetTopIndex() const
Returns the index of the first item displayed at the top of the list box.
Definition listbox.h:211
int GetCaretIndex() const
Returns the index of the currently focused list-box item.
Definition listbox.h:257
virtual int GetSelIndex() const
For single-selection list boxes.
Definition listbox.cpp:538
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
bool SetTabStops(int numTabs=0, int *tabs=0)
Sets tab stops.
Definition checklst.cpp:578
TIntArray TabStops
Definition checklst.h:227
virtual void PaintText(TDC &dc, const TRect &textRect, const tstring &text)
Definition checklst.cpp:629
void AddAt(R t, uint index)
Definition template.h:1543
bool DetachItem(R t)
Definition template.h:1561
Encapsulates the DrawFrameControl 32-bit API.
Definition uihelper.h:448
bool Paint(TDC &dc, TRect &rect, TType type, TState state)
Draw the part onto a DC.
Definition uipart.cpp:27
TState
Enumeration describing the various glyphs available for buttons, captions, menus and scrollbar parts.
Definition uihelper.h:465
@ Inactive
Draw button grayed.
Definition uihelper.h:474
@ Checked
Draw button as checked.
Definition uihelper.h:472
@ Button3State
Three-state button.
Definition uihelper.h:466
@ ButtonCheck
Check box.
Definition uihelper.h:467
@ uiButton
Draw a button glyph.
Definition uihelper.h:456
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
TWindow * GetParentO() const
Return the OWL's parent for this window.
Definition window.h:2006
void EnableTransfer()
Enables the transfer mechanism, which allows state data to be transferred between the window and a tr...
Definition window.h:1828
TResult HandleMessage(TMsgId, TParam1=0, TParam2=0)
Dispatches the given message using the response table.
Definition window.cpp:1392
void EvLButtonDown(uint modKeys, const TPoint &point)
Response method for an incoming WM_LBUTTONDOWN message.
Definition window.cpp:2101
uint32 GetStyle() const
Gets the style bits of the underlying window or the 'Style' member of the attribute structure associa...
Definition window.cpp:3558
HFONT GetWindowFont()
Gets the font the control uses to draw text.
Definition window.h:3489
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
Definition window.cpp:3288
virtual void SetupWindow()
Performs setup following creation of an associated MS-Windows window.
Definition window.cpp:2575
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
Definition window.h:2822
HWND GetHandle() const
Returns the handle of the window.
Definition window.h:2020
Definition of classes for CommonControl encapsulation.
#define _tcscmp
Definition cygwin.h:75
#define _T(x)
Definition cygwin.h:51
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition eventhan.h:492
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
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
int SortCheckList(const void *a, const void *b)
Definition checklst.cpp:311
TTypedArray< int, int, TStandardAllocator > TIntArray
Definition contain.h:33
EV_WM_CHAR
Definition checklst.cpp:196
@ BF_UNCHECKED
Item is unchecked.
Definition checkbox.h:31
@ BF_GRAYED
Item is grayed.
Definition checkbox.h:30
@ BF_CHECKED
Item is checked.
Definition checkbox.h:29
uint16 LoUint16(LRESULT r)
Definition defs.h:264
TParam2 MkParam2(const T1 &lo, const T2 &hi)
Definition dispatch.h:65
OWL_DIAGINFO
Definition animctrl.cpp:14
const int CheckList_BoxWidth
Definition checklst.h:33
END_RESPONSE_TABLE
Definition button.cpp:26
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
EV_WM_LBUTTONDOWN
Definition checklst.cpp:195
#define OWL_CDLEVEL
Definition defs.h:171
Definition of class TString, a flexible universal string envelope class.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.