From: pkv Date: Wed, 21 Sep 2005 15:05:57 +0000 (+0000) Subject: Updating Mode combobox with the names of components X-Git-Tag: BR-D5-38-2003_D2005-12-10~169 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4c6ea65bf8d603f10f3df725b59e8d7a45721b4e;p=modules%2Fvisu.git Updating Mode combobox with the names of components --- diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index 6a24502f..62a3a4b6 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -506,7 +506,6 @@ void VisuGUI_ScalarBarPane::storeToResources() { */ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { initFromResources(); - myModeCombo->setCurrentItem(thePrs->GetScalarMode()); setPosAndSize( thePrs->GetPosX(), thePrs->GetPosY(), thePrs->GetWidth(), @@ -525,7 +524,27 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { setRange( thePrs->GetMin(), thePrs->GetMax(), /*0.0, 0.0,*/ thePrs->IsRangeFixed() ); setScalarBarData( thePrs->GetNbColors(), thePrs->GetLabels() ); - bool isScalarMode = (thePrs->GetField()->myNbComp > 1); + // + int aNbComp=thePrs->GetField()->myNbComp; + bool isScalarMode = (aNbComp > 1); + // + // update myModeCombo + VISU::TNames& aNamesOfComponents =thePrs->GetField()->myCompNames; + VISU::TNames& aUnitNamesOfComponents=thePrs->GetField()->myUnitNames; + myModeCombo->clear(); + myModeCombo->insertItem(""); + for (int i=1; i<=aNbComp; ++i) { + VISU::TName aNmUn=aNamesOfComponents[i-1]; + VISU::TName& aUnits=aUnitNamesOfComponents[i-1]; + if (!aUnits.empty()) { + aNmUn+=", "; + aNmUn+=aUnits; + } + myModeCombo->insertItem(aNmUn); + } + // + myModeCombo->setCurrentItem(thePrs->GetScalarMode()); + // myModeLbl->setEnabled(isScalarMode); myModeCombo->setEnabled(isScalarMode);