X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_MainMenu.h;h=4c3f0ec675cc2821cd6730120a0cef534cd7fd9a;hb=4224f4dbe7ceaefe74b5d6b79a5840a9f5df2d7a;hp=0fed1a07ff64a11c83d68665cd2b1e11b11aac21;hpb=de0f49686ec6655ddc5816c8fa5383964662aec4;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_MainMenu.h b/src/XGUI/XGUI_MainMenu.h index 0fed1a07f..4c3f0ec67 100644 --- a/src/XGUI/XGUI_MainMenu.h +++ b/src/XGUI/XGUI_MainMenu.h @@ -5,6 +5,7 @@ #include #include #include +#include class XGUI_Command; class XGUI_MainWindow; @@ -17,14 +18,14 @@ class QAction; class QDockWidget; class QEvent; - /**\class XGUI_MainMenu * \ingroup GUI * \brief Class for creation of main menu (set of workbenches) */ -class XGUI_EXPORT XGUI_MainMenu: public QObject +class XGUI_EXPORT XGUI_MainMenu: public QWidget { -Q_OBJECT + Q_OBJECT + public: XGUI_MainMenu(XGUI_MainWindow *parent); virtual ~XGUI_MainMenu(); @@ -33,13 +34,13 @@ 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; @@ -47,18 +48,29 @@ public: //! Returns list of created commands QList features() const; -public slots: - void onFeatureChecked(bool); + virtual bool eventFilter(QObject *theWatched, QEvent *theEvent); - void saveCommandsState(); - void restoreCommandState(); + //! Displays given console as a tab in the workbench + void insertConsole(QWidget*); + //! Removes already created tab with python console + void removeConsole(); - virtual bool eventFilter(QObject *theWatched, QEvent *theEvent); + //! 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; };