Sprites.Media.Binary.Tool
The binary editor's Tools window: the selector that picks the tool and the Windows buttons that open the View and Info panels. It mirrors the map and text editors' Tools window, reusing the shared Sprites.Media.Sprite window parts, and owns its live rect, so a window closed and reopened returns to where it was dragged. Each tool's own window lives in its own module: Sprites.Media.Binary.Tool.Move, Sprites.Media.Binary.Tool.Draw, Sprites.Media.Binary.Tool.Type, Sprites.Media.Binary.Tool.Select, Sprites.Media.Binary.Tool.View and Sprites.Media.Binary.Tool.Info.
- Sprites.Media.Binary.Tool.Selector
- Sprites.Media.Binary.Tool.Windows
- Sprites.Media.Binary.Tool.Window
Sprites.Media.Binary.Tool.Selector Void
Sprites.Media.Binary.Tool.Selector(tool)
The canvas tool selector: one button group, one option per tool. Exactly one is selected at a time, and picking an option sets tool, which the editor reads to choose which tool acts on the bytes and which tool window shows. Move pans the view, Draw paints, Type enters values at the caret, and Select marks a range.
| Input | Type | Description |
|---|---|---|
tool | Value | The two way tool name, one of move, draw, type, select. |
Returns nothing.
const tool = Sprites.Reactive.Value('draw');
Sprites.Media.Binary.Tool.Selector(tool);
Sprites.Ui.Dom.Text(' tool = ', tool);
Sprites.Media.Binary.Tool.Windows Void
Sprites.Media.Binary.Tool.Windows(viewVisible, infoVisible)
The Windows buttons: one secondary button per panel window, View and Info, each opening its window on a click by setting its flag true. They turn nothing off: a panel window carries its own close button, so any number may be open at once.
| Input | Type | Description |
|---|---|---|
viewVisible | Value | The View panel's show flag, set true by its button. |
infoVisible | Value | The Info panel's show flag, set true by its button. |
Returns nothing.
const viewVisible = Sprites.Reactive.Value(false);
const infoVisible = Sprites.Reactive.Value(false);
Sprites.Media.Binary.Tool.Windows(viewVisible, infoVisible);
Sprites.Ui.Dom.Text(' view = ', viewVisible, ' info = ', infoVisible);
Sprites.Media.Binary.Tool.Window Void
Sprites.Media.Binary.Tool.Window(tool, viewVisible, infoVisible)
The Tools window: a slim floating window docked to the stage's top left, holding the tool selector over the Windows buttons. It is always shown and has no close button.
| Input | Type | Description |
|---|---|---|
tool | Value | The two way chosen canvas tool. |
viewVisible | Value | The View panel's show flag. |
infoVisible | Value | The Info panel's show flag. |
Returns nothing.
const tool = Sprites.Reactive.Value('move');
const viewVisible = Sprites.Reactive.Value(false);
const infoVisible = Sprites.Reactive.Value(false);
Sprites.Ui.Content.Area(() => {
Sprites.Media.Sprite.Tool.Labelled('Tools', () => {
Sprites.Media.Binary.Tool.Selector(tool);
});
Sprites.Media.Sprite.Tool.Labelled('Windows', () => {
Sprites.Media.Binary.Tool.Windows(viewVisible, infoVisible);
});
});