BaseItemWidgetclass
Constructors1
Showing 1 constructors
public BaseItemWidget(Editor.Widget parent = null)
| Parameter | Type | Description |
|---|---|---|
| parent = null | Widget | — |
No results match this filter.
Methods58
Showing 58 methods
public T AddItem(T item)
Add given item to this widget.
| Parameter | Type | Description |
|---|---|---|
| item | T | — |
T—public void AddItems(System.Collections.Generic.IEnumerable`1<object> items)
| Parameter | Type | Description |
|---|---|---|
| items | IEnumerable<object> | — |
void—public virtual void Clear()
Remove all items.
void—public virtual void Dirty(object dirtyObject = null)
| Parameter | Type | Description |
|---|---|---|
| dirtyObject = null | object | — |
void—protected virtual System.Collections.Generic.IEnumerable`1<object> FindItemsThatStartWith(string text)
| Parameter | Type | Description |
|---|---|---|
| text | string | — |
IEnumerable<object>—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
| Parameter | Type | Description |
|---|---|---|
| obj | object | — |
protected object GetAtIndex(int i)
Returns the item at given index, or null.
| Parameter | Type | Description |
|---|---|---|
| i | int | — |
object—protected virtual Editor.VirtualWidget GetDragItem(Editor.Widget.DragEvent ev)
Get the virtual item to use as a drop target for a given drag event
| Parameter | Type | Description |
|---|---|---|
| ev | DragEvent | — |
public Editor.VirtualWidget GetItemAt(Vector2 localPosition)
Get the virtual item at this local position.
| Parameter | Type | Description |
|---|---|---|
| localPosition | Vector2 | — |
protected virtual string GetTooltip(object obj)
Called to retrieve a tooltip for given item.
| Parameter | Type | Description |
|---|---|---|
| obj | object | — |
string—public virtual bool IsSelected(object obj)
Return true if this item is selected.
| Parameter | Type | Description |
|---|---|---|
| obj | object | — |
bool—protected int ItemIndex(object item)
Returns the index of given item.
| Parameter | Type | Description |
|---|---|---|
| item | object | — |
int—protected virtual Editor.DropAction OnBodyDragDrop(Editor.BaseItemWidget.ItemDragEvent ev)
Called when a drag drop is being dropped onto the canvas
| Parameter | Type | Description |
|---|---|---|
| ev | ItemDragEvent | — |
public virtual void OnDestroyed()
void—protected virtual void OnDoubleClick(Editor.MouseEvent e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseEvent | — |
void—public virtual void OnDragDrop(Editor.Widget.DragEvent ev)
| Parameter | Type | Description |
|---|---|---|
| ev | DragEvent | — |
void—public virtual void OnDragHover(Editor.Widget.DragEvent ev)
| Parameter | Type | Description |
|---|---|---|
| ev | DragEvent | — |
void—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.
| Parameter | Type | Description |
|---|---|---|
| ev | DragEvent | — |
| item | VirtualWidget | — |
void—protected virtual bool OnDragItem(Editor.VirtualWidget item)
Called when we start to drag an item.
| Parameter | Type | Description |
|---|---|---|
| item | VirtualWidget | — |
bool—public virtual void OnDragLeave()
void—protected virtual void OnDragStart()
void—protected virtual void OnDropOnItem(Editor.Widget.DragEvent ev, Editor.VirtualWidget item)
Called when an item is drag and dropped onto this widget.
| Parameter | Type | Description |
|---|---|---|
| ev | DragEvent | — |
| item | VirtualWidget | — |
void—protected virtual void OnHoverChanged(object oldHover, object newHover)
Hover has changed, neither of these objects are guaranteed to be non null.
| Parameter | Type | Description |
|---|---|---|
| oldHover | object | — |
| newHover | object | — |
void—protected virtual void OnItemActivated(object item)
| Parameter | Type | Description |
|---|---|---|
| item | object | — |
void—protected virtual void OnItemContextMenu(Editor.VirtualWidget pressedItem, Editor.MouseEvent e)
The item has been right clicked
| Parameter | Type | Description |
|---|---|---|
| pressedItem | VirtualWidget | — |
| e | MouseEvent | — |
void—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.
| Parameter | Type | Description |
|---|---|---|
| e | ItemDragEvent | — |
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.
| Parameter | Type | Description |
|---|---|---|
| pressedItem | VirtualWidget | — |
| e | MouseEvent | — |
bool—protected virtual void OnKeyPressOnItem(Editor.KeyEvent e, object item)
A key has been pressed on this selected item.
| Parameter | Type | Description |
|---|---|---|
| e | KeyEvent | — |
| item | object | — |
void—protected virtual void OnLayoutChanged()
void—protected virtual void OnMouseMove(Editor.MouseEvent e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseEvent | — |
void—protected virtual void OnMousePress(Editor.MouseEvent e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseEvent | — |
void—protected virtual void OnMouseReleased(Editor.MouseEvent e)
| Parameter | Type | Description |
|---|---|---|
| e | MouseEvent | — |
void—protected virtual void OnPaint()
void—protected virtual void OnResize()
void—protected virtual void OnScrollChanged()
void—protected virtual void OnSelectionAdded(object item)
| Parameter | Type | Description |
|---|---|---|
| item | object | — |
void—protected virtual void OnShortcutPressed(Editor.KeyEvent e)
| Parameter | Type | Description |
|---|---|---|
| e | KeyEvent | — |
void—protected virtual void PaintItem(Editor.VirtualWidget item)
| Parameter | Type | Description |
|---|---|---|
| item | VirtualWidget | — |
void—protected virtual void PaintItemDebug(Editor.VirtualWidget item)
| Parameter | Type | Description |
|---|---|---|
| item | VirtualWidget | — |
void—protected virtual void Rebuild()
Rebuild the panel layout.
void—public void RemoveItem(object item)
Remove given item from this widget.
| Parameter | Type | Description |
|---|---|---|
| item | object | — |
void—protected virtual object ResolveObject(object obj)
For derived classes where the object is wrapped in another class (i.e. TreeView)
| Parameter | Type | Description |
|---|---|---|
| obj | object | — |
object—protected void SelectAll(bool skipEvents = False)
| Parameter | Type | Description |
|---|---|---|
| skipEvents = False | bool | — |
void—public void SelectItem(object obj, bool add = False, bool skipEvents = False)
Select given item.
| Parameter | Type | Description |
|---|---|---|
| obj | object | Item to select. |
| add = False | bool | Whether to add the item to selection, or replace current selection. |
| skipEvents = False | bool | Do not invoke events. |
void—public void SelectItems(System.Collections.Generic.IEnumerable`1<object> items, bool add = False, bool skipEvents = False)
| Parameter | Type | Description |
|---|---|---|
| items | IEnumerable<object> | — |
| add = False | bool | — |
| skipEvents = False | bool | — |
void—public virtual void SelectItemStartingWith(string text)
| Parameter | Type | Description |
|---|---|---|
| text | string | — |
void—public bool SelectMove(int i)
Move the selection pointer by this many positions.
| Parameter | Type | Description |
|---|---|---|
| i | int | — |
bool—public virtual bool SelectMoveColumn(int positions)
| Parameter | Type | Description |
|---|---|---|
| positions | int | — |
bool—public virtual bool SelectMoveRow(int positions)
| Parameter | Type | Description |
|---|---|---|
| positions | int | — |
bool—protected virtual void SelectTo(object item, bool skipEvents = False)
Select everything between the current selection pointer and this one.
| Parameter | Type | Description |
|---|---|---|
| item | object | — |
| skipEvents = False | bool | — |
void—public void SetItems(System.Collections.Generic.IEnumerable`1<object> items)
| Parameter | Type | Description |
|---|---|---|
| items | IEnumerable<object> | — |
void—protected virtual void SetSelected(object obj, bool state, bool skipEvents = False)
Set the selection state of an item.
| Parameter | Type | Description |
|---|---|---|
| obj | object | Item to set selection state of. |
| state | bool | Whether the item should be selected or not. |
| skipEvents = False | bool | Do not invoke `Editor.BaseItemWidget.ItemSelected` and `Editor.BaseItemWidget.ItemDeselected`. |
void—public void UnselectAll(bool skipEvents = False)
Unselects all items that are currently selected (if any)
| Parameter | Type | Description |
|---|---|---|
| skipEvents = False | bool | Do not invoke events. |
void—public void UnselectItem(object obj, bool skipEvents = False)
Unselect given item.
| Parameter | Type | Description |
|---|---|---|
| obj | object | Item to deselect. |
| skipEvents = False | bool | Do not invoke events. |
void—public void UpdateIfDirty()
void—No results match this filter.
Properties29
Showing 29 properties
public System.Action Editor.BaseItemWidget.BodyContextMenu { get; set; }
Called when right clicking on the item's parent.
Action—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.
float—public System.Action`1<object> Editor.BaseItemWidget.ItemActivated { get; set; }
Called when an item is double left clicked.
Action<object>—public System.Action`1<object> Editor.BaseItemWidget.ItemClicked { get; set; }
Called when an item is clicked.
Action<object>—public System.Action`1<object> Editor.BaseItemWidget.ItemContextMenu { get; set; }
Called when an item is right clicked.
Action<object>—public System.Action`1<object> Editor.BaseItemWidget.ItemDeselected { get; set; }
Called when an item is no longer selected.
Action<object>—public System.Func`2<object,bool> Editor.BaseItemWidget.ItemDrag { get; set; }
Called to see whether or not we can drag a specific item.
Func<object,bool>—public System.Action`1<object> Editor.BaseItemWidget.ItemHoverEnter { get; set; }
Called when an item is hovered by the user's cursor.
Action<object>—public System.Action`1<object> Editor.BaseItemWidget.ItemHoverLeave { get; set; }
Called when an item is no longer hovered by the user's cursor.
Action<object>—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; }
IEnumerable<object>—public System.Action`1<object[]> Editor.BaseItemWidget.ItemsDeselected { get; set; }
Multiple items have been deselected
Obsolete: Use OnSelectionChanged or ItemSelected instead
Action<object[]>—public System.Action`1<object> Editor.BaseItemWidget.ItemSelected { get; set; }
Called when an item is selected.
Action<object>—public System.Action`1<object[]> Editor.BaseItemWidget.ItemsSelected { get; set; }
Multiple items have been selected
Obsolete: Use OnSelectionChanged or ItemSelected instead
Action<object[]>—public Sandbox.UI.Margin Editor.BaseItemWidget.Margin { get; set; }
public bool Editor.BaseItemWidget.MultiSelect { get; set; }
Whether to allow selecting multiple items at once.
bool—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.
Action<object[]>—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.
Action<object[]>—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.
Action<object[]>—public virtual bool Editor.BaseItemWidget.ProvidesDebugMode { get; set; }
bool—public System.Collections.Generic.IEnumerable`1<object> Editor.BaseItemWidget.SelectedItems { get; set; }
Selected items.
IEnumerable<object>—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.
Func<object>—protected float Editor.BaseItemWidget.TimeMsPaint { get; set; }
float—protected float Editor.BaseItemWidget.timeMsRebuild { get; set; }
float—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.
bool—No results match this filter.