Salome HOME
This commit was generated by cvs2git to create branch 'IMPORT'.
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_View.h
1 //  File      : SUPERVGUI_View.h
2 //  Created   : 24 / 10 / 2002
3 //  Author    : Vitaly SMETANNIKOV
4 //  Project   : SALOME 
5 //  Module    :  SUPERVGUI
6 //  Copyright : Open CASCADE 
7
8
9 #ifndef SUPERVGUI_View_H
10 #define SUPERVGUI_View_H
11
12 //#include "SUPERVGUI.h"
13 #include <qpopupmenu.h>
14 #include <qscrollview.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_View: public QScrollView {
25   Q_OBJECT
26
27   public:
28     SUPERVGUI_View(SUPERVGUI_Main* theMain);
29     virtual ~SUPERVGUI_View();
30
31     SUPERVGUI_Main* getMain() { return main; };
32     
33     virtual void ActivatePanning();
34     virtual void ResetView();
35     virtual void setAsFromStudy(bool theToStudy);
36
37     void setPaletteBackgroundColor(const QColor& color);
38
39     void ResizeGraph( QWidget * theChild, int theX, int theY );
40
41     int getLastX();
42     int getLastY();
43
44  public slots:
45    void addToStudy();
46
47  protected:
48     void viewportMouseMoveEvent(QMouseEvent* theEvent);
49     void viewportMouseReleaseEvent(QMouseEvent* theEvent); 
50     void viewportMousePressEvent(QMouseEvent* theEvent); 
51
52     SUPERVGUI_Main* main;
53     QPopupMenu*     myPopup;
54     QPopupMenu*     myViewPopup;
55     bool myIsPanActivated;
56     int myAddStudyItem;
57
58  private:
59     int myDx;
60     int myDy;
61     int myLastX;
62     int myLastY;
63     bool myIsDragging;
64     QCursor myCursor;
65
66     
67 };
68
69 #endif