if (b == QString("scalar_bar_orientation")) return;
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
float sbX1,sbY1,sbW,sbH;
+ std::string aWarning;
if(b == QString("scalar_bar_vertical_x") || b == QString("scalar_bar_vertical_width")){
sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", sbX1);
sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", sbW);
if(sbX1+sbW > 1.0){
+ aWarning = "Origin and Size Vertical: X+Width > 1\n";
sbX1=0.01;
sbW=0.05;
aResourceMgr->setValue("VISU", "scalar_bar_vertical_x", sbX1);
sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", sbY1);
sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",sbH);
if(sbY1+sbH > 1.0){
+ aWarning = "Origin and Size Vertical: Y+Height > 1\n";
sbY1=0.01;
sbH=0.5;
aResourceMgr->setValue("VISU", "scalar_bar_vertical_y", sbY1);
sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", sbX1);
sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", sbW);
if(sbX1+sbW > 1.0){
+ aWarning = "Origin and Size Horizontal: X+Width > 1\n";
sbX1=0.2;
sbW=0.6;
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_x", sbX1);
sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", sbY1);
sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",sbH);
if(sbY1+sbH > 1.0){
+ aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
sbY1=0.01;
sbH=0.12;
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_y", sbY1);
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH);
}
}
+ if (aWarning.size() != 0){
+ aWarning += "The default values are applied instead.";
+ SUIT_MessageBox::warn1(GetDesktop(this),
+ tr("ERR_SCALARBAR_PARAMS"),
+ tr(aWarning.c_str()),
+ tr("BUT_OK") );
+ }
}
SUIT_ViewManager*