Preparation for Edit implementation

This commit is contained in:
nds 2016-11-08 12:17:13 +03:00
parent 765d34906e
commit f92ec3a03e
4 changed files with 30 additions and 7 deletions

View File

@ -524,6 +524,13 @@ void GEOMGUI_TextTreeWdg::showContextMenu( const QPoint& pos )
if ( aProp->GetNumber() == 0 )
return;
aMenu.clear();
// Edit annotation action
CAM_Application* anApp = dynamic_cast<CAM_Application*>(myStudy->application());
GeometryGUI* aModule = dynamic_cast<GeometryGUI*>(anApp->activeModule());
QAction* anEditAction = aModule->action(GEOMOp::OpEditAnnotation);
if ( anEditAction )
aMenu.addAction( anEditAction );
// Show/Hide actions
if ( aProp->GetIsVisible( idFromItem( anItem ) ) )
aMenu.addAction( myActions[GEOMOp::OpHide] );
else

View File

@ -5016,6 +5016,18 @@ Please, select face, shell or solid and try again</translation>
<source>STB_ANNOTATION</source>
<translation>Annotation</translation>
</message>
<message>
<source>TOP_EDIT_ANNOTATION</source>
<translation>Edit Annotation</translation>
</message>
<message>
<source>MEN_EDIT_ANNOTATION</source>
<translation>Edit</translation>
</message>
<message>
<source>STB_EDIT_ANNOTATION</source>
<translation>Edit Annotation</translation>
</message>
<message>
<source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
<translation>Show dependency tree</translation>

View File

@ -676,6 +676,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
case GEOMOp::OpFastCheckInters: // MENU MEASURE - FAST CHECK INTERSECTIONS
case GEOMOp::OpManageDimensions: // MENU MEASURE - MANAGE DIMENSIONS
case GEOMOp::OpAnnotation: // MENU MEASURE - ANNOTATION
case GEOMOp::OpEditAnnotation: // POPUP MENU - EDIT ANNOTATION
#ifndef DISABLE_PLOT2DVIEWER
case GEOMOp::OpShapeStatistics: // MENU MEASURE - SHAPE STATISTICS
#endif
@ -1060,6 +1061,7 @@ void GeometryGUI::initialize( CAM_Application* app )
createGeomAction( GEOMOp::OpAngle, "MEASURE_ANGLE" );
createGeomAction( GEOMOp::OpManageDimensions, "MANAGE_DIMENSIONS" );
createGeomAction( GEOMOp::OpAnnotation, "ANNOTATION" );
createGeomAction( GEOMOp::OpEditAnnotation, "EDIT_ANNOTATION" );
createGeomAction( GEOMOp::OpTolerance, "TOLERANCE" );
createGeomAction( GEOMOp::OpWhatIs, "WHAT_IS" );
@ -1609,6 +1611,10 @@ void GeometryGUI::initialize( CAM_Application* app )
mgr->setRule( action( GEOMOp::OpNoAutoColor ), autoColorPrefix + " and isAutoColor=true", QtxPopupMgr::VisibleRule );
mgr->insert( separator(), -1, -1 ); // -----------
mgr->insert( action( GEOMOp::OpEditAnnotation ), -1, -1 ); // edit annotation
mgr->setRule( action( GEOMOp::OpEditAnnotation ), QString("($component={'GEOM'}) and type='Shape' and selcount=1"), QtxPopupMgr::VisibleRule );
mgr->insert( separator(), -1, -1 ); // -----------
QString canDisplay = "($component={'GEOM'}) and (selcount>0) and ({true} in $canBeDisplayed) ",
onlyComponent = "((type='Component') and selcount=1)",
rule = canDisplay + "and ((($type in {%1}) and( %2 )) or " + onlyComponent + ")",

View File

@ -113,14 +113,12 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
case GEOMOp::OpAngle:
dlg = new MeasureGUI_AngleDlg( getGeometryGUI(), parent );
break; // ANGLE
case GEOMOp::OpAnnotation: {
dlg = new MeasureGUI_AnnotationDlg( getGeometryGUI(), true, parent );
} // ANNOTATION
break;
case GEOMOp::OpEditAnnotation: {
case GEOMOp::OpAnnotation:
dlg = new MeasureGUI_AnnotationDlg( getGeometryGUI(), true, parent );
break; // ANNOTATION
case GEOMOp::OpEditAnnotation:
dlg = new MeasureGUI_AnnotationDlg( getGeometryGUI(), false, parent );
} // ANNOTATION
break;
break; // ANNOTATION
case GEOMOp::OpTolerance:
dlg = new MeasureGUI_MaxToleranceDlg( getGeometryGUI(), parent );
break; // MAXTOLERANCE