* * *

Author Topic: Don't use & as accelerator char in MenuItem  (Read 428 times)

Alextp

  • Hero Member
  • *****
  • Posts: 635
    • UVviewsoft
Don't use & as accelerator char in MenuItem
« on: June 12, 2018, 08:58:51 am »
How to disable & as accelerator char in MenuItem, so & is shown as usual caption char?
Only to double it as &&? Not ok.

For all widgetsets.

wp

  • Hero Member
  • *****
  • Posts: 4726
Re: Don't use & as accelerator char in MenuItem
« Reply #1 on: June 12, 2018, 09:12:05 am »
What do you mean with "not ok"? Not acceptable? Not working?

Doubling the "&" in the menuitem caption does show the "&" for me (Win 10)
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Alextp

  • Hero Member
  • *****
  • Posts: 635
    • UVviewsoft
Re: Don't use & as accelerator char in MenuItem
« Reply #2 on: June 12, 2018, 10:16:33 am »
I mean- its not nice trick. Better to have option in TMenuItem. But ok, used && now.

wp

  • Hero Member
  • *****
  • Posts: 4726
Re: Don't use & as accelerator char in MenuItem
« Reply #3 on: June 12, 2018, 10:40:35 am »
I mean- its not nice trick. Better to have option in TMenuItem. But ok, used && now.
It is the Delphi way, and in the end it comes from Windows (DrawText, DT_HIDEPREFIX, https://msdn.microsoft.com/en-us/library/windows/desktop/dd162498(v=vs.85).aspx).

When there were an option in TMenuItem then how would you handle the case of having the underlined accelerator character together with a normal "&" in the same menu item?
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus