Members

(static, constant) OPENING_ANNOUNCEMENT_DELAY

Mirrors JRDialog's OPENING_ANNOUNCEMENT_DELAY. Duplicated rather than shared because BrighterScript consts are file-scoped and JRDialog's is not visible here; the value is one number with one reason, documented in full at its original (the platform's own focus announcement FLUSHES ours, and SceneGraph exposes no event for "the platform has finished speaking").

Default Value
  • 0.15

(static, constant) PANEL_WIDTH

Layout is DERIVED and computed exactly ONCE, from the two blocks this dialog owns: the instruction and the code below it. Both are laid out through the shared flow in source/utils/dialogLayout.bs — the instruction goes in the SUBHEADING slot, because that slot's whole definition is "a lead line that sits inside the body's space, so the pair reads as one block", which is precisely the relationship between "enter this code" and the code. Using it means this component does no layout arithmetic of its own.

Width matches JRDialog's 762 deliberately: this dialog carries about as much text as an alert and should be indistinguishable from one at a glance. That is asserted rather than trusted — see the panel-width spec, which compares this component's rendered panel against a rendered JRDialog rather than against the literal below, so the two cannot drift apart silently.

Default Value
  • 762

Methods

(static) applyLayout() → {void}

Position the chrome and the two body blocks. Safe to run repeatedly; it returns early until every block it needs has actually been measured.

Returns:
Type: 
void

(static) buttonRowHeight() → {integer}

Rendered height of the button row, or a computed fallback before it lays out (localBoundingRect is 0 until the TextButton sizes itself).

Returns:
Type: 
integer

(static) cancelDialog() → {void}

Cancel from OUTSIDE — cancelOpenDialog() and presentOverlayDialog's supersede. Routed through resolveDialog so the once-only guard and the standard cancelled result both apply.

Returns:
Type: 
void

(static) centerButtonRow() → {void}

Centre the row on the PANEL, not the screen.

Returns:
Type: 
void

(static) closeDialog() → {void}

Dismiss this overlay: appended directly to the scene by dialogs.bs, so closing is a removeChild from our parent plus restoring focus to the opener.

Returns:
Type: 
void

(static) init() → {void}

Returns:
Type: 
void

(static) onButtonFocusChanged() → {void}

Announce the whole dialog once the platform's own focus announcement is out of the way — the timing is JRDialog's, measured on device.

The code is spoken DIGIT BY DIGIT (see spokenQuickConnectCode): it is a string the listener has to transcribe onto another device, and a spaced digit string has exactly one pronunciation where a six-digit number has two.

Returns:
Type: 
void

(static) onButtonReady() → {void}

Returns:
Type: 
void

(static) onCodeChanged() → {void}

Returns:
Type: 
void

(static) onCodeRendered() → {void}

Returns:
Type: 
void

(static) onInstructionChanged() → {void}

Returns:
Type: 
void

(static) onInstructionRendered() → {void}

Returns:
Type: 
void

(static) onKeyEvent(key, press) → {boolean}

The decision is buttonDialogKeyAction in source/utils/dialogKeys.bs, the same model JRDialog uses. Everything here is the doing.

This dialog has ONE button, so the model collapses: "cancel" and "resolve" are the same outcome (resolveDialog takes no index — backing out is the only thing the user can do from here), and stepping a one-button row lands back on the button it started from, so the step actions are no-ops rather than a focus call. stacked is false because a single short label never stacks.

Sharing the model rather than hand-rolling two lines is the point: a horizontal row swallowing up/down under modal containment is a decision this dialog was making by accident, and it is now the same decision JRDialog makes on purpose.

Parameters:
NameTypeDescription
keystring
pressboolean
Returns:
Type: 
boolean

(static) onOpeningAnnouncementDue() → {void}

Returns:
Type: 
void

(static) onTitleChanged() → {void}

SET THE TEXT FIELDS BEFORE PRESENTING, never after — see the field comments in the XML. Each change handler only writes the label; renderTracking brings us back to applyLayout() once the new text has actually laid out.

Returns:
Type: 
void

(static) onTitleMeasured() → {void}

Returns:
Type: 
void

(static) resolveDialog() → {void}

Resolve exactly once, then close. This dialog has only one outcome of its own — the user backing out — so there is no index to pass: approval arrives at the OWNER from the server, which closes this dialog with abandonDialog() rather than through here.

Returns:
Type: 
void

(static) settleLayout() → {void}

Lay out NOW, called by presentOverlayDialog once this dialog is attached.

The dialog is hidden until this returns, so there is no renderTracking to wait on — and none is needed, because localBoundingRect() answers while hidden. See dialogReveal.bs.

Returns:
Type: 
void