X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_MainMenu.h;h=50c19c8a985e6c2b6ccc54f0f16dbe6d407044b0;hb=19bc85698899d6bee8704e7b0953ee045b0eb66f;hp=028f73b12a87c24c5225017196633afc41044f08;hpb=275e39f8c9408e23882702f27f0d561193caeeb3;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_MainMenu.h b/src/XGUI/XGUI_MainMenu.h index 028f73b12..50c19c8a9 100644 --- a/src/XGUI/XGUI_MainMenu.h +++ b/src/XGUI/XGUI_MainMenu.h @@ -1,8 +1,11 @@ #ifndef XGUI_MainMenu_H #define XGUI_MainMenu_H +#include "XGUI.h" #include #include +#include +#include class XGUI_Command; class XGUI_MainWindow; @@ -13,15 +16,17 @@ class QTabWidget; class QLabel; class QAction; class QDockWidget; +class QEvent; /**\class XGUI_MainMenu * \ingroup GUI * \brief Class for creation of main menu (set of workbenches) */ -class XGUI_MainMenu: public QObject +class XGUI_EXPORT XGUI_MainMenu : public QWidget { Q_OBJECT -public: + + public: XGUI_MainMenu(XGUI_MainWindow *parent); virtual ~XGUI_MainMenu(); @@ -29,18 +34,48 @@ public: XGUI_Workbench* addWorkbench(const QString& theId, const QString& theText = ""); //! Returns workbench (menu group) by the given name. - XGUI_Workbench* findWorkbench(const QString& theId); + XGUI_Workbench* findWorkbench(const QString& theId) const; //! Returns General page (predefined workbench) - XGUI_Workbench* generalPage() const { return myGeneralPage; } + XGUI_MenuGroupPanel* generalPage() const + { + return myGeneralPage; + } //! Rerturns last created workbench in dock widget container - QDockWidget* getLastDockWindow() const { return myMenuTabs.last(); } + //QDockWidget* getLastDockWindow() const; + + //! Returns already created command by its ID + XGUI_Command* feature(const QString& theId) const; + + //! Returns list of created commands + QList features() const; + + virtual bool eventFilter(QObject *theWatched, QEvent *theEvent); -private: + //! Displays given console as a tab in the workbench + void insertConsole(QWidget*); + //! Removes already created tab with python console + void removeConsole(); + + //! Defines size of menu item. + //! In the future this value should be extracted from the preferences. + int menuItemSize() const; + //! Defines number of menu item rows. + //! In the future this value should be extracted from the preferences. + int menuItemRowsCount() const; + //! Defines height of the main menu. (Number of rows * row height) + int menuHeight() const; + + void updateFromResources(); + + private: XGUI_MainWindow* myDesktop; - QList myMenuTabs; - XGUI_Workbench* myGeneralPage; + QTabWidget* myMenuTabs; + XGUI_MenuGroupPanel* myGeneralPage; + QList myWorkbenches; + + QMap myCommandState; }; #endif