Api Editor BaseItemWidget
class

BaseItemWidget

public class BaseItemWidget : BaseScrollWidget

Constructors

BaseItemWidget(Widget parent)

Properties

Name Type Description
ItemClicked Action<Object> Called when an item is clicked.
ItemSelected Action<Object> Called when an item is selected.
ItemDeselected Action<Object> Called when an item is no longer selected.
ItemHoverEnter Action<Object> Called when an item is hovered by the user's cursor.
ItemHoverLeave Action<Object> Called when an item is no longer hovered by the user's cursor.
ItemContextMenu Action<Object> Called when an item is right clicked.
ItemActivated Action<Object> Called when an item is double left clicked.
ItemPaint Action<VirtualWidget> Used to overwrite an item's style
ItemDrag Func<Object, Boolean> Called to see whether or not we can drag a specific item.
SelectionOverride Func<Object> Can override an item's selection here.
BodyContextMenu Action Called when right clicking on the item's parent.
OnBeforeSelection Action<Object[]> Called before selection is changed on selection. When multiple items are affected this will only be called once.
OnBeforeDeselection Action<Object[]> Called before selection is changed on deselection. When multiple items are affected this will only be called once.
ItemsSelected Action<Object[]> Multiple items have been selected
ItemsDeselected Action<Object[]> Multiple items have been deselected
OnSelectionChanged Action<Object[]> Called when selection has changed. When multiple items are affected this will only be called once.
ToggleSelect Boolean If set, selecting an item will not deselect all already selected items, clicking a selected item will deselect it.
BodyDropTarget DragDropTarget What shall we do if they drag something in and it's not over an item?
DragDropTargetClosestThreshold Single Gets or sets the maximum distance, in pixels, at which a target is considered close enough for drag-and-drop when in BodyDropTarget.Closest mode. operations.
ProvidesDebugMode virtual Boolean
Margin Margin
CanvasRect Rect The inner of LocalRect with Margin
Items IEnumerable<Object>
CurrentItemDragEvent ItemDragEvent
MultiSelect Boolean Whether to allow selecting multiple items at once.
Selection SelectionSystem
SelectedItems IEnumerable<Object> Selected items.

Methods

Void SetItems(IEnumerable<Object> items)
Void AddItems(IEnumerable<Object> items)
T AddItem(T item)

Add given item to this widget.

Void RemoveItem(Object item)

Remove given item from this widget.

virtual Void Clear()

Remove all items.

virtual Void Dirty(Object dirtyObject = null)
VirtualWidget GetItemAt(Vector2 localPosition)

Get the virtual item at this local position.

virtual Void OnDragLeave()
virtual Void OnDragHover(DragEvent ev)
virtual Void OnDragDrop(DragEvent ev)
virtual Boolean SelectMoveColumn(Int32 positions)
virtual Boolean SelectMoveRow(Int32 positions)
virtual Void ScrollTo(Object target)

Ensure that given item is in view, scrolling to it if necessary.

virtual Void ScrollTo(Single targetPosition, Single height)

Ensure that given position is in view, scrolling to it if necessary.

targetPosition — Target vertical position to make sure is in view.
height — Height of a potential item/element we want to make sure is in view.
Void UpdateIfDirty()
virtual Void OnDestroyed()
virtual Boolean IsSelected(Object obj)

Return true if this item is selected.

Void SelectItem(Object obj, Boolean add = False, Boolean skipEvents = False)

Select given item.

obj — Item to select.
add — Whether to add the item to selection, or replace current selection.
skipEvents — Do not invoke events.
Void SelectItems(IEnumerable<Object> items, Boolean add = False, Boolean skipEvents = False)
Void UnselectItem(Object obj, Boolean skipEvents = False)

Unselect given item.

obj — Item to deselect.
skipEvents — Do not invoke events.
Void UnselectAll(Boolean skipEvents = False)

Unselects all items that are currently selected (if any)

skipEvents — Do not invoke events.
Boolean SelectMove(Int32 i)

Move the selection pointer by this many positions.

virtual Void SelectItemStartingWith(String text)
Assembly: Sandbox.Tools Namespace: Editor Full Name: Editor.BaseItemWidget