1 #ifndef XGUI_MainMenu_H
2 #define XGUI_MainMenu_H
10 class XGUI_MenuGroupPanel;
18 /**\class XGUI_MainMenu
20 * \brief Class for creation of main menu (set of workbenches)
22 class XGUI_MainMenu: public QObject
26 XGUI_MainMenu(XGUI_MainWindow *parent);
27 virtual ~XGUI_MainMenu();
29 //! Creates and adds a new workbench (menu group) with the given name and returns it.
30 XGUI_Workbench* addWorkbench(const QString& theId, const QString& theText = "");
32 //! Returns workbench (menu group) by the given name.
33 XGUI_Workbench* findWorkbench(const QString& theId);
35 //! Returns General page (predefined workbench)
36 XGUI_Workbench* generalPage() const { return myGeneralPage; }
38 //! Rerturns last created workbench in dock widget container
39 QDockWidget* getLastDockWindow() const { return myMenuTabs.last(); }
41 //! Returns already created command by its ID
42 XGUI_Command* feature(const QString& theId) const;
44 //! Returns list of created commands
45 QList<XGUI_Command*> features() const;
48 virtual bool eventFilter(QObject *theWatched, QEvent *theEvent);
51 XGUI_MainWindow* myDesktop;
52 QList<QDockWidget*> myMenuTabs;
53 XGUI_Workbench* myGeneralPage;