antoine-source/appleworksgs/PL/Src/PMOUSE.S

1 line
8.7 KiB
ArmAsm
Raw Normal View History

2023-03-04 02:45:20 +00:00
load 'macros.dump' include 'driver.equ' include 'pl.equ' ;----------------------------------------------- ; ; Imported addresses ; ;----------------------------------------------- IMPORT P_PIconRect IMPORT P_IconPalette IMPORT P_GrowRect IMPORT P_ActionProc IMPORT P_ContentRect IMPORT P_CurrentWin IMPORT P_DblPage IMPORT P_DeselectAll IMPORT P_DrawHandles IMPORT P_Entry IMPORT P_FindObject IMPORT P_FixMenus IMPORT P_FixRect IMPORT P_GrewDoc IMPORT P_HRulRect IMPORT P_ImportHdl IMPORT P_ImportType IMPORT P_KillUndo IMPORT P_Local2PL IMPORT P_MDInTools IMPORT P_MakeFigure IMPORT P_MakeObj IMPORT P_MoveGuide IMPORT P_MoveObject IMPORT P_MoveTabs IMPORT P_NewGuide IMPORT P_NewTool IMPORT P_ObjList IMPORT P_Page IMPORT P_PageMode IMPORT P_PastePt IMPORT P_Placing IMPORT P_PortRect IMPORT P_ScrollPages IMPORT P_SelectRect IMPORT P_StretchObj IMPORT P_ThreadDir IMPORT P_ThreadHdl IMPORT P_ToolType IMPORT P_TrackCursor IMPORT P_VRulRect IMPORT P_VisPalette IMPORT P_VisRuler IMPORT T_Activate IMPORT T_Click IMPORT T_CurParHdl IMPORT T_Deactivate IMPORT T_DotObj IMPORT T_Editing ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY P_FindTextObj ENTRY P_MouseContent ;------------------------------------------------------------------------------ ; ; P_MouseDown (Click:w,TaskRec:l,CLickPt2:l,ClickPt3:l) ; ; 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 P_MouseDown PROC EXPORT ;Using P_IconData ;Using P_Data ;Using P_ObjData ;Using P_RulerData ;Using T_Data ;Using T_TextEqu INPUT Click:w,TaskRec:l,ClickPt2:l,ClickPt3:l LOCAL ThePt:l,tmprect:r,tmpctl:l BEGIN +b cpzl P_CurrentWin jeq Exit ; Just in case jsl P_Entry movelong [TaskRec]:#owhere,ThePt tool _GlobalToLocal,in=(!ThePt:l) CkContent tool _PtInRect,in=(!ThePt:l,#P_ContentRect:l),out=(a:w) beq CkPages call P_MouseContent,in=(TaskRec:l,click:w) brl Exit CkPages tool _ClipRect,in=(#P_PortRect:l) tool _PtInRect,in=(!ThePt:l,#P_PIconRect:l),out=(a:w) beq CkTools call P_ScrollPages,in=(ThePt+2:w) brl SetClip CkTools lda P_VisPalette beq CkControls tool _PtInRect,in=(!ThePt:l,#P_IconPalette:l),out=(a:w) beq CkControls call P_MDInTools,in=(ThePt:l) brl SetClip CkControls in !tmpctl:l,[TaskRec]:#owhere:l,P_CurrentWin:l out a:w xtool _FindControl beq CkGrow in [TaskRec]:#owhere:l,#P_ActionProc:l,tmpctl:l out a:w xtool _TrackControl brl SetClip CkGrow tool _PtInRect,in=(!ThePt:l,#P_GrowRect:l),out=(a:w) beq CkTabs spacelong addword #11,P_DblPage,a asl a asl a asl a asl a asl a pushword a pushword #P_MinHeight pushlong [TaskRec]:#owhere pushlong P_CurrentWin xtool _GrowWindow lda 1,s bne CleanUp lda 3,s bne CleanUp pla pla brl SetClip CleanUp lda 3,s and #$FFFE ; Q_Mask odd bit off. sta 3,s tool _SizeWindow,in=(P_CurrentWin:l) call P_GrewDoc,in=(P_CurrentWin:l) brl SetClip CkTabs lda P_VisRuler jeq SetClip ; Check if in tab area moverect P_HRulRect,tmprect moveword #10,tmprect tool _PtInRect,in=(!ThePt:l,!tmprect:l),out=(a:w) bne DoTabs ; Check if in tab well moveword P_HRulRect,tmprect moveword P_VRulRect+2,tmprect+2 movelong P_ContentRect,tmprect+4 tool _PtInRect,in=(!ThePt:l,!tmprect:l),out=(a:w) beq CkHGuide DoTabs