Re: A92: tios::MenuPopup default values?


[Prev][Next][Index][Thread]

Re: A92: tios::MenuPopup default values?




At 09:16 1998-02-10 +0100, you wrote:
>
>
>Could you send an example for MenuPopup please ? I would like to use it,but 
>there s no explanation about it. Thanks.

Here it is; tell me if you have any questions.
Note: You can also add submenu-structures to each item; this is made by
another value than $80xx and an offset to the structure in the offset list.
I'll see if I can dig up my old files on what values to use.


;************** ASM file header stuff ***************

	include	"tios.h"
	include	"flib.h"
	include	"hexlib.h"
	xdef	_main
	xdef	_comment

;******************* Constants ***********************

;******************* Code *************************

_main:
	jsr		flib::clr_scr

	move.w		#$FFFF,-(sp)		;Window y position ($FFFF=center)
	move.w		#$FFFF,-(sp)		;Window x position ($FFFF=center)
	pea		menu(PC)		;Adress to fields structure
	jsr		tios::MenuPopup		;Activate window
	addq.l		#8,sp

	move.l		#10,d1		;Note: d0 contains the returned value
	move.l		#10,d2		; or 0 if you press ESC.
	move.l		#7,d4
	jsr		hexlib::put_hex

	jsr		flib::idle_loop

	rts

;************************ STRUCTURE DATA ******************************

menu		dc.w	item1-menu	;offset to first item
		dc.w	$0025		;menu_type
		dc.w	$0003		;total_items
		dc.b	$00		;max_width (0=width of longest string)
		dc.b	$53		;max_height
		dc.w	$0003		;main_items
		ds.w	3
		dc.l	$FFFFFFFF

		dc.w	$8001,item1-item1,$8002,item2-item1,$8003,item3-item1
		dc.l	$FFFFFFFF

item1		dc.b	"Here",0
item2		dc.b	"we",0
item3		dc.b	"go",0

;******************* Variables and strings **************************

_comment	dc.b	"MenuPopup Test"

	end



Niklas Brunlid - http://www.efd.lth.se/~e96nbr
PQF Quote follows:

- "ALL YOU CAN HOPE FOR IS THE MERCY OF HELL."
- "Yeah?"
- "JUST OUR LITTLE JOKE."
- "Ngk," said Crowley.
        -- Crowley in conversation with his superiors
           (Terry Pratchett & Neil Gaiman, Good Omens)


Follow-Ups: References: