#include "GLViewer_ViewPort2d.h"
#include <QtxToolBar.h>
-#include <QtxMultiAction.h>
#include <QtxActionToolMgr.h>
#include <SUIT_Desktop.h>
{
int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL") );
toolMgr()->append( DumpId, tid );
-
- QtxMultiAction* aScaleAction = new QtxMultiAction( this );
- aScaleAction->insertAction( toolMgr()->action( FitAllId ) );
- aScaleAction->insertAction( toolMgr()->action( FitRectId ) );
- aScaleAction->insertAction( toolMgr()->action( FitSelectId ) );
- aScaleAction->insertAction( toolMgr()->action( ZoomId ) );
- toolMgr()->append( aScaleAction, tid );
-
- QtxMultiAction* aPanAction = new QtxMultiAction( this );
- aPanAction->insertAction( toolMgr()->action( PanId ) );
- aPanAction->insertAction( toolMgr()->action( GlobalPanId ) );
- toolMgr()->append( aPanAction, tid );
-
- toolMgr()->append( toolMgr()->action( ResetId ), tid );
+ toolMgr()->append( toolMgr()->separator(), tid );
+ toolMgr()->append( FitAllId, tid );
+ toolMgr()->append( FitRectId, tid );
+ toolMgr()->append( FitSelectId, tid );
+ toolMgr()->append( ZoomId, tid );
+ toolMgr()->append( toolMgr()->separator(), tid );
+ toolMgr()->append( PanId, tid );
+ toolMgr()->append( GlobalPanId, tid );
+ toolMgr()->append( toolMgr()->separator(), tid );
+ toolMgr()->append( ResetId, tid );
}
/*!
#include <QtxAction.h>
#include <QtxActionToolMgr.h>
-#include <QtxMultiAction.h>
#include <QtxToolBar.h>
#include <SUIT_Desktop.h>
{
int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL") );
toolMgr()->append( DumpId, tid );
-
- myScaleAction = new QtxMultiAction( this );
- myScaleAction->insertAction( toolMgr()->action( FitAllId ) );
- myScaleAction->insertAction( toolMgr()->action( FitRectId ) );
- myScaleAction->insertAction( toolMgr()->action( FitSelectId ) );
- myScaleAction->insertAction( toolMgr()->action( ZoomId ) );
- toolMgr()->append( myScaleAction, tid );
-
- myPanAction = new QtxMultiAction( this );
- myPanAction->insertAction( toolMgr()->action( PanId ) );
- myPanAction->insertAction( toolMgr()->action( GlobalPanId ) );
- toolMgr()->append( myPanAction, tid );
-
- toolMgr()->append( toolMgr()->action( ResetId ), tid );
-
+ toolMgr()->append( toolMgr()->separator(), tid );
+ toolMgr()->append( FitAllId, tid );
+ toolMgr()->append( FitRectId, tid );
+ toolMgr()->append( FitSelectId, tid );
+ toolMgr()->append( ZoomId, tid );
+ toolMgr()->append( toolMgr()->separator(), tid );
+ toolMgr()->append( PanId, tid );
+ toolMgr()->append( GlobalPanId, tid );
+ toolMgr()->append( toolMgr()->separator(), tid );
+ toolMgr()->append( ResetId, tid );
return tid;
}
return myViewPort->dumpView();
}
-//================================================================
-// Function : expandToolBarActions
-// Purpose :
-//================================================================
-void GraphicsView_ViewFrame::expandToolBarActions()
-{
- QList<QtxMultiAction*> anExpandableActions;
- anExpandableActions.append( myScaleAction );
- anExpandableActions.append( myPanAction );
-
- QListIterator<QtxMultiAction*> anIter( anExpandableActions );
- while( anIter.hasNext() )
- {
- if( QtxMultiAction* aMultiAction = anIter.next() )
- {
- QList<QAction*> aLocalActions = aMultiAction->actions();
- QListIterator<QAction*> aLocalIter( aLocalActions );
- while( aLocalIter.hasNext() )
- if( QAction* anAction = aLocalIter.next() )
- toolMgr()->append( anAction, myToolBarId );
-
- int anId = toolMgr()->actionId( aMultiAction );
- toolMgr()->remove( anId, myToolBarId );
- }
- }
-}
-
//================================================================
// Function : onViewPan
// Purpose :
class QGraphicsSceneMouseEvent;
class QGraphicsSceneWheelEvent;
-class QtxMultiAction;
-
class SUIT_Desktop;
class GraphicsView_Viewer;
virtual QImage dumpView();
- void expandToolBarActions();
-
protected slots:
void onViewPan();
void onViewZoom();
GraphicsView_ViewPort* myViewPort;
int myToolBarId;
- QtxMultiAction* myScaleAction;
- QtxMultiAction* myPanAction;
};
#endif
#include <SUIT_Desktop.h>
#include <QtxAction.h>
-#include <QtxMultiAction.h>
#include <QtxActionToolMgr.h>
#include <QStatusBar>
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onZoom() ) );
mgr->registerAction( aAction, ZoomId );
- // 2.4. Create multi-action for scaling operations
- QtxMultiAction* aScaleAction = new QtxMultiAction( this );
- aScaleAction->insertAction( mgr->action( FitAllId ) );
- aScaleAction->insertAction( mgr->action( FitRectId ) );
- aScaleAction->insertAction( mgr->action( ZoomId ) );
- mgr->registerAction( aScaleAction, ScaleOpId );
-
// 3. Moving operations
// 3.1. Panning
connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onGlobalPanning() ) );
mgr->registerAction( aAction, GlobalPanId );
- // 3.3. Create multi-action for moving operations
- QtxMultiAction* aPanAction = new QtxMultiAction( this );
- aPanAction->insertAction( mgr->action( PanId ) );
- aPanAction->insertAction( mgr->action( GlobalPanId ) );
- mgr->registerAction( aPanAction, MoveOpId );
-
// 4. Curve type operations
// 4.1. Points
myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ) );
mgr->append( DumpId, myToolBar );
mgr->append( PrintId, myToolBar );
- mgr->append( ScaleOpId, myToolBar );
- mgr->append( MoveOpId, myToolBar );
+ mgr->append( toolMgr()->separator(), myToolBar );
+ mgr->append( FitAllId, myToolBar );
+ mgr->append( FitRectId, myToolBar );
+ mgr->append( ZoomId, myToolBar );
+ mgr->append( toolMgr()->separator(), myToolBar );
+ mgr->append( PanId, myToolBar );
+ mgr->append( GlobalPanId, myToolBar );
mgr->append( toolMgr()->separator(), myToolBar );
mgr->append( CurvPointsId, myToolBar );
mgr->append( CurvLinesId, myToolBar );
public:
enum { DumpId, PrintId,
- ScaleOpId, FitAllId, FitRectId, ZoomId,
- MoveOpId, PanId, GlobalPanId,
+ FitAllId, FitRectId, ZoomId,
+ PanId, GlobalPanId,
PModeXLinearId, PModeXLogarithmicId,
- PModeYLinearId, PModeYLogarithmicId,
+ PModeYLinearId, PModeYLogarithmicId,
CurvPointsId, CurvLinesId, CurvSplinesId,
LegendId,
CurvSettingsId, CurvesSettingsId,
mgr->append( SwitchInteractionStyleId, myToolBar );
mgr->append( ViewTrihedronId, myToolBar );
- QtxMultiAction* aScaleAction = new QtxMultiAction( this );
- aScaleAction->insertAction( getAction( FitAllId ) );
- aScaleAction->insertAction( getAction( FitRectId ) );
- aScaleAction->insertAction( getAction( ZoomId ) );
- mgr->append( aScaleAction, myToolBar );
-
- QtxMultiAction* aPanningAction = new QtxMultiAction( this );
- aPanningAction->insertAction( getAction( PanId ) );
- aPanningAction->insertAction( getAction( GlobalPanId ) );
- mgr->append( aPanningAction, myToolBar );
+ mgr->append( FitAllId, myToolBar );
+ mgr->append( FitRectId, myToolBar );
+ mgr->append( ZoomId, myToolBar );
+
+ mgr->append( PanId, myToolBar );
+ mgr->append( GlobalPanId, myToolBar );
mgr->append( ChangeRotationPointId, myToolBar );
myToolBar->addAction( myActionsMap[DumpId] );
myToolBar->addAction( myActionsMap[TrihedronShowId] );
- QtxMultiAction* aScaleAction = new QtxMultiAction( this );
- aScaleAction->insertAction( myActionsMap[FitAllId] );
- aScaleAction->insertAction( myActionsMap[FitRectId] );
- aScaleAction->insertAction( myActionsMap[ZoomId] );
- myToolBar->addAction( aScaleAction );
-
- QtxMultiAction* aPanningAction = new QtxMultiAction( this );
- aPanningAction->insertAction( myActionsMap[PanId] );
- aPanningAction->insertAction( myActionsMap[GlobalPanId] );
- myToolBar->addAction( aPanningAction );
+ myToolBar->addAction( myActionsMap[FitAllId] );
+ myToolBar->addAction( myActionsMap[FitRectId] );
+ myToolBar->addAction( myActionsMap[ZoomId] );
+
+ myToolBar->addAction( myActionsMap[PanId] );
+ myToolBar->addAction( myActionsMap[GlobalPanId] );
myToolBar->addAction( myActionsMap[RotationId] );