26#ifndef SYMBOLSHORTCUTDIALOG_H
27#define SYMBOLSHORTCUTDIALOG_H
32#include <wx/stattext.h>
55 using UsageLookup = std::function<wxString(
const wxString &rawShortcut)>;
58 const wxString ¤tShortcut,
UsageLookup usage);
79 const wxString &rawShortcut);
86 std::vector<wxm::SymbolShortcut> shortcuts,
87 const wxString &symbol);
90 void OnCharHook(wxKeyEvent &event);
91 void OnRemove(wxCommandEvent &event);
97 wxStaticText *m_shortcutText;
98 wxStaticText *m_warning;
Keyboard shortcuts that type a symbol into the worksheet (GH #2578).
Asks the user to press the keys that should type a symbol.
Definition: SymbolShortcutDialog.h:50
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 th...
Definition: SymbolShortcutDialog.cpp:163
bool RecordKey(const wxKeyEvent &event)
Records a key press as if the user had pressed it.
Definition: SymbolShortcutDialog.cpp:85
std::function< wxString(const wxString &rawShortcut)> UsageLookup
Describes what a shortcut is already used for: a menu entry's or another symbol's name,...
Definition: SymbolShortcutDialog.h:55
static wxString MenuItemUsingShortcut(const wxMenuBar *menuBar, const wxString &rawShortcut)
What the menu bar already uses this shortcut for.
Definition: SymbolShortcutDialog.cpp:149
static wxMenuBar * FindMenuBar(wxWindow *window)
The menu bar of the main window window belongs to, if any.
Definition: SymbolShortcutDialog.cpp:118
const wxString & GetShortcut() const
The recorded shortcut, in the raw form wxm::SymbolShortcut stores.
Definition: SymbolShortcutDialog.h:64