mirror of
https://github.com/antoinevignau/source.git
synced 2024-08-11 15:28:58 +00:00
1 line
18 KiB
Plaintext
1 line
18 KiB
Plaintext
|
LOAD 'Macros.dump'
INCLUDE 'M16.Profile'
INCLUDE 'SS.equ'
INCLUDE 'Driver.equ'
INCLUDE 'Heap.aii.i'
INCLUDE 'Eval.aii.i'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT D_AddStrings
IMPORT D_CheckPurge
IMPORT D_DisposePtr
IMPORT D_GetNewUntitled
IMPORT D_GetPrintHandle
IMPORT D_GetRefCon
IMPORT D_KillFont
IMPORT D_LoadSegment
IMPORT D_MakeNewWin
IMPORT D_NeedHand
IMPORT D_PrOpenDoc
IMPORT D_SelectFont
IMPORT D_SetCursor
IMPORT D_SetRefCon
IMPORT D_UnloadSegment
IMPORT S_ActivateScrlBars
IMPORT S_ActiveWindow
IMPORT S_BSRect
IMPORT S_BSValue
IMPORT S_BreakLink
IMPORT S_CalcAutoStr
IMPORT S_CalcManStr
IMPORT S_ColLab2Text
IMPORT S_ColLabRect
IMPORT S_CurBRMost
IMPORT S_CurBRSelect
IMPORT S_CurBScrl
IMPORT S_CurContHt
IMPORT S_CurContRect
IMPORT S_CurContWd
IMPORT S_CurContXpt
IMPORT S_CurContYpt
IMPORT S_CurEditFlag
IMPORT S_CurEditRect
IMPORT S_CurGrow
IMPORT S_CurLEHandle
IMPORT S_CurMaxTLCell
IMPORT S_CurPrinting
IMPORT S_CurRScrl
IMPORT S_CurRowBlock
IMPORT S_CurSheet
IMPORT S_CurTLCell
IMPORT S_CurTLSelect
IMPORT S_CurTwiceVertLines
IMPORT S_CurVertLineHandSize
IMPORT S_CurVertLines
IMPORT S_CurWindow
IMPORT S_DefWinRect
IMPORT S_DisposeRowBlock
IMPORT S_DoChecks
IMPORT S_ExTitle
IMPORT S_GetCellPtr
IMPORT S_GrowRect
IMPORT S_HideGridStr
IMPORT S_InitState
IMPORT S_InsertControls
IMPORT S_KillLinks
IMPORT S_LEHandle
IMPORT S_LoadAWorksInfo
IMPORT S_NewSheet
IMPORT S_PrintPage
IMPORT S_RSRect
IMPORT S_RSValue
IMPORT S_SetBRMostCell
IMPORT S_SetMaxTLCell
IMPORT S_SetUndoOff
IMPORT S_SetUndoOff2
IMPORT S_SetVertLines
IMPORT S_ShowGridStr
IMPORT S_SwapIn
IMPORT S_SwapOut
IMPORT S_TBarColor
IMPORT S_TitleColor
IMPORT S_ViewDataStr
IMPORT S_ViewFormStr
IMPORT S_WinColors
IMPORT S_WinPlane
IMPORT S_WinRect
IMPORT S_WinTitlePtr
IMPORT S_WindowParms
;-------------------------------------------------------------------------;
; S_ActivateDoc ( Window:l )
;
; S_ActivateDoc is called to make the given window the active window.
; The driver will make sure that the menu is as it was when the document was
; deactivated. (ie menu items are enabled, disabled, inserted and deleted
; just as they last were.) Any checks or menu item style changes, however,
; will have been lost and must be refreshed.
S_ActivateDoc PROC EXPORT
input Window:l
local Sheet:l
BEGIN +b
Call S_SwapIn,in=(Window:l)
CmpLong Window,S_ActiveWindow
jeq setMenuChecks
MoveLong Window,S_ActiveWindow
Call S_SetVertLines
; Set the Calculate Menu string appropriately
lda S_CurEditFlag
and #S_ManCalcBit
bne setAutoStr
Tool _SetMItemName,in=(#S_CalcManStr:l,#S_CalculateItem:w)
bra chkViewMode
setAutoStr
Tool _SetMItemName,in=(#S_CalcAutoStr:l,#S_CalculateItem:w)
; Set the View Menu string appropriately
chkViewMode
lda S_CurEditFlag
and #S_ViewFormulaBit
bne setDataStr
Tool _SetMItemName,in=(#S_ViewFormStr:l,#S_ViewItem:w)
bra chkGrid
setDataStr
Tool _SetMItemName,in=(#S_ViewDataStr:l,#S_ViewItem:w)
chkGrid
lda S_CurEditFlag
and #S_GridOff
beq resetGrid
Tool _SetMItemName,in=(#S_ShowGridStr:l,#S_GridItem:w)
bra chkLE
resetGrid
Tool _SetMItemName,in=(#S_HideGridStr:l,#S_GridItem:w)
; Set LE appropriately ;
chkLE
lda S_CurEditFlag
and #S_EditingBit
beq setMenuChecks
Tool _LEActivate,in=(S_CurLEHandle:l)
setMenuChecks
Call S_DoChecks
RETURN
ENDP
;-------------------------------------------------------------------------;
; S_DeactivateDoc ( Window:l )
;
; S_DeactivateDoc is called to deactivate the given document window.
; Active data is copied at this time to the windows information store.
S_DeactivateDoc PROC EXPORT
input Window:l
local Sheet:l
BEGIN +b
; Only deactivate if the window is still active ;
CmpLong Window,S_ActiveWindow
bne broughtOut
Call S_SetUndoOff2
CmpLong Window,S_CurWindow
bne notIn
Tool _LEDeActivate,in=(S_CurLEHandle:l)
Call S_SwapOut
bra broughtOut
notIn
Call D_GetRefCon,in=(Window:l),out=(Window:l
|