{
SUIT_ViewManager* aVM = viewManager( vmType );
SUIT_ViewManager* anActiveVM = CAM_Application::activeViewManager();
-
+ MESSAGE("vmType: " << vmType.toStdString() << " aVM: " << aVM << " anActiveVM: " << anActiveVM );
if ( anActiveVM && anActiveVM->getType() == vmType )
- aVM = anActiveVM;
+ {
+ MESSAGE("aVM = anActiveVM");
+ aVM = anActiveVM;
+ }
if ( aVM && create )
{
if ( !aVM->getActiveView() )
- aVM->createView();
+ {
+ MESSAGE("aVM->createView()");
+ aVM->createView();
+ }
else
- desktop()->setActiveWindow( aVM->getActiveView() );
+ {
+ MESSAGE("desktop()->setActiveWindow: " << aVM->getActiveView());
+ desktop()->setActiveWindow( aVM->getActiveView() );
+ }
}
else if ( create )
- aVM = createViewManager( vmType );
+ {
+ MESSAGE("aVM = createViewManager( vmType )");
+ aVM = createViewManager( vmType );
+ }
return aVM;
}
#include <QPaintEvent>
#include <QCoreApplication>
+#include <utilities.h>
namespace
{
/*!
for ( int i = 0, n = vec.size(); i < n; i++ ) {
SUIT_ViewWindow* wnd = vec[ i ];
if ( wnd )
- myResult.append( wnd->getId() );
+ {
+ MESSAGE("SUIT_ViewWindow*: "<< wnd << " id: " << wnd->getId());
+ myResult.append( wnd->getId() );
+ }
}
}
}
virtual void Execute()
{
SUIT_ViewWindow* wnd = getWnd( myWndId );
+ MESSAGE("window id:" << myWndId << " SUIT_ViewWindow*: " << wnd);
if ( wnd ) {
wnd->setFocus();
myResult = true;
return ProcessEvent( new TActivateView( id ) );
}
+/*!
+ *
+ */
+
+class TActivateViewManagerAndView: public SALOME_Event
+{
+public:
+ typedef bool TResult;
+ TResult myResult;
+ int myWndId;
+ TActivateViewManagerAndView( const int id )
+ : myResult( false ),
+ myWndId( id ) {}
+ virtual void Execute()
+ {
+ SUIT_ViewWindow* wnd = getWnd( myWndId );
+ MESSAGE("window id:" << myWndId << " SUIT_ViewWindow*: " << wnd);
+ if ( wnd )
+ {
+ LightApp_Application* app = getApplication();
+ app->setActiveViewManager(wnd->getViewManager());
+ wnd->setFocus();
+ myResult = true;
+ }
+ }
+};
+bool SalomePyQt::activateViewManagerAndView( const int id )
+{
+ return ProcessEvent( new TActivateViewManagerAndView( id ) );
+}
+
/*!
*
*/
static bool setViewSize( const int, const int, const int = 0 );
static QList<int> findViews( const QString& );
static bool activateView( const int );
+ static bool activateViewManagerAndView( const int );
static QWidget* getViewWidget( const int );
static int createView( const QString&, bool visible = true, const int width = 0, const int height = 0 );
static int createView( const QString&, QWidget* );
static bool setViewSize( const int, const int, const int = 0 ) /ReleaseGIL/ ;
static QList<int> findViews( const QString& ) /ReleaseGIL/ ;
static bool activateView( const int ) /ReleaseGIL/ ;
+ static bool activateViewManagerAndView( const int ) /ReleaseGIL/ ;
static QWidget* getViewWidget( const int ) /ReleaseGIL/ ;
static int createView( const QString&, bool visible = true, const int width = 0, const int height = 0 ) /ReleaseGIL/ ;
static int createView( const QString&, QWidget* ) /ReleaseGIL/ ;
virtual void updateDesktopTitle();
+ virtual void setActiveViewManager( SUIT_ViewManager* );
+
signals:
/*!emit that view manager added*/
void viewManagerAdded( SUIT_ViewManager* );
virtual void beforeCloseDoc( SUIT_Study* theDoc );
virtual void afterCloseDoc();
- virtual void setActiveViewManager( SUIT_ViewManager* );
-
virtual int openChoice( const QString& );
virtual bool openAction( const int, const QString& );