Sprites.Media.Binary.Tool.Type

The binary editor's Type tool window: the entry granularity, bit, byte or ASCII, and a readout of the caret address. It mirrors the map and text editors' Type windows, reusing the shared Sprites.Media.Sprite window parts, and owns its live rect. The tool selector and the Tools window live in Sprites.Media.Binary.Tool.

Sprites.Media.Binary.Tool.Type

Sprites.Media.Binary.Tool.Type.Window Void

Sprites.Media.Binary.Tool.Type.Window(visible, subMode, caret)

The Type window: the entry granularity, bit, byte or ASCII, and a readout of the caret address. It is shown while the Type tool is active and has no close button.

InputTypeDescription
visibleValueThe show flag, true while the Type tool is active.
subModeValueThe two way entry granularity, one of bit, byte, ascii.
caretValueThe caret address, shown in hex in the readout.

Returns nothing.

const subMode = Sprites.Reactive.Value('byte');
const caret = Sprites.Reactive.Value(16);
Sprites.Ui.Content.Area(() => {
  Sprites.Media.Sprite.Tool.Labelled('Enter', () => {
    Sprites.Ui.Button.Select(subMode, () => {
      Sprites.Ui.Button.Group.Column(() => {
        Sprites.Ui.Button.Option('bit', 'Bit');
        Sprites.Ui.Button.Option('byte', 'Byte');
        Sprites.Ui.Button.Option('ascii', 'ASCII');
      });
    });
  });
  Sprites.Ui.Dom.Tag('p', () => {
    Sprites.Ui.Dom.Class('binary-readout');
    const address = Sprites.Text.Hex(caret, Sprites.Media.Binary.AddressDigits);
    Sprites.Ui.Dom.Text('Caret ', address);
  });
  Sprites.Ui.Content.Text('Type to enter, arrow keys to move.');
});
The entry granularity picker over the caret readout.