Constructor
new InternalWindow(textopt)
InternalWindow constructor.
| Name | Type | Attributes | Description |
|---|---|---|---|
text | string | <optional> | Window title text |
Classes
Members
innerOffset :Object
Gets the offset (in pixels) from each edge of the window to the content container.
- Object
// 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.
| Name | Type | Attributes | Description |
|---|---|---|---|
value | boolean | <optional> |
|
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.
| Name | Type | Attributes | Description |
|---|---|---|---|
value | boolean | <optional> |
|
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.
| Name | Type | Attributes | Description |
|---|---|---|---|
value | boolean | <optional> |
|
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.
| Name | Type | Attributes | Description |
|---|---|---|---|
value | boolean | <optional> |
|
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.
| Name | Type | Attributes | Description |
|---|---|---|---|
value | boolean | <optional> |
|
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.
| Name | Type | Attributes | Description |
|---|---|---|---|
value | boolean | <optional> |
|
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 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.
| Name | Type | Attributes | Description |
|---|---|---|---|
operation | Window. | <optional> | One of Window.CloseOperation enum values. |
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.
| Name | Type | Attributes | Description |
|---|---|---|---|
width_or_sizeObject | Object | | <optional> | Integer width value or a size object |
height | number | <optional> | Integer height value. Required if the first argument is a numeric width. |
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.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
callback | function | <optional> | The event handler function. Receives an event object. | |
remove | boolean | <optional> | false | Set to |
- Type:
- this
// 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.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
callback | function | <optional> | The event handler function. Receives an event object. | |
remove | boolean | <optional> | false | Set to |
- Type:
- this
// 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.
| Name | Type | Attributes | Description |
|---|---|---|---|
selected | boolean | <optional> |
|
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]
| Name | Type | Attributes | Description |
|---|---|---|---|
state | Window. | <optional> | Setting new window state |
Returns this Window if argument is provided, otherwise returns current state.
- Type:
- Window.
State |Window
window.state(Window.State.Maximized);
if(window.state() === Window.State.Maximized) console.log("It works!");