Salome HOME
Fix for Bug IPAL8945
[modules/visu.git] / src / VISUGUI / VisuGUI_VectorsDlg.cxx
index 1a150753279fa128e364ddb8e3bd5f5957974f98..a5e2f2c590ea8845052d11f462a26f65b4c0c067 100644 (file)
 //  $Header$
 
 #include "VisuGUI_VectorsDlg.h"
-#include "VISU_Vectors_i.hh"
+
 #include "VisuGUI.h"
-#include "VisuGUI_Selection.h"
+//#include "VisuGUI_Selection.h"
+#include "VisuGUI_Tools.h"
+
+#include "VISU_Vectors_i.hh"
+
+#include "SalomeApp_Module.h"
+#include "SUIT_Desktop.h"
 
 #include <qlayout.h>
 #include <qcolordialog.h>
@@ -40,8 +46,8 @@ using namespace std;
 /*!
   Constructor
 */
-VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (QWidget* parent)
-    : QDialog(parent, "VisuGUI_VectorsDlg", true,
+VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule)
+    : QDialog(VISU::GetDesktop(theModule), "VisuGUI_VectorsDlg", true,
       WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
   setCaption(tr("DLG_TITLE"));
@@ -402,6 +408,15 @@ void VisuGUI_VectorsDlg::enableMagnColor( bool enable )
 
 
 void VisuGUI_VectorsDlg::accept() {
-  if (myScalarPane->check())  QDialog::accept();
+  if (myScalarPane->check()) 
+    {
+      myScalarPane->deletePreview();
+      QDialog::accept();
+    }
 }
 
+void VisuGUI_VectorsDlg::reject()
+{
+  myScalarPane->deletePreview();
+  QDialog::reject();
+}