1 #ifndef XGUI_MainMenu_H
2 #define XGUI_MainMenu_H
11 class XGUI_MainWindow;
13 class XGUI_MenuGroupPanel;
21 /**\class XGUI_MainMenu
23 * \brief Class for creation of main menu (set of workbenches)
25 class XGUI_EXPORT XGUI_MainMenu: public QWidget
30 //TODO(sbh, vsv): Move to the settings
38 XGUI_MainMenu(XGUI_MainWindow *parent);
39 virtual ~XGUI_MainMenu();
41 //! Creates and adds a new workbench (menu group) with the given name and returns it.
42 XGUI_Workbench* addWorkbench(const QString& theId, const QString& theText = "");
44 //! Returns workbench (menu group) by the given name.
45 XGUI_Workbench* findWorkbench(const QString& theId) const;
47 //! Returns General page (predefined workbench)
48 XGUI_MenuGroupPanel* generalPage() const { return myGeneralPage; }
50 //! Rerturns last created workbench in dock widget container
51 //QDockWidget* getLastDockWindow() const;
53 //! Returns already created command by its ID
54 XGUI_Command* feature(const QString& theId) const;
56 //! Returns list of created commands
57 QList<XGUI_Command*> features() const;
59 QList<XGUI_Workbench*> workbenches() const;
61 virtual bool eventFilter(QObject *theWatched, QEvent *theEvent);
63 //! Displays given console as a tab in the workbench
64 void insertConsole(QWidget*);
65 //! Removes already created tab with python console
68 int menuItemSize() const;
69 int menuItemRowsCount() const;
70 int menuHeight() const;
73 XGUI_MainWindow* myDesktop;
74 QTabWidget* myMenuTabs;
75 XGUI_MenuGroupPanel* myGeneralPage;
77 QMap<XGUI_Command*, bool> myCommandState;