]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug PAL10966.
authormzn <mzn@opencascade.com>
Mon, 19 Dec 2005 12:37:45 +0000 (12:37 +0000)
committermzn <mzn@opencascade.com>
Mon, 19 Dec 2005 12:37:45 +0000 (12:37 +0000)
src/VISUGUI/VisuGUI_ScalarBarDlg.cxx
src/VISUGUI/VisuGUI_ScalarBarDlg.h

index bad70b7dcf57063c3efa4ceba8d3f4829f5dfc0d..9cffb00221a8f4fe309f8c3bbb21d7edb1b32356 100644 (file)
@@ -244,7 +244,7 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent, bool SetPref):
   CheckGroup->layout()->setMargin( 0 );
   QGridLayout* CheckGroupLayout = new QGridLayout( CheckGroup->layout() );
   
-  myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), this);
+  myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), CheckGroup);
   myPreviewCheck->setChecked(false);
   CheckGroupLayout->addWidget(myPreviewCheck , 0, 0 );
 
@@ -601,6 +601,10 @@ void VisuGUI_ScalarBarPane::createScalarBar()
 
   if(!check()) return;
 
+  if ( myBusy ) return;
+
+  myBusy = true;
+
   int sbCol,sbLab;
   sbCol = getNbColors();
   sbLab = getNbLabels();
@@ -683,11 +687,15 @@ void VisuGUI_ScalarBarPane::createScalarBar()
   aScalarBarActor->Modified();
 
   VISU::GetViewWindow()->AddActor(myPreviewActor);
+
+  myBusy = false;
 }
 /*! Deleting preview scalar bar
  */
 void VisuGUI_ScalarBarPane::deleteScalarBar()
 {
+  if ( myBusy ) return;
+  
   if (myPreviewActor == 0) return;
   if (SVTK_ViewWindow* vf = VISU::GetViewWindow()){
     vf->RemoveActor(myPreviewActor);
index 33c55f963a00f7f129da10b59560dd424e653b63..d6da0b486c4e6a9ebcc187c99c25cc4edbecf712 100644 (file)
@@ -167,6 +167,8 @@ class VisuGUI_ScalarBarPane : public QVBox
   QCheckBox* myPreviewCheck;
   VISU_ScalarMapAct* myPreviewActor;
   VISU::ScalarMap_i* myScalarMap;
+
+  bool myBusy;
 };