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

1 line
22 KiB
Plaintext
Raw Normal View History

2023-03-04 02:45:20 +00:00
LOAD 'Macros.dump' INCLUDE 'SS.equ' INCLUDE 'Driver.equ' INCLUDE 'Heap.aii.i' ; IMPORT ArrowCursor ; IMPORT LeftRightCursor ; IMPORT OkBox ; IMPORT appleKey ; IMPORT shiftKey ;----------------------------------------------- ; ; Imported addresses ; ;----------------------------------------------- IMPORT D_AlertBox IMPORT D_BitMapChanged IMPORT D_BitMapPtr IMPORT D_MemoryError IMPORT D_SetCursor IMPORT S_ActivateScrlBars IMPORT S_ActiveWindow IMPORT S_AdjustCell IMPORT S_AdjustPoint IMPORT S_AdjustSheetColumns IMPORT S_CalculateSheet IMPORT S_Cell2Str IMPORT S_ChangeColWidth IMPORT S_ColLabRect IMPORT S_CurBRSelect IMPORT S_CurBScrl IMPORT S_CurContHt IMPORT S_CurContWd IMPORT S_CurContXpt IMPORT S_CurContYpt IMPORT S_CurEditFlag IMPORT S_CurEditRect IMPORT S_CurGrow IMPORT S_CurLEHandle IMPORT S_CurRScrl IMPORT S_CurTLCell IMPORT S_CurTLSelect IMPORT S_CurTwiceVertLines IMPORT S_CurVertLines IMPORT S_CurWindow IMPORT S_DashMask IMPORT S_DeltaMove IMPORT S_DoChecks IMPORT S_DoMove IMPORT S_DrawLocation IMPORT S_DrawMove IMPORT S_FindRect IMPORT S_FixLE IMPORT S_GrowDoc IMPORT S_HScrlAction IMPORT S_HiliteCells IMPORT S_MoveSrcBR IMPORT S_MoveSrcTL IMPORT S_NoMoveReasonMsg IMPORT S_NormalMask IMPORT S_RefreshScreen IMPORT S_RowLabRect IMPORT S_SetCurFormat IMPORT S_SetEdittingMenus IMPORT S_SetUndoOn IMPORT S_SetVertLines IMPORT S_SwapIn IMPORT S_Thumb IMPORT S_VScrlAction IMPORT S_WhereCell IMPORT S_WhichCell ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY S_ColLabelClick ENTRY S_GIFinish ENTRY S_GIMiddle ENTRY S_GIScroll ENTRY S_GIStart ENTRY S_PointShootMove ENTRY S_SelectCells ENTRY S_SelectFinish ENTRY S_SelectMiddle ENTRY S_SelectScroll ENTRY S_SelectStart ENTRY S_TrackVertLine ;-------------------------------------------------------------------------; ; S_MouseInfo ( TaskRecordPtr:l ) ; ; S_MouseInfo is called by the driver to handle a mouse down event in ; the currently active window's info bar. S_MouseInfo PROC EXPORT input TaskRecordPtr:l BEGIN ; +b RETURN ENDP ;-------------------------------------------------------------------------; ; S_MouseUp ( TaskRecordPtr:l ) ; ; S_MouseUp is called by the driver when the preceding mouse down was in ; an SS window and a mouse up has occured. S_MouseUp PROC EXPORT input TaskRecordPtr:l BEGIN ; +b RETURN ENDP ;-------------------------------------------------------------------------; ; S_MouseDown ( Click:w,TaskRecordPtr:l,ClickPt2:l,ClickPt3:l ) ; ; S_MouseDown is called by the driver to handle a mouse down event in ; SS's currently active window. S_MouseDown PROC EXPORT ;Using S_CurrentData input Click:w,TaskRecordPtr:l,ClickPt2:l,ClickPt3:l local Point:l,Control:l local ModField:w,Rect:r BEGIN +b Call S_SwapIn,in=(S_ActiveWindow:l) Tool _SetPort,in=(S_ActiveWindow:l) MoveLong [TaskRecordPtr]:#10,Point MoveWord [TaskRecordPtr]:#14,ModField out a:w in !Control:l,Point:l,S_CurWindow:l XTool _FindControl jeq notcontrol docontrol Call D_SetCursor,in=(#ArrowCursor:w) CmpLong Control,S_CurGrow bne dotrack out :l in #200:w,#70:w,Point:l,S_CurWindow:l XTool _GrowWindow Tool _SizeWindow,in=(:l,S_CurWindow:l) Call S_GrowDoc,in=(S_CurWindow:l) brl Exit dotrack Tool _GetCtlRefCon,in=(Control:l),out=(ax:l) asl a asl a tax in Point:l,ActionTable:x:l,Control:l out a:w XTool _TrackControl beq skipThumb ; Check if thumb was tracked. cmp #$81 bne skipThumb Call S_Thumb,in=(Control:l) skipThumb Call S_SetVertLines brl Exit notcontrol Tool _GlobalToLocal,in=(!Point:l) ; Handle Line Edit click ; Tool _PtInRect,in=(!Point:l,#S_CurEditRect:l),out=(a:w) beq notEdit CmpLong S_CurTLSelect,S_CurBRSelect jne Exit lda S_CurEditFlag and #S_Edi