class Callout
package feathers.controls
extends FeathersControl › MeasureSprite › ValidatingSprite
extended by TextCallout
A pop-up container that points at (or calls out) a specific region of the application (typically a specific control that triggered it).
In the following example, a callout displaying a Label
is shown when a
Button
is triggered:
function button_triggerHandler(event:TriggerEvent):Void {
var button = cast(event.currentTarget, Button);
var label = new Label();
label.text = "Hello World!";
Callout.show(label, button);
}
button.addEventListener(TriggerEvent.TRIGGER, button_triggerHandler);
Events:
openfl.events.Event.CLOSE | Dispatched when the callout closes. |
---|
1.0.0
.See also:
Static methods
staticshow(content:DisplayObject, origin:DisplayObject, ?supportedPositions:RelativePositions, modal:Bool = true, ?customOverlayFactory:() ‑> DisplayObject):Callout
Creates a callout, and then positions and sizes it automatically based based on an origin component and an optional set of positions.
In the following example, a callout displaying a Label
is shown when
a Button
is triggered:
function button_triggerHandler(event:TriggerEvent):Void {
var button = cast(event.currentTarget, Button);
var label = new Label();
label.text = "Hello World!";
Callout.show(label, button);
}
button.addEventListener(TriggerEvent.TRIGGER, button_triggerHandler);
1.0.0
.Constructor
new(?content:DisplayObject)
Creates a new Callout
object.
In general, a Callout
shouldn't be instantiated directly with the
constructor. Instead, use the static function Callout.show()
to create
a Callout
, as this often requires less pop-up management code.
1.0.0
.See also:
Variables
arrowPosition:RelativePosition
The edge of the callout where the arrow is positioned.
When calling Callout.show()
, the arrowPosition
property will be
managed automatically and should not be modified.
1.0.0
.backgroundSkin:DisplayObject
The primary background to display behind the callout's content.
In the following example, the callout's background is set to a bitmap:
callout.backgroundSkin = new Bitmap(bitmapData);
1.0.0
.bottomArrowGap:Float
The gap, in pixels, between the callout and the bottomArrowSkin
.
In the following example, the callout's bottom arrow gap is set to -1.0 pixels:
callout.bottomArrowGap = -1.0;
1.0.0
.bottomArrowSkin:DisplayObject
The arrow skin to display when the arrow is positioned on the bottom of the callout.
In the following example, the callout's bottom arrow skin is set to a bitmap:
callout.bottomArrowSkin = new Bitmap(bitmapData);
1.0.0
.content:DisplayObject
The display object that will be displayed by the callout.
This object may be resized to fit the callout's bounds. If the content
needs to be scrolled when placed into a smaller region than its ideal
size, it should be added to a ScrollContainer
, and the
ScrollContainer
should be passed in as the content.
In the following example, the callout's content is a bitmap:
callout.content = new Bitmap(bitmapData);
1.0.0
.See also:
gap:Float
The space, in pixels, between the callout and its origin.
In the following example, the callout's gap is set to 20 pixels:
callout.gap = 20.0;
1.0.0
.horizontalAlign:HorizontalAlign
The horizontal alignment of the callout, relative to the origin, if the callout is positioned on the top or bottom side of the origin.
The following example aligns the callout to the right:
callout.horizontalAlign = RIGHT;
Note: The HorizontalAlign.JUSTIFY
constant is not supported by this
component.
1.0.0
.See also:
leftArrowGap:Float
The gap, in pixels, between the callout and the leftArrowSkin
.
In the following example, the callout's left arrow gap is set to -1.0 pixels:
callout.leftArrowGap = -1.0;
1.0.0
.leftArrowSkin:DisplayObject
The arrow skin to display when the arrow is positioned on the left side of the callout.
In the following example, the callout's left arrow skin is set to a bitmap:
callout.leftArrowSkin = new Bitmap(bitmapData);
1.0.0
.marginBottom:Float
The minimum space, in pixels, between the callout and the stage's bottom edge.
In the following example, the callout's bottom margin is set to 20 pixels:
callout.marginBottom = 20.0;
1.0.0
.marginLeft:Float
The minimum space, in pixels, between the callout and the stage's left edge.
In the following example, the callout's left margin is set to 20 pixels:
callout.marginLeft = 20.0;
1.0.0
.marginRight:Float
The minimum space, in pixels, between the callout and the stage's right edge.
In the following example, the callout's right margin is set to 20 pixels:
callout.marginRight = 20.0;
1.0.0
.marginTop:Float
The minimum space, in pixels, between the callout and the stage's top edge.
In the following example, the callout's top margin is set to 20 pixels:
callout.marginTop = 20.0;
1.0.0
.origin:DisplayObject
A callout may be positioned relative to another display object, known as the origin. Even if the position of the origin changes, the callout will be re-positioned automatically to always point at the origin.
1.0.0
.See also:
paddingBottom:Float
The minimum space, in pixels, between the callout's bottom edge and the callout's content.
In the following example, the callout's bottom padding is set to 20 pixels:
callout.paddingBottom = 20.0;
1.0.0
.paddingLeft:Float
The minimum space, in pixels, between the callout's left edge and the callout's content.
In the following example, the callout's left padding is set to 20 pixels:
callout.paddingLeft = 20.0;
1.0.0
.paddingRight:Float
The minimum space, in pixels, between the callout's right edge and the button's content.
In the following example, the callout's right padding is set to 20 pixels:
callout.paddingRight = 20.0;
1.0.0
.paddingTop:Float
The minimum space, in pixels, between the callout's top edge and the callout's content.
In the following example, the callout's top padding is set to 20 pixels:
callout.paddingTop = 20.0;
1.0.0
.rightArrowGap:Float
The gap, in pixels, between the callout and the rightArrowSkin
.
In the following example, the callout's right arrow gap is set to -1.0 pixels:
callout.rightArrowGap = -1.0;
1.0.0
.rightArrowSkin:DisplayObject
The arrow skin to display when the arrow is positioned on the right side of the callout.
In the following example, the callout's right arrow skin is set to a bitmap:
callout.rightArrowSkin = new Bitmap(bitmapData);
1.0.0
.supportedPositions:Array<RelativePosition>
The set of positions that the callout may appear at, relative to its origin. Positioning of the callout is attempted in order, and if the callout does not fit between the origin and the edge of the stage, the next position is attempted. If the callout is too large for all positions, the position with the most space will be used.
1.0.0
.See also:
topArrowGap:Float
The gap, in pixels, between the callout and the topArrowSkin
.
In the following example, the callout's top arrow gap is set to -1.0 pixels:
callout.topArrowGap = -1.0;
1.0.0
.topArrowSkin:DisplayObject
The arrow skin to display when the arrow is positioned on the top of the callout.
In the following example, the callout's top arrow skin is set to a bitmap:
callout.topArrowSkin = new Bitmap(bitmapData);
1.0.0
.verticalAlign:VerticalAlign
The vertical alignment of the callout, relative to the origin, if the callout is positioned on the left or right side of the origin.
The following example aligns the callout to the top:
callout.verticalAlign = TOP;
Note: The VerticalAlign.JUSTIFY
constant is not supported by this
component.
1.0.0
.See also:
Methods
close():Void
Closes the callout, if opened.
When the callout closes, it will dispatch an event of type
Event.CLOSE
.
1.0.0
.See also:
setPadding(value:Float):Void
Sets all four padding properties to the same value.
1.0.0
.See also: