LIBTUI:RADIO event fix

This commit is contained in:
burniouf 2024-01-25 19:44:59 +01:00
parent a197ec297c
commit daa19bfc34
11 changed files with 53 additions and 78 deletions

Binary file not shown.

View File

@ -704,6 +704,7 @@ CS.BUT.Init >PUSHB hSCRN hParent
CS.DLG.SAVE >PUSHB hCTX hParent
>PUSHBI 70 W
>PUSHBI 11 H
>PUSHBI 0
>PUSHW L.DLGS.Title
>LIBCALL hLIBTUI,LIBTUI.NewDlg
bcs .9

View File

@ -11,6 +11,7 @@ NEW
*--------------------------------------
EV.SAVE .EQ $C0
EV.CHECKBOX .EQ $C1
EV.RADIO .EQ $C2
EV.OK .EQ $CE
EV.CANCEL .EQ $CF
*--------------------------------------
@ -124,9 +125,11 @@ CS.RUN.LOOP lda hSCRN
jsr CS.RUN.DLGSAVE
bcc CS.RUN.LOOP
rts
.2 cmp #EV.CHECKBOX
bne .8
bne .3
>LDA.G CBOX1.Var
bne .20
@ -143,6 +146,13 @@ CS.RUN.LOOP lda hSCRN
rts
.3 cmp #EV.RADIO
bne .8
* Do something when RADIO got a new value
bra CS.RUN.LOOP
.8 cmp #EV.QUIT
bne CS.RUN.LOOP
@ -261,7 +271,7 @@ CS.RADIO1.Init >PUSHB hSCRN hParent
>PUSHBI 50 X1
>PUSHBI 16 Y1
>PUSHBI 0
>PUSHBI 0
>PUSHBI EV.RADIO
>PUSHW L.RADIO1.List
>PUSHEA.G RADIO1.Var
>PUSHBI 0

View File

@ -138,9 +138,6 @@ BUT.Draw ldy #S.BUT.pLabel
.8 clc
rts
*--------------------------------------
BUT.Activate
BUT.Deactivate jmp OBJ.Draw.Body
*--------------------------------------
MAN
SAVE usr/src/lib/libtui.s.but
LOAD usr/src/lib/libtui.s

View File

@ -73,16 +73,11 @@ CBOX.Run ldy #S.BUT.HotKey
cmp #C.SPACE
bne .9
.8 ldy #S.OBJ.pVar
lda (ZPObjPtr),y
sta ZPPtr1
iny
lda (ZPObjPtr),y
sta ZPPtr1+1
.8 jsr OBJ.GetpVarPtr2
lda (ZPPtr1)
lda (ZPPtr2)
eor #$ff
sta (ZPPtr1)
sta (ZPPtr2)
ldy #1 hObj
lda (pStack),y
@ -112,16 +107,11 @@ CBOX.Draw ldx #'<'
.10 txa
jsr LB.COut
ldy #S.OBJ.pVar
lda (ZPObjPtr),y
sta ZPPtr1
iny
lda (ZPObjPtr),y
sta ZPPtr1+1
jsr OBJ.GetpVarPtr2
ldx #C.SPACE
lda (ZPPtr1)
lda (ZPPtr2)
bpl .11
ldx #'X'
@ -187,10 +177,6 @@ CBOX.Draw ldx #'<'
.8 clc
rts
*--------------------------------------
CBOX.Activate
*--------------------------------------
CBOX.Deactivate jmp OBJ.Draw.Body
*--------------------------------------
MAN
SAVE usr/src/lib/libtui.s.cbox
LOAD usr/src/lib/libtui.s

View File

@ -46,7 +46,6 @@ LBOX.Run ldy #S.OBJ.S
inc
tax
ldy #S.OBJ.pBuf
jsr OBJ.GetLineXAtY
bcs .8
@ -110,7 +109,6 @@ LBOX.Draw ldy #S.LBOX.VScroll
adc (pStack) Relative Y
tax
ldy #S.OBJ.pBuf
jsr OBJ.GetLineXAtY
bcs .5
@ -148,10 +146,6 @@ LBOX.Draw ldy #S.LBOX.VScroll
.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

View File

@ -933,7 +933,15 @@ OBJ.DecWordAtY clc
sta (ZPObjPtr),y
rts
*--------------------------------------
OBJ.GetBuf ldy #S.OBJ.pBuf
OBJ.GetpVarPtr2 ldy #S.OBJ.pVar
lda (ZPObjPtr),y
sta ZPPtr2
iny
lda (ZPObjPtr),y
sta ZPPtr2+1
rts
*--------------------------------------
OBJ.GetpBufPtr1 ldy #S.OBJ.pBuf
lda (ZPObjPtr),y
sta ZPPtr1
iny
@ -941,11 +949,7 @@ OBJ.GetBuf ldy #S.OBJ.pBuf
sta ZPPtr1+1
rts
*--------------------------------------
OBJ.GetLineXAtY lda (ZPObjPtr),y
sta ZPPtr1
iny
lda (ZPObjPtr),y
sta ZPPtr1+1
OBJ.GetLineXAtY jsr OBJ.GetpBufPtr1
stz TempI

View File

@ -91,18 +91,18 @@ RADIO.Run ldy #S.OBJ.S
cmp #C.SPACE
bne .2
ldy #S.OBJ.pVar
lda (ZPObjPtr),y
sta ZPPtr1
iny
lda (ZPObjPtr),y
sta ZPPtr1+1
jsr OBJ.GetpVarPtr2
ldy #S.RADIO.Idx
lda (ZPObjPtr),y
sta (ZPPtr1)
sta (ZPPtr2)
bra .7
jsr .7
ldy #S.BUT.EV
lda (ZPObjPtr),y
* clc
rts
.2 cmp #C.LF
bne .5
@ -154,16 +154,10 @@ RADIO.Run ldy #S.OBJ.S
RADIO.Draw lda (pStack) Relative Y
tax
ldy #S.OBJ.pBuf
jsr OBJ.GetLineXAtY
bcs .8
ldy #S.OBJ.pVar
lda (ZPObjPtr),y
sta ZPPtr2
iny
lda (ZPObjPtr),y
sta ZPPtr2+1
jsr OBJ.GetpVarPtr2
clc
ldx #'('
@ -236,11 +230,6 @@ RADIO.Draw lda (pStack) Relative Y
.8 clc
rts
*--------------------------------------
RADIO.Activate
*--------------------------------------
RADIO.Deactivate
jmp OBJ.Draw.Body
*--------------------------------------
MAN
SAVE usr/src/lib/libtui.s.radio
LOAD usr/src/lib/libtui.s

View File

@ -96,7 +96,7 @@ TBOX.RUN.Ignore lda #0
rts
*--------------------------------------
TBOX.RUN.PrevLink
jsr OBJ.GetBuf -> ZPPtr1
jsr OBJ.GetpBufPtr1
ldy #S.TBOX.SelBegin
jsr TBOX.RUN.GetSel -> TempC
@ -131,7 +131,7 @@ TBOX.RUN.PrevLink.9
rts
*--------------------------------------
TBOX.RUN.NextLink
jsr OBJ.GetBuf -> ZPPtr1
jsr OBJ.GetpBufPtr1
ldy #S.TBOX.SelEnd
jsr TBOX.RUN.GetSel -> TempC
@ -218,12 +218,7 @@ TBOX.RUN.CheckLink
.2 ldy #S.TBOX.SelEnd
jsr TBOX.SetTempCAtY
ldy #S.OBJ.pVar
lda (ZPObjPtr),y
sta ZPPtr2
iny
lda (ZPObjPtr),y
sta ZPPtr2+1
jsr OBJ.GetpVarPtr2
ldy #$ff SKIP "[[TEXT]"
@ -733,7 +728,7 @@ TBOX.SetProp jsr OBJ.SetProp
cpy #S.TBOX.BufPtr+2
bcc .1
jsr OBJ.GetBuf
jsr OBJ.GetpBufPtr1
ldx #0
ldy #0
@ -760,7 +755,7 @@ TBOX.SetProp jsr OBJ.SetProp
.8 clc
.9 rts
*--------------------------------------
TBOX.GetBuf jsr OBJ.GetBuf
TBOX.GetBuf jsr OBJ.GetpBufPtr1
ldy #S.TBOX.BufPtr
lda ZPPtr1
@ -787,7 +782,7 @@ TBOX.GetDocYInAX
TBOX.GetLineAX stx TempW
sta TempW+1 Req Line Num
jsr OBJ.GetBuf get pBuf in ZPPtr1
jsr OBJ.GetpBufPtr1
stz TempI Current Line Num
stz TempI+1

View File

@ -43,7 +43,7 @@ TLINE.Run ldy #S.OBJ.S
lda (ZPObjPtr),y
bpl .9 S.OBJ.S.bActive
jsr OBJ.GetBuf
jsr OBJ.GetpBufPtr1
ldy #$ff
@ -167,7 +167,7 @@ TLINE.RUN.DEL ldy #S.TLINE.Ptr
.8 clc
rts
*--------------------------------------
TLINE.Draw jsr OBJ.GetBuf
TLINE.Draw jsr OBJ.GetpBufPtr1
ldx #C.SPACE

View File

@ -109,20 +109,20 @@ J.ObjActivate .DA OBJ.Activate
.DA LABEL.Activate
.DA TLINE.Activate
.DA TBOX.Activate
.DA LBOX.Activate
.DA CBOX.Activate
.DA BUT.Activate
.DA RADIO.Activate
.DA OBJ.Draw.Body LBOX.Activate
.DA OBJ.Draw.Body CBOX.Activate
.DA OBJ.Draw.Body BUT.Activate
.DA OBJ.Draw.Body RADIO.Activate
*--------------------------------------
J.ObjDeactivate .DA OBJ.Deactivate
.DA OBJ.Deactivate
.DA LABEL.Deactivate
.DA TLINE.Deactivate
.DA TBOX.Deactivate
.DA LBOX.Deactivate
.DA CBOX.Deactivate
.DA BUT.Deactivate
.DA RADIO.Deactivate
.DA OBJ.Draw.Body LBOX.Deactivate
.DA OBJ.Draw.Body CBOX.Deactivate
.DA OBJ.Draw.Body BUT.Deactivate
.DA OBJ.Draw.Body RADIO.Deactivate
*--------------------------------------
J.ObjSetProp .DA OBJ.SetProp
.DA OBJ.SetProp
@ -311,7 +311,6 @@ LIB.GetCTX >LDYA ZPObjPtr
lda (ZPCtxPtr),y
beq *
>SYSCALL2 GetMemPtr
bcs *
>STYA ZPCtxPtr
rts