|
wxMaxima
|
Asks the user to press the keys that should type a symbol. More...
#include <SymbolShortcutDialog.h>
Public Member Functions | |
| SymbolShortcutDialog (wxWindow *parent, const wxString &symbol, const wxString ¤tShortcut, UsageLookup usage) | |
| const wxString & | GetShortcut () const |
| The recorded shortcut, in the raw form wxm::SymbolShortcut stores. | |
| bool | RecordKey (const wxKeyEvent &event) |
| Records a key press as if the user had pressed it. | |
Static Public Member Functions | |
| static wxString | MenuItemUsingShortcut (const wxMenuBar *menuBar, const wxString &rawShortcut) |
| What the menu bar already uses this shortcut for. | |
| static wxMenuBar * | FindMenuBar (wxWindow *window) |
The menu bar of the main window window belongs to, if any. | |
| static UsageLookup | MakeUsageLookup (wxWindow *window, std::vector< wxm::SymbolShortcut > shortcuts, const wxString &symbol) |
The usual UsageLookup: the menu entries of window's main window and the symbols in shortcuts other than symbol. | |
Asks the user to press the keys that should type a symbol.
The keys are caught before any control of the dialog sees them, so a combination like Ctrl+Alt+T is recorded instead of acting on the dialog. Enter, Escape and Tab without Ctrl or Alt keep working as usual: they aren't usable as a symbol's shortcut anyway (see wxm::IsUsableShortcut()).
The dialog only records. What the shortcut is currently used for is asked of the function passed to the constructor, which is how the dialog can warn about a clash with a menu or another symbol without knowing where the shortcuts are kept.
|
inline |
The recorded shortcut, in the raw form wxm::SymbolShortcut stores.
Empty if the user removed the shortcut.
|
static |
What the menu bar already uses this shortcut for.
The label of the menu entry it belongs to (without the "&" mnemonics), or an empty string.
| bool SymbolShortcutDialog::RecordKey | ( | const wxKeyEvent & | event | ) |
Records a key press as if the user had pressed it.
Returns whether it was a usable shortcut. The test drives the dialog through this, as synthesising real key presses is not portable.