(notepad) Added pagination

This commit is contained in:
Devine Lu Linvega 2023-04-26 09:58:33 -07:00
parent 87ad933e56
commit eb827b19be
1 changed files with 35 additions and 12 deletions

View File

@ -5,11 +5,15 @@
|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &chord $1
|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
|0000
@page $1
|0100
( theme )
#f0f0 .System/r DEO2
#f000 .System/g DEO2
#f00f .System/r DEO2
#f00f .System/g DEO2
#f00f .System/b DEO2
( size )
#00e0 .Screen/width DEO2
@ -68,9 +72,13 @@ BRK
&on-mouse-down ( -> )
#00 .Mouse/state DEO
.Mouse/y DEI2 #00d6 SUB2 NIP
#18 .Mouse/x DEI2 NIP SUB
ADD #18 LTH ?&go-next prev-page BRK
ADD #18 LTH ?&go-next
prev-page
BRK
&go-next next-page
BRK
@ -94,13 +102,15 @@ JMP2r
@prev-page ( -- )
#ff phex/b #0a18 DEO
.page LDZ #01 SUB #07 AND .page STZ
redraw
JMP2r
@next-page ( -- )
#01 phex/b #0a18 DEO
.page LDZ INC #07 AND .page STZ
redraw
JMP2r
@ -123,6 +133,16 @@ JMP2r
(
@|drawing )
@redraw ( -- )
#0000 .Screen/x DEO2
#0018 .Screen/y DEO2
#80 .Screen/pixel DEO
draw-note
draw-footer
JMP2r
@draw-header ( -- )
( a )
@ -164,7 +184,7 @@ JMP2r
#0008 .Screen/x DEO2
#0018 .Screen/y DEO2
;mem draw-uf2
;mem #00 .page LDZ #2000 MUL2 ADD2 draw-uf2
JMP2r
@ -184,10 +204,12 @@ JMP2r
#01 .Screen/sprite DEO
INC DUP ?&l
POP
JMP2r
@walk-uf2 ( text* -- )
( page number )
#15 .Screen/auto DEO
.Screen/width DEI2 #01 SFT2 #0003 SUB2 .Screen/x DEO2
.Screen/height DEI2 #0020 SUB2 .Screen/y DEO2
#0011 .page LDZ ADD #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
#01 .Screen/sprite DEOk DEO
JMP2r
@ -202,7 +224,6 @@ JMP2r
.Screen/y DEI2k #0010 ADD2 ROT DEO2
INC2 LDAk ?&while
&no-wrap
LDAk #20 SUB #00 SWP
DUP2 #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
;font ADD2 LDA #00 SWP .Screen/x DEI2 ADD2
@ -406,8 +427,10 @@ JMP2r
0000 0068 b000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 00ff 0000 0000 0000 0000 ffff ffff ffff ffff ]
@mem
|8000 @mem
"Keep 20 "up 20 "to 20 "eight 20 "pages 20 "of 20 "notes 20 "in 20 "the 20 "Note 20 "Pad. 20
"Click 20 "on 20 "the 20 "dog-ear 20 "to 20 "turn 20 "to 20 "to 20 "the 20 "next 20 "following 20 "page. 20
"Click 20 "in 20 "the 20 "lower 20 "left 20 "corner 20 "to 20 "turn 20 "to 20 "the 20 "next 20 "previous 20 "page.
|a000 "The 20 "other 20 "page.