CustomPopupForm¶
Qualified name: delphifmx.CustomPopupForm
- class CustomPopupForm¶
Bases:
CustomFormTCustomPopupForm 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
Positions the current pop-up form.
Retrieves whether the form is not visible.
Close-attempt event dispatcher.
TCommonCustomForm.LoadProps() Load properties from a .pydfm file
Attributes
ActionSpecifies the action associated with the control.
ActionClientSpecifies whether the component object has an associated action.
ActiveSpecifies whether the form has focus.
ActiveControlSpecifies the active control on the form.
Sets the animation duration for the pop-up form to close or to show.
Read-only property returning values between 0 and 1.
Embarcadero Technologies does not currently have any additional information.
BiDiModeIndicates the layout of this form when running under Middle Eastern versions of the operating system.
BorderEmbarcadero Technologies does not currently have any additional information.
BorderIconsSpecifies which icons appear on the title bar of the form.
BorderStyleSpecifies the appearance and behavior of the form border.
BoundsBounds of form - position and size.
BoundsFEmbarcadero Technologies does not currently have any additional information.
CanvasProvides access to the drawing area of the form.
CaptionSpecifies a text string that identifies the form to the user.
CapturedSpecifies the control that has captured the mouse.
ChildrenStores an array of children attached to this parent component.
ChildrenCountRead-only property that specifies the number of children in the children list.
ClassNameReturns the TObject.ClassName
ClientHeightSpecifies the height (in pixels) of the form's client area.
ClientWidthSpecifies the width (in pixels) of the form's client area.
ComObjectSpecifies the interface reference implemented by the component.
ComponentCountReturns the owned component count
ComponentIndexIndicates the position of the component in its owner's Components property array.
ComponentStateDescribes the current state of the component, indicating when a component needs to avoid certain actions.
ComponentStyleGoverns the behavior of the component.
ComponentsReturns an iterator over the owned components
ConstraintsEmbarcadero Technologies does not currently have any additional information.
Specifies the control that is shown on the pop-up form.
Specifies the padding of the pop-up form.
CursorSpecifies the mouse cursor that will be used on this form.
DataStores a Tvalue, which is a data structure that can store different kinds of data types.
DesignInfoContains information used by the Form designer.
DesignerSpecifies the designer interface for the form.
Specifies whether the current TCustomPopupForm can be dragged after it is shown.
FillSpecifies the way the background on this form is filled.
FocusedSpecifies the control that has the focus set on it.
FormFactorwidth, height, orientations, and devices.
FormFamilyIs a string property that specifies the form family this form is part of.
FormStateIndicates transitional state information about the form.
FormStyleDetermines the form style.
FullScreenIndicates whether the form is in fullscreen mode.
HandleSpecifies the handle of this form.
HeightSpecifies the vertical size of the form (in pixels).
Embarcadero Technologies does not currently have any additional information.
HoveredIdentifies the control over which the mouse pointer is hovering.
IndexSpecifies the index of the child object in the children array attached to this object.
LeftSpecifies the X coordinate of the upper-left corner of the form, relative to the screen.
ModalResultRepresents the return value of a form that is used as a modal dialog box.
NameSpecifies the name of the component as referenced in code.
ObserversIndicates the TObservers object added to the TComponent.
The offset of the padding rectangle relative to the rectangle of the pop-up form.
OriginalContainerSizeEmbarcadero Technologies does not currently have any additional information.
OwnerReturns the Component Owner
PaddingSpecifies the padding of the form.
Returns/Sets the Control Visibility
ParentFormSpecifies the parent form of this form.
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.
Gets or sets a rectangle, relative to which the TCustomPopupForm is positioned.
The target control, relative to which the TCustomPopupForm is positioned.
PositionRepresents the size and placement of the form.
Specifies the index of the display that shows the pop-up form.
QualityEmbarcadero Technologies does not currently have any additional information.
Used internally.
RootSpecifies the root parent of this object.
SaveStateSpecifies the save state of the FireMonkey form.
Screen coordinates of the rectangle relative to which controls in the pop-up form are positioned.
Screen coordinates of the rectangle relative to which the pop-up form is positioned.
ShowFullScreenIconIndicates whether the Mac fullscreen icon is visible.
ShowHintDetermines 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.
The working area size of the current pop-up form.
StoredSpecifies whether this object is stored in the .XFM file.
StyleBookSpecifies the style book for this form.
StyleLookupSpecifies the name of the style to look up and apply to this form.
StyleNameSpecifies the style name for this FMX component.
SystemStatusBarSystem status bar settings on mobile platforms.
TagStores a NativeInt integral value as a part of a component.
TagFloatCustom property that stores any floating-point value.
TagObjectCustom property that stores any object value.
TagStringCustom property that stores any string value.
TopSpecifies the Y coordinate of the upper-left corner of the form, relative to the screen.
TouchEmbarcadero Technologies does not currently have any additional information.
TransparencyIndicates whether the form is transparent or not.
VCLComObjectRepresents information used internally by components that support COM.
VisibleIndicates whether the form is visible.
WidthSpecifies the horizontal size of the form (in pixels).
WindowStateRepresents how the form appears on the screen.
WindowStyleEmbarcadero 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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:
- 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: