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.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : SUPERVGUI_Service.h
25 // Author : Francis KLOSS
28 #ifndef SUPERVGUI_Service_H
29 #define SUPERVGUI_Service_H
31 #include "SUPERVGUI_Def.h"
32 #include <qtabwidget.h>
33 #include <qhgroupbox.h>
34 #include <qwidgetstack.h>
39 * Pane for Python script editing
41 class SUPERVGUI_PythonEditPane: public QFrame {
46 SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation, int& theX, int& theY );
47 ~SUPERVGUI_PythonEditPane() {};
49 QString getFuncName();
52 { return (myText->paragraphs() > 1); }
54 SUPERV_Strings getFunction();
55 void setFunction(SUPERV_Strings theStr);
58 // load all functions from an XML file into internal structures
61 // when user presses "Enter" - automatically set indentation of next line
62 void autoIndentLine();
64 // when user select another function name in combo box - fill myText with its body
65 void readFunction( int i );
67 // when user presses "Library" button - open a "Create node from Library" dialog
73 QComboBox* myFunctionsCombo;
75 // fills myPyFunctions list. called from loadFile() after user selects a file.
76 void initPyFunctions( QTextStream& );
78 // list of Python functions. filled in loadFile(), strings (functions) retrieved
80 QStringList myPyFunctions;
82 int& myX; // comes from SUPERVGUI_Service
83 int& myY; // comes from SUPERVGUI_Service
88 * Dialog box for node creation
90 class SUPERVGUI_Service: public QDialog {
95 SUPERVGUI_Service(SALOME_NamingService* ns);
101 * Do the following actions for newly created Engine's CNode:
102 * 1. Create a presentation for it (CanvasNode)
103 * 2. Place the CanvasNode to the current top-left corner or the current viewport
104 * 3. Increment the coordinates of the next CanvasNode (new nodes are "cascaded" when several of them are created at once)
105 * PS theEndNode is passed only for Loop and Switch nodes (EndLoop and EndSwitch)
107 static void addNode( SUPERV::CNode_var theNode, SUPERV::INode_var theEndNode, int& theX, int& theY );
110 void showEvent(QShowEvent* theEvent);
116 void tabChanged(QWidget *);
117 void addComputeNode();
118 void addFactoryNodeDef();
119 void addFactoryNodeCust();
120 void addInlineNode();
122 void typeNodeSelected(int theRow);
126 QListView* components;
127 SALOME_NamingService* naming;
129 QWidgetStack* myStackWidget;
133 SUPERVGUI_PythonEditPane* myScriptPane;
135 SUPERVGUI_PythonEditPane* myInitPane;
136 SUPERVGUI_PythonEditPane* myMorePane;
137 SUPERVGUI_PythonEditPane* myNextPane;
139 QListView* myMacroPane;
142 QTabWidget* myTabPane;
145 QComboBox* myTypeCombo;
151 class SUPERVGUI_EditPythonDlg: public QDialog {
156 SUPERVGUI_EditPythonDlg(bool isLoop = false);
157 ~SUPERVGUI_EditPythonDlg() {};
159 // Not Loop functions
160 QString getFuncName()
161 { return myEditPane->getFuncName(); }
164 { return myEditPane->isDefined(); }
166 SUPERV_Strings getFunction()
167 { return myEditPane->getFunction(); }
169 void setFunction(SUPERV_Strings theStr)
170 { myEditPane->setFunction(theStr); }
173 QString getInitFuncName()
174 { return myInitPane->getFuncName(); }
176 SUPERV_Strings getInitFunction()
177 { return myInitPane->getFunction(); }
179 void setInitFunction(SUPERV_Strings theStr)
180 { myInitPane->setFunction(theStr); }
183 QString getMoreFuncName()
184 { return myMorePane->getFuncName(); }
186 SUPERV_Strings getMoreFunction()
187 { return myMorePane->getFunction(); }
189 void setMoreFunction(SUPERV_Strings theStr)
190 { myMorePane->setFunction(theStr); }
193 QString getNextFuncName()
194 { return myNextPane->getFuncName(); }
196 SUPERV_Strings getNextFunction()
197 { return myNextPane->getFunction(); }
199 void setNextFunction(SUPERV_Strings theStr)
200 { myNextPane->setFunction(theStr); }
206 bool myIsLoop; // mkr : PAL12236
208 SUPERVGUI_PythonEditPane* myEditPane;
209 SUPERVGUI_PythonEditPane* myInitPane;
210 SUPERVGUI_PythonEditPane* myMorePane;
211 SUPERVGUI_PythonEditPane* myNextPane;
214 class SUPERVGUI_CustomSettings: public QDialog {
218 SUPERVGUI_CustomSettings(QListViewItem* theItem, bool isMultiSel, bool isCimpl);
219 virtual ~SUPERVGUI_CustomSettings();
235 QMultiLineEdit* commV;