Salome HOME
Stream Links show
[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  public slots:
47    void addToStudy();
48
49  protected:
50     void viewportMouseMoveEvent(QMouseEvent* theEvent);
51     void viewportMouseReleaseEvent(QMouseEvent* theEvent); 
52     void viewportMousePressEvent(QMouseEvent* theEvent); 
53
54     SUPERVGUI_Main* main;
55     QPopupMenu*     myPopup;
56     QPopupMenu*     myViewPopup;
57     bool myIsPanActivated;
58     int myAddStudyItem;
59
60  private:
61     int myDx;
62     int myDy;
63     int myLastX;
64     int myLastY;
65     bool myIsDragging;
66     QCursor myCursor;
67
68     
69 };
70
71 #endif