BUG: QuickBasic WINDOW Type 2 Disable Switching w/ MultiFinder (49129)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0

This article was previously published under Q49129

SYMPTOMS

In Macintosh QuickBasic Version 1.00, using a WINDOW of type 2, which has a double border, disables the ability to switch among applications with MultiFinder. If the current output window is a type 2 WINDOW, then clicking on the MultiFinder icon produces no results.

Microsoft has confirmed this to be a bug in QuickBasic Version 1.00 for the Macintosh . We are researching this problem and will post new information as it becomes available.

MORE INFORMATION

You can work around this problem by using WINDOW type 3, which does not disable MultiFinder, instead of WINDOW type 2. WINDOW type 2 has a double border and WINDOW type 3 has a single border, but the effect of WINDOW type 2 can be simulated with one of the following workarounds:

  1. Create a WINDOW of type 3, draw the appropriate borders, and then use the WINDOW. The disadvantage to this method is that the program must constantly control output to the WINDOW and detect refresh events to ensure that the borders are not overwritten or overlayed.
  2. Use two WINDOWs of type 3, making the first WINDOW larger and having a wide border around the edge. Make the second slightly smaller and place it directly "inside" of the first without covering WINDOW #1's borders. This gives the effect of a double border window.

Code Example

The second workaround is demonstrated in the following code example:
'*****************************
'* Double Border Window      *
'*****************************
DIM Win1Rect%(4) ' This will hold the coordinates for the border.
ON DIALOG GOSUB dlghandler
ON MENU GOSUB MenuHandler
MENU 1, 0,1, "File"
MENU 1,1,1,"Quit"

Message$ = "This is the current output window!"
ScreenW% = SYSTEM(5) - 50 ' Set window width (with margin).
ScreenH% = SYSTEM(6) - 50 ' Window Height (minus margin).
Corner% = 40  ' This is x and y coordinate for top corner of window.
Indent% = 8 ' This is the amount to indent the second window

WINDOW 1,,(Corner%,Corner%)-(ScreenW%,ScreenH%),3
x1%=Corner%+Indent%
y1%=Corner%+Indent%
x2%=ScreenW%-Indent%
y2%=ScreenH%-Indent%
WINDOW 2,,(x1%,y1%)-(x2%,y2%),3

' The following two statements draw the window for the first time:
RefreshFlag% = 5
GOSUB firsttime
LOCATE 5, 5
PRINT
' Turn on the event trapping:
DIALOG ON
MENU ON
WINDOW OUTPUT 2
' **** MAIN program loop ****
WHILE 1   ' Sits and waits for dialogs or menus to happen.
WEND

terminate:
   END

MenuHandler:
   ' If user chooses to Quit from the File menu.
   IF MENU (0) = 1 AND MENU(1) = 1 THEN
         ' Close windows before quitting.
         WINDOW CLOSE 1
         WINDOW CLOSE 2
         RETURN terminate
    END IF
    ' Otherwise, continue.
    RETURN

dlghandler:
   RefreshFlag% = DIALOG(0)
firsttime:
   IF RefreshFlag% = 5 THEN
      RefreshFlag% = 0 ' Reset the flag.
      WINDOW OUTPUT 1
      x2% = WINDOW(2)      ' Width of the window.
      y2% = WINDOW(3)      ' Height of the window.
      SetRect Win1Rect%(0),0,0,x2%,y2%
      CALL PENSIZE (3,3) ' Make the border fatter.
      FRAMERECT VARPTR(Win1Rect%(0)) ' Refresh the border.
      ' Return control back to the other window.
      WINDOW OUTPUT 2
      ' Refresh the message.
      LOCATE 5,5 : PRINT Message$
   END IF
RETURN
				

Modification Type:MinorLast Reviewed:1/8/2003
Keywords:kbbug KB49129