public abstract class Editor.ControlWidget : Editor.Widget
A control widget is used to edit the value of a single SerializedProperty.
Related Guides
Broader workflow and conceptual references connected to this API.
When creating your own Classes/Structs/Assets/ect, you'll sometimes want custom editors that pair with them. For example, a Gradient Editor so you can visually see what the Gradient looks like instead of editing the Gradient as if it were a Struct with a list of Colours.
You can add attributes to your Component's properties in C# to change how they look in the editor/inspector.
Constructors
Showing 1 constructors
public ControlWidget(Sandbox.SerializedProperty property)
No results match this filter.
Methods
Showing 19 methods
public static Editor.ControlWidget Create(Sandbox.SerializedProperty property)
public virtual void FromClipboardString(string clipboard)
protected virtual Vector2 MinimumSizeHint()
protected virtual void OnContextMenu(Editor.ContextMenuEvent e)
public virtual void OnLabelContextMenu(Editor.ContextMenu menu)
Called when right clicking a label in a ControlSheet for this widget. This allows you to add advanced menu items for this widget at the top of the menu, before the default ones.
protected virtual void OnMultipleDifferentValues(bool state)
protected virtual void OnPaint()
Implementations
protected virtual void OnValueChanged()
protected virtual void PaintControl()
protected virtual void PaintOver()
protected virtual void PaintUnder()
public void Prime()
Should get called right after creation
protected void PropertyFinishEdit()
protected void PropertyStartEdit()
protected virtual Vector2 SizeHint()
public virtual void StartEditing()
Selects this widget and starts editing. Used when we want to focus on the widget in the inspector, like when double-clicking on something in a graph editor that maps to this widget.
public virtual void Think()
public virtual string ToClipboardString()
public static Editor.ControlWidget TryCreateGenericObjectControlWidget(Sandbox.SerializedProperty property)
No results match this filter.
Properties
Showing 11 properties
public virtual Sandbox.TextFlag Editor.ControlWidget.CellAlignment { get; set; }
If none, when in a grid, the control will fill the entire cell
public virtual bool Editor.ControlWidget.IncludeLabel { get; set; }
If true (default) we'll include a label next to the control
public virtual bool Editor.ControlWidget.IsControlActive { get; set; }
public virtual bool Editor.ControlWidget.IsControlButton { get; set; }
public virtual bool Editor.ControlWidget.IsControlDisabled { get; set; }
public virtual bool Editor.ControlWidget.IsControlHovered { get; set; }
public virtual bool Editor.ControlWidget.IsWideMode { get; set; }
If true we prefer to be full inspector width with the label above us
public Sandbox.SerializedProperty Editor.ControlWidget.SerializedProperty { get; set; }
public virtual bool Editor.ControlWidget.SupportsMultiEdit { get; set; }
public Color Editor.ControlWidget.Tint { get; set; }
protected virtual int Editor.ControlWidget.ValueHash { get; set; }
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Editor |
| Type | class |
| Assembly | Sandbox.Tools |
| Doc ID | T:Editor.ControlWidget |