]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'master' of newgeom:newgeom.git
authorvsv <vsv@coldrex.nnov.opencascade.com>
Mon, 5 May 2014 09:46:02 +0000 (13:46 +0400)
committervsv <vsv@coldrex.nnov.opencascade.com>
Mon, 5 May 2014 09:46:02 +0000 (13:46 +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 2c4489db8ac4f5a568b615b04a306cf42d8a69ec..02d8d3ef98cab7181db4ce52486b3805ddea95bb 100644 (file)
@@ -11,6 +11,8 @@ SET(PROJECT_HEADERS
        ModuleBase_WidgetFactory.h
        ModuleBase_WidgetPoint2D.h
        ModuleBase_WidgetSwitch.h
+       ModuleBase_IModelWidget.h
+       ModuleBase_MetaWidget.h
 )
 
 SET(PROJECT_SOURCES
@@ -21,6 +23,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 9437d5de6d5f1bf32588b65e32e4606539f0cc16..d89f27de4855c7bf3ef765bd546f33ed05434312 100644 (file)
@@ -7,11 +7,13 @@
 
 #include <ModuleBase_WidgetFactory.h>
 
-#include <ModuleBase_WidgetSwitch.h>
-#include <ModuleBase_OperationDescription.h>
-
+#include <ModuleBase_MetaWidget.h>
 #include <ModuleBase_Operation.h>
+#include <ModuleBase_OperationDescription.h>
+#include <ModuleBase_PropPanelOperation.h>
 #include <ModuleBase_WidgetPoint2D.h>
+#include <ModuleBase_WidgetSwitch.h>
+
 #include <Config_Keywords.h>
 #include <Config_WidgetAPI.h>
 
@@ -183,6 +185,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 3241bfb2f12e7450af0415e5a5ae2a3345cee84e..c5b8ef59881f46a86a6d8b541eda092422cf4dd0 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_Operation*   myOperation;
 
-
+  QList<ModuleBase_IModelWidget*> myWidgets;
 };
 
 #endif /* ModuleBase_WidgetFactory_H_ */
index 805e7673ab758cfce29f6daa011936bae785d2b5..5a8818935af0283f9e8d86f186663c62dd36a74d 100644 (file)
@@ -30,6 +30,7 @@ SET(PROJECT_HEADERS
     XGUI_ErrorDialog.h
     XGUI_SalomeViewer.h
     XGUI_ViewerProxy.h
+    XGUI_PropertyPanel.h
 )
 
 SET(PROJECT_AUTOMOC 
@@ -58,6 +59,7 @@ SET(PROJECT_SOURCES
     XGUI_ActionsMgr.cpp
     XGUI_ErrorDialog.cpp
     XGUI_ViewerProxy.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 5661727c2cf8e14d3aa75c069b1d319b02701ac3..0bab9abba1584de538b304c1575b67eccb662d53 100644 (file)
@@ -53,10 +53,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 e07178ec3ae422fd26a930d09a59823d7dd89043..c80c8a7aefc0f02908614c0abc7b7857f0f1b5b6 100644 (file)
@@ -18,7 +18,9 @@
 #include "XGUI_ActionsMgr.h"
 #include "XGUI_ErrorDialog.h"
 #include "XGUI_ViewerProxy.h"
+#include "XGUI_PropertyPanel.h"
 
+#include <Model_Events.h>
 #include <ModelAPI_PluginManager.h>
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Data.h>
@@ -55,7 +57,7 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector)
   myCurrentFile(QString()),
   myPartSetModule(NULL),
   mySalomeConnector(theConnector),
-  myPropertyPanelDock(0),
+  myPropertyPanel(0),
   myObjectBrowser(0),
   myDisplayer(0)
 {
@@ -91,27 +93,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();
 }
 
 //******************************************************
@@ -184,12 +177,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_Operation* anOperation =
@@ -205,17 +203,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
-
 }
 
 //******************************************************
@@ -225,14 +218,13 @@ void XGUI_Workshop::onOperationStarted()
 
   if(!aOperation->getDescription()->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->getDescription()->description());
+    aFactory.createWidget(myPropertyPanel->contentWidget());
+    myPropertyPanel->setModelWidgets(aFactory.getWrappedWidgets());
+    myPropertyPanel->setWindowTitle(aOperation->getDescription()->description());
   }
 }
 
@@ -309,9 +301,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;
@@ -578,53 +570,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
@@ -636,30 +581,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 de7dc670bb3f5207df99edcb0bb041f589520fd8..0d6c8ff3da9a1a6a34725130e07a7b243e5da08e 100644 (file)
@@ -22,6 +22,7 @@ class XGUI_ActionsMgr;
 class XGUI_ErrorDialog;
 class XGUI_SalomeViewer;
 class XGUI_ViewerProxy;
+class XGUI_PropertyPanel;
 
 class ModuleBase_Operation;
 
@@ -65,7 +66,7 @@ public:
   XGUI_ActionsMgr* actionsMgr() const { return myActionsMgr; };
 
   //! Returns property panel widget
-  QDockWidget* propertyPanel() const { return myPropertyPanelDock; }
+  XGUI_PropertyPanel* propertyPanel() const { return myPropertyPanel; }
 
   //! Creates and adds a new workbench (menu group) with the given name and returns it
   XGUI_Workbench* addWorkbench(const QString& theName);
@@ -140,13 +141,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