A2osX/LIB/LIBTUI.S.LBOX.txt

168 lines
2.5 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
* LBOX.New hParent,X1,Y1,W,H,F,pList,pVar 10
*--------------------------------------
LBOX.New jsr OBJ.Create A = Class
bcs .9
ldy #S.LBOX.pVar
jsr OBJ.PullWordY
ldy #S.LBOX.pList
jsr OBJ.PullWordY
>PULLA
ldy #S.OBJ.F
sta (ZPObjPtr),y
jsr OBJ.PullHW
jsr OBJ.PullY1X1hParent
jmp OBJ.Insert
.9 >POP 10
rts
*--------------------------------------
LBOX.Destroy
clc
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
ldy #S.LBOX.pList
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
bne .9
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
inc pStack
rts
.8 clc
rts
.9 lda #0
sec
rts
*--------------------------------------
LBOX.Draw ldy #S.LBOX.VScroll
lda (ZPObjPtr),y
clc
adc (pStack) Relative Y
tax
ldy #S.LBOX.pList
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
ldy #0
.2 lda (ZPPtr1),y
beq .3
jsr LB.COut
iny
dex
bne .2
.3 txa
beq .8
bra .6
.5 ldy #S.OBJ.InnerW
lda (ZPObjPtr),y
tax
.6 lda #C.SPACE
.7 jsr LB.COut
dex
bne .7
.8 clc
rts
*--------------------------------------
LBOX.Activate
LBOX.Deactivate
jmp OBJ.Draw.Body
*--------------------------------------
MAN
SAVE usr/src/lib/libtui.s.lbox
LOAD usr/src/lib/libtui.s
ASM