ControlWidgetclass

A control widget is used to edit the value of a single SerializedProperty.

object→Widget→ControlWidget
Namespace
Editor
Assembly
Sandbox.Tools
Declaration
public abstract class Editor.ControlWidget : Editor.Widget

Constructors1

Showing 1 constructors

Methods19

Showing 19 methods

public virtual void FromClipboardString(string clipboard)PUBLICVIRTUAL

ParameterTypeDescription
clipboardstring—
Returns:void—

protected virtual Vector2 MinimumSizeHint()PROTECTEDVIRTUAL

Returns:Vector2—

public virtual void OnLabelContextMenu(Editor.ContextMenu menu)PUBLICVIRTUAL

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.

ParameterTypeDescription
menuContextMenu—
Returns:void—

protected virtual void OnMultipleDifferentValues(bool state)PROTECTEDVIRTUAL

ParameterTypeDescription
statebool—
Returns:void—

protected virtual void OnPaint()PROTECTEDVIRTUAL

Returns:void—

protected virtual void OnValueChanged()PROTECTEDVIRTUAL

Returns:void—

protected virtual void PaintControl()PROTECTEDVIRTUAL

Returns:void—

protected virtual void PaintOver()PROTECTEDVIRTUAL

Returns:void—

protected virtual void PaintUnder()PROTECTEDVIRTUAL

Returns:void—

public void Prime()PUBLIC

Should get called right after creation

Returns:void—

protected void PropertyFinishEdit()PROTECTED

Returns:void—

protected void PropertyStartEdit()PROTECTED

Returns:void—

protected virtual Vector2 SizeHint()PROTECTEDVIRTUAL

Returns:Vector2—

public virtual void StartEditing()PUBLICVIRTUAL

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.

Returns:void—

public virtual void Think()PUBLICVIRTUAL

Returns:void—

public virtual string ToClipboardString()PUBLICVIRTUAL

Returns:string—

Properties11

Showing 11 properties

public virtual Sandbox.TextFlag Editor.ControlWidget.CellAlignment { get; set; }PUBLICVIRTUALGETSET

If none, when in a grid, the control will fill the entire cell

Returns:TextFlag—

public virtual bool Editor.ControlWidget.IncludeLabel { get; set; }PUBLICVIRTUALGETSET

If true (default) we'll include a label next to the control

Returns:bool—

public virtual bool Editor.ControlWidget.IsControlActive { get; set; }PUBLICVIRTUALGETSET

Returns:bool—

public virtual bool Editor.ControlWidget.IsControlButton { get; set; }PUBLICVIRTUALGETSET

Returns:bool—

public virtual bool Editor.ControlWidget.IsControlDisabled { get; set; }PUBLICVIRTUALGETSET

Returns:bool—

public virtual bool Editor.ControlWidget.IsControlHovered { get; set; }PUBLICVIRTUALGETSET

Returns:bool—

public virtual bool Editor.ControlWidget.IsWideMode { get; set; }PUBLICVIRTUALGETSET

If true we prefer to be full inspector width with the label above us

Returns:bool—

public virtual bool Editor.ControlWidget.SupportsMultiEdit { get; set; }PUBLICVIRTUALGETSET

Returns:bool—

protected virtual int Editor.ControlWidget.ValueHash { get; set; }PROTECTEDVIRTUALGETSET

Returns:int—

On this page

Constructorspublic ControlWidget(Sandbox.SerializedProperty property)Methodspublic static Editor.ControlWidget Create(Sandbox.SerializedProperty property)public virtual System.Void FromClipboardString(System.String clipboard)protected virtual Vector2 MinimumSizeHint()protected virtual System.Void OnContextMenu(Editor.ContextMenuEvent e)public virtual System.Void OnLabelContextMenu(Editor.ContextMenu menu)protected virtual System.Void OnMultipleDifferentValues(System.Boolean state)protected virtual System.Void OnPaint()protected virtual System.Void OnValueChanged()protected virtual System.Void PaintControl()protected virtual System.Void PaintOver()protected virtual System.Void PaintUnder()public System.Void Prime()protected System.Void PropertyFinishEdit()protected System.Void PropertyStartEdit()protected virtual Vector2 SizeHint()public virtual System.Void StartEditing()public virtual System.Void Think()public virtual System.String ToClipboardString()public static Editor.ControlWidget TryCreateGenericObjectControlWidget(Sandbox.SerializedProperty property)Propertiespublic virtual Sandbox.TextFlag Editor.ControlWidget.CellAlignment { get; set; }public virtual System.Boolean Editor.ControlWidget.IncludeLabel { get; set; }public virtual System.Boolean Editor.ControlWidget.IsControlActive { get; set; }public virtual System.Boolean Editor.ControlWidget.IsControlButton { get; set; }public virtual System.Boolean Editor.ControlWidget.IsControlDisabled { get; set; }public virtual System.Boolean Editor.ControlWidget.IsControlHovered { get; set; }public virtual System.Boolean Editor.ControlWidget.IsWideMode { get; set; }public Sandbox.SerializedProperty Editor.ControlWidget.SerializedProperty { get; set; }public virtual System.Boolean Editor.ControlWidget.SupportsMultiEdit { get; set; }public Color Editor.ControlWidget.Tint { get; set; }protected virtual System.Int32 Editor.ControlWidget.ValueHash { get; set; }Metadata