A2osX/LIB/LIBGUI.S.MBAR.txt
burniouf 127ebe266a CC: wired to libgui
SH: bugfix
BIN/*, DRV/*:bugfix, API change
2022-10-09 23:22:46 +02:00

138 lines
1.9 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
*--------------------------------------
* MBAR.New(*S.MBITEM mbitems)
*--------------------------------------
MBAR.New >LDYAI S.MBAR
>SYSCALL2 getmem
bcs .99
>STYA ZPObjPtr
lda #S.OBJ.T.MBAR
sta (ZPObjPtr) S.OBJ.T
lda #0
ldy #S.MBAR-1
.1 sta (ZPObjPtr),y
dey
bne .1
>PULLA
ldy #S.MBAR.MBITEMS
sta (ZPObjPtr),y
>PULLA
iny
sta (ZPObjPtr),y
clc
.99 rts
*--------------------------------------
MBAR.Init >STYA ZPMENUPtr
>STYA ZPPtr1
ldy #S.MBITEM.S
lda (ZPPtr1),y
bmi .80
stz DX
stz DX+1
.1 lda (ZPPtr1)
beq .8
lda #S.MBITEM.TEXT
clc
adc ZPPtr1
tay
lda ZPPtr1+1
adc #0
ldx hSYSFON
jsr FON.GetTextSize
ldy #S.MBITEM.X1
lda DX
sta (ZPPtr1),y
iny
lda DX+1
sta (ZPPtr1),y
iny #S.MBITEM.XT
lda DX
clc
adc PREFS.MBARXMARGIN
sta DX
sta (ZPPtr1),y
iny
lda DX+1
adc #0
sta DX+1
sta (ZPPtr1),y
lda DX
clc
adc CB.CACHE+S.CB.SrcW
sta DX
lda DX+1
adc CB.CACHE+S.CB.SrcW+1
sta DX+1
iny #S.MBITEM.X2
lda DX
clc
adc PREFS.MBARXMARGIN
sta DX
sta (ZPPtr1),y
iny
lda DX+1
adc #0
sta DX+1
sta (ZPPtr1),y
lda (ZPPtr1)
clc
adc ZPPtr1
sta ZPPtr1
bcc .1
inc ZPPtr1+1
bra .1
.8 lda #$80
ldy #S.MBITEM.S
sta (ZPMENUPtr),y
.80 clc
rts
*--------------------------------------
* ZPWNDPtr parent WND
* MSG.X1, MSG.Y1
*--------------------------------------
MBAR.Enter
* >DEBUG
*--------------------------------------
MBAR.Leave
clc
rts
*--------------------------------------
MAN
SAVE usr/src/lib/libgui.s.mbar
LOAD usr/src/lib/libgui.s
ASM