X-Ray
X-Ray

Reputation: 2846

Strange popup menu issue

I'm using delphi 2009 and have created a popup menu.

object PopupMenu1: TPopupMenu
  object lmm1: TMenuItem
    Caption = 'lm/m'#178
  end
end

as soon as i have a "²" in a popup menu, it'll appear as "lm/m²(L)". using maManual for AutoHotKeys doesn't help...it still appears the same way. it's like hotkeys because each menu item gets a new one.

"lm/m² (L)" "m/m² (M)" "am/m² (N)" "bm/m² (O)"

must i use "lm/m2" instead of "lm/m²" if i want the (L) to go away?

used internationally, i'd still expect the "²" would be displayed properly.

thank you for your help!

Upvotes: 1

Views: 1050

Answers (2)

X-Ray
X-Ray

Reputation: 2846

here's the solution i devised after studying/debugging the source of the TMenuItem.InternalRethinkHotkeys and TMenuItem.GetAutoHotkeys:

object PopupMenu1: TPopupMenu
  Left = 184
  Top = 272
  object MenuItem1: TMenuItem
    AutoHotkeys = maManual
    Caption = 'lm/m'#178
  end
end

Upvotes: 2

Remy Lebeau
Remy Lebeau

Reputation: 598448

The AutoHotKeys property applies to keyboard accelerators when the ALT key is held down. What you are seeing is the TMenuItem.ShortCut property at work instead. Make sure it is set to scNone for any item you do not want "(#)" to appear on.

Upvotes: 0

Related Questions