Class: PopupPanel

olympe.ui.std. PopupPanel

Popup window appearing on the middle of the screen, with callbacks defined when accepting or canceling the message. This is mostly an abstract class, and you should probably use one of its subclasses.


new PopupPanel( [dimension] [, modal] [, alternativeParent] [, themeClass])

Creates a PopupPanel with a given dimension.

Parameters:
Name Type Argument Default Description
dimension olympe.df.PVector2 <optional>

The Dimension (w, h) for this popup window.

modal boolean <optional>
true

True if popup is modal (user can't click outside popup).

alternativeParent olympe.ui.std.Layer <optional>

Parent container for this element.

themeClass olympe.df.POString | string <optional>

The name of the theme class.

See:

Extends

Members


<protected, nullable> anchoredPosition :olympe.df.Vector2

Type:
Inherited From:
Overrides:

<protected> attachedParent :olympe.df.Proxy.<olympe.ui.std.Layer>|olympe.ui.std.Layer

Parent of this popup.

Type:
Inherited From:
Overrides:

<protected> autoHeight :olympe.df.POBoolean

Whether this popup sets its height automatically or not.

Type:
Inherited From:
Overrides:

<protected> autoWidth :olympe.df.POBoolean

Whether this popup sets its width automatically or not.

Type:
Inherited From:
Overrides:

<protected, non-null> container :olympe.ui.std.AbsoluteLayout

Layout used by this popup to render its content.

Type:
Inherited From:
Overrides:

<protected, non-null> content :olympe.df.Proxy.<olympe.ui.std.DockableElement>

Type:
Inherited From:
Overrides:

Whether this popup is modal or not.

Type:
  • boolean
Inherited From:
Overrides:

<protected> visible :olympe.df.POBoolean

Whether this popup is visible or not.

Type:
Inherited From:
Overrides:

Methods


anchorToAttachedParent()

Anchor to attached parent, center in the middle

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

anchorToElement(element [, horizontalAlign] [, verticalAlign] [, offset])

Anchor the FloatingElement to a screen element.

Parameters:
Name Type Argument Default Description
element olympe.ui.std.DockableElement

The element to use as an anchor.

horizontalAlign olympe.ui.std.FloatingElement.HorizontalAnchorAlignType <optional>
MIDDLE

The horizontal alignment.

verticalAlign olympe.ui.std.FloatingElement.VerticalAnchorAlignType <optional>
MIDDLE

The vertical alignment.

offset olympe.df.Vector2 <optional>

The offset (dx, dy) relative to the anchor's position.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

anchorToMouse(mouseEvent [, horizontalAlign] [, verticalAlign] [, offset])

Anchor the FloatingElement to the mouse.

Parameters:
Name Type Argument Default Description
mouseEvent olympe.df.Proxy.<olympe.ui.events.MouseEvent> | olympe.ui.events.MouseEvent

Emitted by a UI element, use getEventMouseMove to follow the mouse

horizontalAlign olympe.ui.std.FloatingElement.HorizontalAnchorAlignType <optional>
MIDDLE

The horizontal alignment.

verticalAlign olympe.ui.std.FloatingElement.VerticalAnchorAlignType <optional>
MIDDLE

The vertical alignment.

offset olympe.df.Vector2 <optional>

The offset (dx, dy) relative to the mouse's position.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

applyTheme(theme)

Parameters:
Name Type Description
theme olympe.ui.std.theme.ElementTheme
Inherited From:
Overrides:

<protected> cancel()


<protected> confirm()


getAnimateContent()

Checks whether the content is to be animated.

Inherited From:
Overrides:
Returns:

true if the content is animated, false for the element itself.

Type
olympe.df.POBoolean

getAnimateOverlay()

Checks whether the overlay is to be animated.

Inherited From:
Overrides:
Returns:

true if the overlay is to be animated.

Type
olympe.df.POBoolean

getAnimation()

Gets the animation associated with this FloatingElement.

Inherited From:
Overrides:
Returns:

The animation.

Type
olympe.df.Proxy.<olympe.ui.std.TransitionAnimation>

getAutoHeight()

Checks whether the height of this FloatingElement is calculated automatically.

Inherited From:
Overrides:
Returns:

true if height is automatically calculated.

Type
olympe.df.POBoolean

getAutoWidth()

Checks whether the width of this FloatingElement is calculated automatically.

Inherited From:
Overrides:
Returns:

true if width is automatically calculated.

Type
olympe.df.POBoolean

getDimension()

Gets the dimension of this FloatingElement.

Inherited From:
Overrides:
Returns:

The dimension.

Type
olympe.df.PVector2

getOverlayBackgroundColor()

Gets the background color of the overlay when this popup is modal.

Inherited From:
Overrides:
Returns:

The background Color.

Type
olympe.df.Proxy.<olympe.df.Color>

getParent()

Gets the parent container of this element.

Inherited From:
Overrides:
Returns:

The parent.

Type
olympe.df.Proxy.<olympe.ui.std.DockableElement>

getPosition()

Gets the position of this FloatingElement.

Inherited From:
Overrides:
Returns:

Position of this element.

Type
olympe.df.PVector2

isVisible()

Checks whether this FloatingElement is visible.

Inherited From:
Overrides:
Returns:

true if popup is visible

Type
olympe.df.POBoolean

offCancel(key)

Unregisters a callback previously set with olympe.ui.std.PopupPanel#onCancel.

Parameters:
Name Type Description
key string

The ID of the callback.


offConfirm(key)

Unregisters a callback previously set with olympe.ui.std.PopupPanel#onConfirm.

Parameters:
Name Type Description
key string

The ID of the callback.


onCancel(callback [, key])

Registers a callback to be executed when the 'Cancel' button of the popup is pressed.

Parameters:
Name Type Argument Description
callback function

Function to call when the 'Cancel' button is pressed.

key string <optional>

Identifier for this event registration. A unique one will be generated if omitted.

Returns:

the ID of the callback.

Type
string

onCloseAnimationEnd(callbackFunc [, key])

Registers a callback to be called when the 'close' animation ends.

Parameters:
Name Type Argument Description
callbackFunc function

The function to call back.

key string <optional>

The ID of the callback. Generated automatically if omitted.

Inherited From:
Overrides:
Returns:

The ID of the callback.

Type
string

onConfirm(callback [, key])

Registers a callback to be executed when the 'Confirm' button of the popup is pressed.

Parameters:
Name Type Argument Description
callback function

Function to call when the Confirm button is pressed.

key string <optional>

Identifier for this event registration. A unique one will be generated if omitted.

Returns:

The ID of the callback.

Type
string

onOpenAnimationEnd(callbackFunc [, key])

Registers a callback to be called when the 'open' animation ends.

Parameters:
Name Type Argument Description
callbackFunc function

The function to call back.

key string <optional>

The ID of the callback. Generated automatically if omitted.

Inherited From:
Overrides:
Returns:

The ID of the callback.

Type
string

onOverlayClick(callbackFunc [, key])

Registers a callback to be called when the user clicks in the overlay.

Parameters:
Name Type Argument Description
callbackFunc olympe.ui.events.OnMouseEventCallback

The function to call back.

key string <optional>

The ID of the callback. Generated automatically if omitted.

Inherited From:
Overrides:
Returns:

The ID of the callback.

Type
string

releaseAnchor()

Unties this FloatingElement from its anchor.

Inherited From:
Overrides:
See:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

restoreToAnchor()

Returns to the position set by anchorToElement.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setAnimateContent(value)

Sets whether to animate content inside the FloatingElement, or the FloatingElement itself.

Parameters:
Name Type Description
value olympe.df.POBoolean | boolean

true to animate the content, false for the container.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setAnimateOverlay(value)

Sets whether to animate the overlay (for modal elements).

Parameters:
Name Type Description
value olympe.df.POBoolean | boolean

true to animate the overlay.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setAnimation(animation)

Sets the animation to use when this FloatingElement becomes visible.

Parameters:
Name Type Description
animation olympe.df.Proxy.<olympe.ui.std.TransitionAnimation> | olympe.ui.std.TransitionAnimation

The animation.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setAutoHeight(value)

Sets whether the height of this FloatingElement should be calculated automatically.

Parameters:
Name Type Description
value olympe.df.POBoolean | boolean

true to calculate the height automatically.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

<protected> setAutoSizeLogic()

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setAutoWidth(value)

Sets whether the width of this FloatingElement should be calculated automatically.

Parameters:
Name Type Description
value olympe.df.POBoolean | boolean

true to calculate the width automatically.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setBackgroundColor(color)

Sets the background color for this FloatingElement.

Parameters:
Name Type Description
color olympe.df.PColor

The background color.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setBackgroundImage(url [, size] [, position] [, sizeVector] [, positionVector])

Sets the background image for this FloatingElement.

Parameters:
Name Type Argument Description
url olympe.df.POString | olympe.df.Node | string

URL to image.

size olympe.ui.common.BackgroundImageSize | olympe.df.Proxy | olympe.df.Node <optional>

The sizing model of the image.

position olympe.ui.common.BackgroundImagePosition | olympe.df.Proxy | olympe.df.Node <optional>

The position of the image inside the container.

sizeVector olympe.df.Vector2 | olympe.df.Proxy | olympe.df.Node <optional>

Size in pixel (ignored if size is not olympe.ui.common.BackgroundImageSize.MANUAL, vertical scale size automatically adjusted if imageSizeY is missing)

positionVector olympe.df.Vector2 | olympe.df.Proxy | olympe.df.Node <optional>

Position of image in pixel (ignored if position is not olympe.ui.common.BackgroundImagePosition.MANUAL)

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setBorder(width, color)

Sets the border width and color of this FloatingElement.

Parameters:
Name Type Description
width number | olympe.df.PONumber

The width, in pixels.

color olympe.df.PColor

The color.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setClosableByClickingOut(value)

Set whether or not this element should be closed when the user clicks outside of it.

The default behaviour is to not do anything.

Parameters:
Name Type Description
value boolean
Inherited From:
Overrides:

setContent(content)

Sets the content of this FloatingElement.

Parameters:
Name Type Description
content olympe.df.Proxy.<olympe.ui.std.DockableElement> | olympe.ui.std.DockableElement

The content.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setCornerRadius(radius)

Sets the corner radius for this FloatingElement.

Parameters:
Name Type Description
radius olympe.df.PONumber | olympe.df.Node | number

The corner radius.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setDimension(dimension)

Sets the dimension of this FloatingElement.

Parameters:
Name Type Description
dimension olympe.df.PVector2

The dimension (w, h).

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setOpacity(opacity)

Sets the opacity for this FloatingElement. It's a value between 0 & 1, 0 meaning transparent and 1 meaning opaque.

Parameters:
Name Type Description
opacity olympe.df.PONumber

The opacity, a value between 0 & 1.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setOverlayBackgroundColor(color)

Sets the overlay background color when this popup is modal.

Parameters:
Name Type Description
color olympe.df.Color | olympe.df.Proxy.<olympe.df.Color>

The overlay background color.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setPosition(position)

Sets the position of this FloatingElement.

Warning: This method should only be called by Layouts!

Parameters:
Name Type Description
position olympe.df.PVector2

The position of this element.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

setScale(scale)

Sets the scale for both axis (x, y) of this FloatingElement.

Parameters:
Name Type Description
scale olympe.df.PVector2

The scale (x,y).

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

<protected> setVisibilityLogic()

Inherited From:
Overrides:

setVisible(visible)

Displays or hides this FloatingElement.

Parameters:
Name Type Description
visible olympe.df.POBoolean | boolean

true to display, false to hide.

Inherited From:
Overrides:
Returns:

This FloatingElement.

Type
olympe.ui.std.FloatingElement

unregisterOnCloseAnimationEnd(key)

Unregisters a callback set by olympe.ui.std.FloatingElement#onCloseAnimationEnd.

Parameters:
Name Type Description
key string

The ID of the callback.

Inherited From:
Overrides:

unregisterOnOpenAnimationEnd(key)

Unregisters a callback set by olympe.ui.std.FloatingElement#onOpenAnimationEnd.

Parameters:
Name Type Description
key string

The ID of the callback.

Inherited From:
Overrides:

unregisterOnOverlayClick(key)

Unregisters a callback set by olympe.ui.std.FloatingElement#onOverlayClick.

Parameters:
Name Type Description
key string

The ID of the callback.

Inherited From:
Overrides: