A2osX/LIB/LIBTUI.S.LBOX.txt

176 lines
2.6 KiB
Plaintext
Raw Normal View History

NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
2024-01-26 14:05:51 +00:00
* LBOX.New hParent,X1,Y1,W,H,EV.CHANGED,EV.PRESSED,pList,pVar,F 12
*--------------------------------------
LBOX.New lda #S.OBJ.T.LBOX
jsr OBJ.Create
bcs .9
>PULLA
ldy #S.OBJ.F
sta (ZPObjPtr),y
ldy #S.OBJ.pVar
jsr OBJ.PullWordY
ldy #S.OBJ.pBuf
jsr OBJ.PullWordY
2024-01-26 14:05:51 +00:00
>PULLA
ldy #S.LBOX.EV.PRESSED
sta (ZPObjPtr),y
2024-01-26 14:05:51 +00:00
>PULLA
ldy #S.LBOX.EV.CHANGED
sta (ZPObjPtr),y
jsr OBJ.PullHW
jsr OBJ.PullY1X1hParent
jsr CONT.Insert
bcs .99
lda hObj
* clc
rts
2024-01-26 14:05:51 +00:00
.9 >POP 12
.99 rts
*--------------------------------------
LBOX.Run ldy #S.OBJ.S
lda (ZPObjPtr),y
bpl .9
lda (pStack) Event
cmp #C.LF
bne .2
ldy #S.LBOX.Idx
lda (ZPObjPtr),y
inc
tax
jsr OBJ.GetLineXAtY
bcs .8
ldy #S.LBOX.Idx
lda (ZPObjPtr),y
inc
sta (ZPObjPtr),y
clc
ldy #S.LBOX.VScroll
adc (ZPObjPtr),y
ldy #S.OBJ.InnerH
cmp (ZPObjPtr),y
bcc .7
ldy #S.LBOX.VScroll
lda (ZPObjPtr),y
inc
sta (ZPObjPtr),y
bra .7
.2 cmp #C.VT
2024-01-26 14:05:51 +00:00
bne .3
ldy #S.LBOX.Idx
lda (ZPObjPtr),y
beq .8
dec
sta (ZPObjPtr),y
ldy #S.LBOX.VScroll
cmp (ZPObjPtr),y
bcs .7
ldy #S.LBOX.VScroll
lda (ZPObjPtr),y
dec
sta (ZPObjPtr),y
.7 ldy #1 hObj
lda (pStack),y
>PUSHA
jsr OBJ.Draw.Body
2024-01-26 14:05:51 +00:00
inc pStack
2024-01-26 14:05:51 +00:00
bcs .99
ldy #S.LBOX.EV.CHANGED
lda (ZPObjPtr),y
* clc
rts
2024-01-26 14:05:51 +00:00
.3 cmp #C.SPACE
bne .9
2024-01-26 14:05:51 +00:00
ldy #S.LBOX.EV.PRESSED
lda (ZPObjPtr),y
clc
rts
.8 lda #0
clc
rts
.9 lda #0
sec
2024-01-26 14:05:51 +00:00
.99 rts
*--------------------------------------
LBOX.Draw ldy #S.LBOX.VScroll
lda (ZPObjPtr),y
clc
adc (pStack) Relative Y
tax
jsr OBJ.GetLineXAtY
bcs .5
txa
ldy #S.LBOX.Idx
cmp (ZPObjPtr),y
bne .1
ldy #S.OBJ.S
lda (ZPObjPtr),y S.OBJ.S.bActive
bpl .1
ldx #SEQ.INVERSE-SEQS
jsr LB.SeqOut
.1 ldy #S.OBJ.InnerW
lda (ZPObjPtr),y
tax
jsr LB.Ptr1OutEscMaxX
txa
beq .8
bne .6
.5 ldy #S.OBJ.InnerW
lda (ZPObjPtr),y
tax
.6 lda #C.SPACE
.7 jsr LB.COut
dex
bne .7
.8 clc
rts
*--------------------------------------
MAN
SAVE usr/src/lib/libtui.s.lbox
LOAD usr/src/lib/libtui.s
ASM