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);
59 void autoIndentLine();
63 QPushButton* myNextBtn;
65 // fills myPyFunctions list. called from loadFile() after user selects a file.
66 void initPyFunctions( QTextStream& );
68 // list of Python functions. filled in loadFile(), strings (functions) retrieved
70 QStringList myPyFunctions;
72 // index of currently displayed Python function
77 //*****************************************************
78 // Dialog box for node creation
79 //*****************************************************
81 class SUPERVGUI_Service: public QDialog {
85 SUPERVGUI_Service(SALOME_NamingService* ns);
91 void showEvent(QShowEvent* theEvent);
97 void tabChanged(QWidget *);
98 void addComputeNode();
99 void addFactoryNode();
100 void addInlineNode();
102 void typeNodeSelected(int theRow);
106 QListView* components;
107 SALOME_NamingService* naming;
109 QWidgetStack* myStackWidget;
113 SUPERVGUI_PythonEditPane* myScriptPane;
115 SUPERVGUI_PythonEditPane* myInitPane;
116 SUPERVGUI_PythonEditPane* myMorePane;
117 SUPERVGUI_PythonEditPane* myNextPane;
119 QListView* myMacroPane;
122 QTabWidget* myTabPane;
125 QComboBox* myTypeCombo;
131 class SUPERVGUI_EditPythonDlg: public QDialog {
135 SUPERVGUI_EditPythonDlg(bool isLoop = false);
136 ~SUPERVGUI_EditPythonDlg() {};
138 // Not Loop functions
139 QString getFuncName()
140 { return myEditPane->getFuncName(); }
143 { return myEditPane->isDefined(); }
145 SUPERV_Strings getFunction()
146 { return myEditPane->getFunction(); }
148 void setFunction(SUPERV_Strings theStr)
149 { myEditPane->setFunction(theStr); }
152 QString getInitFuncName()
153 { return myInitPane->getFuncName(); }
155 SUPERV_Strings getInitFunction()
156 { return myInitPane->getFunction(); }
158 void setInitFunction(SUPERV_Strings theStr)
159 { myInitPane->setFunction(theStr); }
162 QString getMoreFuncName()
163 { return myMorePane->getFuncName(); }
165 SUPERV_Strings getMoreFunction()
166 { return myMorePane->getFunction(); }
168 void setMoreFunction(SUPERV_Strings theStr)
169 { myMorePane->setFunction(theStr); }
172 QString getNextFuncName()
173 { return myNextPane->getFuncName(); }
175 SUPERV_Strings getNextFunction()
176 { return myNextPane->getFunction(); }
178 void setNextFunction(SUPERV_Strings theStr)
179 { myNextPane->setFunction(theStr); }
182 SUPERVGUI_PythonEditPane* myEditPane;
183 SUPERVGUI_PythonEditPane* myInitPane;
184 SUPERVGUI_PythonEditPane* myMorePane;
185 SUPERVGUI_PythonEditPane* myNextPane;