Board index » cppbuilder » TPopupMenu automatically underlines (creates shortcut keys)

TPopupMenu automatically underlines (creates shortcut keys)


2006-05-13 06:59:00 AM
cppbuilder38
I upgraded from BC++B4 to BC++B6, and suddenly all my popup menus have
underlined letters. I don't want this.
I tried:
TPopupMenu* menu = new TPopupMenu(this);
menu->AutoHotkeys = false;
menu->AutoPopup = false;
menu->Items->AutoHotkeys = false;
menu->Items->AutoLineReduction = false;
But nothing seems to be getting rid of this. Any ideas? I hate it when
things are changed like this without a list of changes provided
somewhere.
 
 

Re:TPopupMenu automatically underlines (creates shortcut keys)

Disregard, for other people searching for the solution....
The problem was that AutoPopup was not boolean, so false actually means
Automatic in the enum.... yah, mistake on my part but upgrading Borland
has put me so far behind schedule that I'm not thinking clearly anymore
lol.
 

Re:TPopupMenu automatically underlines (creates shortcut keys)

"Sally" < XXXX@XXXXX.COM >wrote in message
Quote
I upgraded from BC++B4 to BC++B6, and suddenly all my
popup menus have underlined letters.
TPopupMenu has an AutoHotKeys property, and TMenuItem has a Shortcut
property. The AutoHotKeys property is set to maAutomatic by default.
Quote
I don't want this.
Set the AutoHotKeys property to maManual. Since the Shortcut property of
each item is already 0 by default, no accellerator should appear on a menu
item unless you explicitally assign one.
Quote
menu->AutoHotkeys = false;
menu->Items->AutoHotkeys = false;
The AutoHotKeys property is a TMenuItemAutoFlag enum, not a bool. By
assigning 'false', you are actually assigning '0', which is the same as
setting the property to maAutomatic. You should be setting the property to
maManual instead.
Also, setting the TPopupMenu's AutoHotKeys property automatically sets the
AutoHotKeys for the Items property, so you do not need to set that
separately.
Gambit
 

{smallsort}