]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Updating property pannel from the model. Preleminary integration.
authorsbh <sergey.belash@opencascade.com>
Mon, 5 May 2014 08:51:33 +0000 (12:51 +0400)
committersbh <sergey.belash@opencascade.com>
Mon, 5 May 2014 08:51:33 +0000 (12:51 +0400)
17 files changed:
src/Config/Config_FeatureMessage.h
src/Config/Config_FeatureReader.cpp
src/Config/Config_FeatureReader.h
src/ModuleBase/CMakeLists.txt
src/ModuleBase/ModuleBase_IModelWidget.h [new file with mode: 0644]
src/ModuleBase/ModuleBase_MetaWidget.cpp [new file with mode: 0644]
src/ModuleBase/ModuleBase_MetaWidget.h [new file with mode: 0644]
src/ModuleBase/ModuleBase_WidgetCustom.h
src/ModuleBase/ModuleBase_WidgetFactory.cpp
src/ModuleBase/ModuleBase_WidgetFactory.h
src/XGUI/CMakeLists.txt
src/XGUI/XGUI_Constants.h
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_PropertyPanel.cpp [new file with mode: 0644]
src/XGUI/XGUI_PropertyPanel.h [new file with mode: 0644]
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

index bcf674cee780c7f505c1496092e2bde03657e55f..99116d707e0f9be53ace04483b9d9c3b627d5dc8 100644 (file)
@@ -6,6 +6,9 @@
 \r
 #include <string>\r
 \r
+/// Event ID that feature is loaded (comes with Config_FeatureMessage)\r
+static const char * EVENT_FEATURE_LOADED = "FeatureLoaded";\r
+\r
 /*\r
  * Class to pass a feature entry extracted from xml file.\r
  * Example of the feature entry:\r
index a3b7b56f2c1214cc99788c1d842847adad5c3e1a..78e485e912d1b5e294d160c57b380e57273aff39 100644 (file)
@@ -28,7 +28,7 @@ Config_FeatureReader::Config_FeatureReader(const std::string& theXmlFile,
                                            const char* theEventGenerated)
     : Config_XMLReader(theXmlFile),
       myLibraryName(theLibraryName),
-      myEventGenerated(theEventGenerated ? theEventGenerated : "FeatureEvent")
+      myEventGenerated(theEventGenerated ? theEventGenerated : EVENT_FEATURE_LOADED)
 {
 }
 
index 12517a5df395849fdaeac3753325411305347047..e4e7c63db8590674f4feb7c61fe0688083a1c7e8 100644 (file)
@@ -38,7 +38,7 @@ private:
   std::string myLibraryName;
 
   std::list<std::string> myFeatures;
-  /// event generated on feature data sending, by default it is "FeatureEvent"
+  /// event generated on feature data sending, by default it is EVENT_FEATURE_LOADED
   const char* myEventGenerated;
 };
 
index 116353000eccf4a1440a1d408b35ebb0bd9ae324..1669689c0c7bea294a354140abb2c186770f7e89 100644 (file)
@@ -9,6 +9,8 @@ SET(PROJECT_HEADERS
        ModuleBase_WidgetFactory.h
        ModuleBase_WidgetPoint2D.h
        ModuleBase_WidgetSwitch.h
+       ModuleBase_IModelWidget.h
+       ModuleBase_MetaWidget.h
 )
 
 SET(PROJECT_SOURCES
@@ -17,6 +19,7 @@ SET(PROJECT_SOURCES
        ModuleBase_WidgetFactory.cpp
        ModuleBase_WidgetPoint2D.cpp
        ModuleBase_WidgetSwitch.cpp
+       ModuleBase_MetaWidget.cpp
 )
 
 SET(PROJECT_LIBRARIES
diff --git a/src/ModuleBase/ModuleBase_IModelWidget.h b/src/ModuleBase/ModuleBase_IModelWidget.h
new file mode 100644 (file)
index 0000000..e128dc6
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * ModuleBase_IModelWidget.h
+ *
+ *  Created on: Apr 30, 2014
+ *      Author: sbh
+ */
+
+#ifndef MODULEBASE_IMODELWIDGET_H_
+#define MODULEBASE_IMODELWIDGET_H_
+
+#include <ModuleBase.h>
+#include <QWidget>
+#include <QString>
+
+/*
+ * Common interface for widgets in the property panel.
+ * Every widget are able to save/restore data from the
+ * model and/or to contain other widgets.
+ *
+ * Also, there are some methods to simplify and accelerate
+ * searching of children.
+ */
+class ModuleBase_IModelWidget
+{
+public:
+  //! Interface for saving widget's data into the data model
+  MODULEBASE_EXPORT virtual bool storeValue() = 0;
+  //! Interface for loading widget's data from the data model
+  MODULEBASE_EXPORT virtual bool restoreValue() = 0;
+};
+
+#endif /* MODULEBASE_IMODELWIDGET_H_ */
diff --git a/src/ModuleBase/ModuleBase_MetaWidget.cpp b/src/ModuleBase/ModuleBase_MetaWidget.cpp
new file mode 100644 (file)
index 0000000..442be7d
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ *
+ */
+
+#include <ModuleBase_MetaWidget.h>
+#include <QMetaObject>
+
+#ifdef _DEBUG
+#include <iostream>
+#endif
+
+ModuleBase_MetaWidget::ModuleBase_MetaWidget(const QString& theId,
+                                               QWidget* theWrapped,
+                                               boost::shared_ptr<ModelAPI_Feature> theFeature)
+    : myId(theId), myWrappedWidget(theWrapped), myFeature(theFeature)
+{
+
+}
+
+ModuleBase_MetaWidget::~ModuleBase_MetaWidget()
+{
+
+}
+
+bool ModuleBase_MetaWidget::storeValue()
+{
+  #ifdef _DEBUG
+  std::cout << "ModuleBase_MetaWidget::storeValue"
+            << myWrappedWidget->metaObject()->className() << std::endl;
+  #endif
+  return true;
+}
+
+bool ModuleBase_MetaWidget::restoreValue()
+{
+  #ifdef _DEBUG
+  std::cout << "ModuleBase_MetaWidget::restoreValue"
+            << myWrappedWidget->metaObject()->className() << std::endl;
+  #endif
+  return true;
+}
diff --git a/src/ModuleBase/ModuleBase_MetaWidget.h b/src/ModuleBase/ModuleBase_MetaWidget.h
new file mode 100644 (file)
index 0000000..c81efee
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * ModuleBase_IModelWidget.h
+ *
+ *  Created on: Apr 30, 2014
+ *      Author: sbh
+ */
+
+#ifndef MODULEBASE_METAWIDGET_H_
+#define MODULEBASE_METAWIDGET_H_
+
+#include <ModuleBase_IModelWidget.h>
+#include <ModuleBase.h>
+
+#include <ModelAPI_Feature.h>
+
+#include <QWidget>
+#include <QString>
+
+#include <boost/shared_ptr.hpp>
+
+/*
+ *
+ */
+class ModuleBase_MetaWidget : public ModuleBase_IModelWidget
+{
+public:
+  MODULEBASE_EXPORT ModuleBase_MetaWidget(const QString& theId,
+                                           QWidget* theWrapped,
+                                           boost::shared_ptr<ModelAPI_Feature>);
+  virtual ~ModuleBase_MetaWidget();
+  //! Interface for saving widget's data into the data model
+  MODULEBASE_EXPORT virtual bool storeValue();
+  //! Interface for loading widget's data from the data model
+  MODULEBASE_EXPORT virtual bool restoreValue();
+
+private:
+  QString  myId;
+  QWidget* myWrappedWidget;
+  boost::shared_ptr<ModelAPI_Feature> myFeature;
+};
+
+#endif /* MODULEBASE_METAWIDGET_H_ */
index 471d3f5caa286339a51efe47b99fe35e3410451e..37716f31d22eda8a9d1a281064fde05272e97e3b 100644 (file)
@@ -6,6 +6,7 @@
 #define ModuleBase_WidgetCustom_H
 
 #include <ModuleBase.h>
+#include <ModuleBase_IModelWidget.h>
 
 #include <QObject>
 
index d902d0eef1e420b0978bf10c427882acbd902f3e..2fcce7cbe53bc3e3898c8f7f7a82c73a22339031 100644 (file)
@@ -6,11 +6,11 @@
  */
 
 #include <ModuleBase_WidgetFactory.h>
-
-#include <ModuleBase_WidgetSwitch.h>
-
+#include <ModuleBase_MetaWidget.h>
 #include <ModuleBase_PropPanelOperation.h>
 #include <ModuleBase_WidgetPoint2D.h>
+#include <ModuleBase_WidgetSwitch.h>
+
 #include <Config_Keywords.h>
 #include <Config_WidgetAPI.h>
 
@@ -182,6 +182,9 @@ QWidget* ModuleBase_WidgetFactory::doubleSpinBoxControl()
   aControlLay->setStretch(1, 1);
   result->setLayout(aControlLay);
   connectWidget(aBox, WDG_DOUBLEVALUE);
+  ModuleBase_MetaWidget* aWrappedWdg =
+      new ModuleBase_MetaWidget(anObjName, aBox, myOperation->feature());
+  myWidgets.append(aWrappedWdg);
   return result;
 }
 
index 404bcc057df6121892a994a9134c273ce2a3ece8..5193be3dbcf01bf874ef7f17d8687c37ddf790e3 100644 (file)
@@ -9,7 +9,10 @@
 #define ModuleBase_WidgetFactory_H_
 
 #include <ModuleBase.h>
+#include <ModuleBase_IModelWidget.h>
+
 #include <QString>
+#include <QList>
 
 class QObject;
 class QWidget;
@@ -24,6 +27,11 @@ public:
 
   void createWidget(QWidget* theParent);
 
+  QList<ModuleBase_IModelWidget*> getWrappedWidgets() const
+  {
+    return myWidgets;
+  }
+
 protected:
   //Widgets
   QWidget* createWidgetByType(const std::string& theType, QWidget* theParent = NULL);
@@ -39,7 +47,7 @@ private:
   Config_WidgetAPI* myWidgetApi;
   ModuleBase_PropPanelOperation*   myOperation;
 
-
+  QList<ModuleBase_IModelWidget*> myWidgets;
 };
 
 #endif /* ModuleBase_WidgetFactory_H_ */
index d8de8a441ad697af43190a3fe5aa38200e6af2e6..4077529979cee04914dfc31c6732d64ff6089aa3 100644 (file)
@@ -28,6 +28,7 @@ SET(PROJECT_HEADERS
     XGUI_SalomeConnector.h
     XGUI_ActionsMgr.h
     XGUI_ErrorDialog.h
+    XGUI_PropertyPanel.h
 )
 
 SET(PROJECT_AUTOMOC 
@@ -55,6 +56,7 @@ SET(PROJECT_SOURCES
     XGUI_SelectionMgr.cpp
     XGUI_ActionsMgr.cpp
     XGUI_ErrorDialog.cpp
+    XGUI_PropertyPanel.cpp
 )
 
 SET(PROJECT_RESOURCES 
index f228e092e9daf37a54bd9bcd4d213d970a74b155..9255b5239a74016f26abb017a85749228f0fbca7 100644 (file)
@@ -84,7 +84,6 @@ enum TextureMode
 const static char* PROP_PANEL = "property_panel_dock";
 const static char* PROP_PANEL_OK = "property_panel_ok";
 const static char* PROP_PANEL_CANCEL = "property_panel_cancel";
-const static char* PROP_PANEL_WDG = "property_panel_widget";
 
 };
 
index aeb0ed3c06533a771a44873994117795ae04193f..be3aa5819af841496d3911071ca1027c1acd825c 100644 (file)
@@ -45,10 +45,11 @@ bool XGUI_OperationMgr::canStartOperation(ModuleBase_Operation* theOperation)
     int anAnswer = QMessageBox::question(0, tr("Operation launch"),
                                 tr("Previous operation is not finished and will be aborted"),
                                 QMessageBox::Ok, QMessageBox::Cancel);
-    if (anAnswer == QMessageBox::Ok)
+    if (anAnswer == QMessageBox::Ok) {
       aCurrentOp->abort();
-    else
+    } else {
       aCanStart = false;
+    }
   }
   return aCanStart;
 }
diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp
new file mode 100644 (file)
index 0000000..202be90
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * XGUI_PropertyPanel.cpp
+ *
+ *  Created on: Apr 29, 2014
+ *      Author: sbh
+ */
+
+#include <XGUI_Constants.h>
+#include <XGUI_PropertyPanel.h>
+
+#include <ModuleBase_PropPanelOperation.h>
+
+#include <QWidget>
+#include <QVBoxLayout>
+#include <QFrame>
+#include <QPushButton>
+#include <QIcon>
+#include <QVBoxLayout>
+
+#ifdef _DEBUG
+#include <iostream>
+#endif
+
+XGUI_PropertyPanel::XGUI_PropertyPanel(QWidget* theParent)
+{
+  this->setWindowTitle(tr("Property Panel"));
+  QAction* aViewAct = this->toggleViewAction();
+  this->setObjectName(XGUI::PROP_PANEL);
+
+  QWidget* aContent = new QWidget(this);
+  QVBoxLayout* aMainLay = new QVBoxLayout(aContent);
+  aMainLay->setContentsMargins(3, 3, 3, 3);
+  this->setWidget(aContent);
+
+  QFrame* aFrm = new QFrame(aContent);
+  aFrm->setFrameStyle(QFrame::Sunken);
+  aFrm->setFrameShape(QFrame::Panel);
+  QHBoxLayout* aBtnLay = new QHBoxLayout(aFrm);
+  aBtnLay->setContentsMargins(0, 0, 0, 0);
+  aMainLay->addWidget(aFrm);
+
+  QPushButton* aBtn = new QPushButton(QIcon(":pictures/button_help.png"), "", aFrm);
+  aBtn->setFlat(true);
+  aBtnLay->addWidget(aBtn);
+  aBtnLay->addStretch(1);
+  aBtn = new QPushButton(QIcon(":pictures/button_ok.png"), "", aFrm);
+  aBtn->setObjectName(XGUI::PROP_PANEL_OK);
+  aBtn->setFlat(true);
+  aBtnLay->addWidget(aBtn);
+  aBtn = new QPushButton(QIcon(":pictures/button_cancel.png"), "", aFrm);
+  aBtn->setObjectName(XGUI::PROP_PANEL_CANCEL);
+  aBtn->setFlat(true);
+  aBtnLay->addWidget(aBtn);
+
+  myCustomWidget = new QWidget(aContent);
+  aMainLay->addWidget(myCustomWidget);
+  aMainLay->addStretch(1);
+}
+
+XGUI_PropertyPanel::~XGUI_PropertyPanel()
+{
+}
+
+void XGUI_PropertyPanel::setModelWidgets(const QList<ModuleBase_IModelWidget*>& theWidgets)
+{
+  myWidgets = theWidgets;
+}
+
+QWidget* XGUI_PropertyPanel::contentWidget()
+{
+  return myCustomWidget;
+}
+
+void XGUI_PropertyPanel::updateContentWidget()
+{
+  foreach(ModuleBase_IModelWidget* eachWidget, myWidgets) {
+    eachWidget->restoreValue();
+  }
+}
diff --git a/src/XGUI/XGUI_PropertyPanel.h b/src/XGUI/XGUI_PropertyPanel.h
new file mode 100644 (file)
index 0000000..92de955
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * XGUI_PropertyPanel.h
+ *
+ *  Created on: Apr 29, 2014
+ *      Author: sbh
+ */
+
+#ifndef XGUI_PROPERTYPANEL_H_
+#define XGUI_PROPERTYPANEL_H_
+
+#include <ModuleBase_IModelWidget.h>
+
+#include <QDockWidget>
+#include <QList>
+
+class XGUI_PropertyPanel: public QDockWidget
+{
+  Q_OBJECT
+public:
+  XGUI_PropertyPanel(QWidget* theParent);
+  virtual ~XGUI_PropertyPanel();
+
+  QWidget* contentWidget();
+  void setModelWidgets(const QList<ModuleBase_IModelWidget*>& theWidgets);
+
+public slots:
+  void updateContentWidget();
+
+private:
+  QWidget* myCustomWidget;
+
+  QList<ModuleBase_IModelWidget*> myWidgets;
+};
+
+#endif /* XGUI_PROPERTYPANEL_H_ */
index 60bad111dbc77e1b051e2f6df8c41965a11821cc..c14efc4ee539c0dd820ee08433404cfb8f6661d1 100644 (file)
@@ -16,7 +16,9 @@
 #include "XGUI_SalomeConnector.h"
 #include "XGUI_ActionsMgr.h"
 #include "XGUI_ErrorDialog.h"
+#include "XGUI_PropertyPanel.h"
 
+#include <Model_Events.h>
 #include <ModelAPI_PluginManager.h>
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Data.h>
@@ -52,7 +54,7 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector)
   myCurrentFile(QString()),
   myPartSetModule(NULL),
   mySalomeConnector(theConnector),
-  myPropertyPanelDock(0),
+  myPropertyPanel(0),
   myObjectBrowser(0),
   myDisplayer(0)
 {
@@ -87,27 +89,18 @@ void XGUI_Workshop::startApplication()
   Events_Loop* aLoop = Events_Loop::loop();
   aLoop->registerListener(this, Events_Error::errorID()); //!< Listening application errors.
   //TODO(sbh): Implement static method to extract event id [SEID]
-  Events_ID aFeatureId = aLoop->eventByName("FeatureEvent");
+  Events_ID aFeatureId = aLoop->eventByName(EVENT_FEATURE_LOADED);
   aLoop->registerListener(this, aFeatureId);
   Events_ID aPartSetId = aLoop->eventByName("PartSetModuleEvent");
   aLoop->registerListener(this, aPartSetId);
+  Events_ID aFeatureUpdatedId = aLoop->eventByName(EVENT_FEATURE_UPDATED);
+  aLoop->registerListener(this, aFeatureUpdatedId);
   activateModule();
   if (myMainWindow) {
     myMainWindow->show();
     updateCommandStatus();
   }
   onNew();
-  // Testing of document creation
-  //boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
-  //boost::shared_ptr<ModelAPI_Feature> aPoint1 = aMgr->rootDocument()->addFeature("Point");
-  //boost::shared_ptr<ModelAPI_Feature> aPart = aMgr->rootDocument()->addFeature("Part");
-  //aPart->execute();
-  //aMgr->setCurrentDocument(aPart->data()->docRef("PartDocument")->value());
-  //boost::shared_ptr<ModelAPI_Feature> aPoint2 = aMgr->rootDocument()->addFeature("Point");
-  //aPoint2 = aMgr->rootDocument()->addFeature("Point");
-
-  //aPart = aMgr->rootDocument()->addFeature("Part");
-  //aPart->execute();
 }
 
 //******************************************************
@@ -180,12 +173,17 @@ XGUI_Workbench* XGUI_Workshop::addWorkbench(const QString& theName)
 //******************************************************
 void XGUI_Workshop::processEvent(const Events_Message* theMessage)
 {
-  static Events_ID aFeatureId = Events_Loop::loop()->eventByName("FeatureEvent");
-  if (theMessage->eventID() == aFeatureId) {
+  static Events_ID aFeatureLoadedId = Events_Loop::loop()->eventByName(EVENT_FEATURE_LOADED);
+  if (theMessage->eventID() == aFeatureLoadedId) {
     const Config_FeatureMessage* aFeatureMsg = dynamic_cast<const Config_FeatureMessage*>(theMessage);
     addFeature(aFeatureMsg);
     return;
   }
+  static Events_ID aFeatureUpdatedId = Events_Loop::loop()->eventByName(EVENT_FEATURE_UPDATED);
+  if (theMessage->eventID() == aFeatureUpdatedId)
+  {
+    myPropertyPanel->updateContentWidget();
+  }
   const Config_PointerMessage* aPartSetMsg = dynamic_cast<const Config_PointerMessage*>(theMessage);
   if (aPartSetMsg) {
     ModuleBase_PropPanelOperation* anOperation =
@@ -201,17 +199,12 @@ void XGUI_Workshop::processEvent(const Events_Message* theMessage)
   }
   const Events_Error* anAppError = dynamic_cast<const Events_Error*>(theMessage);
   if (anAppError) {
-      emit errorOccurred(QString::fromLatin1(anAppError->description()));
-      myErrorDlg->show();
-      myErrorDlg->raise();
-      myErrorDlg->activateWindow();
+    emit errorOccurred(QString::fromLatin1(anAppError->description()));
+    myErrorDlg->show();
+    myErrorDlg->raise();
+    myErrorDlg->activateWindow();
   }
 
-#ifdef _DEBUG
-  qDebug() << "XGUI_Workshop::ProcessEvent: "
-  << "Catch message, but it can not be processed.";
-#endif
-
 }
 
 //******************************************************
@@ -222,14 +215,13 @@ void XGUI_Workshop::onOperationStarted()
 
   if(!aOperation->xmlRepresentation().isEmpty()) { //!< No need for property panel
     connectWithOperation(aOperation);
-    QWidget* aPropWidget = myPropertyPanelDock->findChild<QWidget*>(XGUI::PROP_PANEL_WDG);
-    qDeleteAll(aPropWidget->children());
 
     showPropertyPanel();
 
     ModuleBase_WidgetFactory aFactory = ModuleBase_WidgetFactory(aOperation);
-    aFactory.createWidget(aPropWidget);
-    setPropertyPannelTitle(aOperation->description());
+    aFactory.createWidget(myPropertyPanel->contentWidget());
+    myPropertyPanel->setModelWidgets(aFactory.getWrappedWidgets());
+    myPropertyPanel->setWindowTitle(aOperation->description());
   }
 }
 
@@ -305,9 +297,9 @@ void XGUI_Workshop::addFeature(const Config_FeatureMessage* theMessage)
  */
 void XGUI_Workshop::connectWithOperation(ModuleBase_Operation* theOperation)
 {
-  QPushButton* aOkBtn = myPropertyPanelDock->findChild<QPushButton*>(XGUI::PROP_PANEL_OK);
+  QPushButton* aOkBtn = myPropertyPanel->findChild<QPushButton*>(XGUI::PROP_PANEL_OK);
   connect(aOkBtn, SIGNAL(clicked()), theOperation, SLOT(commit()));
-  QPushButton* aCancelBtn = myPropertyPanelDock->findChild<QPushButton*>(XGUI::PROP_PANEL_CANCEL);
+  QPushButton* aCancelBtn = myPropertyPanel->findChild<QPushButton*>(XGUI::PROP_PANEL_CANCEL);
   connect(aCancelBtn, SIGNAL(clicked()), theOperation, SLOT(abort()));
 
   QAction* aCommand = 0;
@@ -573,53 +565,6 @@ QDockWidget* XGUI_Workshop::createObjectBrowser(QWidget* theParent)
   return aObjDock;
 }
 
-//******************************************************
-QDockWidget* XGUI_Workshop::createPropertyPanel(QWidget* theParent)
-{
-  QDockWidget* aPropPanel = new QDockWidget(theParent);
-  aPropPanel->setWindowTitle(tr("Property Panel"));
-  QAction* aViewAct = aPropPanel->toggleViewAction();
-  aPropPanel->setObjectName(XGUI::PROP_PANEL);
-
-  QWidget* aContent = new QWidget(aPropPanel);
-  QVBoxLayout* aMainLay = new QVBoxLayout(aContent);
-  aMainLay->setContentsMargins(3, 3, 3, 3);
-  aPropPanel->setWidget(aContent);
-
-  QFrame* aFrm = new QFrame(aContent);
-  aFrm->setFrameStyle(QFrame::Sunken);
-  aFrm->setFrameShape(QFrame::Panel);
-  QHBoxLayout* aBtnLay = new QHBoxLayout(aFrm);
-  aBtnLay->setContentsMargins(0, 0, 0, 0);
-  aMainLay->addWidget(aFrm);
-
-  QPushButton* aBtn = new QPushButton(QIcon(":pictures/button_help.png"), "", aFrm);
-  aBtn->setFlat(true);
-  aBtnLay->addWidget(aBtn);
-  aBtnLay->addStretch(1);
-  aBtn = new QPushButton(QIcon(":pictures/button_ok.png"), "", aFrm);
-  aBtn->setObjectName(XGUI::PROP_PANEL_OK);
-  aBtn->setFlat(true);
-  aBtnLay->addWidget(aBtn);
-  aBtn = new QPushButton(QIcon(":pictures/button_cancel.png"), "", aFrm);
-  aBtn->setObjectName(XGUI::PROP_PANEL_CANCEL);
-  aBtn->setFlat(true);
-  aBtnLay->addWidget(aBtn);
-
-  QWidget* aCustomWidget = new QWidget(aContent);
-  aCustomWidget->setObjectName(XGUI::PROP_PANEL_WDG);
-  aMainLay->addWidget(aCustomWidget);
-  aMainLay->addStretch(1);
-
-  return aPropPanel;
-}
-
-//******************************************************
-void XGUI_Workshop::setPropertyPannelTitle(const QString& theTitle)
-{
-  myPropertyPanelDock->setWindowTitle(theTitle);
-}
-
 //******************************************************
 /*
  * Creates dock widgets, places them in corresponding area
@@ -631,30 +576,30 @@ void XGUI_Workshop::createDockWidgets()
                                           myMainWindow;
   QDockWidget* aObjDock = createObjectBrowser(aDesktop);
   aDesktop->addDockWidget(Qt::LeftDockWidgetArea, aObjDock);
-  myPropertyPanelDock = createPropertyPanel(aDesktop);
-  aDesktop->addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanelDock);
+  myPropertyPanel = new XGUI_PropertyPanel(aDesktop);
+  aDesktop->addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanel);
   hidePropertyPanel(); //<! Invisible by default
   hideObjectBrowser();
-  aDesktop->tabifyDockWidget(aObjDock, myPropertyPanelDock);
+  aDesktop->tabifyDockWidget(aObjDock, myPropertyPanel);
 }
 
 //******************************************************
 void XGUI_Workshop::showPropertyPanel()
 {
-  QAction* aViewAct = myPropertyPanelDock->toggleViewAction();
+  QAction* aViewAct = myPropertyPanel->toggleViewAction();
   //<! Restore ability to close panel from the window's menu
   aViewAct->setEnabled(true);
-  myPropertyPanelDock->show();
-  myPropertyPanelDock->raise();
+  myPropertyPanel->show();
+  myPropertyPanel->raise();
 }
 
 //******************************************************
 void XGUI_Workshop::hidePropertyPanel()
 {
-  QAction* aViewAct = myPropertyPanelDock->toggleViewAction();
+  QAction* aViewAct = myPropertyPanel->toggleViewAction();
   //<! Do not allow to show empty property panel
   aViewAct->setEnabled(false);
-  myPropertyPanelDock->hide();
+  myPropertyPanel->hide();
 }
 
 //******************************************************
index 3f857ff12400d7f12e68d8f34869a788b504ac65..7daa43ea1a0d1d34b2cc79410a7ce2509f6d186c 100644 (file)
@@ -20,6 +20,7 @@ class XGUI_SalomeConnector;
 class XGUI_ObjectsBrowser;
 class XGUI_ActionsMgr;
 class XGUI_ErrorDialog;
+class XGUI_PropertyPanel;
 class ModuleBase_Operation;
 class ModuleBase_PropPanelOperation;
 
@@ -126,13 +127,12 @@ private:
 
   // Creates Dock widgets: Object browser and Property panel
   void createDockWidgets();
-  void setPropertyPannelTitle(const QString& theTitle);
 
   QString myCurrentFile;
   XGUI_MainWindow* myMainWindow;
   XGUI_Module* myPartSetModule;
   XGUI_ObjectsBrowser* myObjectBrowser;
-  QDockWidget* myPropertyPanelDock;
+  XGUI_PropertyPanel* myPropertyPanel;
   XGUI_SelectionMgr* mySelector;
   XGUI_Displayer* myDisplayer;
   XGUI_OperationMgr* myOperationMgr; ///< manager to manipulate through the operations