X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_MainWindow.h;h=3294f58ac5fd276945c1cd31e6a1b36c9c9c807b;hb=fc2acc7bd36f7bff6ec1f5095bf7c44be15e2574;hp=2a71a876a00327a14758f54812ef941a43be002f;hpb=ff8ca280553ca5b69794492d5c1c4b60b180959e;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_MainWindow.h b/src/XGUI/XGUI_MainWindow.h index 2a71a876a..3294f58ac 100644 --- a/src/XGUI/XGUI_MainWindow.h +++ b/src/XGUI/XGUI_MainWindow.h @@ -6,20 +6,23 @@ class XGUI_MainMenu; class XGUI_Viewer; -class XGUI_ObjectsBrowser; +class XGUI_ActionsMgr; +class XGUI_ViewWindow; class QMdiArea; +class QMdiSubWindow; class PyConsole_EnhConsole; +class QCloseEvent; /**\class XGUI_MainWindow * \ingroup GUI * \brief Main window of the application (Desktop). * It contains: Object Browser, 3d Viewer, Python console, property panel, main menu */ -class XGUI_EXPORT XGUI_MainWindow: public QMainWindow +class XGUI_EXPORT XGUI_MainWindow : public QMainWindow { Q_OBJECT -public: + public: XGUI_MainWindow(QWidget* parent = 0); virtual ~XGUI_MainWindow(); @@ -29,12 +32,6 @@ public: return myMenuBar; } - //! Returns Object browser - XGUI_ObjectsBrowser* objectBrowser() const - { - return myObjectBrowser; - } - //! Returns MDI area QMdiArea* mdiArea() const; @@ -44,29 +41,65 @@ public: return myViewer; } - // Creates Dock widgets: Object broewser and Property panel - void createDockWidgets(); - void setPropertyPannelTitle(const QString& theTitle); - -public slots: + public slots: void showPythonConsole(); void hidePythonConsole(); - void showPropertyPanel(); - void hidePropertyPanel(); - void showObjectBrowser(); - void hideObjectBrowser(); + //! Python console can be a dock widget + void dockPythonConsole(); + //! or can be a tab in the main menu. + void undockPythonConsole(); -private: - QDockWidget* createObjectBrowser(); - QDockWidget* createPropertyPanel(); + void createSubWindow(); - XGUI_MainMenu* myMenuBar; - XGUI_ObjectsBrowser* myObjectBrowser; - QDockWidget* myPropertyPanelDock; + /// Add name of current directory into title of desktop window + void setCurrentDir(const QString& theDir, bool toUpdate = true); + + /// Add asterisk to a title of the window + void setModifiedState(bool isModified, bool toUpdate = true); + + /// Returns current state of modification + bool isModifiedState() const { return myIsModified; } + + void updateTitle(); + + private slots: + void cascadeWindows(); + void onViewCreated(XGUI_ViewWindow* theWindow); + void onDeleteView(XGUI_ViewWindow* theWindow); + void activateView(); + void onViewActivated(QMdiSubWindow* theSubWnd); + +signals: + void exitKeySequence(); + + protected: + void closeEvent(QCloseEvent* event); + void createMainMenu(); + private: + XGUI_MainMenu* myMenuBar; XGUI_Viewer* myViewer; + QString myTitle; + QString myCurrentDir; + bool myIsModified; + PyConsole_EnhConsole* myPythonConsole; }; +class XGUI_EXPORT CloseEventWatcher : public QObject +{ +Q_OBJECT + + public: + CloseEventWatcher(QObject* theParent); + +signals: + void widgetClosed(); + + protected: + bool eventFilter(QObject *obj, QEvent *); + +}; + #endif