]> SALOME platform Git repositories - modules/yacs.git/blobdiff - src/genericgui/EditionContainer.cxx
Salome HOME
GUI for HP containers.
[modules/yacs.git] / src / genericgui / EditionContainer.cxx
index 18d02683466ef1d05b940b222194b40e72262f21..f42585b8860d8312bce17a8bec77b3ab11cc8b1e 100644 (file)
@@ -22,7 +22,7 @@
 //#define _DEVDEBUG_
 #include "YacsTrace.hxx"
 
-#include "FormContainer.hxx"
+#include "FormContainerDecorator.hxx"
 #include "QtGuiContext.hxx"
 #include "guiObservers.hxx"
 #include "Proc.hxx"
@@ -36,17 +36,12 @@ using namespace YACS;
 using namespace YACS::HMI;
 using namespace YACS::ENGINE;
 
-EditionContainer::EditionContainer(Subject* subject,
-                                   QWidget* parent,
-                                   const char* name)
-  : ItemEdition(subject, parent, name)
+EditionContainer::EditionContainer(Subject* subject, QWidget* parent, const char* name):ItemEdition(subject, parent, name)
 {
-  _wContainer = new FormContainer(this);
+  _wContainer = new FormContainerDecorator(getContainer(),this);
   _wid->gridLayout1->addWidget(_wContainer);
-  connect(_wContainer->cb_resource, SIGNAL(mousePressed()),
-          this, SLOT(fillContainerPanel()));
-  connect(_wContainer->tb_container, SIGNAL(toggled(bool)),
-          this, SLOT(fillContainerPanel())); // --- to update display of current selection
+  connect(_wContainer, SIGNAL(resourceMousePressed()), this, SLOT(fillContainerPanel()));
+  connect(_wContainer->tb_container, SIGNAL(toggled(bool)), this, SLOT(fillContainerPanel())); // --- to update display of current selection
   _wContainer->tb_container->toggle();
 }
 
@@ -62,7 +57,7 @@ void EditionContainer::update(GuiEvent event, int type, Subject* son)
     {
     case RENAME:
     case UPDATE:
-      _wContainer->le_name->setText((son->getName()).c_str());
+      _wContainer->setName(son->getName());
       fillContainerPanel();
       break;
     default:
@@ -73,9 +68,7 @@ void EditionContainer::update(GuiEvent event, int type, Subject* son)
 void EditionContainer::fillContainerPanel()
 {
   DEBTRACE("EditionContainer::fillContainerPanel");
-  SubjectContainer *scont = dynamic_cast<SubjectContainer*>(_subject);
-  YASSERT(scont);
-  _wContainer->FillPanel(scont->getContainer());
+  _wContainer->FillPanel(getContainer());
 }
 
 void EditionContainer::onApply()
@@ -99,3 +92,10 @@ void EditionContainer::onCancel()
   _wContainer->onCancel();
   ItemEdition::onCancel();
 }
+
+YACS::ENGINE::Container *EditionContainer::getContainer()
+{
+  SubjectContainerBase *scont(dynamic_cast<SubjectContainerBase*>(_subject));
+  YASSERT(scont);
+  return scont->getContainer();
+}