0

I'm using Firemonkey TMemo component in my desktop application, I hope that when the user right-clicks or Long-Taps on the Memo , the default menu will not been pop up.

Leo
  • 1,947
  • 2
  • 20
  • 37
  • May I ask why you want to prevent your users from showing a default Popup Menu? – SilverWarior Apr 11 '20 at 22:31
  • @SilverWarior My program runs on touch screen(Kiosk App). I use a TMemo to display a long article, only allowing users to scroll up and down to browse the contents of the article. So I don't want a popup menu to pop up when the user long-tap on memo component. – Leo Apr 13 '20 at 13:50
  • So why don't you then just disable the `LongTap` interactive gesture of your memo under `Touch->InteractiveGestures->LongTap` property. Granted this won't prevent opening popup menu by right click but as you said in your comment this is run on a touch based kiosk machine which I presume doesn't have mouse attached. Meaning that it would be enough. – SilverWarior Apr 13 '20 at 20:20
  • @SilverWarior, This seems like a good idea. But I tried. After setting LongTap to False, the menu can still pop up when long-pressed. – Leo Apr 25 '20 at 11:10

1 Answers1

1

This is actually easy.

Just drop a new TPopupMenu on your form and give it a good name (pmRecipe, say). Make sure not to add any menu items to it! Then simply assign it to your memo's PopupMenu property.

However, as a user of your application, I expect a context menu, so I might get annoyed by the lack of such a menu. (I'd also be annoyed by the fact that the app is FMX and not VCL and that the control isn't the native Windows EDIT control, but maybe that's just me.)

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384
  • The amount of hybrid apps in the market will make it hard to find the native edit control in an app. Users already lost that distinction. – Nasreddine Galfout Apr 11 '20 at 12:59
  • Well, personally I have spent most of my time in front of Microsoft Windows computers every day since the age of 7 (25 years ago), and I have never used a Mac or owned a smartphone, so for me the difference is huge. – Andreas Rejbrand Apr 11 '20 at 13:00
  • You are an intelligent individual. You can see the difference. I have many clients that won't even notice shades of colors I changed. let alone the time I changed the whole underlying platform and they thought it was a simple update (it still cracks me up every time). – Nasreddine Galfout Apr 11 '20 at 15:04