Vixen
02b45cc4
csharp
public sealed class PortEditor

The value a port takes when nothing is wired to it, as the canvas shows it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A picture of a value, not the value. What a port's number is lives in the document — Vixen.Editor.NodeGraph.GraphNode.Values — because that is what is saved, undone and compiled. This is what the canvas draws and what a gesture writes into before anything is recorded, the same bargain Connect makes: the picture moves first and the command follows, because a field that waited for a round trip through a command stack would drop keystrokes.

⚠ Lanes are fixed at construction. A port that is a float3 is three boxes for as long as it exists, and a caller that wants a different width makes a different editor — which is what a reprojection does anyway. Growing one in place would mean the element pool showing it had to notice, and it is rebound rather than rebuilt.

Fields and properties (7)

  • public PortEditorKind Kind

    What it looks like.

  • public int Lanes

    How many numbers it holds.

  • public int Decimals

    How many decimal places each box shows.

  • public bool ReadOnly

    Whether it may be typed into.

  • public string LaneNames

    What the letter beside each box says, or empty for none.

  • public float this[int lane]

    One lane.

  • public bool IsOn

    Whether it is on, for a Toggle.

Methods (3)

  • public PortEditor(PortEditorKind kind, int lanes = 1)

    Creates one.

  • public void Set(ReadOnlySpan<float> lanes)

    Fills the lanes from a span, padding with the last one it was given.

  • public float[] ToArray()

    The lanes, copied.

Used by (5)

  • GraphPortVixen.Ui.Controls.Advanced
  • NodeCanvasTestsVixen.Ui.Controls.Advanced.Tests
  • NodePortEditorVixen.Ui.Controls.Advanced
  • NodeGraphViewVixen.Editor.NodeGraph
  • PortValueTestsVixen.Editor.NodeGraph.Tests