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

1 line
22 KiB
Plaintext
Raw Normal View History

2023-03-04 02:45:20 +00:00
load 'macros.dump' include 'driver.equ' include 'wp.equ' include 'WP.Macros' ;----------------------------------------------- ; ; Imported addresses ; ;----------------------------------------------- IMPORT W_BotLine IMPORT W_BotPB IMPORT W_BotPar IMPORT W_CalcDocRect IMPORT W_CalcFonts IMPORT W_CalcGrowREct IMPORT W_CalcNewLines IMPORT W_CalcPages IMPORT CaretOff IMPORT W_CurDoc IMPORT W_EdMakeCaret IMPORT W_EndLine IMPORT W_EndOffset IMPORT W_EndPar IMPORT W_FindLine IMPORT W_GetBegLine IMPORT W_GetEndLine IMPORT W_GetEndPar IMPORT W_GetHPos IMPORT W_GetLastLine IMPORT W_GetLeft IMPORT W_GetLineOffset IMPORT W_GetPageSize IMPORT W_GetParRec IMPORT W_GrewDoc IMPORT W_LastP IMPORT W_LeftMargin IMPORT W_LineToTopPixel IMPORT W_MakeCaret IMPORT W_MakeLines IMPORT W_MakeVisRuler IMPORT W_ModifyRuler IMPORT W_NewRuler IMPORT W_PaperSize IMPORT W_ParRec IMPORT W_PixelToLine IMPORT W_PixelToOffset IMPORT W_PutOnScreen IMPORT W_ReadRuler IMPORT Q_Rect IMPORT W_RightMargin IMPORT W_RulBytes IMPORT W_RulerClick IMPORT W_ScrollBar IMPORT W_ScrollBarProc IMPORT W_ScrollClick IMPORT W_SetDocRect IMPORT D_SetFileChanged IMPORT W_SetFullREct IMPORT W_ShowRuler IMPORT W_StartLine IMPORT W_StartOffset IMPORT W_StartPar IMPORT D_TextSelectOff IMPORT D_TextSelectOn IMPORT W_TopLine IMPORT W_TopPB IMPORT W_TopPar IMPORT W_TopPg IMPORT W_TopPgPixel IMPORT W_UnUseRuler IMPORT W_UndoOff IMPORT W_UseRuler IMPORT W_WPFontFlag IMPORT W_WordBounds IMPORT W_GetTopSpace IMPORT W_Selected ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY W_DoubleClick ENTRY W_GotPBPar ENTRY W_InvSelect ENTRY W_InvText ENTRY W_MInRuler ENTRY W_MouseInContent ENTRY W_PtToText ENTRY W_SelectOff ENTRY W_SelectOn ENTRY W_StartFirst ENTRY W_TripleClick ***************************************************************** * A mouse down occurred in the (Your) active window. * w-W_MyMouseDown(click:w,TaskRec:l,CLickPt2:l,ClickPt3:l) * input - * Click - the number of the click 1 - single click, 2 for double, 3 for triple * TaskRec - a pointer to an Event Record for you to look at. * ClickPt2 - the Q_Point(global) where the first click of this sequence was * Single click (click=1) look at the TaskRec as before, ClickPts are undefined. * Double click (click=2) look at the pt in the TaskRec(global) and see if it * is D_Close enough to ClickPt2(global) to be a double click. ClickPt3 is undefin * Triple click (click=3) check that ClickPt3 is D_Close enough to ClickPt2 * and the pt in TaskRec. * If you don't support a type of click, or it isn't D_Close enough together * just do the same thing you would do for single clicking W_MyMouseDown PROC EXPORT ;Using WPGlobals input click:w,TaskRec:l,ClickPt2:l,ClickPt3:l local Pt:r,Q_Rect:r,par:w,W_ParRec:l begin +b pushlong W_CurDoc _SetPort jsl CaretOff pha pushlong TaskRec jsl W_ScrollClick pla jne CExit lda W_ShowRuler beq NoRuler pha pushlong TaskRec ;changes Q_Point to local !!!!!! jsl W_RulerClick pla beq NoRuler jsl W_UndoOff jsl W_MInRuler brl CExit NoRuler movelong [TaskRec]:#owhere,Pt pushlong !Pt _GlobalToLocal pushlong !Q_Rect jsl W_CalcGrowREct pha pushlong !Pt pushlong !Q_Rect _PtInRect pla beq InContent pha pha ;room pushword #200 ;minimum width pushword #75 ;minimum W_Height pushlong [TaskRec]:#owhere pushlong W_CurDoc _GrowWindow pushlong W_CurDoc _SizeWindow pushlong W_CurDoc jsl W_GrewDoc bra CExit InContent pushlong !Q_Rect jsl W_CalcDocRect pha pushlong !Pt pushlong !Q_Rect _PtInRect pla jeq CExit jsl W_UndoOff lda click cmp #1 beq Click1 cmp #2 beq Click2 Click3 pushlong Pt jsl W_TripleClick brl CExit Click2 pushlong Pt jsl W_DoubleClick brl CExit Click1 pushlong TaskRec pushlong Pt jsl W_MouseInContent CExit return ENDP *************************************