XUISourceListItem
Description
Represents an item in a XUISourceList
.
Properties
Name | Type | Read-Only |
---|---|---|
BadgeValue | Integer |
✔ |
CanAcceptChildren | Boolean |
|
ChildCount | Integer |
✔ |
Data | Variant |
|
Depth | Integer |
✔ |
DisclosureBounds | Rect |
|
Expandable | Boolean |
|
Expanded | Boolean |
|
HasIcon | Boolean |
✔ |
HasWidget | Boolean |
|
Icon | Picture |
|
IsSection | Boolean |
✔ |
mChildren() | XUISourceListItem |
|
mOwner | WeakRef |
|
mParent | WeakRef |
|
Owner | XUISourceList |
|
Section | XUISourceListItem |
✔ |
ShowBadge | Boolean |
|
Title | String |
|
Value | Integer |
|
WidgetBounds | Rect |
|
WidgetIcon | Picture |
Methods
Name | Parameters | Returns |
---|---|---|
AddChild | item As XUISourceListItem , shouldRebuild As Boolean |
|
AddChildAt | index As Integer , item As XUISourceListItem , shouldRebuild As Boolean |
|
ChildAtIndex | index As Integer |
XUISourceListItem |
Constructor | title As String , icon As Picture , value As Integer , data As Variant , canAcceptChildren As Boolean |
|
GetParent | XUISourceListItem |
|
IndexOfChild | child As XUISourceListItem |
Integer |
RemoveChild | child As XUISourceListItem , shouldRebuild As Boolean |
|
SetParent | parent As XUISourceListItem , shouldRebuild As Boolean |
Property Descriptions
BadgeValue As Integer
The sum of this item's Value and all of its children's Value properties.
CanAcceptChildren As Boolean
If True then this item can accept child rows dropped on it.
ChildCount As Integer
The number of children this item has.
Data As Variant
Arbitrary data associated with this item.
Depth As Integer
How deep in the source list this item is. Sections have a depth of zero.
DisclosureBounds As Rect
The hit bounds for the item's disclosure widget. Local to the source list control. May be Nil.
Expandable As Boolean
True if this item is allowed to be expanded. Setting this does not immediately refresh the source list.
Expanded As Boolean
True if this item is expanded. Setting this will not automatically refresh the source list.
HasIcon As Boolean
True if this item's icon is not Nil.
HasWidget As Boolean
If True and a widget icon is set then a widget will be drawn beside the item.
Icon As Picture
This item's icon. May or may not be visible depending on the renderer used.
IsSection As Boolean
True if this item is a section (read only).
mChildren() As XUISourceListItem
This item's children. May be empty.
mOwner As WeakRef
A weak reference to the owning source list. May be Nil if the item was created programmatically.
mParent As WeakRef
Weak reference to this item's parent. Will be Nil if this item is a section.
Owner As XUISourceList
The owning source list. May be Nil if the item was created programmatically.
Section As XUISourceListItem
This item's section or Nil if the item is a section.
ShowBadge As Boolean
If True and the item has a cumulative value > 0 then a badge will be shown. Only shown on sections if the section is expanded.
Title As String
The item's title.
Value As Integer
Optional integer value associated with this item. Note that BadgeValue
is the sum of this item's Value
plus the Value
of all children.
WidgetBounds As Rect
The hit bounds for the item's widget. Local to the source list control. May be Nil.
WidgetIcon As Picture
The icon to use for this item's widget. Depending on the renderer used, this may be ignored. It must not be Nil if the renderer expects a Picture when HasWidget is True.
Method Descriptions
AddChild(item As XUISourceListItem, shouldRebuild As Boolean)
Appends item
to the end of this item's children.
By default this will not immediately rebuild the source list.
AddChildAt(index As Integer, item As XUISourceListItem, shouldRebuild As Boolean)
Adds item
to the specified 0-based index of this item's children.
By default this will not immediately rebuild the source list.
ChildAtIndex(index As Integer) As XUISourceListItem
Returns the child at the 0-based index
. Returns Nil if the index is invalid.
Constructor(title As String, icon As Picture, value As Integer, data As Variant, canAcceptChildren As Boolean)
Default constructor.
title
is the visible title of this item.icon
is an optional icon.value
is an optional value for this item. It and the sum of all of this item's children will be used for the badge value.data
is optional arbitrary data for use in your application.- If
canAcceptChildren
is True then this item is permitted to contain children.
GetParent() As XUISourceListItem
Gets this item's parent. May be Nil (for example if the item is a section).
IndexOfChild(child As XUISourceListItem) As Integer
Returns the 0-based index in this item of child
in its top level children or -1 if this item does not contain child
.
RemoveChild(child As XUISourceListItem, shouldRebuild As Boolean)
Removes child
from this item's top-level children (if present).
By default this will trigger a full rebuild of the source list.
SetParent(parent As XUISourceListItem, shouldRebuild As Boolean)
Sets this item's parent item. By default setting the parent will trigger a full rebuild of the source list.