Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
17060 Discussions

Close all but 1 QuickWin window

Intel_C_Intel
Employee
525 Views
I have a QuickWin program in which I would like to implement a "Close All" command--except that I want to leave one window open, unit 10. The other unit numbers are not known, although there's only one in the range 20-29, one in the range 30-39, .... Now, this works

  DO I = 11, 99 
    CLOSE(I) 
  ENDDO


but I need to deallocate arrays according to what unit is actually closed.

I thought something like the following would be helpful, but GetUnitQQ() always returned -1.

NextUnit = GetUnitQQ(GetWindow(GetHwndQQ(10), GW_HWNDNEXT))

Does anyone know how to fix this up? Otherwise I'm left with restoring and minimizing window unit 10 whenever it gets the focus, and that seems quite clunky!

  INTEGER :: I, nUnit, NextWin 
 
! Close all child windows except LUN=10 
  I = FOCUSQQ(10) 
  nUnit = NextWin(10) 
  DO WHILE(nUnit .NE. 10) 
    CALL MY_CLOSE_ROUTINE(nUnit) 
    I = INQFOCUSQQ(nUnit) 
    IF (nUnit .EQ. 10) nUnit = NextWin(10) 
  ENDDO 
	: 
	: 
INTEGER FUNCTION NextWin(RefWin) 
  USE DFLIB 
  IMPLICIT NONE 
  INTEGER, INTENT(IN) :: RefWin 
  INTEGER :: I, nWin 
  TYPE (QWINFO) :: wc 
 
  wc%type = QWIN$RESTORE 
  I = SetWSizeQQ(RefWin,wc)  
  wc%type = QWIN$MIN 
  I = SetWSizeQQ(RefWin,wc)  
  I = INQFOCUSQQ(nWin) 
  IF (nWin .EQ. RefWin) THEN 
    wc%type = QWIN$RESTORE 
    I = SetWSizeQQ(RefWin,wc)  
  ENDIF 
  NextWin = nWin 
END FUNCTION NextWin 
 


I appreciate what a helpful forum this is!
Dick
0 Kudos
2 Replies
Steven_L_Intel1
Employee
525 Views
You can use INQUIRE (UNIT=n,OPENED=logicalvar) to see if a unit is open, and then process accordingly.

Steve
0 Kudos
Intel_C_Intel
Employee
525 Views
Ah, but of course! Thank you, Steve.
0 Kudos
Reply