From 255e69f3061472b68750a12c36fff165a54c8b95 Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 3 Apr 2006 10:18:44 +0000 Subject: [PATCH] actions ids is public now and new method setActionState is added --- src/OCCViewer/OCCViewer_ViewWindow.cxx | 6 ++++++ src/OCCViewer/OCCViewer_ViewWindow.h | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index dbd2618b6..474c179f6 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -1024,3 +1024,9 @@ void OCCViewer_ViewWindow::setVisualParameters( const QString& parameters ) performRestoring( params ); } } + +void OCCViewer_ViewWindow::setActionState( const int id, const bool on ) +{ + if( myActionsMap.contains( id ) ) + myActionsMap[ id ]->setEnabled( on ); +} diff --git a/src/OCCViewer/OCCViewer_ViewWindow.h b/src/OCCViewer/OCCViewer_ViewWindow.h index b6bda965a..5a30f0516 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.h +++ b/src/OCCViewer/OCCViewer_ViewWindow.h @@ -93,11 +93,14 @@ signals: void vpTransformationFinished(OCCViewer_ViewWindow::OperationType type); void cloneView(); -protected: +public: enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId, FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, ClippingId, MemId, RestoreId, TrihedronShowId }; + + void setActionState( const int, const bool ); +protected: typedef QMap ActionsMap; QImage dumpView(); -- 2.39.2