]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_ViewWindow.h
Salome HOME
Transparent background on toolbars of ViewWindow
[modules/shaper.git] / src / XGUI / XGUI_ViewWindow.h
1 #ifndef XGUI_ViewWindow_H
2 #define XGUI_ViewWindow_H
3
4 #include <QFrame>
5 #include <QIcon>
6 #include <QToolBar>
7 #include <QLabel>
8
9 #include <V3d_View.hxx>
10 #include <V3d_Viewer.hxx>
11
12 class XGUI_ViewPort;
13 class XGUI_Viewer;
14 class ViewerToolbar;
15 class ViewerLabel;
16
17 class XGUI_ViewWindow : public QFrame
18 {
19     Q_OBJECT
20 public:
21     XGUI_ViewWindow(XGUI_Viewer* theViewer, 
22                     V3d_TypeOfView theType);
23
24     virtual ~XGUI_ViewWindow();
25
26 protected:
27     virtual void resizeEvent(QResizeEvent* theEvent);
28
29     virtual void changeEvent(QEvent* theEvent);
30
31     virtual void enterEvent(QEvent* theEvent);
32     virtual void leaveEvent(QEvent* theEvent);
33
34     virtual bool eventFilter(QObject *theObj, QEvent *theEvent);
35
36 private slots:
37     void onClose();
38     void onMinimize();
39     void onMaximize();
40
41 private:
42     enum WindowState { MinimizedState, MaximizedState, NormalState };
43
44
45     XGUI_Viewer* myViewer;
46
47     QLabel* myPicture;
48     ViewerLabel* myGripWgt;
49     XGUI_ViewPort* myViewPort;
50     ViewerToolbar* myViewBar;
51     ViewerToolbar* myWindowBar;
52     QAction* myMinimizeBtn;
53     QAction* myMaximizeBtn;
54
55     QIcon MinimizeIco;
56     QIcon MaximizeIco;
57     QIcon CloseIco;
58     QIcon RestoreIco;
59     
60     bool myMoving;
61     QPoint myMousePnt;
62
63     WindowState myLastState;
64
65     //QGraphicsScene* myScene;
66 };
67
68 class ViewerToolbar : public QToolBar
69 {
70     Q_OBJECT
71 public:
72     ViewerToolbar(QWidget* theParent, XGUI_ViewPort* thePort) :
73     QToolBar(theParent), myVPort(thePort) {}
74
75 protected:
76     virtual void paintEvent( QPaintEvent* theEvent);
77
78 private:
79     XGUI_ViewPort* myVPort;
80 };
81
82 class ViewerLabel : public QLabel
83 {
84     Q_OBJECT
85 public:
86     ViewerLabel(QWidget* theParent, XGUI_ViewPort* thePort) :
87     QLabel(theParent), myVPort(thePort) {}
88
89 protected:
90     virtual void paintEvent( QPaintEvent* theEvent);
91
92 private:
93     XGUI_ViewPort* myVPort;
94 };
95
96 #endif