mirror of
https://github.com/antoinevignau/source.git
synced 2025-01-20 02:30:40 +00:00
1 line
32 KiB
Plaintext
1 line
32 KiB
Plaintext
|
LOAD 'Macros.dump'
INCLUDE 'SS.equ'
INCLUDE 'Driver.equ'
INCLUDE 'Heap.aii.i'
INCLUDE 'Eval.aii.i'
;-----------------------------------------------
;
; Imported addresses
;
;-----------------------------------------------
IMPORT D_AlertBox
IMPORT D_BeachBall
IMPORT D_DisableMItems
IMPORT D_EnableMItems
IMPORT D_FastMult
IMPORT D_GetRefCon
IMPORT D_GrowHandle
IMPORT D_NeedHandle
IMPORT D_NewCtl
IMPORT D_SetCursor
IMPORT D_SetFileChanged
IMPORT X_FormatValue
IMPORT S_ActivateScrlBars
IMPORT S_ActiveWindow
IMPORT S_AdjustTitleOffset
IMPORT S_AworksMemError
IMPORT S_BSRect
IMPORT S_BScrollTemp
IMPORT S_BuildColWdUndo
IMPORT S_CalcAutoStr
IMPORT S_ColLabRect
IMPORT S_CurBRMost
IMPORT S_CurBRSelect
IMPORT S_CurBRTitle
IMPORT S_CurBScrl
IMPORT S_CurChangedList
IMPORT S_CurChartCount
IMPORT S_CurChartList
IMPORT S_CurColumnWds
IMPORT S_CurContHt
IMPORT S_CurContRect
IMPORT S_CurContWd
IMPORT S_CurContXpt
IMPORT S_CurContYpt
IMPORT S_CurCopySize
IMPORT S_CurDefColWd
IMPORT S_CurDefFormat
IMPORT S_CurEditFlag
IMPORT S_CurFormat
IMPORT S_CurGrow
IMPORT S_CurHeap
IMPORT S_CurLEHandle
IMPORT S_CurMaxTLCell
IMPORT S_CurRScrl
IMPORT S_CurRowBlock
IMPORT S_CurSheet
IMPORT S_CurSheetInfo
IMPORT S_CurTLCell
IMPORT S_CurTLSelect
IMPORT S_CurTLTitle
IMPORT S_CurTwiceVertLines
IMPORT S_CurVPageSize
IMPORT S_CurVertLineHandSize
IMPORT S_CurVertLines
IMPORT S_CurWindow
IMPORT S_GetCellPtr
IMPORT S_GetCellTableEntry
IMPORT S_GrowRect
IMPORT S_GrowTemp
IMPORT S_InsertLeftPadCells
IMPORT S_InsertRightPadCells
IMPORT S_LEDestRect
IMPORT S_LEViewRect
IMPORT S_NormalizeRange
IMPORT S_RSRect
IMPORT S_RSViewSize
IMPORT S_RScrollTemp
IMPORT S_RemovePadCells
IMPORT S_ResetCircularBits
IMPORT S_RowLabRect
IMPORT S_ScrlUpdate
IMPORT S_SetUndoOff
IMPORT S_SheetSize
IMPORT S_ViewDataStr
;-----------------------------------------------
;
; Forward addresses and entries
;
;-----------------------------------------------
ENTRY S_FixPadCells
ENTRY S_QTraverse
ENTRY S_SetCellWidth
ENTRY S_SwapOut
ENTRY S_WhereCell
;---------------------------------------------------------------------------
; S_CellWidth( Col:w ): Width:w
;
; This routine gets the width of a given cell in the current sheet.
S_CellWidth PROC EXPORT
;Using S_CurrentData
input Col:w
output Width:w
local WdArray:l
error DefaultFlag
BEGIN
stz DefaultFlag
lda S_CurColumnWds
ora S_CurColumnWds+2
beq getDefault
H_GetBlockPtr S_CurColumnWds,WdArray
ldy Col
lda [WdArray],y
and #$00FF
beq getDefault
asl a
asl a
sta Width
bra Exit
getDefault
MoveWord S_CurDefColWd,Width
inc DefaultFlag
Exit
RETURN
ENDP
;--------------------------------------------------------------------------
;
;
S_ChangeColWidth PROC EXPORT
input Col:w,NewWidth:w
local OldWidth:w
error ErrFlag
BEGIN
stz ErrFlag
Call S_BuildColWdUndo,in=(Col:w),err=ErrFlag
bcs Exit
Call S_CellWidth,in=(Col:w),out=(OldWidth:w)
Call S_SetCellWidth,in=(Col:w,NewWidth:w),err=ErrFlag
bcs Exit
CmpWord OldWidth,NewWidth
beq Exit
Call S_AdjustTitleOffset
in Col:w,#1:w,Col:w,#9999:w,#S_FixPadCells:l
XCall S_QTraverse,err=ErrFlag
Exit
RETURN
ENDP
;---------------------------------------------------------------------------
;
;
S_ChangeDef PROC EXPORT
input Cell:l
error ErrorFlag
BEGIN
stz ErrorFlag
Call S_CellWidth,in=(Cell+2:w),out=(a:w)
bcc Exit
in Cell+2:w,#1:w,Cell+2:w,#9999:w,#S_FixPadCells:l
XCall S_QTraverse,err=ErrorFlag
Exit
RETURN
ENDP
;-----------------------------------------------------------------------------
; S_ColLab2Text ( Cell:a ) Text:a
;
; Input, an internal column number, is passed in the a-register,
; and output, a text form of the corsponding column, is returned in
; the a-register.
S_ColLab2Text PROC EXPORT
BEGIN
dec a
Tool _UDivide,in=(a:w,#26:w),ou
|