A2osX/LIB/LIBGUI.S.BUT.txt
2022-11-02 07:54:30 +01:00

112 lines
1.7 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
*--------------------------------------
* NewBut(HWND, bFlags, wW, pICON, pTEXT, bKEYMOD, bKEY, wID, wX, wY)
*--------------------------------------
BUT.New lda #S.OBJ.T.BUT
jsr OBJ.New
bcs .9
* >STYA ZPObjPtr
ldy #S.OBJ.Y1
jsr OBJ.PullWordAtY
ldy #S.OBJ.X1
jsr OBJ.PullWordAtY
ldy #S.BUT.KEYMOD
jsr OBJ.PullWordAtY
ldy #S.BUT.pTEXT
jsr OBJ.PullWordAtY
ldy #S.BUT.pICON
jsr OBJ.PullWordAtY
ldy #S.OBJ.W
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
ldx hSYSFON
jsr FON.GetTextSize
ldy #S.OBJ.F
lda (ZPObjPtr),y
and #S.BUT.F.NOSPACE
bne .2
lda DX
beq .2
clc
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
.3 lda #PREFS.XSeparator
asl
* clc
adc DX
ldy #S.OBJ.W
sta (ZPObjPtr),y
lda #0
adc DX+1
iny
sta (ZPObjPtr),y
.5
.8 clc
rts
.9 >POP 14
rts
*--------------------------------------
BUT.Enter
*--------------------------------------
BUT.Draw
*--------------------------------------
BUT.Close
clc
rts
*--------------------------------------
MAN
SAVE usr/src/lib/libgui.s.but
LOAD usr/src/lib/libgui.s
ASM