1 // SUPERV SUPERVGUI : GUI for Supervisor component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SUPERVGUI_Service.h
25 // Author : Francis KLOSS
28 #ifndef SUPERVGUI_Service_H
29 #define SUPERVGUI_Service_H
32 #include "SUPERVGUI_Def.h"
33 #include <qtabwidget.h>
34 #include <qhgroupbox.h>
35 #include <qwidgetstack.h>
38 //*****************************************************
39 // Pane for Python script editing
40 //*****************************************************
41 class SUPERVGUI_PythonEditPane: public QFrame {
45 SUPERVGUI_PythonEditPane(QWidget* theParent);
46 ~SUPERVGUI_PythonEditPane() {};
48 QString getFuncName();
51 { return (myText->paragraphs() > 1); }
53 SUPERV_Strings getFunction();
54 void setFunction(SUPERV_Strings theStr);
62 QPushButton* myNextBtn;
64 // fills myPyFunctions list. called from loadFile() after user selects a file.
65 void initPyFunctions( QTextStream& );
67 // list of Python functions. filled in loadFile(), strings (functions) retrieved
69 QStringList myPyFunctions;
71 // index of currently displayed Python function
76 //*****************************************************
77 // Dialog box for node creation
78 //*****************************************************
80 class SUPERVGUI_Service: public QDialog {
84 SUPERVGUI_Service(SALOME_NamingService* ns);
90 void showEvent(QShowEvent* theEvent);
96 void tabChanged(QWidget *);
97 void addComputeNode();
98 void addFactoryNode();
101 void typeNodeSelected(int theRow);
105 QListView* components;
106 SALOME_NamingService* naming;
108 QWidgetStack* myStackWidget;
112 SUPERVGUI_PythonEditPane* myScriptPane;
114 SUPERVGUI_PythonEditPane* myInitPane;
115 SUPERVGUI_PythonEditPane* myMorePane;
116 SUPERVGUI_PythonEditPane* myNextPane;
118 QListView* myMacroPane;
121 QTabWidget* myTabPane;
124 QComboBox* myTypeCombo;
130 class SUPERVGUI_EditPythonDlg: public QDialog {
134 SUPERVGUI_EditPythonDlg(bool isLoop = false);
135 ~SUPERVGUI_EditPythonDlg() {};
137 // Not Loop functions
138 QString getFuncName()
139 { return myEditPane->getFuncName(); }
142 { return myEditPane->isDefined(); }
144 SUPERV_Strings getFunction()
145 { return myEditPane->getFunction(); }
147 void setFunction(SUPERV_Strings theStr)
148 { myEditPane->setFunction(theStr); }
151 QString getInitFuncName()
152 { return myInitPane->getFuncName(); }
154 SUPERV_Strings getInitFunction()
155 { return myInitPane->getFunction(); }
157 void setInitFunction(SUPERV_Strings theStr)
158 { myInitPane->setFunction(theStr); }
161 QString getMoreFuncName()
162 { return myMorePane->getFuncName(); }
164 SUPERV_Strings getMoreFunction()
165 { return myMorePane->getFunction(); }
167 void setMoreFunction(SUPERV_Strings theStr)
168 { myMorePane->setFunction(theStr); }
171 QString getNextFuncName()
172 { return myNextPane->getFuncName(); }
174 SUPERV_Strings getNextFunction()
175 { return myNextPane->getFunction(); }
177 void setNextFunction(SUPERV_Strings theStr)
178 { myNextPane->setFunction(theStr); }
181 SUPERVGUI_PythonEditPane* myEditPane;
182 SUPERVGUI_PythonEditPane* myInitPane;
183 SUPERVGUI_PythonEditPane* myMorePane;
184 SUPERVGUI_PythonEditPane* myNextPane;