Title mechanism in the SUIT_ViewManager was changed. Now view manager support title for views with specific tags: %M - view manager number, %V - view number.
#include "OCCViewer_ViewWindow.h"
#include "SUIT_Desktop.h"
-int OCCViewer_ViewManager::myMaxId = 0;
-
/*!
Constructor
*/
OCCViewer_ViewManager::OCCViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop, bool DisplayTrihedron )
-: SUIT_ViewManager( study, theDesktop )
+: SUIT_ViewManager( study, theDesktop, new OCCViewer_Viewer( DisplayTrihedron ) )
{
- myId = ++myMaxId;
- setViewModel( new OCCViewer_Viewer( DisplayTrihedron ) );
+ setTitle( tr( "OCC_VIEW_TITLE" ) );
}
/*!
{
}
-/*!
- Sets view name
- \param theView - view to assign name
-*/
-void OCCViewer_ViewManager::setViewName(SUIT_ViewWindow* theView)
-{
- int aPos = myViews.find(theView);
- theView->setCaption( tr( "OCC_VIEW_TITLE" ).arg( myId ).arg( aPos + 1 ) );
-}
-
/*!
Fills popup menu with custom actions
\param popup - popup menu to be filled with
OCCViewer_Viewer* getOCCViewer() { return (OCCViewer_Viewer*) myViewModel; }
virtual void contextMenuPopup( QPopupMenu* );
-
-protected:
- void setViewName(SUIT_ViewWindow* theView);
-
-protected:
- static int myMaxId;
- int myId;
};
#endif
#include "Plot2d_ViewModel.h"
#include "Plot2d_ViewWindow.h"
-int Plot2d_ViewManager::myMaxId = 0;
-
/*!
Constructor
*/
Plot2d_ViewManager::Plot2d_ViewManager( SUIT_Study* study, SUIT_Desktop* desk )
-: SUIT_ViewManager( study, desk )
+: SUIT_ViewManager( study, desk, new Plot2d_Viewer() )
{
- myId = ++myMaxId;
- Plot2d_Viewer* v = new Plot2d_Viewer();
- setViewModel( v );
+ setTitle( tr( "PLOT2D_VIEW_TITLE" ) );
}
/*!
return (Plot2d_Viewer*)myViewModel;
}
-/*!
- Sets default name of view
- \param the View - view to be renamed
-*/
-void Plot2d_ViewManager::setViewName( SUIT_ViewWindow* theView )
-{
- int aPos = myViews.find(theView);
- theView->setCaption( QString( "Plot2d scene:%1 - viewer:%2" ).arg(myId).arg(aPos+1));
-}
-
/*!
Adds new view
\param theView - view to be added
Plot2d_Viewer* getPlot2dModel() const;
protected:
- void setViewName(SUIT_ViewWindow* theView);
bool insertView(SUIT_ViewWindow* theView);
public slots:
signals:
void cloneView( Plot2d_ViewFrame*, Plot2d_ViewFrame* );
-
-protected:
- static int myMaxId;
- int myId;
};
#endif
#include "SVTK_ViewManager.h"
#include "SVTK_ViewModel.h"
-int SVTK_ViewManager::_SVTKViewMgr_Id = 0;
+#include <VTKViewer_ViewManager.h>
/*!
Constructor
*/
-SVTK_ViewManager::SVTK_ViewManager( SUIT_Study* study,
- SUIT_Desktop* theDesktop )
-: SUIT_ViewManager( study, theDesktop )
+SVTK_ViewManager::SVTK_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop )
+: SUIT_ViewManager( study, theDesktop, new SVTK_Viewer() )
{
- myId = ++_SVTKViewMgr_Id;
- setViewModel( new SVTK_Viewer() );
+ setTitle( VTKViewer_ViewManager::tr( "VTK_VIEW_TITLE" ) );
}
/*!
{
return myDesktop;
}
-
-/*!
- Sets default name of view
-*/
-void SVTK_ViewManager::setViewName(SUIT_ViewWindow* theView)
-{
- int aPos = myViews.find(theView);
- theView->setCaption( tr( "VTK_VIEW_TITLE" ).arg( myId ).arg( aPos + 1 ) );
-}
virtual ~SVTK_ViewManager();
SUIT_Desktop* getDesktop();
-
-protected:
- void setViewName( SUIT_ViewWindow* theView );
-
-private:
- int myId;
- static int _SVTKViewMgr_Id;
};
#endif
#include "VTKViewer_ViewManager.h"
#include "VTKViewer_ViewModel.h"
-int VTKViewer_ViewManager::_VTKViewMgr_Id = 0;
-
/*!Constructor.Initialize SIUT_ViewManager by \a study and \a theDesktop.
* Create new instance of VTKViewer_Viewer and set view model by it.
*/
VTKViewer_ViewManager::VTKViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop )
-: SUIT_ViewManager( study, theDesktop )
+: SUIT_ViewManager( study, theDesktop, new VTKViewer_Viewer() )
{
- myId = ++_VTKViewMgr_Id;
- setViewModel( new VTKViewer_Viewer() );
+ setTitle( tr( "VTK_VIEW_TITLE" ) );
}
/*!Destructor.*/
{
/*!Do nothing.*/
}
-
-/*!Sets view window name*/
-void VTKViewer_ViewManager::setViewName(SUIT_ViewWindow* theView)
-{
- int aPos = myViews.find(theView);
- theView->setCaption( tr( "VTK_VIEW_TITLE" ).arg( myId ).arg( aPos + 1 ) );
-}
public:
VTKViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* );
virtual ~VTKViewer_ViewManager();
-
-protected:
- void setViewName( SUIT_ViewWindow* theView );
-
-private:
- int myId;
- static int _VTKViewMgr_Id;
};
#endif