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

1 line
16 KiB
Plaintext
Raw Normal View History

2023-03-04 02:45:20 +00:00
load 'macros.dump' include 'driver.equ' include 'wp.equ' ;----------------------------------------------- ; ; Imported addresses ; ;----------------------------------------------- IMPORT W_BoxAdTable IMPORT W_BoxLocTable IMPORT W_DTabPc IMPORT D_DrawIcon IMPORT W_LTabPc IMPORT W_MargPc IMPORT W_RTabPc IMPORT W_TabWell IMPORT W_IndentPc IMPORT Q_Mask IMPORT W_NothingPc IMPORT W_oldnumtabs IMPORT Q_Point IMPORT W_TabIcons IMPORT W_vr_indentm IMPORT W_vr_leftm IMPORT W_vr_numtabs IMPORT W_vr_rightm IMPORT W_vr_status IMPORT W_vr_tablist import W_r_changes import W_RulOffset ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY W_CheckWells ENTRY W_DeleteTab ENTRY W_InvertBitBox ENTRY W_SetStatBit ENTRY W_TrackTab **************************************************************** * * StyleWorks word processor RULERS private routines *______________________________________________________________* * * CONTENTS: * W_OneRulClick(clickpt:l) -> changed:w * W_DeleteTab(num:w) ; * W_InsertTab(type:w,pos:w) * W_TrackTab(type:w) ; * W_SetStatBit(bit:w) * W_InvertBitBox(bit:w) * **************************************************************** **************************************************************** * * W_OneRulClick(clickpt:l) -- W_Handle a single D_MouseDown event * in the visible ruler * **************************************************************** W_OneRulClick PROC EXPORT ;Using W_RulerData input clickpt:l output changed:w local count:w,temprect:r,rectptr:l begin stz changed moveword W_vr_numtabs,W_oldnumtabs ; redraw tabwells if nec. cmpw clickpt,#W_tabtop ; is the Q_Point in the numbers? jlt bye cmpw clickpt,#W_boxtop ; could it be in a box? jge boxstuff *--------------------------------------------------------------* * W_Handle click in tab area *--------------------------------------------------------------* subword clickpt+2,#W_TabOffset,clickpt+2 ; adjust for clk detex'n subword clickpt+2,W_vr_leftm,a ; is it the left margin? blt notleft cmp #W_TabSlop bgt notleft subword clickpt+2,W_vr_indentm,a ; COULD it be the W_Indent margin? blt justleft cmp #W_TabSlop bgt justleft cmpw clickpt,#W_tabtop+3 ; it could be. Is it low enough? jgt itsindent justleft pushlong #W_NothingPc ; erase the margin markers addword W_vr_leftm,#W_TabOffset,s pushword #W_tabtop pushword #NotCopy jsl D_DrawIcon pushlong #W_NothingPc addword W_vr_indentm,#W_TabOffset,s pushword #W_tabtop pushword #NotCopy jsl D_DrawIcon pushword #W_rt_leftm addword W_vr_leftm,#W_TabOffset,s pushword #W_tabtop jsl W_TrackTab lda W_r_changes ora #W_ch_left ora #W_ch_indent ; W_Indent changed, too. sta W_r_changes brl done notleft subword clickpt+2,W_vr_indentm,a ; is it the W_Indent margin? blt notindent cmp #W_TabSlop bgt notindent itsindent pushlong #W_NothingPc ; erase the marker addword W_vr_indentm,#W_TabOffset,s pushword #W_tabtop pushword #NotCopy jsl D_DrawIcon pushlong #W_MargPc ; redraw the left margin, just in case addword W_vr_leftm,#W_TabOffset,s pushword #W_tabtop pushword #NotBic jsl D_DrawIcon pushword #W_rt_indentm addword W_vr_indentm,#W_TabOffset,s pushword #W_tabtop jsl W_TrackTab lda W_r_changes ora #W_ch_indent sta W_r_changes brl done notindent subword clickpt+2,W_vr_rightm,a ; is it the right margin? blt notright cmp #W_TabSlop bgt notright pushlong #W_NothingPc ; erase the marker addword W_vr_rightm,#W_TabOffset,s pushword #W_tabtop pushword #NotCopy jsl D_DrawIcon pushword #W_rt_rightm addword W_vr_rightm,#W_TabOffset,s pushword #W_tabtop jsl W_TrackTab lda W_r_changes ora #W_ch_right sta W_r_changes brl done notright stz count tabloop cmpw count,W_vr_numtabs ; is it a tab? jeq bye lda count asl a asl a tax lda clickpt+2 sec sbc W_vr_tablist+W_ort_Location,x blt nexttab cmp #W_TabSlop bgt nexttab pushword W_vr_tablist+W_ort_Type:x ; for W_TrackT