MCPcopy Create free account
hub / github.com/KLayout/klayout / get_shortcuts

Method get_shortcuts

src/laybasic/laybasic/layAbstractMenu.cc:2075–2096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2073}
2074
2075void
2076AbstractMenu::get_shortcuts (const std::string &root, std::map<std::string, std::string> &bindings, bool with_defaults)
2077{
2078 std::vector<std::string> items = this->items (root);
2079 for (std::vector<std::string>::const_iterator i = items.begin (); i != items.end (); ++i) {
2080 if (i->size () > 0) {
2081 const AbstractMenuItem *item = find_item_exact (*i);
2082 if (item && item->action () && item->action ()->is_visible ()) {
2083 if (item->has_submenu ()) {
2084 // a menu must be listed (so it can be hidden), but does not have a shortcut
2085 // but we don't include special menus
2086 if (i->at (0) != '@') {
2087 bindings.insert (std::make_pair (*i, std::string ()));
2088 }
2089 get_shortcuts (*i, bindings, with_defaults);
2090 } else if (! item->action ()->is_separator () && item->primary ()) {
2091 bindings.insert (std::make_pair (*i, with_defaults ? item->action ()->get_default_shortcut () : item->action ()->get_effective_shortcut ()));
2092 }
2093 }
2094 }
2095 }
2096}
2097
2098}

Callers 4

set_key_bindingsFunction · 0.80
get_key_bindingsFunction · 0.80
get_default_key_bindingsFunction · 0.80
applyMethod · 0.80

Calls 13

itemsMethod · 0.95
get_shortcutsFunction · 0.85
is_separatorMethod · 0.80
primaryMethod · 0.80
get_default_shortcutMethod · 0.80
stringFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
actionMethod · 0.45
is_visibleMethod · 0.45

Tested by

no test coverage detected