public class Editor.BaseItemWidget : Editor.BaseScrollWidget
Constructors
Showing 1 constructors
public BaseItemWidget(Editor.Widget parent = null)
Parameters
parent: Default: null
No results match this filter.
Methods
Showing 58 methods
public T AddItem(T item)
Add given item to this widget.
public void AddItems(System.Collections.Generic.IEnumerable`1<object> items)
public virtual void Clear()
Remove all items.
public virtual void Dirty(object dirtyObject = null)
Parameters
dirtyObject: Default: null
protected virtual System.Collections.Generic.IEnumerable`1<object> FindItemsThatStartWith(string text)
protected Editor.VirtualWidget FindVirtualWidget(object obj)
Given an object, try to find the virtual widget. This can of course return null if the item isn't visible
protected object GetAtIndex(int i)
Returns the item at given index, or null.
protected virtual Editor.VirtualWidget GetDragItem(Editor.Widget.DragEvent ev)
Get the virtual item to use as a drop target for a given drag event
public Editor.VirtualWidget GetItemAt(Vector2 localPosition)
Get the virtual item at this local position.
protected virtual string GetTooltip(object obj)
Called to retrieve a tooltip for given item.
public virtual bool IsSelected(object obj)
Return true if this item is selected.
protected int ItemIndex(object item)
Returns the index of given item.
protected virtual Editor.DropAction OnBodyDragDrop(Editor.BaseItemWidget.ItemDragEvent ev)
Called when a drag drop is being dropped onto the canvas
public virtual void OnDestroyed()
protected virtual void OnDoubleClick(Editor.MouseEvent e)
public virtual void OnDragDrop(Editor.Widget.DragEvent ev)
public virtual void OnDragHover(Editor.Widget.DragEvent ev)
protected virtual void OnDragHoverItem(Editor.Widget.DragEvent ev, Editor.VirtualWidget item)
Called when a dragged item is being hovered over this widget. This is the place to make drag and drop previews.
protected virtual bool OnDragItem(Editor.VirtualWidget item)
Called when we start to drag an item.
public virtual void OnDragLeave()
protected virtual void OnDragStart()
protected virtual void OnDropOnItem(Editor.Widget.DragEvent ev, Editor.VirtualWidget item)
Called when an item is drag and dropped onto this widget.
protected virtual void OnHoverChanged(object oldHover, object newHover)
Hover has changed, neither of these objects are guaranteed to be non null.
protected virtual void OnItemActivated(object item)
protected virtual void OnItemContextMenu(Editor.VirtualWidget pressedItem, Editor.MouseEvent e)
The item has been right clicked
protected virtual Editor.DropAction OnItemDrag(Editor.BaseItemWidget.ItemDragEvent e)
Called when a dragged item is being hovered over this widget. This is the place to make drag and drop previews.
protected virtual bool OnItemPressed(Editor.VirtualWidget pressedItem, Editor.MouseEvent e)
Allows over-riding mouse press on an item, without click or selection. Return true to allow default behavior.
protected virtual void OnKeyPress(Editor.KeyEvent e)
protected virtual void OnKeyPressOnItem(Editor.KeyEvent e, object item)
A key has been pressed on this selected item.
protected virtual void OnLayoutChanged()
protected virtual void OnMouseMove(Editor.MouseEvent e)
protected virtual void OnMousePress(Editor.MouseEvent e)
protected virtual void OnMouseReleased(Editor.MouseEvent e)
protected virtual void OnPaint()
protected virtual void OnResize()
protected virtual void OnScrollChanged()
protected virtual void OnSelectionAdded(object item)
protected virtual void OnShortcutPressed(Editor.KeyEvent e)
protected virtual void PaintItem(Editor.VirtualWidget item)
protected virtual void PaintItemDebug(Editor.VirtualWidget item)
protected virtual void Rebuild()
Rebuild the panel layout.
public void RemoveItem(object item)
Remove given item from this widget.
protected virtual object ResolveObject(object obj)
For derived classes where the object is wrapped in another class (i.e. TreeView)
protected void SelectAll(bool skipEvents = False)
Parameters
skipEvents: Default: False
public void SelectItem(object obj, bool add = False, bool skipEvents = False)
Select given item.
Parameters
obj: Item to select.add: Whether to add the item to selection, or replace current selection. Default: FalseskipEvents: Do not invoke events. Default: False
public void SelectItems(System.Collections.Generic.IEnumerable`1<object> items, bool add = False, bool skipEvents = False)
Parameters
add: Default: FalseskipEvents: Default: False
public virtual void SelectItemStartingWith(string text)
public bool SelectMove(int i)
Move the selection pointer by this many positions.
public virtual bool SelectMoveColumn(int positions)
public virtual bool SelectMoveRow(int positions)
protected virtual void SelectTo(object item, bool skipEvents = False)
Select everything between the current selection pointer and this one.
Parameters
skipEvents: Default: False
public void SetItems(System.Collections.Generic.IEnumerable`1<object> items)
protected virtual void SetSelected(object obj, bool state, bool skipEvents = False)
Set the selection state of an item.
Parameters
obj: Item to set selection state of.state: Whether the item should be selected or not.skipEvents: Do not invoke `Editor.BaseItemWidget.ItemSelected` and `Editor.BaseItemWidget.ItemDeselected`. Default: False
public void UnselectAll(bool skipEvents = False)
Unselects all items that are currently selected (if any)
Parameters
skipEvents: Do not invoke events. Default: False
public void UnselectItem(object obj, bool skipEvents = False)
Unselect given item.
Parameters
obj: Item to deselect.skipEvents: Do not invoke events. Default: False
public void UpdateIfDirty()
No results match this filter.
Properties
Showing 29 properties
public System.Action Editor.BaseItemWidget.BodyContextMenu { get; set; }
Called when right clicking on the item's parent.
public Editor.BaseItemWidget.DragDropTarget Editor.BaseItemWidget.BodyDropTarget { get; set; }
What shall we do if they drag something in and it's not over an item?
public Sandbox.Rect Editor.BaseItemWidget.CanvasRect { get; set; }
The inner of LocalRect with Margin
public Editor.BaseItemWidget.ItemDragEvent Editor.BaseItemWidget.CurrentItemDragEvent { get; set; }
public float Editor.BaseItemWidget.DragDropTargetClosestThreshold { get; set; }
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.
public System.Action`1<object> Editor.BaseItemWidget.ItemActivated { get; set; }
Called when an item is double left clicked.
public System.Action`1<object> Editor.BaseItemWidget.ItemClicked { get; set; }
Called when an item is clicked.
public System.Action`1<object> Editor.BaseItemWidget.ItemContextMenu { get; set; }
Called when an item is right clicked.
public System.Action`1<object> Editor.BaseItemWidget.ItemDeselected { get; set; }
Called when an item is no longer selected.
public System.Func`2<object,bool> Editor.BaseItemWidget.ItemDrag { get; set; }
Called to see whether or not we can drag a specific item.
public System.Action`1<object> Editor.BaseItemWidget.ItemHoverEnter { get; set; }
Called when an item is hovered by the user's cursor.
public System.Action`1<object> Editor.BaseItemWidget.ItemHoverLeave { get; set; }
Called when an item is no longer hovered by the user's cursor.
public System.Action`1<Editor.VirtualWidget> Editor.BaseItemWidget.ItemPaint { get; set; }
Used to overwrite an item's style
public System.Collections.Generic.IEnumerable`1<object> Editor.BaseItemWidget.Items { get; set; }
public System.Action`1<object[]> Editor.BaseItemWidget.ItemsDeselected { get; set; }Obsolete
Multiple items have been deselected
Obsolete: Use OnSelectionChanged or ItemSelected instead
public System.Action`1<object> Editor.BaseItemWidget.ItemSelected { get; set; }
Called when an item is selected.
public System.Action`1<object[]> Editor.BaseItemWidget.ItemsSelected { get; set; }Obsolete
Multiple items have been selected
Obsolete: Use OnSelectionChanged or ItemSelected instead
public Sandbox.UI.Margin Editor.BaseItemWidget.Margin { get; set; }
public bool Editor.BaseItemWidget.MultiSelect { get; set; }
Whether to allow selecting multiple items at once.
public System.Action`1<object[]> Editor.BaseItemWidget.OnBeforeDeselection { get; set; }
Called before selection is changed on deselection. When multiple items are affected this will only be called once.
public System.Action`1<object[]> Editor.BaseItemWidget.OnBeforeSelection { get; set; }
Called before selection is changed on selection. When multiple items are affected this will only be called once.
public System.Action`1<object[]> Editor.BaseItemWidget.OnSelectionChanged { get; set; }
Called when selection has changed. When multiple items are affected this will only be called once.
public virtual bool Editor.BaseItemWidget.ProvidesDebugMode { get; set; }
public System.Collections.Generic.IEnumerable`1<object> Editor.BaseItemWidget.SelectedItems { get; set; }
Selected items.
public Sandbox.SelectionSystem Editor.BaseItemWidget.Selection { get; set; }
public System.Func`1<object> Editor.BaseItemWidget.SelectionOverride { get; set; }
Can override an item's selection here.
protected float Editor.BaseItemWidget.TimeMsPaint { get; set; }
protected float Editor.BaseItemWidget.timeMsRebuild { get; set; }
public bool Editor.BaseItemWidget.ToggleSelect { get; set; }
If set, selecting an item will not deselect all already selected items, clicking a selected item will deselect it.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Editor |
| Type | class |
| Assembly | Sandbox.Tools |
| Doc ID | T:Editor.BaseItemWidget |