Sprites.Media.Binary.Tool.Move

The binary editor's Move tool window: the start address the view begins at, as a two way number, and a Reset button that snaps the window back to the top. It mirrors the map and text editors' Move windows, reusing the shared Sprites.Media.Sprite window parts, and owns its live rect, so it returns to where it was dragged. The tool selector and the Tools window live in Sprites.Media.Binary.Tool.

Sprites.Media.Binary.Tool.Move

Sprites.Media.Binary.Tool.Move.Window Void

Sprites.Media.Binary.Tool.Move.Window(visible, startAddress, resetView)

The Move window: the start address the view begins at, as a two way number, and a Reset button that snaps the window back to the top. It is shown while the Move tool is active and has no close button.

InputTypeDescription
visibleValueThe show flag, true while the Move tool is active.
startAddressValueThe two way start address the view begins at.
resetViewValueThe command the Reset button runs to snap back to the top.

Returns nothing.

const startAddress = Sprites.Reactive.Value(0);
const resetView = Sprites.Reactive.Reverse(() => {
  Sprites.Reactive.Set(startAddress, 0);
});
Sprites.Ui.Content.Area(() => {
  Sprites.Media.Sprite.Tool.Labelled('Start address', () => {
    Sprites.Ui.Input.Number(startAddress, 0, Sprites.Media.Binary.MaxLength);
  });
  Sprites.Ui.Button.Group.Column(() => {
    Sprites.Ui.Button.Act(resetView, () => {
      Sprites.Ui.Button.Secondary();
      Sprites.Ui.Dom.Text('Reset');
    });
  });
});
Change the start address, or Reset to snap back to the top.