2018-05-04 14:55:29 +00:00
|
|
|
|
NEW
|
2019-07-30 08:57:25 +00:00
|
|
|
|
AUTO 3,1
|
2018-05-04 14:55:29 +00:00
|
|
|
|
*--------------------------------------
|
2022-11-02 06:54:30 +00:00
|
|
|
|
* NewBut(HWND, bFlags, wW, pICON, pTEXT, bKEYMOD, bKEY, wID, wX, wY)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
BUT.New lda #S.OBJ.T.BUT
|
|
|
|
|
jsr OBJ.New
|
2022-12-07 07:02:29 +00:00
|
|
|
|
* bcs .9
|
2022-11-02 06:54:30 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
phx hOBJ
|
2018-05-04 14:55:29 +00:00
|
|
|
|
|
2023-07-10 04:57:04 +00:00
|
|
|
|
jsr OBJ.PullY1X1
|
2022-11-02 06:54:30 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
ldy #S.BUT.ID
|
|
|
|
|
jsr OBJ.PullWordAtY
|
|
|
|
|
|
2022-11-02 06:54:30 +00:00
|
|
|
|
ldy #S.BUT.KEYMOD
|
|
|
|
|
jsr OBJ.PullWordAtY
|
|
|
|
|
|
|
|
|
|
ldy #S.BUT.pTEXT
|
|
|
|
|
jsr OBJ.PullWordAtY
|
|
|
|
|
|
|
|
|
|
ldy #S.BUT.pICON
|
|
|
|
|
jsr OBJ.PullWordAtY
|
|
|
|
|
|
2019-01-10 16:26:58 +00:00
|
|
|
|
ldy #S.OBJ.W
|
2022-11-02 06:54:30 +00:00
|
|
|
|
jsr OBJ.PullWordAtY
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
jsr OBJ.PullByteAtY
|
|
|
|
|
|
|
|
|
|
jsr OBJ.PullHWND
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.W
|
|
|
|
|
jsr OBJ.GetPropAtY
|
|
|
|
|
bcc .5 W in !NULL, static size
|
|
|
|
|
|
|
|
|
|
stz DX
|
|
|
|
|
stz DX+1
|
|
|
|
|
|
|
|
|
|
ldy #S.BUT.pICON
|
|
|
|
|
jsr OBJ.GetPropAtY
|
|
|
|
|
bcs .1 no icon
|
|
|
|
|
|
|
|
|
|
lda #16 IconW
|
|
|
|
|
sta DX
|
|
|
|
|
|
|
|
|
|
.1 ldy #S.BUT.pTEXT
|
|
|
|
|
jsr OBJ.GetPropAtY
|
|
|
|
|
bcs .3 no text
|
2018-05-07 14:59:51 +00:00
|
|
|
|
|
2022-11-02 06:54:30 +00:00
|
|
|
|
ldx hSYSFON
|
|
|
|
|
jsr FON.GetTextSize
|
2018-05-07 14:59:51 +00:00
|
|
|
|
|
2022-11-02 06:54:30 +00:00
|
|
|
|
ldy #S.OBJ.F
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
and #S.BUT.F.NOSPACE
|
|
|
|
|
bne .2
|
2019-01-08 16:29:26 +00:00
|
|
|
|
|
2022-11-02 06:54:30 +00:00
|
|
|
|
lda DX
|
|
|
|
|
beq .2
|
2019-01-08 16:29:26 +00:00
|
|
|
|
|
|
|
|
|
clc
|
2022-11-02 06:54:30 +00:00
|
|
|
|
adc PREFS.XSeparator
|
|
|
|
|
sta DX
|
|
|
|
|
|
|
|
|
|
.2 clc
|
|
|
|
|
lda CB.CACHE+S.CB.SrcW
|
|
|
|
|
adc DX
|
|
|
|
|
sta DX
|
|
|
|
|
|
|
|
|
|
lda CB.CACHE+S.CB.SrcW+1
|
|
|
|
|
adc DX+1
|
|
|
|
|
sta DX+1
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.3 lda PREFS.XSeparator
|
2022-11-02 06:54:30 +00:00
|
|
|
|
asl
|
|
|
|
|
* clc
|
|
|
|
|
adc DX
|
|
|
|
|
ldy #S.OBJ.W
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
lda #0
|
|
|
|
|
adc DX+1
|
|
|
|
|
iny
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.5 lda SYSFON.Hp2
|
|
|
|
|
ldy #S.OBJ.H
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
>LDYA ZPObjPtr
|
|
|
|
|
jsr OBJ.SetX2Y2
|
2022-11-02 06:54:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.8 jsr WND.AddChild.I
|
|
|
|
|
|
|
|
|
|
pla hOBJ
|
|
|
|
|
clc
|
2019-01-08 16:29:26 +00:00
|
|
|
|
rts
|
2022-11-02 06:54:30 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.9 >POP 16
|
2022-11-02 06:54:30 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-12-07 07:02:29 +00:00
|
|
|
|
BUT.Enter ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
bpl BUT.Paint
|
2018-05-04 14:55:29 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
BUT.Leave ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
bpl .8
|
|
|
|
|
|
|
|
|
|
bit #S.BUT.F.NOLEAVE
|
|
|
|
|
beq BUT.Paint
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2018-05-04 14:55:29 +00:00
|
|
|
|
*--------------------------------------
|
2020-09-07 20:40:50 +00:00
|
|
|
|
BUT.Close
|
2018-05-04 14:55:29 +00:00
|
|
|
|
|
2020-09-07 20:40:50 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2018-05-04 14:55:29 +00:00
|
|
|
|
*--------------------------------------
|
2022-12-07 07:02:29 +00:00
|
|
|
|
BUT.Paint eor #S.BUT.S.SELECTED
|
|
|
|
|
sta (ZPObjPtr),y
|
|
|
|
|
|
|
|
|
|
jsr WND.GetInnerInClip
|
|
|
|
|
|
|
|
|
|
BUT.fPaint jsr CB.GetBuf
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldx #1
|
|
|
|
|
jsr DRAW.BordersAtX
|
|
|
|
|
|
|
|
|
|
ldx #C.WHITE
|
|
|
|
|
|
|
|
|
|
ldy #S.OBJ.S
|
|
|
|
|
lda (ZPObjPtr),y
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
* and #S.BUT.S.SELECTED
|
|
|
|
|
* beq .1
|
|
|
|
|
|
|
|
|
|
ldx #C.BLACK
|
|
|
|
|
|
|
|
|
|
.1 txa
|
|
|
|
|
jsr CB.FillRectMonoA
|
|
|
|
|
|
|
|
|
|
jsr CB.GetObjX1Y1X2Y2
|
|
|
|
|
|
|
|
|
|
jsr CB.Cache2CBBufG
|
|
|
|
|
|
|
|
|
|
ldy #S.BUT.pTEXT
|
|
|
|
|
jsr OBJ.GetPropAtY
|
|
|
|
|
ldx hSYSFON
|
|
|
|
|
jsr FON.GetTextSize
|
|
|
|
|
|
|
|
|
|
jsr CB.SrcWCenterH
|
|
|
|
|
|
|
|
|
|
jsr CB.IncY1
|
|
|
|
|
|
|
|
|
|
ldy #S.BUT.pTEXT
|
|
|
|
|
jsr OBJ.GetPropAtY
|
|
|
|
|
ldx hSYSFON
|
|
|
|
|
jsr DRAW.YAText
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.8 jmp CB.FlushBuf
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2018-05-04 14:55:29 +00:00
|
|
|
|
MAN
|
2020-06-30 15:32:23 +00:00
|
|
|
|
SAVE usr/src/lib/libgui.s.but
|
|
|
|
|
LOAD usr/src/lib/libgui.s
|
2018-05-04 14:55:29 +00:00
|
|
|
|
ASM
|