
FB II Compiler
PG PRO
Debugging
Memory
System
Mathematics
Resources
Disk I/O
Windows
Controls
Menus
Mouse
Keyboard
Text
Fonts
Drawing
Sound
Clipboard
Printing
Communication
ASM
|
WINDOWS
Correct FB Editor window
I finally got around to fixing the last two problems:
FB has a small bug in it that allows it to open a window at startup, before the Project Manager can get in and load up the Window positon information. There is another small bug were it uses a previous windows positon information instead of the current window's position info.
I have managed to track and correct both these bugs, hopefully without creating any new ones. It is so great being able to double-click on a project file, and have all the windows put back to where they were last time. You will be able to tell when the fix has done its work, because you will see the window open-up in the wrong location, then quickly move to its correct location!
Here are the fixes, they must be applied to your source code for the project manager tool, then re-compile, and add it in using the tool manager. If you don't want to make these changes yourself, let me know, and I will send you a compiled version. Note that you may have to turn off _MacsBugLabels to get in under the 32k limit.
Good Luck
In the file "PM Selector.INCL" find "FN OpenAFile" and add the part at the bottom:
CLEAR LOCAL
DIM FBWSel% 'Selector
DIM FBWRslt& 'Result
DIM FBWWndPtr& 'Window Pointer
DIM FBWBehind& 'Behind this window
DIM FBWRect%;8 'Window Rect
DIM FBWLine% 'Which Line
DIM FBWSelStrt%,FBWSelEnd% 'Sel Start/End
DIM FBWVolume% 'Vol of File
DIM FBWName$;64 'File Name
DIM TempWindow&
'
DIM PBlock.128
'
LOCAL FN OpenAFile(FileName$,FileVolume%)
LONG IF LEN(FileName$)
PBlock.IOVRefNum% = FileVolume%
PBlock.IONamePtr& = @FileName$
IF FN GETFILEINFO(@PBlock) THEN EXIT FN '**** Changed =10/27/95 ***
END IF
'
EditWindow& = [gVector&+_ZgEditWindow] ' FUTURE Basic edit Window
FBWRect%;8 = EditWindow&+_portRect ' = 3/11/95 =
CALL GETPORT(oldPort&) ' = 3/11/95 =
CALL SETPORT(EditWindow&) ' = 3/11/95 =
FN LocalToGlobalRect(FBWRect)
CALL SETPORT(oldPort&) ' = 3/11/95 =
CALL OFFSETRECT(FBWRect%,5,5) ' = 3/11/95 =
'
FBWSel% = _FBWOpenWindow 'Selector
FBWBehind& = -1 'Behind this =window
FBWVolume% = FileVolume% 'Vol of File
FBWName$ = FileName$ 'File Name
'
FN getWPos(FileName$,FBWRect%) 'open to old =size/pos
CALL "DCOD",64,Rslt&,(@FBWSel%)
SELECT CASE Rslt&
CASE 0 'already open & frontmost
FN FindALine
CASE 1 'open, not frontmost
CASE 2 'was not open
TempWindow& = [gVector&+_ZgEditWindow] 'wnd to close after compiling
gCloseSoon& = TempWindow&
END SELECT
' **** Start of Jamins Additions
windowFix& = FN FRONTWINDOW
LONG IF windowFix& > 0
CALL MOVEWINDOW(windowFix&,FBWRect.left%,FBWRect.top%,_true)
CALL = SIZEWINDOW(windowFix&,FBWRect.right%-FBWRect.left%,FBWRect.bottom%-FBWRect.top%,_true)
udProc& = REGISTER%(D0) + 80 'FB Resize Vector
CALL udProc&
FN PMSetFBOutput(windowFix&)
END IF
' **** End of Jamins Additions
END FN = TempWindow&
In the file "PM.DCOD" find "FN getWPos" and REM out to lines:
LOCAL FN getWPos(recordPtr&)
DIM rectPtr&,namePtr&
DIM y&;0,y,x
DIM t,l,b,r
'---------------------------------------
rectPtr&;8 = recordPtr&
rName$ = PSTR$(namePtr&)
InValidRect = _zTrue
'
rHndl& = FN GETNAMEDRESOURCE(_"wPos",rName$)
LONG IF rHndl&
y& = rHndl&..Top& : y = y-8
LONG IF FN PTINRGN(y&,[_GrayRgn])
y& = rHndl&..Bottom&
'LONG IF FN PTINRGN(y&,[_GrayRgn]) <- Jamin Changed =(REM out)
BLOCKMOVE [rHndl&],rectPtr&,8
InValidRect = _False
'END IF <- Jamin Changed =(REM out)
END IF
END IF
'
END FN
|