]> SALOME platform Git repositories - modules/superv.git/blob - src/SUPERVGUI/SUPERVGUI_View.h
Salome HOME
Modify the version number of SALOME: 2.2.0.
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_View.h
1 //  SUPERV SUPERVGUI : GUI for Supervisor component
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : SUPERVGUI_View.h
8 //  Author : Vitaly SMETANNIKOV
9 //  Module : SUPERV
10
11 #ifndef SUPERVGUI_View_H
12 #define SUPERVGUI_View_H
13
14 //#include "SUPERVGUI.h"
15 #include <qpopupmenu.h>
16 #include <qscrollview.h>
17
18 //VRV: porting on Qt 3.0.5
19 #if QT_VERSION >= 0x030005
20 #include <qcursor.h> 
21 #endif
22 //VRV: porting on Qt 3.0.5
23
24 class SUPERVGUI_Main;
25
26 class SUPERVGUI_View: public QScrollView {
27   Q_OBJECT
28
29   public:
30     SUPERVGUI_View(SUPERVGUI_Main* theMain);
31     virtual ~SUPERVGUI_View();
32
33     SUPERVGUI_Main* getMain() { return main; };
34     
35     virtual void ActivatePanning();
36     virtual void ResetView();
37     virtual void setAsFromStudy(bool theToStudy);
38
39     void setPaletteBackgroundColor(const QColor& color);
40
41     void ResizeGraph( QWidget * theChild, int theX, int theY );
42
43     int getLastX();
44     int getLastY();
45
46     void addDSPopupItem();
47
48  public slots:
49    void addToStudy();
50    void changeBackground();
51
52  protected:
53     void viewportMouseMoveEvent(QMouseEvent* theEvent);
54     void viewportMouseReleaseEvent(QMouseEvent* theEvent); 
55     void viewportMousePressEvent(QMouseEvent* theEvent); 
56     bool isHavingStreamPort();
57
58     SUPERVGUI_Main* main;
59     QPopupMenu*     myPopup;
60     QPopupMenu*     myViewPopup;
61     bool myIsPanActivated;
62     int myAddStudyItem;
63
64  private:
65     int myDSItemID;
66     int myDx;
67     int myDy;
68     int myLastX;
69     int myLastY;
70     bool myIsDragging;
71     QCursor myCursor;
72
73     
74 };
75
76 #endif