Salome HOME
An improvement for adding a library node: it will use addNode() function, so creation...
authorasv <asv@opencascade.com>
Fri, 24 Dec 2004 13:26:26 +0000 (13:26 +0000)
committerasv <asv@opencascade.com>
Fri, 24 Dec 2004 13:26:26 +0000 (13:26 +0000)
src/SUPERVGUI/SUPERVGUI_Service.cxx
src/SUPERVGUI/SUPERVGUI_Service.h

index 0a92e1a37c3454b20f90618d5c17d1a27826b0bb..ad7a195a4db218117d255e9cf14086adcd477a62 100644 (file)
@@ -169,18 +169,18 @@ SUPERVGUI_Service::SUPERVGUI_Service(SALOME_NamingService* ns):
   myStackWidget = new QWidgetStack(aPythonPane);
 
   // other pane
-  myScriptPane = new SUPERVGUI_PythonEditPane( myStackWidget, true );
+  myScriptPane = new SUPERVGUI_PythonEditPane( myStackWidget, true, myX, myY );
   myOtherId = myStackWidget->addWidget(myScriptPane);
 
   // loop pane
   QTabWidget* aLoopTabPane = new QTabWidget(myStackWidget);
-  myInitPane = new SUPERVGUI_PythonEditPane( myStackWidget, true ); 
+  myInitPane = new SUPERVGUI_PythonEditPane( myStackWidget, true, myX, myY ); 
   aLoopTabPane->addTab(myInitPane, "Init");
 
-  myMorePane = new SUPERVGUI_PythonEditPane( myStackWidget, true );
+  myMorePane = new SUPERVGUI_PythonEditPane( myStackWidget, true, myX, myY );
   aLoopTabPane->addTab(myMorePane, "More");
 
-  myNextPane = new SUPERVGUI_PythonEditPane( myStackWidget, true );
+  myNextPane = new SUPERVGUI_PythonEditPane( myStackWidget, true, myX, myY );
   aLoopTabPane->addTab(myNextPane, "Next");
   myLoopId = myStackWidget->addWidget(aLoopTabPane);
 
@@ -652,9 +652,10 @@ void SUPERVGUI_Service::tabChanged(QWidget* theWidget) {
 //*****************************************************
 //  Pane for Python script editing
 //*****************************************************
-SUPERVGUI_PythonEditPane::SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation ) 
+SUPERVGUI_PythonEditPane::SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation, int& theX, int& theY ) 
   : myIsWithLibrary( isNodeCreation ), 
-    QFrame( theParent )
+    QFrame( theParent ),
+    myX( theX ), myY( theY )
 {
   QGridLayout* aEditLayout = new QGridLayout( this, 2, 8, 0, 6 );
 
@@ -881,7 +882,7 @@ void SUPERVGUI_PythonEditPane::autoIndentLine() {
  * This slot opens a dialog box which then "lives" by itself..
  */
 void SUPERVGUI_PythonEditPane::library() {
-  SUPERVGUI_LibDlg* aDlg = new SUPERVGUI_LibDlg( this );
+  SUPERVGUI_LibDlg* aDlg = new SUPERVGUI_LibDlg( this, myX, myY );
   aDlg->exec();
 }
 
@@ -895,20 +896,21 @@ SUPERVGUI_EditPythonDlg::SUPERVGUI_EditPythonDlg( bool isLoop )
   setCaption(tr("TIT_FUNC_PYTHON"));
   resize( 500, 250 );
   QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 4);
+  int a,b; // dummies for PythonEditPane, not used, since library = false and myX, myY are not used in PythonEditPane
   if (isLoop) {
     QTabWidget* aLoopTabPane = new QTabWidget(this);
-    myInitPane = new SUPERVGUI_PythonEditPane( this, false ); // library == false, since no creation of a node is needed here
+    myInitPane = new SUPERVGUI_PythonEditPane( this, false, a, b ); // library == false, since no creation of a node is needed here
     aLoopTabPane->addTab(myInitPane, "Init");
     
-    myMorePane = new SUPERVGUI_PythonEditPane( this, false );
+    myMorePane = new SUPERVGUI_PythonEditPane( this, false, a, b );
     aLoopTabPane->addTab(myMorePane, "More");
     
-    myNextPane = new SUPERVGUI_PythonEditPane( this, false );
+    myNextPane = new SUPERVGUI_PythonEditPane( this, false, a, b );
     aLoopTabPane->addTab(myNextPane, "Next");
 
     aMainLayout->addWidget(aLoopTabPane);    
   } else {
-    myEditPane = new SUPERVGUI_PythonEditPane( this, false );
+    myEditPane = new SUPERVGUI_PythonEditPane( this, false, a, b );
     aMainLayout->addWidget(myEditPane);
   }
   QGroupBox* aBtnBox = new QGroupBox( this );
index 0bba98c93086cb36ab04c65160bc79edbc0d41c6..1d9a5576c6b5c9005006def9214220f409b70380 100644 (file)
@@ -44,7 +44,7 @@ class SUPERVGUI_PythonEditPane: public QFrame {
   Q_OBJECT
 
 public:
-  SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation );
+  SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation, int& theX, int& theY );
   ~SUPERVGUI_PythonEditPane() {};
   
   QString getFuncName();
@@ -80,6 +80,9 @@ private:
   // in readFunction()
   QStringList  myPyFunctions; 
 
+  int& myX; // comes from SUPERVGUI_Service 
+  int& myY; // comes from SUPERVGUI_Service 
+
 };
 
 /*!
@@ -120,7 +123,7 @@ private slots:
     void loadGraph();
 
 private:
-    QListView*            components;
+    QListView* components;
     SALOME_NamingService* naming;
     int myX, myY;
     QWidgetStack* myStackWidget;