From 0a19ed26d9bb366af7cbeddfc6123a874e128ff6 Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 17 Jan 2006 06:54:10 +0000 Subject: [PATCH] Adjust to OCC_development_generic_2006 --- src/VISUGUI/VisuGUI.cxx | 48 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index cf4415e8..0c935ffa 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -22,7 +22,7 @@ // // // File : VisuGUI.cxx -// Author : Laurent CORNABE +// Author : // Module : VISU // $Header$ @@ -2941,8 +2941,52 @@ void VisuGUI::createPreferences() LightApp_Preferences::Bool, "VISU", "represent_shading" ); } -void VisuGUI::preferencesChanged( const QString&, const QString& ) +void VisuGUI::preferencesChanged( const QString& a, const QString& b) { + if (a != QString("VISU")) return; + if (b == QString("scalar_bar_orientation")) return; + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + float sbX1,sbY1,sbW,sbH; + 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){ + sbX1=0.01; + sbW=0.05; + aResourceMgr->setValue("VISU", "scalar_bar_vertical_x", sbX1); + aResourceMgr->setValue("VISU", "scalar_bar_vertical_width", sbW); + } + } + else if(b == QString("scalar_bar_vertical_y") || b == QString("scalar_bar_vertical_height")){ + sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", sbY1); + sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",sbH); + if(sbY1+sbH > 1.0){ + sbY1=0.01; + sbH=0.5; + aResourceMgr->setValue("VISU", "scalar_bar_vertical_y", sbY1); + aResourceMgr->setValue("VISU", "scalar_bar_vertical_height",sbH); + } + } + else if(b == QString("scalar_bar_horizontal_x") || b == QString("scalar_bar_horizontal_width")){ + sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", sbX1); + sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", sbW); + if(sbX1+sbW > 1.0){ + sbX1=0.2; + sbW=0.6; + aResourceMgr->setValue("VISU", "scalar_bar_horizontal_x", sbX1); + aResourceMgr->setValue("VISU", "scalar_bar_horizontal_width", sbW); + } + } + else if(b == QString("scalar_bar_horizontal_y") || b == QString("scalar_bar_horizontal_height")){ + sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", sbY1); + sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",sbH); + if(sbY1+sbH > 1.0){ + sbY1=0.01; + sbH=0.12; + aResourceMgr->setValue("VISU", "scalar_bar_horizontal_y", sbY1); + aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH); + } + } } SUIT_ViewManager* -- 2.39.2