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

1 line
24 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_CheckWells IMPORT D_DrawIcon IMPORT W_InvertBitBox IMPORT W_OneRulClick IMPORT D_SelectFont IMPORT D_Set4Pat IMPORT W_SetFullREct IMPORT W_SetRulRect IMPORT W_SetStatBit ;----------------------------------------------- ; ; Forward addresses and entries ; ;----------------------------------------------- ENTRY W_Box1 ENTRY W_BoxAdTable ENTRY W_BoxLocTable ENTRY W_DTabPc ENTRY W_DrawTabs ENTRY W_IndentPc ENTRY W_LTabPc ENTRY W_MargPc ENTRY W_RTabPc ENTRY W_RulOffset ENTRY W_RulPinfo ENTRY W_RulPRect ENTRY W_RulPattern ENTRY W_RulRect ENTRY W_tabrect ENTRY W_TabWell ENTRY W_VisRuler ENTRY W_vr_end ENTRY W_vr_indentm ENTRY W_vr_leftm ENTRY W_vr_numtabs ENTRY W_vr_rightm ENTRY W_vr_status ENTRY W_vr_tablist entry W_r_changes entry W_oldnumtabs **************************************************************** * ; * AppleWorks GS word processor RULERS ; *______________________________________________________________* * ; * CONTENTS: ; * W_DrawRuler ; * W_InitVisRuler(ruler:l) ; * W_MakeVisRuler(ruler:l) ; * W_RulerClick(taskrec:l) -> changed:w ; * W_ModifyRuler(ruler:l) ; * W_RulerData ; * ; **************************************************************** ******************************************************************** * * * includes * * * * Wednesday, May 3, 1989 5:14:23 AM ******************************************************************** **************************************************************** * * W_DrawRuler -- draw W_VisRuler at the top of the screen * **************************************************************** W_DrawRuler PROC EXPORT ;Using W_RulerData local count:w,temp:w begin +b jsl W_SetRulRect _PenNormal pushword #LightYellow jsl D_Set4Pat pushlong #W_RulRect _PaintRect _PenNormal pushword #0 ; draw ruler's bottom Q_Line pushword W_RulRect+4 _MoveTo pushword W_RulRect+6 pushword #0 _Line pushlong #W_RulPinfo ; ---- DRAW THE HASH MARKS ---- pushlong #W_RulPRect ; first three inches... pushword W_RulOffset pushword #3 pushword #notCopy _PPtoPort pushlong #W_RulPinfo ; ...second three inches... pushlong #W_RulPRect addword W_RulOffset,#240,s pushword #3 pushword #notCopy _PPtoPort pushlong #W_RulPinfo ; ...and third three inches! pushlong #W_RulPRect addword W_RulOffset,#480,s pushword #3 pushword #notCopy _PPtoPort movelong #0,ax ; use the system font ldy #0 ; (black) jsl D_SelectFont addword W_RulOffset,#10,s ; ---- DRAW THE NUMBERS ---- pushword #8 _MoveTo pushword #4 ; fore copy _SetTextMode pushword #0 ; black _SetForeColor pushword #3 ; white, I guess _SetBackColor moveword #'1',count loop pushword #72 ; move to the next number's position pushword #0 _Move pushword count ; draw the number _DrawChar inc count cmpw count,#'9' ; done? ble loop jsl W_DrawTabs ; Draw the margins and W_Tabs stz count ; ---- DRAW THE BOXES AND TABWELLS ---- loop2 lda count asl a asl a tax cmpl W_BoxAdTable:x,#0 ; draw one box beq nomore pushlong W_BoxAdTable:x pushlong W_BoxLocTable:x pushword #$8000 ; not copy jsl D_DrawIcon inc count bra loop2 nomore stz count ; ---- INVERT THE STATUS BOXES ---- lda W_vr_status and #W_r_defined ; just look at the defined bits sta temp invloop lda temp beq fillwells clc ror temp ; is the bit set? bcc noinv pushword count jsl W_InvertBitBox noinv inc count bra invloop fillwells cmpw W_vr_numtabs,#W_maxTabs ; ---- FILL THE TAB WELLS ---- beq notabs pushlong #W_LTabPc ; Put W_Tabs in the wells if there are pushword #W_t1+W_TH