antoine-source/appleworksgs/SS/Src/Edit.aii

1 line
25 KiB
Plaintext
Raw Normal View History

2023-03-04 02:45:20 +00:00
LOAD 'Macros.dump' INCLUDE 'SS.equ' INCLUDE 'Driver.equ' INCLUDE ':::Scrap:Scrap.equ' INCLUDE 'Heap.aii.i' INCLUDE 'Eval.aii.i' ;----------------------------------------------- ; ; Imported addresses ; ;----------------------------------------------- IMPORT D_AlertBox IMPORT D_BeachBall IMPORT D_BitMapChanged IMPORT D_BitMapPtr IMPORT D_GrowHandle IMPORT D_MemoryError IMPORT D_NeedHand IMPORT D_SetFileChanged IMPORT D_SetUndoStr IMPORT X_DialogFromScrap IMPORT X_DisposeScrap IMPORT X_PostScrap IMPORT S_AcceptCell IMPORT S_ActiveWindow IMPORT S_AddCellToChangedList IMPORT S_BadPasteMsg IMPORT S_BuildSimpleUndo IMPORT S_CalculateSheet IMPORT S_CellWidth IMPORT S_ChkCellProtect IMPORT S_CurBRSelect IMPORT S_CurContHt IMPORT S_CurContWd IMPORT S_CurContXpt IMPORT S_CurContYpt IMPORT S_CurDefFormat IMPORT S_CurEditFlag IMPORT S_CurEditRect IMPORT S_CurHeap IMPORT S_CurLEHandle IMPORT S_CurTLSelect IMPORT S_CurWindow IMPORT S_ErrorFormula IMPORT S_ErrorFormulaLength IMPORT S_ExtraData IMPORT S_ExtraDataMsg IMPORT S_FixLE IMPORT S_GetCellIndex IMPORT S_GetRealCell IMPORT S_INFFormula IMPORT S_INFFormulaLength IMPORT S_NAFormula IMPORT S_NAFormulaLength IMPORT S_NegINFFormula IMPORT S_NegINFFormulaLength IMPORT S_NewLineEdit IMPORT S_ParseText IMPORT S_ProtectedCell IMPORT S_ProtectedCellMsg IMPORT S_QTraverse IMPORT S_RedrawCellRange IMPORT S_RemoveCell IMPORT S_SetUndoOn IMPORT S_SwapIn IMPORT S_SwapOut IMPORT S_UndoHandle IMPORT S_UndoNames IMPORT S_UndoType IMPORT S_WhichCell ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY S_AddBufferToScrap ENTRY S_CheckFormula ENTRY S_ClearCell ENTRY S_CopyFrame ENTRY S_CopyRect ENTRY S_GetSSScrap ENTRY S_Image ENTRY S_PutSSScrap ENTRY S_ScrapBR ENTRY S_ScrapLeft ENTRY S_ScrapRight ENTRY S_ScrapTL ENTRY S_SetImage ;-------------------------------------------------------------------------; ; S_Clear ; ; S_Clear will clear the currently selected item(s) from the active ; document. S_Clear PROC EXPORT ;Using S_ScrapData ;Using S_CurrentData ;Using S_ProtectData ;Using S_ErrorData error ErrFlag BEGIN +b stz ErrFlag Call S_SwapIn,in=(S_ActiveWindow:l) lda S_CurEditFlag and #S_EditingBit beq notLE Tool _LEDelete,in=(S_CurLEHandle:l) brl Exit notLE in S_CurTLSelect:l,S_CurBRSelect:l,#S_ChkCellProtect:l XCall S_QTraverse bcc contClear Call D_AlertBox,in=(#OkBox:w,#S_ProtectedCellMsg:l),out=(a:w) brl Exit contClear MoveLong S_CurTLSelect,S_ScrapTL MoveLong S_CurBRSelect,S_ScrapBR in S_CurTLSelect:l,S_CurBRSelect:l XCall S_BuildSimpleUndo,err=ErrFlag bcs memError Call S_QTraverse,in=(S_ScrapTL:l,S_ScrapBR:l,#S_ClearCell:l) bcc redraw memError Call D_MemoryError redraw ldx #0 Call S_NewLineEdit,in=(x:w,x:w) in S_ScrapTL:l,S_ScrapBR:l XCall S_RedrawCellRange Call S_SetUndoOn,in=(#S_UndoClearType:w) lda S_CurEditFlag and #S_ManCalcBit bne Exit Call S_CalculateSheet Exit RETURN ENDP ;------------------------------------------------------------------------- ; ; S_ClearCell PROC EXPORT ;Using S_ScrapData input Cell:l,CellIndex:l error ErrorFlag BEGIN ; Note: cells will be added to ChangedList in S_RemoveCell ; Another Note: There is no need to execute this code on pad or empty ; cells. Put in branch around in that case. ldx #S_CellTypeEmpty in Cell:l,x:w,x:w,x:w,x:w out :l,:l XCall S_AcceptCell,err=ErrorFlag fixLRCells pla pla cmp S_ScrapRight blt OKright sta S_ScrapRight OKright pla pla cmp S_ScrapLeft bge Exit sta S_ScrapLeft Exit RETURN ENDP ;-------------------------------------------------------------------------; ; S_Copy (Window:l): ImageRoutine:l, Type:w, Scrap:l ; ; S_Copy will perform a copy of the c