InternalWindow

InternalWindow UI component, extends UIComponent class. Internal window is a Window like component, but it can only be added to InternalWindowContainer for window-in-window experience.

For more methods for this component check UIComponent class.

Constructor

new InternalWindow(textopt)

InternalWindow constructor.

Parameters:
NameTypeAttributesDescription
textstring<optional>

Window title text

Classes

InternalWindow

Members

innerOffset :Object

Gets the offset (in pixels) from each edge of the window to the content container.

Type:
  • Object
Example
// Returned offset object format:
{
    top: number,
    right: number,
    bottom: number,
    left: number
}

Methods

alwaysOnTop(valueopt) → {InternalWindow|boolean}

Sets or gets whether the InternalWindow should be above other internal windows in default layer. It puts the InternalWindow component in a higher layer. More than one InternalWindow can be in the top layer.

Parameters:
NameTypeAttributesDescription
valueboolean<optional>

true to set enable, false to disable (default).

Returns:

Returns this component instance if argument is set, otherwise returns current value.

Type: 
InternalWindow | boolean

canClose(valueopt) → {InternalWindow|boolean}

Sets or gets whether close button in window title bar should be visible.

Parameters:
NameTypeAttributesDescription
valueboolean<optional>

true to show (default), false - to hide.

Returns:

Returns this component instance if argument is set, otherwise returns current value.

Type: 
InternalWindow | boolean

canMaximize(valueopt) → {InternalWindow|boolean}

Sets or gets whether maximize button in window title bar should be visible.

Parameters:
NameTypeAttributesDescription
valueboolean<optional>

true to show (default), false - to hide.

Returns:

Returns this component instance if argument is set, otherwise returns current value.

Type: 
InternalWindow | boolean

canMinimize(valueopt) → {InternalWindow|boolean}

Sets or gets whether minimize button in window title bar should be visible.

Parameters:
NameTypeAttributesDescription
valueboolean<optional>

true to show (default), false - to hide.

Returns:

Returns this component instance if argument is set, otherwise returns current value.

Type: 
InternalWindow | boolean

canMove(valueopt) → {InternalWindow|boolean}

Sets or gets the ability to move the window in GUI by dragging title bar or resizing. Programmatically it can still be moved and resized even when this is disabled. This may not be supported in Linux and some other systems.

Parameters:
NameTypeAttributesDescription
valueboolean<optional>

true to enable (default), false - to disable.

Returns:

Returns this component instance if argument is set, otherwise returns current value.

Type: 
InternalWindow | boolean

canResize(valueopt) → {InternalWindow|boolean}

Sets or gets the ability to resize the window in GUI. Programmatically it can still be resized even when this is disabled.

Parameters:
NameTypeAttributesDescription
valueboolean<optional>

true to enable (default), false - to disable.

Returns:

Returns this component instance if argument is set, otherwise returns current value.

Type: 
InternalWindow | boolean

close() → {InternalWindow}

Performs previously specified close operation on this InternalWindow. To specify what operation should be performed use closeOperation(Window.CloseOperation.[Nothing|Exit|Hide|Dispose])

Returns:

Returns this window component

Type: 
InternalWindow

closeOperation(operationopt) → {InternalWindow|Window.CloseOperation}

Sets or gets the operation to perform when the InternalWindow's close button is clicked by a user or a close() method is called on this InternalWindow.

Parameters:
NameTypeAttributesDescription
operationWindow.CloseOperation<optional>

One of Window.CloseOperation enum values.

Returns:

Returns this component if argument is provided, otherwise returns value.

Type: 
InternalWindow | Window.CloseOperation

innerSize(width_or_sizeObjectopt, heightopt) → {InternalWindow|boolean}

Gets or sets the size of the window's content container (excluding window borders and menu bar, unlike the size() method). When setting, this method resizes the entire InternalWindow so that the content container ends up with the specified size.

Parameters:
NameTypeAttributesDescription
width_or_sizeObjectObject | number<optional>

Integer width value or a size object {width:number, height:number}.

heightnumber<optional>

Integer height value. Required if the first argument is a numeric width.

Returns:

Returns this component instance if argument is set, otherwise returns current size Object.

Type: 
InternalWindow | boolean

onStateChange(callbackopt, removeopt) → {this}

Gets, registers or unregisters an event handler for when the state of the Window changes between normal, minimized, maximized.

Parameters:
NameTypeAttributesDefaultDescription
callbackfunction<optional>

The event handler function. Receives an event object.

removeboolean<optional>
false

Set to true to unregister the event handler.

Returns:
Type: 
this
Example
// Example event object:
const e = {
  target: InternalWindow,    // The component that triggered the event.
  type: string,              // `change`
  state: Window.State,       // New state
  new_state: Window.State,   // Previous state
  interactive: boolean       // Indicates if the state was changed by user's interaction with window
};

onWindowEvents(callbackopt, removeopt) → {this}

Gets, registers or unregisters an event handler for window events, such as activate, deactivate, close, etc.

Parameters:
NameTypeAttributesDefaultDescription
callbackfunction<optional>

The event handler function. Receives an event object.

removeboolean<optional>
false

Set to true to unregister the event handler.

Returns:
Type: 
this
Example
// Example event object:
const e = {
  target: InternalWindow,    // The component that triggered the event.
  type: string,              // `activate`, `deactivate`, `minimize`, `restore`, `closing`, `close`, `show`
  interactive: boolean       // Indicates if triggered by user's interaction with window
};

selected(selectedopt) → {InternalWindow|boolean}

Make this window be selected (activated) or not.

Parameters:
NameTypeAttributesDescription
selectedboolean<optional>

true to activate, false to deactivate.

Returns:

Returns this component instance if argument is set, otherwise returns current value.

Type: 
InternalWindow | boolean

state(stateopt) → {Window.State|Window}

Sets or get a window state. Use one of these enum values: Window.State.[Normal|Minimized|Maximized]

Parameters:
NameTypeAttributesDescription
stateWindow.State<optional>

Setting new window state

Returns:

Returns this Window if argument is provided, otherwise returns current state.

Type: 
Window.State | Window
Example
window.state(Window.State.Maximized);
if(window.state() === Window.State.Maximized) console.log("It works!");