Flexible popup/overlay component for menus, tooltips, popovers, and modal content.
Popup1.PopupType := ptDropdown; Popup1.PlacementTarget := Button1; Popup1.Placement := pBottom; Popup1.ShowArrow := True; Popup1.CloseOnBackdropClick := True; // Add menu items to popup var MenuLayout := TFlexFMXLayout.Create(Popup1); MenuLayout.Parent := Popup1; // Add menu buttons... Popup1.Popup; // Show popup
Popup1.PopupType := ptModal; Popup1.Placement := pCenter; Popup1.ShowBackdrop := True; Popup1.BackdropColor := $80000000; // 50% black Popup1.CloseOnBackdropClick := True; Popup1.AnimationType := paZoom; Popup1.Width := 400; Popup1.Height := 300; Popup1.Popup;
Popup1.PopupType := ptTooltip; Popup1.PlacementTarget := EditControl; Popup1.Placement := pTop; Popup1.ShowArrow := True; Popup1.AnimationType := paFade; var Label := TLabel.Create(Popup1); Label.Parent := Popup1; Label.Text := 'Enter your email address'; Label.TextSettings.Font.Size := 12; Popup1.AutoSize := True; Popup1.Popup;
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
if Button = TMouseButton.mbRight then
begin
Popup1.PopupType := ptDropdown;
Popup1.PlacementTarget := Image1;
Popup1.Placement := pBottom;
// Position at cursor
Popup1.Left := X;
Popup1.Top := Y;
Popup1.Popup;
end;
end;
Popup - Show popupIsOpen - Check if popup is currently visibleClose - Hide popupPopupAtPoint(X, Y) - Show at specific coordinatesOnPopup - Before popup appearsOnClose - Popup dismissedOnBackdropClick - Backdrop area clicked