Silverfrost Forums

Welcome to our forums

Problem with closing a child window

8 Sep 2013 3:48 #12986

I have opened a window for plotting purposes by the following routine:

 i=winio@('%ca@&',STDIS(NONLINEPL))
      i=winio@('%mi[icon_1]&')
      i=winio@('%ww[no_border,topmost]&')

......
......
......


     i=winio@('%nl%nl%nl%nl%nl%nl%dd%^`4rd&',SCALESTEP(NONLINEPL),scaleminpl1(NONLINEPL),setpl)
      i=winio@('%hw&',hwndchild)
      i=winio@('%cc&',ex_funplot)
      i=winio@('%pv%lw',ctrl1)
 
     i=winio@('%`gr[white,rgb_colours]&',180L,160L,IDGR)
!
      IHWPLOT(NONLINEPL)=HWNDCHILD
      IDGRPLOT(NONLINEPL)=IDGR

I would like to close these windows automatically using their related numbers that are saved in common blocks by the followings:

integer function ex_funplot()
        INCLUDE <WINDOWS.INS>
!      COMMON /ONLINEPLOT0/ NONLINEPL
      COMMON /ONLINEPLOT3/ IHWPLOT( 21),IDGRPLOT( 21)
      INTEGER*4 IHWPLOT,IHW,IDGRPLOT
      COMMON /ONLINEPLOT1/ IPLOTVOLTB(1800),IPLOTVOLTG( 399),IPLOTVOLTM( 615),IPLOTVOLTL(2,2730)
      INTEGER*2 IPLOTVOLTB,IPLOTVOLTG,IPLOTVOLTM,IPLOTVOLTL
      COMMON /ONLINEPLOT7/ IPLOTVOLTRETURN( 21),IDLOTVOLTRETURN( 21)
      COMMON /TEACHERPLOT1/ ITE,IC,IROU
      INTEGER*4 ITE,IROU,IC
      IROU=2
      IF(ITE.EQ.2)THEN
      I=INTS(IC)
      GOTO 50
      ENDIF
      IHW  = clearwin_info@('FOCUS_WINDOW')
      DO 10 I=1,( 21)
      IF(IHW.EQ.IHWPLOT(I))GOTO 50
  10  CONTINUE
      GOTO 200
  50  IHWPLOT(I)=0
      NONLINEPL=IDGRPLOT(I)-1000
      ID=IDLOTVOLTRETURN(NONLINEPL)
      IS=IPLOTVOLTRETURN(NONLINEPL)
      IF(ID.GE.1)THEN
      IPLOTVOLTB(IS)=0
      ELSEIF(ID.GE.7)THEN
      IPLOTVOLTG(IS)=0
      ELSEIF(ID.GE.13)THEN
      IPLOTVOLTM(IS)=0
      ELSEIF(ID.GE.19)THEN
      IPLOTVOLTL(1,IS)=0
      ELSEIF(ID.GE.25)THEN
      IPLOTVOLTL(2,IS)=0
      ENDIF
      IDGRPLOT(I)=0
!  14  NONLINEPL=NONLINEPL-1
      IF(ITE.EQ.2)GOTO 200
      IC=I
      call teachstudplots
 200  ex_funplot=0
      end

What routine should I use. I have tested many routines for this purpose but none of them worked.

8 Sep 2013 7:06 #12987

Make sure ctrl1 is integer*4 Put it in a common block so you can access it. To close window set it to zero and Call window_update@(ctrl1)

8 Sep 2013 7:14 #12988

Ian is right. There are other more elaborate ways, and these can be used to close windows in other self-contained applications.

I noted your %nl%nl etc. You could use (say) %5nl

Eddie

Please login to reply.