2 * \file Menubar_pimpl.C
3 * Copyright 1999-2001 The LyX Team.
4 * See the file COPYING.
6 * \author Lars Gullik Bjønnes, larsbj@lyx.org
14 #pragma implementation
17 #include "Menubar_pimpl.h"
18 #include "MenuBackend.h"
19 #include "LyXAction.h"
23 #include "FloatList.h"
24 #include "support/lstrings.h"
25 #include "support/LAssert.h"
30 #include "QLPopupMenu.h"
42 Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mbe)
43 : owner_(static_cast<QtView*>(view)), menubackend_(mbe)
45 Menu::const_iterator m = mbe.getMenubar().begin();
46 Menu::const_iterator end = mbe.getMenubar().end();
47 for (; m != end; ++m) {
48 pair<int, QLPopupMenu *> menu =
49 createMenu(owner_->menuBar(), &(*m), this, true);
50 name_map_[m->submenuname()] = menu.second;
55 void Menubar::Pimpl::openByName(string const & name)
57 NameMap::const_iterator const cit = name_map_.find(name);
58 if (cit == name_map_.end())
61 // this will have to do I'm afraid.
62 cit->second->exec(QCursor::pos());