Salome HOME
Bugs 153, 154.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ProfileDlg.cxx
index 8c691004167402773c43d4c38e485fc3c3be79c7..e05d473911d14939d1da86de28c66755cad91319 100644 (file)
@@ -51,9 +51,19 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr
 
   addLayout(aNameLayout);
 
-  myEditorWidget = new CurveCreator_Widget( this, NULL );
+  int anActionFlags = 
+    CurveCreator_Widget::DisableNewSection | CurveCreator_Widget::DisableDetectionMode;
+  myEditorWidget = new CurveCreator_Widget( this, NULL, anActionFlags );
   addWidget( myEditorWidget, 3 );
 
+  myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this );
+  addWidget( myAddElementBox, 2 );
+
+  QBoxLayout* anAddElementLayout = new QVBoxLayout( myAddElementBox );
+  anAddElementLayout->setMargin( 0 );
+  anAddElementLayout->setSpacing( 5 );
+
+
   OCCViewer_ViewManager* aViewMgr = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 );
   myViewer = new OCCViewer_Viewer( true );
 
@@ -82,6 +92,8 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr
   connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
   connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*) ), this, SLOT( processStartedSubOperation(QWidget*) ) );
   connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) );
+
+  myAddElementBox->hide();
 }
 
 HYDROGUI_ProfileDlg::~HYDROGUI_ProfileDlg()
@@ -138,3 +150,25 @@ bool HYDROGUI_ProfileDlg::deleteEnabled()
 {
   return myEditorWidget->removeEnabled();
 }
+
+void HYDROGUI_ProfileDlg::processStartedSubOperation( QWidget* theWidget )
+{
+  myEditorWidget->setEnabled( false );
+
+  QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
+  anAddElementLayout->addWidget( theWidget );
+
+  theWidget->show();
+  myAddElementBox->show();
+}
+
+void HYDROGUI_ProfileDlg::processFinishedSubOperation( QWidget* theWidget )
+{
+  myEditorWidget->setEnabled( true );
+
+  QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
+  anAddElementLayout->removeWidget( theWidget );
+
+  theWidget->hide();
+  myAddElementBox->hide();
+}