Recent

Author Topic: [SOLVED] MEMO and window indesirable  (Read 1210 times)

bourbon

  • New Member
  • *
  • Posts: 28
[SOLVED] MEMO and window indesirable
« on: August 01, 2025, 11:48:40 am »
Hi,
When I right-click in a memo, I automatically get the window shown in the attached image.
I have to click elsewhere in the memo to make it disappear and then continue working on it.
How can I prevent this window from appearing?
I use the "onMouseDown" event to test the mouse button and perform the desired processing.
Thank you.

Note: The unwanted window is circled in red; the other components are circled in black
« Last Edit: August 01, 2025, 02:10:56 pm by bourbon »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12522
  • Debugger - SynEdit - and more
    • wiki
Re: MEMO and window indesirable
« Reply #1 on: August 01, 2025, 12:26:24 pm »
This is the "pop-up menu"

You can assign an empty popup menu to the memo.

From the "component palette" select "TPopupMenu" (2nd in "Standard") and put on form.
Then in the TMemo, search in Object Inspector for "PopupMenu" and select the "PopupMenu1" that you added.

bourbon

  • New Member
  • *
  • Posts: 28
Re: MEMO and window indesirable
« Reply #2 on: August 01, 2025, 02:09:35 pm »
It works perfectly, thank you.
But it's weird to have to add a pop-up menu when I don't need one.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12522
  • Debugger - SynEdit - and more
    • wiki
Re: [SOLVED] MEMO and window indesirable
« Reply #3 on: August 01, 2025, 04:05:25 pm »
TMemo is a "native control" => that means it is provided directly by Windows (and most other platforms).

As such, it comes exactly like Window gives it. Windows adds that context menu on its own.

You get the same menu, if you right click a TEdit. (A TMemo basically is a multi-line TEdit).


If you add your own PopupMenu (even if an empty one) then you override the OS default.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12522
  • Debugger - SynEdit - and more
    • wiki
Re: [SOLVED] MEMO and window indesirable
« Reply #4 on: August 01, 2025, 04:13:54 pm »
Mind, you also get all other normal edit stuff that Windows provides. 

Like the emoji IME => Left-Windows key and "." (dot). Windows adds that to almost everything that can get input. I don't know any simple way to prevent that (I would guess, that within the IME API there will be ways, but not easy).


If you install (Windows features) support for Arabic, or other Right-to-Left languages, then that will also reflect on TEdit/TMemo (e.g. there are keycombos to toggle them between RTL and LTR). That applies to all edits in any app on Window (except custom ones like SynEdit).
But then, if someone has support for such a language installed, they would want that.

If you install support (Windows features) for Chinese or Japanese, you get the IME for those languages, so you can enter text according to those languages.

And if an IME is active that alters the sequence of KeyDown/KeyPress/KeyUp that your edit receives.... (even for custom controls like SynEdit)


bourbon

  • New Member
  • *
  • Posts: 28
Re: [SOLVED] MEMO and window indesirable
« Reply #5 on: August 02, 2025, 09:18:36 am »
Thank you for all the details.
Is all this applicable to Linux? (I forgot to mention that I'm working on Linux.)

 

TinyPortal © 2005-2018