From 60682d46f03c1a6d3d634a09e325d847b234e00b Mon Sep 17 00:00:00 2001 From: mzn Date: Mon, 19 Dec 2005 14:22:47 +0000 Subject: [PATCH] Fix for bug PAL10966. --- src/VISUGUI/VisuGUI_ScalarBarDlg.cxx | 10 +++++++++- src/VISUGUI/VisuGUI_ScalarBarDlg.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index bad70b7d..0daa5bf3 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -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); diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.h b/src/VISUGUI/VisuGUI_ScalarBarDlg.h index 33c55f96..d6da0b48 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.h @@ -167,6 +167,8 @@ class VisuGUI_ScalarBarPane : public QVBox QCheckBox* myPreviewCheck; VISU_ScalarMapAct* myPreviewActor; VISU::ScalarMap_i* myScalarMap; + + bool myBusy; }; -- 2.39.2