A2osX/LIB/LIBGUI.S.MBOX.txt

148 lines
2.2 KiB
Plaintext
Raw Normal View History

2022-10-25 06:05:54 +00:00
NEW
AUTO 3,1
*--------------------------------------
* MsgBox(pTITLE, pBM, pTEXT, idButtons)
2022-11-02 06:54:30 +00:00
*--------------------------------------
MBOX.MsgBox >LDYAI 360
>STYA IE
>LDYAI 70
2022-11-02 06:54:30 +00:00
>STYA INE
2022-11-02 06:54:30 +00:00
lda WND.Desktop+S.OBJ.W
sec
sbc IE
and #$F8
2022-11-02 06:54:30 +00:00
sta DX
2022-11-02 06:54:30 +00:00
lda WND.Desktop+S.OBJ.W+1
sbc IE+1
lsr
2022-11-02 06:54:30 +00:00
sta DX+1
ror DX
lda WND.Desktop+S.OBJ.H
sec
sbc INE
sta DY
lda WND.Desktop+S.OBJ.H+1
sbc INE+1
lsr
2022-11-02 06:54:30 +00:00
sta DY+1
ror DY
>PUSHBI S.OBJ.F.BORDER+S.WND.F.MOVE+S.WND.F.CLOSE+S.WND.F.MODAL
>PUSHW DX
>PUSHW DY
>PUSHW IE
>PUSHW INE
jsr WND.New
bcs .9
sta WND.hWND
jsr OBJ.GetHWNDA for childs later....
2022-11-02 06:54:30 +00:00
ldy #S.WND.BGCOLOR
lda #C.WHITE
sta (ZPObjPtr),y
2022-11-02 06:54:30 +00:00
ldy #6
lda (pStack),y
tax
dey
lda (pStack),y
ldy #S.WND.pTITLE
jsr OBJ.SetAXAtY
ldy #4 pBM
2022-11-02 06:54:30 +00:00
lda (pStack),y
sta ZPBMPtr+1
2022-11-02 06:54:30 +00:00
dey
lda (pStack),y
sta ZPBMPtr
lda #16
sta DX
stz DX+1
lda #20
sta DY
stz DY+1
2022-11-02 06:54:30 +00:00
jsr BITMAP.New.I
bcs .9
2022-11-02 06:54:30 +00:00
ldy #2 pTEXT
lda (pStack),y
sta ZPPtr1+1
dey
lda (pStack),y
sta ZPPtr1
2022-11-02 06:54:30 +00:00
lda #60
sta DX
* stz DX+1
* lda #30
* sta DY
* stz DY+1
2022-11-02 06:54:30 +00:00
jsr LABEL.New.I
bcs .9
jsr MBOX.AddButtons
bcs .9
.8 lda WND.hWND
jsr WND.Show
2022-11-02 06:54:30 +00:00
.9 >POP 7
rts
2022-10-25 06:05:54 +00:00
*--------------------------------------
MBOX.AddButtons lda #360-5-60
sta D
lda /360-5-60
sta D+1
2022-11-02 06:54:30 +00:00
stz IY
.1 lda (pStack)
beq .8
2022-11-02 06:54:30 +00:00
lsr
sta (pStack)
bcc .7
2022-11-02 06:54:30 +00:00
jsr MBOX.AddButton
2022-11-02 06:54:30 +00:00
bcs .9
2022-10-25 06:05:54 +00:00
lda D
sec
sbc #55
sta D
bcs .7
dec D+1
.7 inc IY
inc IY
bra .1
2022-11-02 06:54:30 +00:00
.8 clc
.9 rts
2022-11-02 06:54:30 +00:00
*--------------------------------------
MBOX.AddButton >PUSHB WND.hWND
>PUSHBI 0 flags
>PUSHWI 50 w
>PUSHWZ pIcon
ldx IY
>PUSHW L.BUT.Labels,x pText
>PUSHWZ keymod/key
>PUSHWZ id
>PUSHW D X
>PUSHWI 45 Y
jmp BUT.New
2022-10-25 06:05:54 +00:00
*--------------------------------------
MAN
SAVE usr/src/lib/libgui.s.mbox
LOAD usr/src/lib/libgui.s
ASM