myModeLbl = new QLabel("Scalar Mode", RangeGroup);
myModeCombo = new QComboBox(RangeGroup);
- myModeCombo->insertItem("Modulus");
- myModeCombo->insertItem("Component 1");
- myModeCombo->insertItem("Component 2");
- myModeCombo->insertItem("Component 3");
CBLog = new QCheckBox (tr("LOGARITHMIC_SCALING"), RangeGroup);
CBLog->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
bool isScalarMode = (aNbComp > 1);
//
// update myModeCombo
- VISU::TNames& aNamesOfComponents =thePrs->GetField()->myCompNames;
- VISU::TNames& aUnitNamesOfComponents=thePrs->GetField()->myUnitNames;
myModeCombo->clear();
myModeCombo->insertItem("<Modulus>");
- 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);
+ const VISU::PField& aField = thePrs->GetField();
+ const VISU::TNames& aCompNames = aField->myCompNames;
+ const VISU::TNames& aUnitNames = aField->myUnitNames;
+ for(int i = 0; i < aNbComp; i++){
+ QString aComponent = QString(aCompNames[i]).simplifyWhiteSpace();
+ if(aComponent.isNull() || aComponent == "")
+ aComponent = "Component " + QString::number(i+1);
+ else
+ aComponent = "[" + QString::number(i+1) + "] " + aComponent;
+
+ QString anUnit = QString(aUnitNames[i]).simplifyWhiteSpace();
+ if(anUnit.isNull() || anUnit == "")
+ anUnit = "-";
+
+ aComponent = aComponent + ", " + anUnit;
+
+ myModeCombo->insertItem(aComponent);
}
//
myModeCombo->setCurrentItem(thePrs->GetScalarMode());