Salome HOME
patch for correct compilation on Linux
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ProfileDlg.cxx
index 8c691004167402773c43d4c38e485fc3c3be79c7..dc40477a815b38ed5dc367b7248b5965e6fafc0f 100644 (file)
@@ -54,6 +54,14 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr
   myEditorWidget = new CurveCreator_Widget( this, NULL );
   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 +90,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 +148,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();
+}