Gadgets > Rogue Wave Views Gadgets > Understanding Gadgets > Common Gadget Properties > Associating a Mnemonic with a Gadget Label
 
Associating a Mnemonic with a Gadget Label
A gadget can be associated with a mnemonic. A mnemonic is an underlined letter in a gadget label that you can use as a keyboard shortcut to activate the gadget.
To associate a mnemonic with a gadget label, type a caret (^) before the letter that you want to use as a mnemonic:
gadget->setLabel("^File");
char mnemo = gadget->getMnemonic();
Note: To type a caret (^) inside a gadget label, use the Escape sequence: \^.
You can have a different mnemonic depending on the language you use. You could, for example, have a special entry in your language database (.dbm file) such as:
Message: &MenuPrinterSetup
en_US: Printer ^Setup
en_Fr: ^Configuration imprimante
In French, the letter used as the mnemonic is “C” whereas it is “S” in English.

Version 6.0
Copyright © 2015, Rogue Wave Software, Inc. All Rights Reserved.