17#if !defined(OWL_CHECKLST_H)
21#if defined(BI_HAS_PRAGMA_ONCE)
141 void SetupWindow()
override;
145 void ODAFocus(DRAWITEMSTRUCT&)
override;
146 void ODASelect(DRAWITEMSTRUCT&)
override;
147 void ODADrawEntire(DRAWITEMSTRUCT&)
override;
148 void PaintItem(DRAWITEMSTRUCT&);
153 void EvLButtonDown(
uint modKeys,
const TPoint& point);
175 void Clear(
bool del =
true);
190 void Check(
int index);
241 dc.
DrawText(text, -1, textRect, DT_SINGLELINE | DT_VCENTER);
256 TCheckList(parent,id,x,y,w,h,items,numItems,module)
282 TCheckList(parent,resourceId,items,numItems,module)
307 HasThreeStates(false),
318 HasThreeStates(item.HasThreeStates),
319 Enabled(item.Enabled),
320 UserData(item.UserData)
341 return !(*
this == d);
347 return Text < d.Text;
362 return Text > d.Text;
407 return HasThreeStates;
458 PRECONDITION(index <
static_cast<int>(Items.size()));
return Items[index];
469 return Items[index]->IsChecked();
475 return Items[index]->IsUnchecked();
481 return Items[index]->IsIndeterminate();
487 return Items[index]->IsEnabled();
493 return Items[index]->GetState();
499 return Items[index]->GetThreeStates();
505 Items[index]->Toggle();
511 Items[index]->Check();
517 Items[index]->Uncheck();
523 Items[index]->SetIndeterminate();
529 Items[index]->SetThreeStates(enable);
535 Items[index]->Enable();
541 Items[index]->Disable();
546 return Items.Add(item);
Definition of class TCheckBox.
#define PRECONDITION(condition)
TCheckListArray(int upper, int lower=0, int delta=0)
uint GetState(int index) const
bool IsChecked(int index) const
void SelectString(const tstring &str)
bool IsEnabled(int index) const
int AddStringItem(const tstring &str, UINT_PTR itemData, bool isSelected=false)
int AddItem(TCheckListItem *item)
void SetThreeStates(int index, bool enable=true)
void SetIndeterminate(int index)
bool IsIndeterminate(int index) const
TCheckListItem * GetItem(int index)
TIntArray & GetSelIndices()
bool IsUnchecked(int index) const
void Clear(bool del=true)
int AddString(const tstring &str, bool isSelected=false)
bool GetThreeStates(int index) const
int AddItem(TCheckListItem *item)
Adds the item into the checklist.
friend class TCheckListArray
virtual uint Transfer(TCheckListData &data, TTransferDirection direction)
Safe overload.
TCheckListItem * DetachItem(int idx)
Detaches the item in the list at the given position (starting at 0).
TCheckListItem * GetItem(int idx)
Returns the item at the specified index.
virtual void PaintText(TDC &, const TRect &, const tstring &)
TCheckList(TWindow *parent, int id, int x, int y, int w, int h, TCheckListItem *=0, int numItems=0, TModule *=0)
Creates a checklist.
int InsertItem(TCheckListItem *item, int idx)
Inserts the item into the checklist box at the given position.
void ClearList() override
Each item displayed and manipulated by TCheckList.
void Toggle()
Toggles the state of the item.
void SetThreeStates(bool)
Sets the three-state property.
bool IsEnabled() const
Returns true if the item is enabled.
void Disable()
Disables the item.
bool IsChecked() const
Returns true if the item has been checked.
bool operator<(const TCheckListItem &d) const
void Enable()
Enables the item.
void Uncheck()
Unchecks the item.
bool operator!=(const TCheckListItem &d) const
TCheckListItem()
Initializes the state of TCheckListItem.
friend int SortCheckList(const void *a, const void *b)
bool IsUnchecked() const
Returns true if the item has been unchecked.
bool operator>(const TCheckListItem &d) const
void SetData(UINT_PTR data)
Sets the user-defined data for this item.
const tstring & GetText()
Returns the text of the item.
uint GetState() const
Returns the button state (BF_CHECKED, BF_UNCHECKED or BF_GRAYED).
UINT_PTR GetData()
Returns the user-defined data for this item.
bool GetThreeStates() const
Returns true if the item has tree states.
void SetText(const tstring &text)
Copies the text string.
void Check()
Checks the item.
bool IsIndeterminate() const
Returns true if the item is in the indeterminate state.
void SetIndeterminate()
Makes the item indeterminate.
TDC is the root class for GDI DC wrappers.
int DrawText(const tstring &str, int count, const TRect &, uint16 format=0)
Overload for const TRect& For obvious reasons, this overload does not support the DT_CALCRECT format ...
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),...
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.
bool SetTabStops(int numTabs=0, int *tabs=0)
Sets tab stops.
TTabCheckList(TWindow *parent, int id, int x, int y, int w, int h, TCheckListItem *items=0, int numItems=0, TModule *module=0)
Creates a tabbed checklist.
virtual void PaintText(TDC &dc, const TRect &textRect, const tstring &text)
int GetAverageCharWidths()
TPtrArrayIterator< TCheckListItem *, TTypedArray< TCheckListItem *, TCheckListItem *, TStandardAllocator > > Iterator
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
bool ModifyStyle(uint32 offBits, uint32 onBits, uint swpFlags=0)
Modifies the style bits of the window.
TCheckListArray::Iterator TCheckListArrayIter
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
Definition of class TListBox and TlistBoxData.
Object Windows Library (OWLNext Core).
TTypedArray< int, int, TStandardAllocator > TIntArray
@ BF_UNCHECKED
Item is unchecked.
@ BF_GRAYED
Item is grayed.
@ BF_CHECKED
Item is checked.
const int CheckList_BoxWidth
Definition of container classes used and made available by OWL.