From b73e272eeeb0ed6f65160cd34c0d5a700efb2412 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 17 Nov 2016 10:54:42 +0300 Subject: [PATCH] minor corrections in annotation dialog: 1. Sub-shape selection should be cleared by new shape selection; 2. in edit mode sub-shape should be always disabled. --- src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx b/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx index 400baef26..314ea1b4f 100755 --- a/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_AnnotationDlg.cxx @@ -450,6 +450,18 @@ void MeasureGUI_AnnotationDlg::activateSelectionArgument if ( theSelectionButton == myShapeSelBtn ) { myEditCurrentArgument = myShapeName; anOtherButton = mySubShapeSelBtn; + // throw down current sub-shape selection + TopAbs_ShapeEnum aShapeType = TopAbs_SHAPE; + + mySubShapeTypeCombo->setCurrentIndex( 0 ); + mySubShapeName->setText( "" ); + + myAnnotationProperties.ShapeType = aShapeType; + myAnnotationProperties.ShapeIndex = -1; + + mySelectionMode = aShapeType; + + updateSubShapeEnableState(); } else if ( theSelectionButton == mySubShapeSelBtn ) { myEditCurrentArgument = mySubShapeName; anOtherButton = myShapeSelBtn; @@ -489,6 +501,8 @@ void MeasureGUI_AnnotationDlg::SelectionIntoArgument() if ( !myShapeNameModified ) { myTextEdit->setText( aName ); onTextChange(); + // modified state should not be changed as modification was performed not manually + myShapeNameModified = false; } } @@ -816,6 +830,9 @@ SALOME_Prs* MeasureGUI_AnnotationDlg::buildPrs() //================================================================================= void MeasureGUI_AnnotationDlg::updateSubShapeEnableState() { + if ( !myIsCreation ) + return; + bool isWholeShape = getShapeType() == TopAbs_SHAPE; bool aNullShape = myShape->_is_nil(); mySubShapeSelBtn->setEnabled( !aNullShape && !isWholeShape ); -- 2.39.2