X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_ViewWindow.h;h=65c2ae273cc87b9c50a25f7636d97de8515aff75;hb=a3b2736968186ac435b1e05e530c40becbc82301;hp=0c3ae8a1766f7a266634ab9cb198f90ad9750d5a;hpb=b948502434f1af72184656e478095dae3fe00f96;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_ViewWindow.h b/src/XGUI/XGUI_ViewWindow.h index 0c3ae8a17..65c2ae273 100644 --- a/src/XGUI/XGUI_ViewWindow.h +++ b/src/XGUI/XGUI_ViewWindow.h @@ -1,6 +1,7 @@ #ifndef XGUI_ViewWindow_H #define XGUI_ViewWindow_H +#include "XGUI.h" #include "XGUI_Constants.h" #include "XGUI_ViewBackground.h" @@ -27,7 +28,7 @@ class QMdiSubWindow; It contains a view port object (drawing area) and toolbars for view camera and window management. Also it managements events in view port */ -class XGUI_ViewWindow: public QFrame +class XGUI_EXPORT XGUI_ViewWindow: public QFrame { Q_OBJECT public: @@ -86,6 +87,15 @@ public: //! Sets the current view window closable or not void setClosable( const bool isClosable ) { myClosable = isClosable; } + //! Enable/Disable drawing of ribbon line + void enableDrawMode(bool toEnable) { myEnableDrawMode = toEnable; } + + //! Returns true if ribbon line drawing enabled + bool isDrawModeEnabled() const { return myEnableDrawMode; } + + //! Updates drawing mode in the view window + void updateEnabledDrawMode(); + signals: //! Emited whien view transformation operation is started void vpTransformationStarted(XGUI_ViewWindow::OperationType type); @@ -174,17 +184,19 @@ public slots: //! Reset point of view void reset(); + void windowActivated(); -protected: - virtual void resizeEvent(QResizeEvent* theEvent); + void windowDeactivated(); +protected: virtual void changeEvent(QEvent* theEvent); - virtual void enterEvent(QEvent* theEvent); - virtual void leaveEvent(QEvent* theEvent); - virtual bool eventFilter(QObject *theObj, QEvent *theEvent); + virtual void showEvent(QShowEvent* theEvent); + + virtual void contextMenuEvent(QContextMenuEvent* theEvent); + private slots: void onClose(); void onMinimize(); @@ -265,6 +277,7 @@ private: bool myIsKeyFree; bool myEventStarted; // set when transformation is in process bool myClosable; + bool myIsActive; QCursor myCursor; @@ -291,21 +304,19 @@ class ViewerToolbar: public QToolBar { Q_OBJECT public: - ViewerToolbar(QWidget* theParent, XGUI_ViewPort* thePort) - : QToolBar(theParent), myVPort(thePort) - { - setBackgroundRole(QPalette::NoRole); - setAttribute(Qt::WA_NoSystemBackground); - setAttribute(Qt::WA_PaintOnScreen); - } + ViewerToolbar(QWidget* theParent, XGUI_ViewPort* thePort); - void repaintBackground(); +protected slots: + void onViewPortResized() { myResize = true; } protected: virtual void paintEvent(QPaintEvent* theEvent); + + private: XGUI_ViewPort* myVPort; + bool myResize; }; //****************************************************** @@ -318,19 +329,17 @@ class ViewerLabel: public QLabel { Q_OBJECT public: - ViewerLabel(QWidget* theParent, XGUI_ViewPort* thePort) - : QLabel(theParent), myVPort(thePort) - { - setAttribute(Qt::WA_NoSystemBackground); - } + ViewerLabel(QWidget* theParent, XGUI_ViewPort* thePort); - void repaintBackground(); +protected slots: + void onViewPortResized() { myResize = true; } protected: virtual void paintEvent(QPaintEvent* theEvent); private: XGUI_ViewPort* myVPort; + bool myResize; }; #endif