From: vsr Date: Fri, 27 Oct 2006 12:38:33 +0000 (+0000) Subject: Implement UpdateView() method X-Git-Tag: V3_2_3pre1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ed889505f1d13cdcc0f145a4089122ecac51bbd9;p=modules%2Fgui.git Implement UpdateView() method --- diff --git a/src/SALOME_SWIG/SALOMEGUI_Swig.cxx b/src/SALOME_SWIG/SALOMEGUI_Swig.cxx index 9f8e1e20c..99195e10a 100644 --- a/src/SALOME_SWIG/SALOMEGUI_Swig.cxx +++ b/src/SALOME_SWIG/SALOMEGUI_Swig.cxx @@ -569,3 +569,25 @@ bool SALOMEGUI_Swig::IsInCurrentView( const char* theEntry ) { return ProcessEvent( new TIsInViewerEvent( theEntry ) ); } + +/*! + Updates (repaint) current view +*/ +void SALOMEGUI_Swig::UpdateView() +{ + class TEvent: public SALOME_Event { + public: + TEvent() {} + virtual void Execute() { + if ( SalomeApp_Application* anApp = getApplication() ) { + SUIT_ViewWindow* window = anApp->desktop()->activeWindow(); + if ( window ) { + SALOME_View* view = dynamic_cast( window->getViewManager()->getViewModel() ); + if ( view ) + view->Repaint(); + } + } + } + }; + ProcessVoidEvent( new TEvent() ); +} diff --git a/src/SALOME_SWIG/SALOMEGUI_Swig.hxx b/src/SALOME_SWIG/SALOMEGUI_Swig.hxx index 456211227..c8777842e 100644 --- a/src/SALOME_SWIG/SALOMEGUI_Swig.hxx +++ b/src/SALOME_SWIG/SALOMEGUI_Swig.hxx @@ -60,6 +60,7 @@ public: void DisplayAll(); void EraseAll(); bool IsInCurrentView( const char *Entry ); + void UpdateView(); /* get component name/username */ const char* getComponentName( const char* ComponentUserName ); diff --git a/src/SALOME_SWIG/SALOMEGUI_Swig.i b/src/SALOME_SWIG/SALOMEGUI_Swig.i index 7820811c9..2d3a87a44 100644 --- a/src/SALOME_SWIG/SALOMEGUI_Swig.i +++ b/src/SALOME_SWIG/SALOMEGUI_Swig.i @@ -80,6 +80,7 @@ class SALOMEGUI_Swig void DisplayAll(); void EraseAll(); bool IsInCurrentView(const char *Entry); + void UpdateView(); /* get component name/username */ const char* getComponentName( const char* ComponentUserName );