Alex40 5 Posted June 20, 2023 (edited) Hello, I am using Rad Studio 10.3 I am currently developing and adapting FMX Android version of already developed FMX Windows Application. In the Application we use TPopupMenu for hidden right click menus on many places. For some reason when MyPopupMenu.PopUp is called the app crashes on Android (Andriud 12 and Android 13). As far as I know it is the same situation with the iOS version which is also in progress. My question is: Is it possible to use TPopMenu for Android and iOS or there si an alternative? Has anybody used this Libray TRichView ? --> https://www.trichview.com/forums/viewtopic.php?p=41518 This what I've read there: Thank you for your time in advance! Edited June 21, 2023 by Alex40 Share this post Link to post
Guest Posted June 20, 2023 It is interesting how NOTHING ever comes easy when trying to code for an Android FMX (and probably iOS) project. I have been Android coding using FMX for over six years (23 years coding VCL projects). You fight each and every step. It is interesting that even using Embarcadero's example (https://docwiki.embarcadero.com/CodeExamples/Alexandria/en/FMXTPopupMenu_(Delphi)) to program a simple button/popup menu project does not work. And the testimony from someone stating in your link "FireMonkey for Android does not suppot TPopupMenu" flies opposite from the Embarcadero link that I listed which is perplexing. Good luck. Share this post Link to post
programmerdelphi2k 237 Posted June 20, 2023 (edited) @Alex40 For me PopUp works as expected in Android 11 (64bits) / RAD Studio 11.3 TForm1 = class(TForm) Popup1: TPopup; Button1: TButton; Button2: TButton; Button3: TButton; procedure FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure Button1Click(Sender: TObject); procedure FormTap(Sender: TObject; const Point: TPointF); ... implementation {$R *.fmx} uses FMX.DialogService; procedure TForm1.Button1Click(Sender: TObject); begin TDialogService.ShowMessage('hello, Im ' + TButton(Sender).Name); // Popup1.IsOpen := false; end; procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); // desktop begin if Button = TMouseButton.mbRight then Popup1.IsOpen := true; // Embarcadero recomend "IsOpen = true/false"... end; procedure TForm1.FormTap(Sender: TObject; const Point: TPointF); // mobile begin Popup1.IsOpen := true; end; screen-20230620-155343.mp4 Edited June 20, 2023 by programmerdelphi2k 1 Share this post Link to post
Dave Nottage 557 Posted June 20, 2023 45 minutes ago, programmerdelphi2k said: For me PopUp works as expected That's an alternative, but the discussion was about whether or not TPopupMenu works. 1 hour ago, TazKy said: "FireMonkey for Android does not suppot TPopupMenu" flies opposite from the Embarcadero link that I listed The documentation is incorrect, the advice on the TRichView forum is correct - it's not supported on Android (or iOS) 1 Share this post Link to post
programmerdelphi2k 237 Posted June 20, 2023 (edited) 6 hours ago, Alex40 said: My question is: Is it possible to use TPopMenu for Android and iOS or there si an alternative? for sure this can be seen on Pallete of component ... Edited June 20, 2023 by programmerdelphi2k Share this post Link to post
Dave Nottage 557 Posted June 20, 2023 1 minute ago, programmerdelphi2k said: for sure this can be seen on Pallete of component ... Unfortunately, just because it's on the palette when the platform is selected does not mean it works on that platform - it just means the platform attribute is set on the component. Share this post Link to post
programmerdelphi2k 237 Posted June 20, 2023 (edited) Unfortunately, just because IS IN THE Documentation, does not mean that is true! Edited June 20, 2023 by programmerdelphi2k Share this post Link to post
Dave Nottage 557 Posted June 20, 2023 7 minutes ago, programmerdelphi2k said: Unfortunately, just because IS IN THE Documentation, does not mean that is true! Yes, like I said earlier: 53 minutes ago, Dave Nottage said: The documentation is incorrect 1 Share this post Link to post
Alex40 5 Posted June 21, 2023 Thank you all for your replies! I really wanted to make sure that I am not wasting time in dublicating my logic into alternative components for no reason and that TPopupMenu could work on Android and iOS somehow. From what I concluded I should continue using alternatives. I started with TListbox, but I will give a try to the TPopUp component and will see how it handles all the processes. To me it looks like it is more flexible than the TListBox which is a good sign. Share this post Link to post
programmerdelphi2k 237 Posted June 21, 2023 (edited) 5 hours ago, Alex40 said: I will give a try to the TPopUp component you can use PopUp (it is a FORM behind scene) with any other control into it, including your TListBox! Edited June 21, 2023 by programmerdelphi2k 1 Share this post Link to post
Alex40 5 Posted June 21, 2023 2 hours ago, programmerdelphi2k said: you can use PopUp (it is a FORM behind scene) with any other control into it, including your TListBox! Yeah, I got that, thanks, I chose to use buttons directly (as your example) instead of listbox with items. So far TPopUp does work really nice for the purpose I need it. For now I definetely stay with it. 1 Share this post Link to post