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

Method init_menu

src/laybasic/laybasic/layLayoutViewBase.cc:417–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417void
418LayoutViewBase::init_menu ()
419{
420 make_menu ();
421
422 // make the plugins create their menu items
423 for (tl::Registrar<lay::PluginDeclaration>::iterator cls = tl::Registrar<lay::PluginDeclaration>::begin (); cls != tl::Registrar<lay::PluginDeclaration>::end (); ++cls) {
424 // TODO: get rid of the const_cast hack
425 const_cast <lay::PluginDeclaration *> (&*cls)->init_menu (dispatcher ());
426 }
427
428 // if not in editable mode, hide all entries from "edit_mode" group and show all from the "view_mode" group and vice versa
429 std::vector<std::string> edit_mode_grp = menu ()->group ("edit_mode");
430 for (std::vector<std::string>::const_iterator g = edit_mode_grp.begin (); g != edit_mode_grp.end (); ++g) {
431 menu ()->action (*g)->set_visible (is_editable ());
432 }
433 std::vector<std::string> view_mode_grp = menu ()->group ("view_mode");
434 for (std::vector<std::string>::const_iterator g = view_mode_grp.begin (); g != view_mode_grp.end (); ++g) {
435 menu ()->action (*g)->set_visible (! is_editable ());
436 }
437}
438
439void
440LayoutViewBase::shutdown ()

Callers

nothing calls this directly

Calls 10

groupMethod · 0.80
beginFunction · 0.70
endFunction · 0.70
dispatcherFunction · 0.70
menuFunction · 0.70
is_editableFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
set_visibleMethod · 0.45
actionMethod · 0.45

Tested by

no test coverage detected