1 #ifndef XGUI_MainMenu_H
2 #define XGUI_MainMenu_H
11 class XGUI_MenuGroupPanel;
19 /**\class XGUI_MainMenu
21 * \brief Class for creation of main menu (set of workbenches)
23 class XGUI_EXPORT XGUI_MainMenu: public QObject
27 XGUI_MainMenu(XGUI_MainWindow *parent);
28 virtual ~XGUI_MainMenu();
30 //! Creates and adds a new workbench (menu group) with the given name and returns it.
31 XGUI_Workbench* addWorkbench(const QString& theId, const QString& theText = "");
33 //! Returns workbench (menu group) by the given name.
34 XGUI_Workbench* findWorkbench(const QString& theId);
36 //! Returns General page (predefined workbench)
37 XGUI_Workbench* generalPage() const { return myGeneralPage; }
39 //! Rerturns last created workbench in dock widget container
40 QDockWidget* getLastDockWindow() const { return myMenuTabs.last(); }
42 //! Returns already created command by its ID
43 XGUI_Command* feature(const QString& theId) const;
45 //! Returns list of created commands
46 QList<XGUI_Command*> features() const;
49 virtual bool eventFilter(QObject *theWatched, QEvent *theEvent);
52 XGUI_MainWindow* myDesktop;
53 QList<QDockWidget*> myMenuTabs;
54 XGUI_Workbench* myGeneralPage;