CustomPopupForm

Qualified name: delphifmx.CustomPopupForm

class CustomPopupForm

Bases: CustomForm

TCustomPopupForm represents the base class for FMX pop-up forms. Create a subclass derived from TCustomPopupForm if you want to create new pop-up forms. A derived pop-up form can contain one or more FireMonkey objects, such as TLabel, TComboBox, and so on. Note that every descendant of TCustomPopupForm is a 2D FireMonkey pop-up form.

Methods

ApplyPlacement

Positions the current pop-up form.

CanShow

Retrieves whether the form is not visible.

CloseQuery

Close-attempt event dispatcher.

LoadProps

Load properties from a .pydfm file

Attributes

Action

Specifies the action associated with the control.

ActionClient

Specifies whether the component object has an associated action.

Active

Specifies whether the form has focus.

ActiveControl

Specifies the active control on the form.

AniDuration

Sets the animation duration for the pop-up form to close or to show.

AniPosition

Read-only property returning values between 0 and 1.

AutoFree

Embarcadero Technologies does not currently have any additional information.

BiDiMode

Indicates the layout of this form when running under Middle Eastern versions of the operating system.

Border

Embarcadero Technologies does not currently have any additional information.

BorderIcons

Specifies which icons appear on the title bar of the form.

BorderStyle

Specifies the appearance and behavior of the form border.

Bounds

Bounds of form - position and size.

BoundsF

Embarcadero Technologies does not currently have any additional information.

Canvas

Provides access to the drawing area of the form.

Caption

Specifies a text string that identifies the form to the user.

Captured

Specifies the control that has captured the mouse.

Children

Stores an array of children attached to this parent component.

ChildrenCount

Read-only property that specifies the number of children in the children list.

ClassName

Returns the TObject.ClassName

ClientHeight

Specifies the height (in pixels) of the form's client area.

ClientWidth

Specifies the width (in pixels) of the form's client area.

ComObject

Specifies the interface reference implemented by the component.

ComponentCount

Returns the owned component count

ComponentIndex

Indicates the position of the component in its owner's Components property array.

ComponentState

Describes the current state of the component, indicating when a component needs to avoid certain actions.

ComponentStyle

Governs the behavior of the component.

Components

Returns an iterator over the owned components

Constraints

Embarcadero Technologies does not currently have any additional information.

ContentControl

Specifies the control that is shown on the pop-up form.

ContentPadding

Specifies the padding of the pop-up form.

Cursor

Specifies the mouse cursor that will be used on this form.

Data

Stores a Tvalue, which is a data structure that can store different kinds of data types.

DesignInfo

Contains information used by the Form designer.

Designer

Specifies the designer interface for the form.

DragWithParent

Specifies whether the current TCustomPopupForm can be dragged after it is shown.

Fill

Specifies the way the background on this form is filled.

Focused

Specifies the control that has the focus set on it.

FormFactor

width, height, orientations, and devices.

FormFamily

Is a string property that specifies the form family this form is part of.

FormState

Indicates transitional state information about the form.

FormStyle

Determines the form style.

FullScreen

Indicates whether the form is in fullscreen mode.

Handle

Specifies the handle of this form.

Height

Specifies the vertical size of the form (in pixels).

HideWhenPlacementTargetInvisible

Embarcadero Technologies does not currently have any additional information.

Hovered

Identifies the control over which the mouse pointer is hovering.

Index

Specifies the index of the child object in the children array attached to this object.

Left

Specifies the X coordinate of the upper-left corner of the form, relative to the screen.

ModalResult

Represents the return value of a form that is used as a modal dialog box.

Name

Specifies the name of the component as referenced in code.

Observers

Indicates the TObservers object added to the TComponent.

Offset

The offset of the padding rectangle relative to the rectangle of the pop-up form.

OriginalContainerSize

Embarcadero Technologies does not currently have any additional information.

Owner

Returns the Component Owner

Padding

Specifies the padding of the form.

Parent

Returns/Sets the Control Visibility

ParentForm

Specifies the parent form of this form.

Placement

Gets or sets how the TCustomPopupForm is positioned relative to rectangles specified by the PlacementRectangle or PlacementTarget properties, relative to the screen, or relative to the mouse (pointing device) position.

PlacementRectangle

Gets or sets a rectangle, relative to which the TCustomPopupForm is positioned.

PlacementTarget

The target control, relative to which the TCustomPopupForm is positioned.

Position

Represents the size and placement of the form.

PreferedDisplayIndex

Specifies the index of the display that shows the pop-up form.

Quality

Embarcadero Technologies does not currently have any additional information.

RealPlacement

Used internally.

Root

Specifies the root parent of this object.

SaveState

Specifies the save state of the FireMonkey form.

ScreenContentRect

Screen coordinates of the rectangle relative to which controls in the pop-up form are positioned.

ScreenPlacementRect

Screen coordinates of the rectangle relative to which the pop-up form is positioned.

ShowFullScreenIcon

Indicates whether the Mac fullscreen icon is visible.

ShowHint

Determines whether help hints are enabled or disabled for first level child controls in the form. For more information about the rules for enabling hints for a control, see Using Hints to Show Contextual Help in a FireMonkey Application. TCommonCustomForm.ShowHint is a Boolean property set as True by default. When you place a child control in the form, and set the TControl.Hint property, the hint is displayed because the TControl.ParentShowHint is True by default. If the TCommonCustomForm.ShowHint property of the form is set to False, the hint is not displayed in the child control. To show the hint for a control, even when the TCommonCustomForm.ShowHint property of the form is set to False, set TControl.ShowHint for the control to True.

Size

The working area size of the current pop-up form.

Stored

Specifies whether this object is stored in the .XFM file.

StyleBook

Specifies the style book for this form.

StyleLookup

Specifies the name of the style to look up and apply to this form.

StyleName

Specifies the style name for this FMX component.

SystemStatusBar

System status bar settings on mobile platforms.

Tag

Stores a NativeInt integral value as a part of a component.

TagFloat

Custom property that stores any floating-point value.

TagObject

Custom property that stores any object value.

TagString

Custom property that stores any string value.

Top

Specifies the Y coordinate of the upper-left corner of the form, relative to the screen.

Touch

Embarcadero Technologies does not currently have any additional information.

Transparency

Indicates whether the form is transparent or not.

VCLComObject

Represents information used internally by components that support COM.

Visible

Indicates whether the form is visible.

Width

Specifies the horizontal size of the form (in pixels).

WindowState

Represents how the form appears on the screen.

WindowStyle

Embarcadero Technologies does not currently have any additional information.

AniDuration

Sets the animation duration for the pop-up form to close or to show. AniDuration is measured in seconds. AniDuration defines a duration time for execution of the custom event handler assigned to the OnAniTimer event of the current TCustomPopupForm pop-up form.

Note: AniDuration does not influence onto an animation duration of an external animation (for example TFloatAnimation animation) if such is assigned to the TCustomPopupForm pop-up form. AniDuration is used for the custom event handler assigned to the OnAniTimer event.

Type:

float

AniPosition

Read-only property returning values between 0 and 1. You can use AniPosition in an OnAniTimer event handler. The AniPosition value changes during AniDuration time of a custom animation execution from 0 to 1 (during opening of the current pop-up form) and from 1 to 0 (during closing) respectively. AniPosition might be used as a parameter in intermediate values of animated properties in an OnAniTimer event handler. For example, you can use AniPosition to calculate an intermediate position or intermediate opacity during custom animation. Where AniPosition = 0 corresponds to a starting moment and AniPosition = 1 to a termination of opening animation. For example, in the sample below the form Width (as a component of the form Size) changes from 0 (when AniPosition = 0) to 200 (when AniPosition = 1) during appearing of the pop-up form and vice versa on the form closing:

… procedure TForm1.AniTimerProc(Sender: TObject); begin

if Sender is TCustomPopupForm then begin

// You can use AniPosition whether to define Opacity or Size // TCustomPopupForm(Sender).ContentControl.Opacity := TCustomPopupForm(Sender).AniPosition;

TCustomPopupForm(Sender).Size := TSize.Create(Round(200 * TCustomPopupForm(Sender).AniPosition), 100);

end;

end;

procedure TForm1.Button1Click(Sender: TObject); var

R: TRectangle;

begin

R := TRectangle.Create(Self); F := TCustomPopupForm.Create(Self); F.AniDuration := 0.5; F.ContentControl := R; F.OnAniTimer := AniTimerProc; F.PlacementTarget := Button1; F.Show;

end; …

Commented line shows how to use AniPosition to animate a form transparency. See also discussion in TPopup.OnAniTimer.

Type:

float

ApplyPlacement()

Positions the current pop-up form. ApplyPlacement positions the TCustomPopupForm pop-up form using the current Size and Placement properties.

AutoFree

Embarcadero Technologies does not currently have any additional information.

Type:

bool

CanShow()

Retrieves whether the form is not visible. First CanShow calls the inherited TCommonCustomForm.CanShow. If TCommonCustomForm.CanShow returns False, CanShow exits returning False. If TCommonCustomForm.CanShow returns True, CanShow initiates animation (AniDuration, AniPosition, DoAniTimer) and exits returning True.

CloseQuery()

Close-attempt event dispatcher. FMX.Forms.TCustomPopupForm.CloseQuery inherits from FMX.Forms.TCommonCustomForm.CloseQuery. All content below this line refers to FMX.Forms.TCommonCustomForm.CloseQuery. Close-attempt event dispatcher. CloseQuery is called automatically when an attempt is made to close the form. CloseQuery can allow the form to close by returning True, or prevent the form from closing by returning False. As implemented in TCommonCustomForm, CloseQuery calls the OnCloseQuery event handler, if it exists. If no such event handler exists, CloseQuery returns True.

ContentControl

Specifies the control that is shown on the pop-up form. If a pop-up form does not contain any visible control, then the pop-up form is totally transparent. Therefore, some visible control should be placed onto the pop-up form. This control is specified by the ContentControl property.

Note: A ContentCtrl control can be associated to a PopupForm pop-up form using the Parent property of the control, like in the following example: ContentCtrl.Parent := ParentForm. However, we recommend using the ContentControl property like ParentForm.ContentControl := ContentCtrl, because TCustomPopupForm handling ContentControl takes into account the current scale and rotation of the ContentCtrl control.

Type:

Control

ContentPadding

Specifies the padding of the pop-up form. The ContentPadding of a pop-up form specifies how close, in pixels, the children of the form can come to each of the form edges (top, left, bottom, right). See also Padding. The adhering of the pop-up form is executed to the boundaries of this indented ‘padding rectangle’.

Type:

Bounds

DragWithParent

Specifies whether the current TCustomPopupForm can be dragged after it is shown. For example, if DragWithParent is True, TCustomPopupForm is dragged together with its parent form when the parent form is the target of a drag-and-drop operation. When Placement is Mouse or MouseCenter, then the pop-up form moves following the mouse cursor. On mobile devices, after changing the orientation (portrait/landscape) the pop-up form can change its position in order not to be partially positioned outside of the screen boundaries. The default is True.

Type:

bool

HideWhenPlacementTargetInvisible

Embarcadero Technologies does not currently have any additional information.

Type:

bool

LoadProps()

Load properties from a .pydfm file

Offset

The offset of the padding rectangle relative to the rectangle of the pop-up form. Defines the number of pixels, by which the pop-up form is displaced relatively to the main form position; this number is obtained taking into account all positioning properties used in the TCustomPopupForm class. The Offset direction depends on a Placement value. The Offset property is used, for example, in multi-level menus, when pop-up forms of submenus are placed overlapping a form of a previous level.

Type:

PointF

Parent

Returns/Sets the Control Visibility

Placement

Gets or sets how the TCustomPopupForm is positioned relative to rectangles specified by the PlacementRectangle or PlacementTarget properties, relative to the screen, or relative to the mouse (pointing device) position. TPlacement defines possible values of Placement. TPlacement also specifies the behavior of the TCustomPopupForm, when it overlaps screen boundaries. The default value is Bottom. This figure demonstrates the TopCenter value.

In the figure, ScreenPlacementRect is the colored Fuchsia rectangle of the Show popup button. Use Placement, PlacementTarget, and PlacementRectangle to set the positioning of TCustomPopupForm.

Type:

Placement

PlacementRectangle

Gets or sets a rectangle, relative to which the TCustomPopupForm is positioned. Screen coordinates of PlacementRectangle are calculated relative to PlacementTarget (if specified). Otherwise, relative to the top left corner of the screen. The following rules are used:

If PlacementRectangle is not specified (width or height equals to zero 0), but PlacementTarget is specified, then the coordinates and size of PlacementTarget are used. If neither PlacementRectangle nor PlacementTarget are specified, then adhering of the top left corner of the form is implemented to the mouse cursor. Use Placement, PlacementTarget, and PlacementRectangle to set the target origin and the alignment point of the TCustomPopupForm.

Type:

Bounds

PlacementTarget

The target control, relative to which the TCustomPopupForm is positioned. If PlacementTarget is not set, and the TCustomPopupForm has a ParentForm, then the TCustomPopupForm is positioned relative to its parent. If PlacementTarget and ParentForm are not set, TCustomPopupForm is positioned relative to the main window. Use Placement, RealPlacement, and PlacementRectangle to set the target origin and the alignment point of TCustomPopupForm.

Type:

Control

PreferedDisplayIndex

Specifies the index of the display that shows the pop-up form. Specifies the index of the display in the Displays array that shows the current pop-up form. PreferedDisplayIndex is used for context menus. When an application opens several submenus of context menus, all these submenus should be shown on the same display, even if a new pop-up submenu can be shown on a neighbor display. If a specified PreferedDisplayIndex does not exist, then a pop-up form is shown on a display that is the closest to the place where the form should appear according to all specified positioning parameters Placement, PlacementTarget, and PlacementRectangle.

Type:

int

RealPlacement

Used internally. The CreateNew constructor initializes RealPlacement equal to Placement. At run time RealPlacement can be changed according to the real environment properties. For example, if a run-time environment supports the mouse, then RealPlacement can be set to TPlacement.Mouse, otherwise to TPlacement.Absolute.

Type:

Placement

ScreenContentRect

Screen coordinates of the rectangle relative to which controls in the pop-up form are positioned. ScreenContentRect is the rectangle inside which all controls of the pop-up form are positioned. Notice that some ‘decorative elements’, like ‘triangular peaks’ on TCalloutPanel rectangles, can be positioned outside the ScreenContentRect.

Type:

RectF

ScreenPlacementRect

Screen coordinates of the rectangle relative to which the pop-up form is positioned. ScreenPlacementRect is defined taking into account PlacementRectangle and PlacementTarget.

In the figure, ScreenPlacementRect is the colored Fuchsia rectangle of the Show popup button.

Type:

RectF

Size

The working area size of the current pop-up form. Size defines the width and height of the working area of the current TCustomPopupForm pop-up form. Size defines the rectangle to which all controls of the form are aligned. In the following picture the Size rectangular of the pop-up form is specified with the green dashes. The physical rectangle of the pop-up form window (defined by Width and Height) is marked with red dashes.

As you see from the picture, the physical rectangle is not used for positioning. ClientWidth and ClientHeight of the working area of the form are defined automatically according to the specified Size and Padding. If PlacementRectangle is defined and Placement is Absolute, then Size is ignored. Use a TSizeF object to set the Size of a pop-up form. For example, the following code will set up the working area width to 200 and height to 250:

Form1.Size := TSizeF.Create(200, 250);

Type:

SizeF