2 * \file Menubar_pimpl.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS
16 #pragma implementation
19 #include "Menubar_pimpl.h"
20 #include "MenuBackend.h"
21 #include "LyXAction.h"
25 #include "FloatList.h"
26 #include "support/lstrings.h"
27 #include "support/LAssert.h"
32 #include "QLPopupMenu.h"
44 Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mbe)
45 : owner_(static_cast<QtView*>(view)), menubackend_(mbe)
47 Menu::const_iterator m = mbe.getMenubar().begin();
48 Menu::const_iterator end = mbe.getMenubar().end();
49 for (; m != end; ++m) {
50 pair<int, QLPopupMenu *> menu =
51 createMenu(owner_->menuBar(), &(*m), this, true);
52 name_map_[m->submenuname()] = menu.second;
57 void Menubar::Pimpl::openByName(string const & name)
59 NameMap::const_iterator const cit = name_map_.find(name);
60 if (cit == name_map_.end())
63 // this will have to do I'm afraid.
64 cit->second->exec(QCursor::pos());