From: apo Date: Sun, 25 Nov 2007 14:39:56 +0000 (+0000) Subject: Fix for Bug IPAL17651 X-Git-Tag: mergefrom_MERGE_MULTIPR_EVOLUTION_07-Dec-07~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=461762a11fc8c7592c7dc937e16c4200bf65c251;p=modules%2Fvisu.git Fix for Bug IPAL17651 4.x: "Xlib: unexpected async reply" during execution of the script attached to N7PAL15530. --- diff --git a/src/VISU_I/VISU_View_i.cc b/src/VISU_I/VISU_View_i.cc index c950f0da..c25f276c 100644 --- a/src/VISU_I/VISU_View_i.cc +++ b/src/VISU_I/VISU_View_i.cc @@ -1116,50 +1116,91 @@ namespace VISU { return -1; } - class TEnableGridEvent: public SALOME_Event - { - public: - typedef void (Plot2d_ViewFrame::* TFun)(bool, const int, bool, const int, bool); - TEnableGridEvent (Plot2d_ViewFrame* theView, TFun theFun, - CORBA::Boolean theMajor, CORBA::Long theNumMajor, - CORBA::Boolean theMinor, CORBA::Long theNumMinor): - myView(theView), myFun(theFun), - myMajor(theMajor), myNumMajor(theNumMajor), - myMinor(theMinor), myNumMinor(theNumMinor) - {} - - virtual void Execute() - { - (myView->*myFun)(myMajor,myNumMajor,myMinor,myNumMinor,true); - } - protected: - Plot2d_ViewFrame* myView; - TFun myFun; - CORBA::Boolean myMajor, myMinor; - CORBA::Long myNumMajor, myNumMinor; - }; - void XYPlot_i::EnableXGrid (CORBA::Boolean theMajor, CORBA::Long theNumMajor, CORBA::Boolean theMinor, CORBA::Long theNumMinor) { - if (GetViewWindow()) - myView->setXGrid(theMajor,theNumMajor,theMinor,theNumMinor); + class TEvent: public SALOME_Event + { + public: + TEvent (Plot2d_ViewFrame* theView, + CORBA::Boolean theMajor, + CORBA::Long theNumMajor, + CORBA::Boolean theMinor, + CORBA::Long theNumMinor): + myView(theView), + myMajor(theMajor), + myNumMajor(theNumMajor), + myMinor(theMinor), + myNumMinor(theNumMinor) + {} + + virtual void Execute() + { + myView->setXGrid( myMajor, myNumMajor, myMinor, myNumMinor ); + } + protected: + Plot2d_ViewFrame* myView; + CORBA::Boolean myMajor, myMinor; + CORBA::Long myNumMajor, myNumMinor; + }; + + if ( GetViewWindow() ) + ProcessVoidEvent( new TEvent( myView, theMajor, theNumMajor, theMinor, theNumMinor ) ); } - void XYPlot_i::EnableYGrid(CORBA::Boolean theMajor, CORBA::Long theNumMajor, - CORBA::Boolean theMinor, CORBA::Long theNumMinor) + void XYPlot_i::EnableYGrid(CORBA::Boolean theMajor, + CORBA::Long theNumMajor, + CORBA::Boolean theMinor, + CORBA::Long theNumMinor) { - this->EnableYGrid(theMajor,theNumMajor,theMinor,theNumMinor, - false,0,false,0); + this->EnableYGrid( theMajor, theNumMajor, theMinor, theNumMinor, false, 0, false, 0 ); } - void XYPlot_i::EnableYGrid(CORBA::Boolean theMajor, CORBA::Long theNumMajor, - CORBA::Boolean theMinor, CORBA::Long theNumMinor, - CORBA::Boolean the2Major, CORBA::Long the2NumMajor, - CORBA::Boolean the2Minor, CORBA::Long the2NumMinor) + void XYPlot_i::EnableYGrid(CORBA::Boolean theMajor, + CORBA::Long theNumMajor, + CORBA::Boolean theMinor, + CORBA::Long theNumMinor, + CORBA::Boolean the2Major, + CORBA::Long the2NumMajor, + CORBA::Boolean the2Minor, + CORBA::Long the2NumMinor) { + class TEvent: public SALOME_Event + { + public: + TEvent (Plot2d_ViewFrame* theView, + CORBA::Boolean theMajor, + CORBA::Long theNumMajor, + CORBA::Boolean theMinor, + CORBA::Long theNumMinor, + CORBA::Boolean the2Major, + CORBA::Long the2NumMajor, + CORBA::Boolean the2Minor, + CORBA::Long the2NumMinor): + myView(theView), + myMajor(theMajor), + myNumMajor(theNumMajor), + myMinor(theMinor), + myNumMinor(theNumMinor), + my2Major(the2Major), + my2NumMajor(the2NumMajor), + my2Minor(the2Minor), + my2NumMinor(the2NumMinor) + {} + + virtual void Execute() + { + myView->setYGrid( myMajor, myNumMajor, myMinor, myNumMinor, + my2Major, my2NumMajor, my2Minor, my2NumMinor); + } + protected: + Plot2d_ViewFrame* myView; + CORBA::Boolean myMajor, myMinor, my2Major, my2Minor; + CORBA::Long myNumMajor, myNumMinor, my2NumMajor, my2NumMinor; + }; + if (GetViewWindow()) - myView->setYGrid(theMajor,theNumMajor,theMinor,theNumMinor, - the2Major,the2NumMajor,the2Minor,the2NumMinor); + ProcessVoidEvent( new TEvent( myView, theMajor, theNumMajor, theMinor, theNumMinor, + the2Major, the2NumMajor, the2Minor, the2NumMinor ) ); } class TSetScaleModeEvent: public SALOME_Event