mirror of https://github.com/A2osX/A2osX.git
LIBTUI:Better LBOX / RADIO controls
This commit is contained in:
parent
65be4815e2
commit
f76765cb13
Binary file not shown.
|
@ -53,7 +53,6 @@ CS.START cld
|
||||||
L.LIBTUI .DA LIBTUI
|
L.LIBTUI .DA LIBTUI
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
L.SCRN.Title .DA SCRN.Title
|
L.SCRN.Title .DA SCRN.Title
|
||||||
L.SCRN.Status .DA SCRN.Status
|
|
||||||
|
|
||||||
L.TBOX1.Title .DA TBOX1.Title
|
L.TBOX1.Title .DA TBOX1.Title
|
||||||
L.TBOX1.Status .DA TBOX1.Status
|
L.TBOX1.Status .DA TBOX1.Status
|
||||||
|
@ -152,8 +151,10 @@ CS.RUN.LOOP lda hSCRN
|
||||||
.3 cmp #EV.LBOX1.CHANGED
|
.3 cmp #EV.LBOX1.CHANGED
|
||||||
bne .8
|
bne .8
|
||||||
|
|
||||||
* Do something
|
>PUSHB hSCRN
|
||||||
|
>PUSHBI S.OBJ.pSTATUS
|
||||||
|
>PUSHW.G LBOX1.Var
|
||||||
|
>LIBCALL hLIBTUI,LIBTUI.SetProp
|
||||||
bra CS.RUN.LOOP
|
bra CS.RUN.LOOP
|
||||||
|
|
||||||
.8 cmp #EV.QUIT
|
.8 cmp #EV.QUIT
|
||||||
|
@ -181,7 +182,7 @@ CS.SCRN.Init >PUSHB hCTX hParent
|
||||||
|
|
||||||
>PUSHB hSCRN
|
>PUSHB hSCRN
|
||||||
>PUSHBI S.OBJ.pSTATUS
|
>PUSHBI S.OBJ.pSTATUS
|
||||||
>PUSHW L.SCRN.Status
|
>PUSHW L.LBOX1.List
|
||||||
>LIBCALL hLIBTUI,LIBTUI.SetProp
|
>LIBCALL hLIBTUI,LIBTUI.SetProp
|
||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
|
@ -413,33 +414,34 @@ LIBTUI .AZ "libtui"
|
||||||
hLIBTUI .BS 1
|
hLIBTUI .BS 1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
SCRN.Title .AZ "Window: X1=%d,Y1=%d, W=%d,H=%d, X2=%d,Y2=%d, iX=%d,iY=%d, iW=%d,iH=%d"
|
SCRN.Title .AZ "Window: X1=%d,Y1=%d, W=%d,H=%d, X2=%d,Y2=%d, iX=%d,iY=%d, iW=%d,iH=%d"
|
||||||
SCRN.Status .AZ "Status bar..."
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TBOX1.Title .AZ "Text Box Title"
|
TBOX1.Title .AZ "Text Box Title"
|
||||||
TBOX1.Status .AZ "Text Box Status"
|
TBOX1.Status .AZ "Text Box Status"
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LBOX1.List .CS "Item 1\r"
|
LBOX1.List .CZ "Item 1"
|
||||||
.CS "Item 2\r"
|
.CZ "Item 2"
|
||||||
.CS "Item 3\r"
|
.CZ "Item 3"
|
||||||
.CS "Item 4\r"
|
.CZ "Item 4"
|
||||||
.CS "Item 5\r"
|
.CZ "Item 5"
|
||||||
.CS "Item 6 very long line\r"
|
.CZ "Item 6 very long line"
|
||||||
.CS "Item 7\r"
|
.CZ "Item 7"
|
||||||
.CS "Item 8\r"
|
.CZ "Item 8"
|
||||||
.CS "Item 9\r"
|
.CZ "Item 9"
|
||||||
.CS "Item 10\r"
|
.CZ "Item 10"
|
||||||
.CS "Item 11\r"
|
.CZ "Item 11"
|
||||||
.CS "Item 12\r"
|
.CZ "Item 12"
|
||||||
.CS "Item 13\r"
|
.CZ "Item 13"
|
||||||
.CZ "Item 14 last one\r"
|
.CZ "Item 14 last one"
|
||||||
|
.HS 00
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LABEL.Label .AZ "This is a label."
|
LABEL.Label .AZ "This is a label."
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TLINE.Default .AZ "This is a Line."
|
TLINE.Default .AZ "This is a Line."
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
RADIO1.List .CS "\e[91mRed\r"
|
RADIO1.List .CZ "\e[91mRed"
|
||||||
.CS "\e[92mGreen\r"
|
.CZ "\e[92mGreen"
|
||||||
.CZ "\e[96mBlue\r"
|
.CZ "\e[96mBlue"
|
||||||
|
.HS 00
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CBOX1.Label .AZ "Check Me"
|
CBOX1.Label .AZ "Check Me"
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -456,7 +458,7 @@ SCRN.TitleBuf .BS 80
|
||||||
TLINE.Buf .BS 65
|
TLINE.Buf .BS 65
|
||||||
CBOX1.Var .BS 1
|
CBOX1.Var .BS 1
|
||||||
RADIO1.Var .BS 1
|
RADIO1.Var .BS 1
|
||||||
LBOX1.Var .BS 1
|
LBOX1.Var .BS 2
|
||||||
TBOX1.hBuf .BS 1
|
TBOX1.hBuf .BS 1
|
||||||
DS.END .ED
|
DS.END .ED
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
|
|
@ -105,10 +105,17 @@ LBOX.Run ldy #S.OBJ.S
|
||||||
|
|
||||||
bcs .99
|
bcs .99
|
||||||
|
|
||||||
|
jsr LBOX.SetpVar
|
||||||
|
|
||||||
ldy #S.LBOX.EV.CHANGED
|
ldy #S.LBOX.EV.CHANGED
|
||||||
lda (ZPObjPtr),y
|
lda (ZPObjPtr),y
|
||||||
* clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
.9 lda #0
|
||||||
|
sec
|
||||||
|
.99 rts
|
||||||
|
|
||||||
.3 cmp #C.SPACE
|
.3 cmp #C.SPACE
|
||||||
bne .9
|
bne .9
|
||||||
|
@ -121,10 +128,6 @@ LBOX.Run ldy #S.OBJ.S
|
||||||
.8 lda #0
|
.8 lda #0
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.9 lda #0
|
|
||||||
sec
|
|
||||||
.99 rts
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
LBOX.Draw ldy #S.LBOX.VScroll
|
LBOX.Draw ldy #S.LBOX.VScroll
|
||||||
lda (ZPObjPtr),y
|
lda (ZPObjPtr),y
|
||||||
|
@ -153,9 +156,11 @@ LBOX.Draw ldy #S.LBOX.VScroll
|
||||||
|
|
||||||
jsr LB.Ptr1OutEscMaxX
|
jsr LB.Ptr1OutEscMaxX
|
||||||
txa
|
txa
|
||||||
beq .8
|
|
||||||
bne .6
|
bne .6
|
||||||
|
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
.5 ldy #S.OBJ.InnerW
|
.5 ldy #S.OBJ.InnerW
|
||||||
lda (ZPObjPtr),y
|
lda (ZPObjPtr),y
|
||||||
tax
|
tax
|
||||||
|
@ -169,6 +174,25 @@ LBOX.Draw ldy #S.LBOX.VScroll
|
||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
LBOX.SetpVar ldy #S.LBOX.Idx
|
||||||
|
lda (ZPObjPtr),y
|
||||||
|
tax
|
||||||
|
|
||||||
|
jsr OBJ.GetLineXAtY
|
||||||
|
bcs .8
|
||||||
|
|
||||||
|
jsr OBJ.GetpVarPtr2
|
||||||
|
|
||||||
|
lda ZPPtr1
|
||||||
|
sta (ZPPtr2)
|
||||||
|
lda ZPPtr1+1
|
||||||
|
ldy #1
|
||||||
|
sta (ZPPtr2),y
|
||||||
|
|
||||||
|
.8 clc
|
||||||
|
|
||||||
|
LBOX.SetpVar.9 rts
|
||||||
|
*--------------------------------------
|
||||||
MAN
|
MAN
|
||||||
SAVE usr/src/lib/libtui.s.lbox
|
SAVE usr/src/lib/libtui.s.lbox
|
||||||
LOAD usr/src/lib/libtui.s
|
LOAD usr/src/lib/libtui.s
|
||||||
|
|
|
@ -961,24 +961,7 @@ OBJ.GetLineXAtY jsr OBJ.GetpBufPtr1
|
||||||
|
|
||||||
.2 inc TempI
|
.2 inc TempI
|
||||||
|
|
||||||
ldy #$ff
|
jsr OBJ.NextLinePtr1
|
||||||
|
|
||||||
.4 iny
|
|
||||||
lda (ZPPtr1),y
|
|
||||||
clc
|
|
||||||
beq .5
|
|
||||||
|
|
||||||
cmp #C.CR
|
|
||||||
bne .4
|
|
||||||
|
|
||||||
* sec
|
|
||||||
|
|
||||||
.5 tya
|
|
||||||
adc ZPPtr1
|
|
||||||
sta ZPPtr1
|
|
||||||
bcc .1
|
|
||||||
|
|
||||||
inc ZPPtr1+1
|
|
||||||
bra .1
|
bra .1
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
|
@ -987,6 +970,30 @@ OBJ.GetLineXAtY jsr OBJ.GetpBufPtr1
|
||||||
.9 sec
|
.9 sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
OBJ.NextLinePtr1
|
||||||
|
ldy #$ff
|
||||||
|
|
||||||
|
.1 iny
|
||||||
|
lda (ZPPtr1),y
|
||||||
|
bne .1
|
||||||
|
|
||||||
|
tya
|
||||||
|
beq .9 Empty Line
|
||||||
|
|
||||||
|
sec
|
||||||
|
adc ZPPtr1
|
||||||
|
sta ZPPtr1
|
||||||
|
bcc .8
|
||||||
|
|
||||||
|
inc ZPPtr1+1
|
||||||
|
|
||||||
|
clc
|
||||||
|
|
||||||
|
.8 rts
|
||||||
|
|
||||||
|
.9 sec
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
MAN
|
MAN
|
||||||
SAVE usr/src/lib/libtui.s.obj
|
SAVE usr/src/lib/libtui.s.obj
|
||||||
LOAD usr/src/lib/libtui.s
|
LOAD usr/src/lib/libtui.s
|
||||||
|
|
|
@ -30,29 +30,11 @@ RADIO.New lda #S.OBJ.T.RADIO
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
|
|
||||||
.1 ldy #$ff
|
.1 jsr OBJ.NextLinePtr1
|
||||||
|
bcs .5 empty line
|
||||||
.2 iny
|
|
||||||
lda (ZPPtr1),y
|
|
||||||
clc
|
|
||||||
beq .20
|
|
||||||
|
|
||||||
cmp #C.CR
|
|
||||||
bne .2
|
|
||||||
|
|
||||||
* sec
|
tya
|
||||||
|
* clc
|
||||||
.20 tya
|
|
||||||
beq .5 empty line
|
|
||||||
|
|
||||||
adc ZPPtr1
|
|
||||||
sta ZPPtr1
|
|
||||||
bcc .3
|
|
||||||
|
|
||||||
inc ZPPtr1+1
|
|
||||||
|
|
||||||
.3 tya
|
|
||||||
clc
|
|
||||||
adc #5 room for " ( ) "
|
adc #5 room for " ( ) "
|
||||||
ldy #S.OBJ.W
|
ldy #S.OBJ.W
|
||||||
cmp (ZPObjPtr),y
|
cmp (ZPObjPtr),y
|
||||||
|
@ -192,6 +174,7 @@ RADIO.Draw lda (pStack) Relative Y
|
||||||
bra .13
|
bra .13
|
||||||
|
|
||||||
.11 lda #C.SPACE
|
.11 lda #C.SPACE
|
||||||
|
|
||||||
.13 jsr LB.COut
|
.13 jsr LB.COut
|
||||||
|
|
||||||
ldx #')'
|
ldx #')'
|
||||||
|
|
Loading…
Reference in New Issue