A bit ago I posted a QC report complaining about the speed at which a nested FMX popup menu unfurls. Steps:
- Create a new FMX desktop application.
- Add a TPopupMenu to the form, then four items to the popup menu, the second parented to the first, the third to second and the fourth to the third.
- Add a TRectangle to the form and assign its PopupMenu property to PopupMenu1.
- Right click on the popup menu, select the first item then hover over the second; once the third item is shown, hover over it to show the fourth.
Expected: the menu unfolds quickly.
Actual: the menu unfolds sloooowly.
At the time I thought FMX menus were just slow… until it recently got pointed out to me that the FMX source in fact hardcodes a delay of 500ms. As such, if you require quickly unfurling menus, just take a copy of FMX.Menus.pas and change the value assigned to FDelay in the constructor for TAutopopupMenuTimer (line 575 in XE5 RTM).
That said, ideally, the correct value would be got from the OS; for Windows, the API function to call is SystemParametersInfo:
uses WinApi.Windows; function GetMenuShowDelay: Integer; var Value: DWORD; begin SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, @Value, 0); Result := Value; end;
To be honest, I’m not sure what the OS X equivalent (if there is one) is, so if anyone knows, feel free to tell all in the comments…