Sprites.Media.Binary.Tool.View

The binary editor's View panel: the bytes per line, and a hex or binary display choice. A panel window with a close button, opened from the Tools window. It mirrors the map and text editors' View panels, 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.View

Sprites.Media.Binary.Tool.View.Window Void

Sprites.Media.Binary.Tool.View.Window(visible, widthChoice, binary)

The View window: the bytes per line, and a hex or binary display choice. A panel window with a close button, opened from the Tools window.

InputTypeDescription
visibleValueThe show flag, set true by the Tools window's View button.
widthChoiceValueThe two way bytes per line, one of 8, 16, 32, 64.
binaryValueTrue for the binary display, false for hex.

Returns nothing.

const widthChoice = Sprites.Reactive.Value(16);
const binary = Sprites.Reactive.Value(false);
Sprites.Ui.Content.Area(() => {
  const perLineLabel = Sprites.Logic.Select(binary, 'Bits per line', 'Bytes per line');
  Sprites.Media.Sprite.Tool.Labelled(perLineLabel, () => {
    Sprites.Ui.Button.Select(widthChoice, () => {
      Sprites.Ui.Button.Group.Row(() => {
        Sprites.Ui.Button.Option(8, '8');
        Sprites.Ui.Button.Option(16, '16');
        Sprites.Ui.Button.Option(32, '32');
        Sprites.Ui.Button.Option(64, '64');
      });
    });
  });
  Sprites.Media.Sprite.Tool.Labelled('Display', () => {
    Sprites.Ui.Button.Select(binary, () => {
      Sprites.Ui.Button.Group.Row(() => {
        Sprites.Ui.Button.Option(false, 'Hex');
        Sprites.Ui.Button.Option(true, 'Binary');
      });
    });
  });
});
The bytes per line picker and the hex or binary choice.