1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # Author : A. Bruneton
26 from PyQt5.QtCore import Qt
27 from PyQt5.QtWidgets import QMainWindow,QMenu, QDockWidget
28 from MainCFWidget import MainCFWidget
30 class CFDesktop(QMainWindow):
33 VIEW_TYPE = "COREFLOWS"
35 def __init__(self, sgPyQt):
36 QMainWindow.__init__(self)
42 """ Initialize is called later than __init__() so that the Desktop and the SgPyQt
43 objects can be properly initialized.
47 self._sgDesktop = self._sgPyQt.getDesktop()
61 # self.itemDelActionID = self.generateID()
62 # self.cpsActionID = self.generateID()
63 # self.addPSActionID = self.generateID()
66 # self.etudeMenuID = self.generateID()
68 def createActions(self):
70 # ca = self._sgPyQt.createAction
71 # self.itemDelAction = ca(self.itemDelActionID, "Delete selected", "Delete selected", "", "")
72 # self.cpsAction = ca(self.cpsActionID, "Clear plot set", "Clear plot set", "", "")
73 # self.addPSAction = ca(self.addPSActionID, "Add plot set", "Add plot set", "", "")
75 def createToolbars(self):
77 # self.Toolbar = self._sgPyQt.createTool(self.tr("Toolbar"))
78 # self._sgPyQt.createTool(self.fileNewAction, self.Toolbar)
79 # self._sgPyQt.createTool(self.filePrintAction, self.Toolbar)
80 # sep = self._sgPyQt.createSeparator()
81 # self._sgPyQt.createTool(sep, self.Toolbar)
82 # self._sgPyQt.createTool(self.editUndoAction, self.Toolbar)
83 # self._sgPyQt.createTool(self.editRedoAction, self.Toolbar)
85 def createMenus(self):
87 # curveMenu = self._sgPyQt.createMenu( "Plot management", -1, self.etudeMenuID, self._sgPyQt.defaultMenuGroup() )
88 # self._sgPyQt.createMenu(self.itemDelAction, curveMenu)
91 if self._mainView is None:
92 self._mainView = MainCFWidget()
93 vid = self._sgPyQt.createView(self.VIEW_TYPE, self._mainView)
96 def showCentralWidget(self):
97 if self._viewID == -1:
98 self._viewID = self.createView()
100 self._sgPyQt.activateView(self._viewID)
102 def hideCentralWidget(self):
103 if self._viewID != -1:
104 self._sgPyQt.setViewVisible(self._viewID, False)