27#define MULTIPLESEL (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)
30# if defined(BI_COMP_BORLANDC)
42# if defined(BI_COMP_BORLANDC)
51 SelIndices->
Add(index);
60 int index = Items.Add(item);
62 SelIndices->
Add(index);
76 SelIndices->
Add(index);
83 if (Items[
i]->GetText() == str)
93 return SelIndices->
size();
118 Items.
Add(&items[
i]);
159 Items.
Add(&items[
i]);
215 while(
i <
static_cast<int>(Items.Size())){
216 if(*Items[
i] > *item)
220 if(
i >=
static_cast<int>(Items.Size()))
222 return InsertItem(item,
i);
225 if(GetHandle() && AddString(
reinterpret_cast<LPTSTR>(item)) < 0)
227 return Items.Add(item);
337 SortArray(&Items[0],Items.
Size());
506 for(
int i =0;
i < count;
i++)
659 if (HasThreeStates) {
703 HasThreeStates =
true;
734 HasThreeStates =
d.HasThreeStates;
742 return (Text==
d.Text && State ==
d.State &&
743 HasThreeStates ==
d.HasThreeStates && Enabled ==
d.Enabled);
Definition of class TCheckList, an ownerdrawn listbox to select multiple items.
#define PRECONDITION(condition)
#define DIAG_DECLARE_GROUP(group)
#define TRACEX(group, level, message)
The GDI Brush class is derived from TGdiObject.
void SelectString(const tstring &str)
int AddStringItem(const tstring &str, UINT_PTR itemData, bool isSelected=false)
void Clear(bool del=true)
int AddString(const tstring &str, bool isSelected=false)
TCheckList is an owner-drawn list box to select multiple items.
void ODAFocus(DRAWITEMSTRUCT &) override
Repaints the item entirely.
void EvLButtonDown(uint modKeys, const TPoint &point)
Toggles the checked state when the mouse is clicked in the checkbox.
void ODADrawEntire(DRAWITEMSTRUCT &) override
Repaints the item entirely.
~TCheckList() override
Destructs the checklist.
void SetupWindow() override
Adds the strings into the listbox.
void ODASelect(DRAWITEMSTRUCT &) override
virtual uint Transfer(TCheckListData &data, TTransferDirection direction)
Safe overload.
void Update()
Refreshes the window.
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.
void PaintItem(DRAWITEMSTRUCT &)
Paints the item entirely.
virtual void PaintText(TDC &, const TRect &, const tstring &)
void EvChar(uint key, uint repeatCount, uint flags)
Toggles the checked state when the space key is pressed.
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 operator==(const TCheckListItem &d) const
bool IsEnabled() const
Returns true if the item is enabled.
bool IsChecked() const
Returns true if the item has been checked.
void Uncheck()
Unchecks the item.
void SetData(UINT_PTR data)
Sets the user-defined data for this item.
const tstring & GetText()
Returns the text of the item.
TCheckListItem & operator=(const TCheckListItem &d)
void Check()
Checks the item.
bool IsIndeterminate() const
Returns true if the item is in the indeterminate state.
void SetIndeterminate()
Makes the item indeterminate.
static const TColor SysGrayText
The symbolic system color value for grayed (disabled) text.
static const TColor SysHighlightText
The symbolic system color value for text selected in a control.
static const TColor SysHighlight
The symbolic system color value for items selected in a control.
static const TColor SysWindowText
The symbolic system color value for text in every window.
static const TColor SysWindow
The symbolic system color value for the background of each window.
TDC is the root class for GDI DC wrappers.
bool FillRect(int x1, int y1, int x2, int y2, const TBrush &brush)
Fills the given rectangle on this DC using the specified brush.
bool TextRect(int x1, int y1, int x2, int y2)
Fills the given rectangle, clipping any text to the rectangle.
bool DrawFocusRect(int x1, int y1, int x2, int y2)
Draws the given rectangle on this DC in the style used to indicate focus.
virtual TColor SetBkColor(const TColor &color)
Sets the current background color of this DC to the given color value or the nearest available.
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.
virtual TColor SetTextColor(const TColor &color)
Sets the current text color of this DC to the given color value.
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
LOGFONT GetObject() const
Returns information about this font object.
An interface object that represents a corresponding list box element.
virtual LPARAM GetItemData(int index) const
Returns the custom value associated with the item at index set by SetItemData.
virtual int SetSelIndex(int index)
For single-selection list boxes.
virtual int AddString(LPCTSTR str)
Adds str to the list box, returning its position in the list (0 is the first position).
virtual int SetTopIndex(int index)
The system scrolls the list box contents so that either the specified item appears at the top of the ...
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 GetCount() const
Returns the number of items in the list box, or a negative value if an error occurs.
virtual int DeleteString(int index)
Deletes the item in the list at the position (starting at 0) supplied in index.
TIntArray GetSelIndexes() const
Container-aware overload.
int GetSelCount() const
Returns the number of selected items in the single- or multiple-selection list box or combo box.
virtual void ClearList()
Clears all the entries in the associated listbox.
int SetSel(int index, bool select)
For multiple-selection list boxes.
virtual int GetTopIndex() const
Returns the index of the first item displayed at the top of the list box.
int GetCaretIndex() const
Returns the index of the currently focused list-box item.
virtual int GetSelIndex() const
For single-selection list boxes.
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.
virtual void PaintText(TDC &dc, const TRect &textRect, const tstring &text)
int GetAverageCharWidths()
void AddAt(R t, uint index)
Encapsulates the DrawFrameControl 32-bit API.
bool Paint(TDC &dc, TRect &rect, TType type, TState state)
Draw the part onto a DC.
TState
Enumeration describing the various glyphs available for buttons, captions, menus and scrollbar parts.
@ Inactive
Draw button grayed.
@ Checked
Draw button as checked.
@ Button3State
Three-state button.
@ uiButton
Draw a button glyph.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
TWindow * GetParentO() const
Return the OWL's parent for this window.
void EnableTransfer()
Enables the transfer mechanism, which allows state data to be transferred between the window and a tr...
TResult HandleMessage(TMsgId, TParam1=0, TParam2=0)
Dispatches the given message using the response table.
void EvLButtonDown(uint modKeys, const TPoint &point)
Response method for an incoming WM_LBUTTONDOWN message.
uint32 GetStyle() const
Gets the style bits of the underlying window or the 'Style' member of the attribute structure associa...
HFONT GetWindowFont()
Gets the font the control uses to draw text.
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
virtual void SetupWindow()
Performs setup following creation of an associated MS-Windows window.
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
HWND GetHandle() const
Returns the handle of the window.
Definition of classes for CommonControl encapsulation.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
TTransferDirection
The TTransferDirection enum describes the constants that the transfer function uses to determine how ...
@ tdSizeData
Return the size of data transferred by the class.
@ tdSetData
Set data from the buffer into the window.
@ tdGetData
Get data from the window into the buffer.
Object Windows Library (OWLNext Core)
int SortCheckList(const void *a, const void *b)
TTypedArray< int, int, TStandardAllocator > TIntArray
@ BF_UNCHECKED
Item is unchecked.
@ BF_GRAYED
Item is grayed.
@ BF_CHECKED
Item is checked.
uint16 LoUint16(LRESULT r)
TParam2 MkParam2(const T1 &lo, const T2 &hi)
const int CheckList_BoxWidth
Definition of class TString, a flexible universal string envelope class.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.