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 XGUI_MainMenu(XGUI_MainWindow *parent);
31 virtual ~XGUI_MainMenu();
33 //! Creates and adds a new workbench (menu group) with the given name and returns it.
34 XGUI_Workbench* addWorkbench(const QString& theId, const QString& theText = "");
36 //! Returns workbench (menu group) by the given name.
37 XGUI_Workbench* findWorkbench(const QString& theId) const;
39 //! Returns General page (predefined workbench)
40 XGUI_MenuGroupPanel* generalPage() const
45 //! Rerturns last created workbench in dock widget container
46 //QDockWidget* getLastDockWindow() const;
48 //! Returns already created command by its ID
49 XGUI_Command* feature(const QString& theId) const;
51 //! Returns list of created commands
52 QList<XGUI_Command*> features() const;
54 virtual bool eventFilter(QObject *theWatched, QEvent *theEvent);
56 //! Displays given console as a tab in the workbench
57 void insertConsole(QWidget*);
58 //! Removes already created tab with python console
61 //! Defines size of menu item.
62 //! In the future this value should be extracted from the preferences.
63 int menuItemSize() const;
64 //! Defines number of menu item rows.
65 //! In the future this value should be extracted from the preferences.
66 int menuItemRowsCount() const;
67 //! Defines height of the main menu. (Number of rows * row height)
68 int menuHeight() const;
70 void updateFromResources();
73 XGUI_MainWindow* myDesktop;
74 QTabWidget* myMenuTabs;
75 XGUI_MenuGroupPanel* myGeneralPage;
76 QList<XGUI_Workbench*> myWorkbenches;
78 QMap<XGUI_Command*, bool> myCommandState;