Class: View

This class is the base for all views.

new View()


Members

<readonly> id :number

The view's ID.
Type:
  • number

<readonly> isView :boolean

Identifies a view.
Type:
  • boolean

Methods

activate()

Activates the view

allowLayoutUpdates()

Enables updating the layout, when a property changes.

applyParams(params)

Applies all params to the view.
Parameters:
Name Type Description
params * The view's params
Properties
Name Type Argument Default Description
width number <optional>
100 The view's width
height number <optional>
100 The view's height
left number <optional>
0 The view's left anchor
top number <optional>
0 The view's top anchor
useRelative boolean <optional>
true
clipRect * <optional>
undefined The view's clip rect
zIndex number <optional>
0 The view's z-index
visibility string <optional>
"visible" The view's visibility

center()

Centers the view in the middle of the screen.

close()

Closes the view and clears all resources.

focus()

Focus the views

getCanMaximize() → {boolean}

Gets whether the view can be maximized
Returns:
The state.
Type
boolean

getCanMinimize() → {boolean}

Gets whether the view can be minimized
Returns:
The state.
Type
boolean

getClipRect() → {*}

Gets the view's clip rect.
Returns:
The view's clip rect
Type
*

getHeight() → {number}

Gets the view's height.
Returns:
The view's height
Type
number

getHideWhenClose() → {boolean}

Gets whether the view is will hide when the user tries to close it.
Returns:
The state.
Type
boolean

getIsCloseable() → {boolean}

Gets whether the view is closeable,
Returns:
The closeability.
Type
boolean

getLeft() → {number}

Returns the left anchor.
Returns:
The left ancor
Type
number

getName() → {string}

Gets the view's name.
Returns:
The view's name
Type
string

getOpacity() → {number}

Gets the view's opacity.
Returns:
The view's opacity
Type
number

getParent() → {number}

Gets the view's parent.
Returns:
value The parent's view id
Type
number

getRelativeClipRect() → {*}

Gets the view's relative clip rect.
Returns:
The view's relative clip rect
Type
*

getRelativeLeft() → {number}

Gets the relative left anchor.
Returns:
The relative left anchor
Type
number

getRelativeTop() → {number}

Gets the relative top anchor.
Returns:
The relative top anchor
Type
number

getRoot() → {View}

Gets the view's root.
Returns:
value The root's view
Type
View

getTitle() → {string}

Getsthe title of this view.
Returns:
The title.
Type
string

getTop() → {number}

Returns the top anchor.
Returns:
the top anchor
Type
number

getTopMost() → {boolean}

Gets if the view is top most.
Returns:
Is the view top most.
Type
boolean

getVisibility() → {string}

Gets the view's visibility.
Returns:
The view's visibility
Type
string

getWidth() → {number}

Gets the view's width.
Returns:
The view's width
Type
number

getZIndex() → {number}

Gets the view's z-index.
Returns:
The view's z-index
Type
number

invalidate()

Forces a redraw.

onActivated(callback) → {siteKiosk.ui.view~eventSubscription}

Registers a callback, which will be triggered when a view is activated
Parameters:
Name Type Description
callback siteKiosk.ui.view~activatedCallback The callback, which will be triggered when a view is activated
Returns:
An handler to unsubscribe the event
Type
siteKiosk.ui.view~eventSubscription

onClosed(callback) → {siteKiosk.ui.view~eventSubscription}

Registers a callback, which will be triggered when a view is closed
Parameters:
Name Type Description
callback siteKiosk.ui.view~closedCallback The callback, which will be triggered when a view is closed
Returns:
An handler to unsubscribe the event
Type
siteKiosk.ui.view~eventSubscription

onDeactivated(callback) → {siteKiosk.ui.view~eventSubscription}

Registers a callback, which will be triggered when a view is deactivated
Parameters:
Name Type Description
callback siteKiosk.ui.view~deactivatedCallback The callback, which will be triggered when a view is deactivated
Returns:
An handler to unsubscribe the event
Type
siteKiosk.ui.view~eventSubscription

onGotFocus(callback) → {siteKiosk.ui.view~eventSubscription}

Registers a callback, which will be triggered when a view receives the focus.
Parameters:
Name Type Description
callback siteKiosk.ui.view~gotFocusCallback The callback, which will be triggered when a view receives the focus
Returns:
An handler to unsubscribe the event
Type
siteKiosk.ui.view~eventSubscription

preventLayoutUpdates()

Prevents layout changes from happening.

setCanMaximize(The)

Sets whether the view can be maximized
Parameters:
Name Type Description
The boolean state.

setCanMinimize(The)

Sets whether the view can be minimized
Parameters:
Name Type Description
The boolean state.

setClipRect(value)

Sets the view's clip rect.
Parameters:
Name Type Description
value * The view's clip rect

setHeight(value)

Sets the view's height.
Parameters:
Name Type Description
value number The view's height

setHideWhenClose(The)

Sets whether the view is will hide when the user tries to close it.
Parameters:
Name Type Description
The boolean state.

setIsCloseable(The)

Sets whether the view is closeable,
Parameters:
Name Type Description
The boolean closeability.

setLeft(value)

Sets the left anchor.
Parameters:
Name Type Description
value number The left anchor

setMaxSize(width, height)

Sets the view's maxSize.
Parameters:
Name Type Description
width number The view's maxWidth
height number The view's maxHeight

setMinSize(width, height)

Sets the view's minSize.
Parameters:
Name Type Description
width number The view's minWidth
height number The view's minHeight

setName()

Sets the view's name.

setOpacity(value)

Sets the view's opacity.
Parameters:
Name Type Description
value number The view's opacity

setParent(value)

Sets the view's parent.
Parameters:
Name Type Description
value number The parent's view id

setPosition(left, top, isRelativePosition)

Sets the view's position.
Parameters:
Name Type Description
left number The view's left position
top number The view's top position
isRelativePosition bool Are the coordinates relative to the view´s parent.

setPositionAndSize(left, top, width, height, isRelativePosition)

Sets the view's position and size.
Parameters:
Name Type Description
left number The view's left position
top number The view's top position
width number The view's width
height number The view's height
isRelativePosition bool Are the coordinates relative to the view´s parent.

setRelativeClipRect(value)

Sets the view's relative clip rect.
Parameters:
Name Type Description
value * The view's relative clip rect

setRelativeLeft(value)

Sets the relative left anchor.
Parameters:
Name Type Description
value number The relative left anchor

setRelativeTop(value)

Sets the relative top anchor.
Parameters:
Name Type Description
value number The relative left anchor

setSize(width, height)

Sets the view's size.
Parameters:
Name Type Description
width number The view's width
height number The view's height

setTitle(The)

Sets the view title
Parameters:
Name Type Description
The string title.

setTop(value)

Sets the top anchor.
Parameters:
Name Type Description
value number The top anchor

setTopMost(value)

Sets if thew view is top most.
Parameters:
Name Type Description
value boolean Should the view be top most.

setVisibility(value)

Sets the view's visibility.
Parameters:
Name Type Description
value string The view's visibility

setWidth(value)

Sets the view's width.
Parameters:
Name Type Description
value number The view's width

setZIndex(value)

Sets the view's z-index.
Parameters:
Name Type Description
value number The view's z-index