]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Bug IPAL9976: Preferences-SALOME-Viewers-Plot2d Viewer-Curve type: Points doesn't... T_3_1_0pre
authornds <nds@opencascade.com>
Thu, 15 Dec 2005 14:57:02 +0000 (14:57 +0000)
committernds <nds@opencascade.com>
Thu, 15 Dec 2005 14:57:02 +0000 (14:57 +0000)
src/Plot2d/Plot2d_ViewFrame.cxx
src/Plot2d/Plot2d_ViewWindow.cxx

index c9f598b947f3dfb8c351838d6e27a107e66c5607..3e800e09b4148c9f9d3f45dfbc11f1491e63ef11 100755 (executable)
@@ -303,8 +303,8 @@ void Plot2d_ViewFrame::readPreferences()
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
 
   myCurveType = resMgr->integerValue( "Plot2d", "CurveType", myCurveType );
-  if ( myCurveType < 1 || myCurveType > 2 )
-    myCurveType = 1;
+  setCurveType( resMgr->integerValue( "Plot2d", "CurveType", myCurveType ) );
+
   myShowLegend = resMgr->booleanValue( "Plot2d", "ShowLegend", myShowLegend );
   myLegendPos = resMgr->integerValue( "Plot2d", "LegendPos", myLegendPos );
   myMarkerSize = resMgr->integerValue( "Plot2d", "MarkerSize", myMarkerSize );
index 95b49ab033cfc65acfc3eb32861604b58b8bcdba..437e2b92f49f2a5e09886977b20dd66aac6ef578 100755 (executable)
@@ -356,7 +356,12 @@ void Plot2d_ViewWindow::onChangeVerMode()
 //****************************************************************
 void Plot2d_ViewWindow::onChangeCurveMode()
 {
-  myCurveBtn->SetItem(myViewFrame->getCurveType());
+  int aCurveType = myViewFrame->getCurveType();
+  myCurveBtn->SetItem(aCurveType);
+
+  myActionsMap[CurvPointsId]->setOn(aCurveType == 0);
+  myActionsMap[CurvLinesId]->setOn(aCurveType == 1);
+  myActionsMap[CurvSplinesId]->setOn(aCurveType == 2);
 }
 
 //****************************************************************
@@ -424,26 +429,14 @@ void Plot2d_ViewWindow::onLegend()
 void Plot2d_ViewWindow::onCurves()
 {
   QtxAction* aSender = (QtxAction*) sender();
-  if(aSender == myActionsMap[CurvPointsId]) {
-    myActionsMap[CurvPointsId]->setOn(true);
-    myActionsMap[CurvLinesId]->setOn(false);
-    myActionsMap[CurvSplinesId]->setOn(false);
+  if(aSender == myActionsMap[CurvPointsId])
     myViewFrame->setCurveType(0);
-  }
-  else if(aSender == myActionsMap[CurvLinesId]) {
-    myActionsMap[CurvLinesId]->setOn(true);
-    myActionsMap[CurvPointsId]->setOn(false);
-    myActionsMap[CurvSplinesId]->setOn(false);
+  else if(aSender == myActionsMap[CurvLinesId])
     myViewFrame->setCurveType(1);
-  }
-  else if(aSender == myActionsMap[CurvSplinesId]) {
-    myActionsMap[CurvSplinesId]->setOn( true );
-    myActionsMap[CurvPointsId]->setOn( false );
-    myActionsMap[CurvLinesId]->setOn( false );
+  else if(aSender == myActionsMap[CurvSplinesId])
     myViewFrame->setCurveType(2);
-  }
 }
-
 //****************************************************************
 void Plot2d_ViewWindow::onDumpView()
 {