From 69e3760ce51991d67680717faec09a1b8ba0c170 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 26 Apr 2023 09:07:09 -0700 Subject: [PATCH] (notepad) prev/next button handling --- gui/notepad/notepad.tal | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/gui/notepad/notepad.tal b/gui/notepad/notepad.tal index f916961..f4d675b 100644 --- a/gui/notepad/notepad.tal +++ b/gui/notepad/notepad.tal @@ -8,8 +8,8 @@ |0100 ( theme ) - #f00f .System/r DEO2 - #f00f .System/g DEO2 + #f0f0 .System/r DEO2 + #f000 .System/g DEO2 #f00f .System/b DEO2 ( size ) #00e0 .Screen/width DEO2 @@ -61,12 +61,17 @@ BRK trap-mouse - .Mouse/state DEI ?&on-mouse-down + .Mouse/state DEI #00 NEQ .Mouse/x DEI2 #0018 LTH2 AND ?&on-mouse-down BRK &on-mouse-down ( -> ) + .Mouse/y DEI2 #00d6 SUB2 NIP + #18 .Mouse/x DEI2 NIP SUB + ADD #18 LTH ?&go-next prev-page BRK + &go-next next-page + BRK ( @@ -86,6 +91,18 @@ BRK JMP2r +@prev-page ( -- ) + + #ff phex/b #0a18 DEO + +JMP2r + +@next-page ( -- ) + + #01 phex/b #0a18 DEO + +JMP2r + @update-cursor ( color addr* -- ) [ LIT2 15 -Screen/auto ] DEO