class QString;
class QAction;
class SUIT_Desktop;
-class SUIT_Convertor;
class SUIT_ViewModel;
class SUIT_ResourceMgr;
SUIT_ResourceMgr* resourceMgr() const;
- /*! Returns instance of data object Convertor class according to given Viewer.
- If convertation is not supported returns 0. */
- virtual SUIT_Convertor* getConvertor(const SUIT_ViewModel* theViewer) { return 0; }
-
//! Puts the message to the status bar
void putInfo ( const QString&, const int = 0 );
// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
+// License as published by the Free Software Foundation; either
// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <QtCore/qregexp.h>
#include <QtCore/qpointer.h>
+#include <QtGui/qicon.h>
#include <QtGui/qcursor.h>
#include <QtGui/qmessagebox.h>
myId = useNewId( getType() );
- connect( theDesktop, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+ connect( theDesktop, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
myStudy = theStudy;
setViewName( myViews[i] );
}
+void SUIT_ViewManager::setIcon( const QPixmap& theIcon )
+{
+ myIcon = theIcon;
+ for ( int i = 0; i < (int)myViews.count(); i++ )
+ myViews[i]->setWindowIcon( QIcon( myIcon ) );
+}
+
/*!Sets view model \a theViewModel to view manager.*/
-void SUIT_ViewManager::setViewModel(SUIT_ViewModel* theViewModel)
+void SUIT_ViewManager::setViewModel(SUIT_ViewModel* theViewModel)
{
if (myViewModel && myViewModel != theViewModel) {
myViewModel->setViewManager(0);
delete aView;
return 0;
}
-
+
setViewName( aView );
+ aView->setWindowIcon( QIcon( myIcon ) );
+
//myDesktop->addViewWindow( aView );
//it is done automatically during creation of view
- aView->setViewManager(this);
-
- emit viewCreated(aView);
+ aView->setViewManager( this );
+ emit viewCreated( aView );
// Special treatment for the case when <aView> is the first one in this view manager
// -> call onWindowActivated() directly, because somebody may always want
myViews.resize( aNbItems );
aSize = myViews.size();
}
-
+
connect(theView, SIGNAL(closing(SUIT_ViewWindow*)),
this, SLOT(onClosingView(SUIT_ViewWindow*)));
*\retval QString - type of view model.
*/
QString SUIT_ViewManager::getType() const
-{
- return (!myViewModel)? "": myViewModel->getType();
+{
+ return (!myViewModel)? "": myViewModel->getType();
}
/*!
// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
+// License as published by the Free Software Foundation; either
// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include "SUIT_ViewWindow.h"
#include "SUIT_PopupClient.h"
+#include <QtGui/qpixmap.h>
#include <QtCore/qobject.h>
#include <QtCore/qvector.h>
#include <QtCore/qpointer.h>
virtual QString popupClientType() const { return getType(); }
virtual void contextMenuPopup( QMenu* );
-
+
void setViewModel(SUIT_ViewModel* theViewModel);
SUIT_ViewModel* getViewModel() { return myViewModel; }
-
+
SUIT_Study* study() const;
- QString getType() const;
+ QString getType() const;
SUIT_ViewWindow* getActiveView() { return myActiveView; }
-
+
int getViewsCount() { return myViews.count(); }
QVector<SUIT_ViewWindow*> getViews() const;
QString getTitle() const { return myTitle; }
virtual void setTitle( const QString& );
+ QPixmap getIcon() const { return myIcon; }
+ virtual void setIcon( const QPixmap& );
+
SUIT_ViewWindow* createViewWindow();
bool isVisible() const;
public slots:
void createView();
void closeAllViews();
-
+
signals:
void lastViewClosed(SUIT_ViewManager*);
void deleteView(SUIT_ViewWindow*);
void keyPress(SUIT_ViewWindow*, QKeyEvent*);
void keyRelease(SUIT_ViewWindow*, QKeyEvent*);
void activated(SUIT_ViewManager*);
-
+
protected slots:
void onWindowActivated(SUIT_ViewWindow*);
void onClosingView( SUIT_ViewWindow* );
private slots:
void onContextMenuRequested( QContextMenuEvent* e );
-
+
protected:
/*! Inserts the View into internal Views Vector.\n
* Returns true if view has been added successfully
*/
virtual bool insertView(SUIT_ViewWindow* theView);
-
+
/*! Removes the View from internal Views Vector.*/
virtual void removeView(SUIT_ViewWindow* theView);
-
+
/*! Close the specified View.*/
virtual void closeView(SUIT_ViewWindow* theView);
-
+
/*! Used to set unique name for the view.*/
virtual void setViewName(SUIT_ViewWindow* theView );
QString prepareTitle( const QString&, const int, const int );
SUIT_ViewWindow* myActiveView;
int myId;
+ QPixmap myIcon;
QString myTitle;
SUIT_Study* myStudy;