Found a solution, maybe interesting for someone else as well. This takes into account that the app window is not in top/left corner, the smoothPopup is alway to the right of the Listbox and either above or below the item clicked (depending on pos relative to the top).
procedure TFORM_Main.ASLBOX_MainMenuItemDeleteClicked(Sender: TObject;
Item: TAdvSmoothListBoxItem; var Allow: Boolean);
var
mBar: TAdvSmoothListBox;
relIdx, relTop: integer;
absPos : TWindowPlacement;
absRect: TRect;
begin
mbar := Sender as TAdvSmoothListBox;
//-- get the position on screen for smoothPopup display.
relIdx := 0;
try
while mbar.Items[mbar.GetTopIndex+relIdx] <> Item do
inc (relIdx);
relTop := relIdx * mbar.ItemAppearance.Height;
if relTop > ASPOPUP_ConfirmDelete.Height then begin
ASPOPUP_ConfirmDelete.ArrowPosition := paLeftBottom;
dec (relTop, ASPOPUP_ConfirmDelete.Height - mbar.ItemAppearance.Height);
end else begin
ASPOPUP_ConfirmDelete.ArrowPosition := paLeftTop;
end;
absPos.Length := SizeOf(TWindowPlacement);
GetWindowPlacement(Self.Handle, @absPos);
absRect := absPos.rcNormalPosition;
ASPOPUP_ConfirmDelete.PopupAt ( absRect.Left + mbar.Left + mbar.Width
, absRect.Top + relTop);
finally
//-- never allow delete, smoothPopup buttons handled outside.
Allow := false;
end;
Still don't know how to change the caption on the "Delete" button.
Enjoy.