Interfaces

IWindowResizeHandler

The contract for a window resize handler: reports the window's current and last-resized size, and lets a caller resize, collapse, or restore it. Implemented by the built-in window resizing component attached to each spawned window.

Namespace: AplosConsole.Window.Components

Properties

Name Data Type Description
CanResize bool Whether the window currently accepts resize operations. Get/set.
LastResizeWindowSize Vector2 The window's size as of the last resize, used to restore it after a collapse. Read-only.
CurrentWindowSize Vector2 The window's current size. Read-only.

Public methods

SetWindowSize

Parameters:

  • size (Vector2) — Requested window size, clamped to the current min/max bounds.

Example

resizeHandler.SetWindowSize(new Vector2(480f, 320f));

Description: Resizes the window to the given size, clamped between its current minimum and maximum bounds.


SetSizeConstraints

Parameters:

  • minSize (Vector2) — Lower bound on the window's resizable dimensions.
  • maxSize (Vector2) — Upper bound on the window's resizable dimensions.

Example

resizeHandler.SetSizeConstraints(new Vector2(200f, 200f), new Vector2(800f, 600f));

Description: Overrides the window's min/max resize bounds and re-clamps its current size to fit within them.


CollapseWindowSize

Example

resizeHandler.CollapseWindowSize();

Description: Remembers the window's current expanded size, then shrinks it down to the collapsed bar height.


RestoreWindowSize

Example

resizeHandler.RestoreWindowSize();

Description: Restores the window to the size it was at before it was last collapsed.


IWindowStateStore

Internal contract. Persists and restores a single window's WindowState by key, abstracting the backing store (file, prefs, ...) from the components that capture and apply window layout.

Namespace: AplosConsole.Windows.Persistence

Public methods

TryLoad

Parameters:

  • key (string) — Identifier the state was previously saved under.
  • state (out WindowState) — The stored state, if a valid save exists for the key.

Example

if (windowStateStore.TryLoad("myWindow", out WindowState state))
{
    // apply state
}

Description: Returns true and outputs the stored state when a valid save exists for the key; otherwise returns false and leaves callers on their defaults.


Save

Parameters:

  • key (string) — Identifier to save the state under.
  • state (WindowState) — The window state to persist.

Example

windowStateStore.Save("myWindow", state);

Description: Persists the given state under the specified key.


Clear

Parameters:

  • key (string) — Identifier of the saved state to discard.

Example

windowStateStore.Clear("myWindow");

Description: Discards any saved state for the key so the next load falls back to the window's authored defaults (used by the console reset).