box property

Part? get box

Gets or sets the Part used as the "rubber-band selection box" that is stretched to follow the mouse, as feedback for what area will be passed to #selectInRect upon a mouse-up.

Initially this is a Part containing only a simple magenta rectangular Shape. The object to be resized during dragging should be named "SHAPE". Setting this property does not raise any events.

Here is an example of changing the selection box to be a thicker bright green rectangle:

  myDiagram.toolManager.dragSelectingTool.box =
    $(go.Part,
      { layerName: "Tool", selectable: false },
      $(go.Shape,
        { name: "SHAPE", fill: null, stroke: "chartreuse", strokeWidth: 3 }));

Note that the Part should be put into a Layer that Layer#isTemporary.

Modifying this property while this tool Tool#isActive might have no effect.

Implementation

_i3.Part? get box => _i4.getProperty(
      this,
      'box',
    );
set box (Part? value)

Implementation

set box(_i3.Part? value) {
  _i4.setProperty(
    this,
    'box',
    value ?? _i5.undefined,
  );
}