Salome HOME
Fix for IPAL10387 ( Supervisor viewer has no "View Operations" toolbar ) :
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_ArrayView.h
1 //  SUPERV SUPERVGUI : GUI for Supervisor component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE
4 //
5 //  File   : SUPERVGUI_ArrayView.h
6 //  Author : 
7 //  Module : SUPERV
8
9 #ifndef SUPERVGUI_ArrayView_H
10 #define SUPERVGUI_ArrayView_H
11
12 #include "SUPERVGUI_CanvasArray.h"
13 #include <qpopupmenu.h>
14 #include <qtooltip.h>
15
16 //VRV: porting on Qt 3.0.5
17 #if QT_VERSION >= 0x030005
18 #include <qcursor.h> 
19 #endif
20 //VRV: porting on Qt 3.0.5
21
22 class SUPERVGUI_Main;
23
24 class SUPERVGUI_ArrayView: public QCanvasView {
25   Q_OBJECT
26
27   public:
28     SUPERVGUI_ArrayView(SUPERVGUI_CanvasArray* theArray, SUPERVGUI_Main* theMain);
29     virtual ~SUPERVGUI_ArrayView();
30
31     SUPERVGUI_Main* getMain() const { return myMain; }
32
33     void ActivatePanning();
34     void ResetView();
35
36   public slots:
37     void addToStudy();
38     void changeBackground();
39
40   protected:
41     void resizeEvent( QResizeEvent* e);
42
43   private:
44     void contentsMousePressEvent(QMouseEvent* theEvent);
45     void contentsMouseMoveEvent(QMouseEvent* theEvent);
46     void contentsMouseReleaseEvent(QMouseEvent* theEvent);
47
48     SUPERVGUI_Main* myMain;
49     QPopupMenu*     myPopup;
50     int             myAddStudyItem;
51     int             myShowToolBarItem;
52
53     QCursor         myCursor;
54
55     QPoint   myGlobalPoint;
56
57     bool myIsPanActivated;
58
59 };
60
61 class SUPERVGUI_ToolTip: public QToolTip {
62
63   public:
64     SUPERVGUI_ToolTip(QWidget* theWidget, QToolTipGroup* theGroup = 0):
65       QToolTip(theWidget, theGroup) {}
66     ~SUPERVGUI_ToolTip() { remove(parentWidget()); }
67     
68     virtual void maybeTip(const QPoint& theP);
69 };
70
71 #endif