home *** CD-ROM | disk | FTP | other *** search
Unknown | 1997-03-10 | 28.3 KB |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was not able to be converted.
This format is not currently supported by dexvert.
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| file
| data
| default
| |
100%
| gt2
| Kopftext: 'HELP('
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 48 45 4c 50 28 00 00 00 | cb 00 00 00 ff ff ff ff |HELP(...|........|
|00000010| 2c 00 00 00 00 fd ff ff | 00 00 00 00 84 00 00 00 |,.......|........|
|00000020| 00 01 00 00 00 00 00 00 | 24 00 00 00 44 49 52 24 |........|$...DIR$|
|00000030| 8c 00 00 00 8c 00 00 00 | b8 00 00 00 47 ff fa ff |........|....G...|
|00000040| 3c 0c 56 4d ac 02 00 00 | 13 00 00 00 00 00 00 00 |<.VM....|........|
|00000050| 21 69 00 00 64 03 00 00 | 46 fd ff ff a4 29 af fe |!i..d...|F....)..|
|00000060| 39 01 00 00 13 00 00 00 | 00 00 00 00 21 4d 65 6e |9.......|....!Men|
|00000070| 75 00 00 00 a0 04 00 00 | 47 fd ff ff 6d b0 ab 68 |u.......|G...m..h|
|00000080| 6d 02 00 00 13 00 00 00 | 00 00 00 00 21 52 6f 6f |m.......|....!Roo|
|00000090| 74 00 00 00 10 07 00 00 | 47 fd ff ff a6 18 ac 68 |t.......|G......h|
|000000a0| a0 02 00 00 13 01 00 00 | 00 00 00 00 4d 65 6e 75 |........|....Menu|
|000000b0| 55 74 69 6c 5f 00 00 00 | 44 41 54 41 ac 02 00 00 |Util_...|DATA....|
|000000c0| 44 72 61 77 c9 00 00 00 | 00 00 00 00 44 72 61 77 |Draw....|....Draw|
|000000d0| 20 20 20 20 20 20 20 20 | b7 f6 00 00 94 4e 01 00 | |.....N..|
|000000e0| eb 27 02 00 de e0 02 00 | 00 00 00 00 18 00 00 00 |.'......|........|
|000000f0| 01 54 72 69 6e 69 74 79 | 2e 42 6f 6c 64 00 00 00 |.Trinity|.Bold...|
|00000100| 0b 00 00 00 58 00 00 00 | 00 00 00 00 00 00 00 00 |....X...|........|
|00000110| 00 00 00 00 00 00 00 00 | 00 06 00 00 10 01 00 00 |........|........|
|00000120| 00 00 f0 3f 00 00 00 00 | 10 00 00 00 00 00 00 00 |...?....|........|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 01 00 00 00 01 00 00 00 | 00 00 00 00 01 00 00 00 |........|........|
|00000150| 80 00 00 00 88 13 00 00 | 02 00 00 00 ac 00 00 00 |........|........|
|00000160| 1e e7 01 00 07 63 02 00 | eb 27 02 00 d4 a3 02 00 |.....c..|.'......|
|00000170| 00 ff ff ff 00 bb bb bb | 00 00 00 00 42 00 10 20 |........|....B.. |
|00000180| 02 00 00 00 6e 1e 02 00 | 85 6c 02 00 06 00 00 00 |....n...|.l......|
|00000190| c9 11 02 00 de 5f 02 00 | 43 fd 01 00 de 5f 02 00 |....._..|C...._..|
|000001a0| 9c f0 01 00 85 6c 02 00 | 06 00 00 00 f5 e3 01 00 |.....l..|........|
|000001b0| 2c 79 02 00 f5 e3 01 00 | b0 8d 02 00 9c f0 01 00 |,y......|........|
|000001c0| 57 9a 02 00 06 00 00 00 | 43 fd 01 00 fe a6 02 00 |W.......|C.......|
|000001d0| c9 11 02 00 fe a6 02 00 | 6e 1e 02 00 57 9a 02 00 |........|n...W...|
|000001e0| 06 00 00 00 15 2b 02 00 | b0 8d 02 00 15 2b 02 00 |.....+..|.....+..|
|000001f0| 2c 79 02 00 6e 1e 02 00 | 85 6c 02 00 05 00 00 00 |,y..n...|.l......|
|00000200| 00 00 00 00 02 00 00 00 | fc 00 00 00 b8 21 01 00 |........|.....!..|
|00000210| da 56 01 00 d3 1f 02 00 | ee 42 02 00 00 ff ff ff |.V......|.B......|
|00000220| 00 bb bb bb 00 00 00 00 | 42 00 10 20 02 00 00 00 |........|B.. ....|
|00000230| 40 06 02 00 c0 42 02 00 | 08 00 00 00 2e b7 01 00 |@....B..|........|
|00000240| ee 42 02 00 06 00 00 00 | fb 8d 01 00 e5 2a 02 00 |.B......|.....*..|
|00000250| 35 5b 01 00 20 0c 02 00 | b8 21 01 00 1f f3 01 00 |5[.. ...|.!......|
|00000260| 06 00 00 00 76 3e 01 00 | 15 f4 01 00 7e 54 01 00 |....v>..|....~T..|
|00000270| da f9 01 00 34 72 01 00 | 82 02 02 00 06 00 00 00 |....4r..|........|
|00000280| 06 3d 01 00 3b d1 01 00 | 9c 1f 01 00 53 86 01 00 |.=..;...|....S...|
|00000290| bf 4e 01 00 cd 64 01 00 | 06 00 00 00 91 88 01 00 |.N...d..|........|
|000002a0| ac 3b 01 00 f4 05 02 00 | b2 73 01 00 d3 1f 02 00 |.;......|.s......|
|000002b0| ee b8 01 00 08 00 00 00 | b9 c6 01 00 ee b8 01 00 |........|........|
|000002c0| 06 00 00 00 85 b4 01 00 | e5 a0 01 00 3b 9f 01 00 |........|....;...|
|000002d0| a6 9a 01 00 fb 8d 01 00 | 28 a7 01 00 06 00 00 00 |........|(.......|
|000002e0| 1d 74 01 00 32 bf 01 00 | ed df 01 00 f1 24 02 00 |.t..2...|.....$..|
|000002f0| 40 06 02 00 c0 42 02 00 | 05 00 00 00 00 00 00 00 |@....B..|........|
|00000300| 0c 00 00 00 64 00 00 00 | b7 f6 00 00 94 4e 01 00 |....d...|.....N..|
|00000310| ee 1c 01 00 de e0 02 00 | 00 00 00 00 00 00 01 00 |........|........|
|00000320| 00 00 ff ff 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000330| 00 00 00 00 00 00 00 00 | 00 dd dd dd 01 00 00 00 |........|........|
|00000340| 00 36 00 00 00 36 00 00 | f6 1b 01 00 64 4d 01 00 |.6...6..|....dM..|
|00000350| 4d 65 6e 75 55 74 69 6c | 73 20 76 2e 20 30 2e 31 |MenuUtil|s v. 0.1|
|00000360| 32 00 00 00 44 41 54 41 | 39 01 00 00 53 74 72 6f |2...DATA|9...Stro|
|00000370| 6e 67 48 65 6c 70 20 4d | 61 69 6e 20 4d 65 6e 75 |ngHelp M|ain Menu|
|00000380| 0a 23 62 61 63 6b 67 72 | 6f 75 6e 64 20 77 69 6d |.#backgr|ound wim|
|00000390| 70 20 31 0a 23 70 6f 73 | 74 66 69 78 20 3a 21 52 |p 1.#pos|tfix :!R|
|000003a0| 6f 6f 74 0a 23 64 72 61 | 77 20 38 2c 38 20 21 69 |oot.#dra|w 8,8 !i|
|000003b0| 0a 23 69 6e 64 65 6e 74 | 20 36 0a 54 68 69 73 20 |.#indent| 6.This |
|000003c0| 69 73 20 61 20 6c 69 73 | 74 20 6f 66 20 61 6c 6c |is a lis|t of all|
|000003d0| 20 63 75 72 72 65 6e 74 | 6c 79 20 69 6e 73 74 61 | current|ly insta|
|000003e0| 6c 6c 65 64 20 6d 61 6e | 75 61 6c 73 2e 20 43 6c |lled man|uals. Cl|
|000003f0| 69 63 6b 20 6f 6e 20 74 | 68 65 20 6f 6e 65 20 79 |ick on t|he one y|
|00000400| 6f 75 20 72 65 71 75 69 | 72 65 2e 0a 23 6c 69 6e |ou requi|re..#lin|
|00000410| 65 0a 23 54 61 62 6c 65 | 20 6c 69 6e 65 73 20 38 |e.#Table| lines 8|
|00000420| 0a 23 4d 61 6e 75 61 6c | 73 0a 23 45 6e 64 74 61 |.#Manual|s.#Endta|
|00000430| 62 6c 65 0a 23 69 6e 64 | 65 6e 74 20 30 0a 23 62 |ble.#ind|ent 0.#b|
|00000440| 65 6c 6f 77 3b 20 4c 69 | 6e 65 3b 20 57 72 61 70 |elow; Li|ne; Wrap|
|00000450| 20 6f 66 66 3b 20 41 6c | 69 67 6e 20 43 65 6e 74 | off; Al|ign Cent|
|00000460| 72 65 0a 53 74 72 6f 6e | 67 48 65 6c 70 20 69 73 |re.Stron|gHelp is|
|00000470| 20 61 20 66 72 65 65 77 | 61 72 65 20 70 72 6f 64 | a freew|are prod|
|00000480| 75 63 74 20 66 72 6f 6d | 20 47 75 74 74 6f 72 6d |uct from| Guttorm|
|00000490| 2e 56 69 6b 40 65 75 6e | 65 74 2e 6e 6f 00 00 00 |.Vik@eun|et.no...|
|000004a0| 44 41 54 41 6d 02 00 00 | 4d 65 6e 75 55 74 69 6c |DATAm...|MenuUtil|
|000004b0| 73 20 30 2e 31 32 0a 23 | 50 61 72 65 6e 74 20 53 |s 0.12.#|Parent S|
|000004c0| 74 72 6f 6e 67 48 65 6c | 70 3a 21 4d 65 6e 75 0a |trongHel|p:!Menu.|
|000004d0| 23 69 6e 64 65 6e 74 20 | 36 0a 23 64 72 61 77 20 |#indent |6.#draw |
|000004e0| 38 2c 38 20 21 69 0a 3c | 4d 65 6e 75 55 74 69 6c |8,8 !i.<|MenuUtil|
|000004f0| 73 20 30 2e 31 32 3d 3e | 4d 65 6e 75 55 74 69 6c |s 0.12=>|MenuUtil|
|00000500| 5f 4f 76 65 72 76 69 65 | 77 3e 20 70 72 6f 76 69 |_Overvie|w> provi|
|00000510| 64 65 73 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |des the |followin|
|00000520| 67 20 53 57 49 73 3a 0a | 0a 8f 20 09 3c 4d 65 6e |g SWIs:.|.. .<Men|
|00000530| 75 55 74 69 6c 5f 49 6e | 69 74 69 61 6c 69 73 65 |uUtil_In|itialise|
|00000540| 3e 09 09 8f 20 09 3c 4d | 65 6e 75 55 74 69 6c 5f |>... .<M|enuUtil_|
|00000550| 54 69 63 6b 3e 20 20 20 | 0a 8f 20 09 3c 4d 65 6e |Tick> |.. .<Men|
|00000560| 75 55 74 69 6c 5f 4e 65 | 77 3e 09 09 09 8f 20 09 |uUtil_Ne|w>.... .|
|00000570| 3c 4d 65 6e 75 55 74 69 | 6c 5f 44 6f 74 73 3e 20 |<MenuUti|l_Dots> |
|00000580| 20 20 20 20 20 20 20 20 | 20 20 0a 8f 20 09 3c 4d | | .. .<M|
|00000590| 65 6e 75 55 74 69 6c 5f | 41 64 64 3e 09 09 09 8f |enuUtil_|Add>....|
|000005a0| 20 09 3c 4d 65 6e 75 55 | 74 69 6c 5f 46 61 64 65 | .<MenuU|til_Fade|
|000005b0| 3e 20 20 20 20 20 20 20 | 20 20 20 20 0a 8f 20 09 |> | .. .|
|000005c0| 3c 4d 65 6e 75 55 74 69 | 6c 5f 44 65 6c 65 74 65 |<MenuUti|l_Delete|
|000005d0| 3e 09 09 8f 20 09 3c 4d | 65 6e 75 55 74 69 6c 5f |>... .<M|enuUtil_|
|000005e0| 57 61 72 6e 69 6e 67 3e | 20 20 0a 8f 20 09 3c 4d |Warning>| .. .<M|
|000005f0| 65 6e 75 55 74 69 6c 5f | 44 65 63 6f 64 65 3e 09 |enuUtil_|Decode>.|
|00000600| 09 8f 20 09 3c 4d 65 6e | 75 55 74 69 6c 5f 57 72 |.. .<Men|uUtil_Wr|
|00000610| 69 74 61 62 6c 65 3e 0a | 8f 20 09 3c 4d 65 6e 75 |itable>.|. .<Menu|
|00000620| 55 74 69 6c 5f 53 68 6f | 77 3e 09 09 09 8f 20 09 |Util_Sho|w>.... .|
|00000630| 3c 4d 65 6e 75 55 74 69 | 6c 5f 53 75 62 4d 65 6e |<MenuUti|l_SubMen|
|00000640| 75 3e 20 20 20 20 0a 8f | 20 09 3c 4d 65 6e 75 55 |u> ..| .<MenuU|
|00000650| 74 69 6c 5f 53 68 6f 77 | 53 75 62 4d 65 6e 75 3e |til_Show|SubMenu>|
|00000660| 09 09 8f 20 09 3c 4d 65 | 6e 75 55 74 69 6c 5f 43 |... .<Me|nuUtil_C|
|00000670| 6f 6c 6f 75 72 4d 65 6e | 75 3e 0a 8f 20 09 3c 4d |olourMen|u>.. .<M|
|00000680| 65 6e 75 55 74 69 6c 5f | 49 6e 66 6f 3e 09 09 09 |enuUtil_|Info>...|
|00000690| 8f 20 09 3c 4d 65 6e 75 | 55 74 69 6c 5f 43 6f 6c |. .<Menu|Util_Col|
|000006a0| 6f 75 72 73 3e 20 20 20 | 20 0a 8f 20 09 3c 4d 65 |ours> | .. .<Me|
|000006b0| 6e 75 55 74 69 6c 5f 54 | 65 78 74 3e 09 09 09 8f |nuUtil_T|ext>....|
|000006c0| 20 09 3c 4d 65 6e 75 55 | 74 69 6c 5f 54 69 63 6b | .<MenuU|til_Tick|
|000006d0| 4f 6e 6c 79 3e 0a 23 4c | 69 6e 65 0a 8f 20 09 3c |Only>.#L|ine.. .<|
|000006e0| 48 6f 77 20 74 6f 20 63 | 72 65 61 74 65 20 61 20 |How to c|reate a |
|000006f0| 46 6f 6e 74 20 4d 65 6e | 75 3d 3e 4d 65 6e 75 55 |Font Men|u=>MenuU|
|00000700| 74 69 6c 5f 46 6f 6e 74 | 4d 65 6e 75 3e 00 00 00 |til_Font|Menu>...|
|00000710| 44 49 52 24 a0 02 00 00 | a0 02 00 00 b0 09 00 00 |DIR$....|........|
|00000720| 47 ff ff ff 05 1e ab 68 | 27 03 00 00 13 00 00 00 |G......h|'.......|
|00000730| 00 00 00 00 49 6e 69 74 | 69 61 6c 69 73 65 00 00 |....Init|ialise..|
|00000740| d8 0c 00 00 47 ff ff ff | 12 21 ab 68 fb 06 00 00 |....G...|.!.h....|
|00000750| 13 00 00 00 00 00 00 00 | 4e 65 77 00 d4 13 00 00 |........|New.....|
|00000760| 47 ff ff ff 05 04 ab 68 | a0 0a 00 00 13 00 00 00 |G......h|........|
|00000770| 00 00 00 00 41 64 64 00 | 74 1e 00 00 47 ff ff ff |....Add.|t...G...|
|00000780| b6 0c ab 68 25 05 00 00 | 13 00 00 00 00 00 00 00 |...h%...|........|
|00000790| 44 65 6c 65 74 65 00 00 | 9c 23 00 00 47 ff ff ff |Delete..|.#..G...|
|000007a0| 14 ee aa 68 6c 0a 00 00 | 13 00 00 00 00 00 00 00 |...hl...|........|
|000007b0| 44 65 63 6f 64 65 00 00 | 08 2e 00 00 47 ff ff ff |Decode..|....G...|
|000007c0| 85 69 ab 68 0b 05 00 00 | 13 00 00 00 00 00 00 00 |.i.h....|........|
|000007d0| 53 68 6f 77 00 00 00 00 | 14 33 00 00 47 ff ff ff |Show....|.3..G...|
|000007e0| 6c 6c ab 68 34 04 00 00 | 13 00 00 00 00 00 00 00 |ll.h4...|........|
|000007f0| 53 68 6f 77 53 75 62 4d | 65 6e 75 00 48 37 00 00 |ShowSubM|enu.H7..|
|00000800| 47 ff ff ff c9 18 ab 68 | 75 02 00 00 13 00 00 00 |G......h|u.......|
|00000810| 00 00 00 00 49 6e 66 6f | 00 00 00 00 c0 39 00 00 |....Info|.....9..|
|00000820| 47 ff ff ff 5f 72 ab 68 | 64 05 00 00 13 00 00 00 |G..._r.h|d.......|
|00000830| 00 00 00 00 54 65 78 74 | 00 00 00 00 24 3f 00 00 |....Text|....$?..|
|00000840| 47 ff ff ff 51 75 ab 68 | 28 04 00 00 13 00 00 00 |G...Qu.h|(.......|
|00000850| 00 00 00 00 54 69 63 6b | 00 00 00 00 4c 43 00 00 |....Tick|....LC..|
|00000860| 47 ff ff ff ef 44 51 4d | b9 03 00 00 13 00 00 00 |G....DQM|........|
|00000870| 00 00 00 00 44 6f 74 73 | 00 00 00 00 08 47 00 00 |....Dots|.....G..|
|00000880| 47 ff ff ff cb 47 51 4d | 0d 04 00 00 13 00 00 00 |G....GQM|........|
|00000890| 00 00 00 00 46 61 64 65 | 00 00 00 00 18 4b 00 00 |....Fade|.....K..|
|000008a0| 47 ff ff ff 4b 7d ab 68 | 55 04 00 00 13 00 00 00 |G...K}.h|U.......|
|000008b0| 00 00 00 00 57 61 72 6e | 69 6e 67 00 70 4f 00 00 |....Warn|ing.pO..|
|000008c0| 47 ff ff ff 3e 80 ab 68 | 4a 05 00 00 13 00 00 00 |G...>..h|J.......|
|000008d0| 00 00 00 00 57 72 69 74 | 61 62 6c 65 00 00 00 00 |....Writ|able....|
|000008e0| bc 54 00 00 47 ff ff ff | 55 6f ab 68 61 04 00 00 |.T..G...|Uo.ha...|
|000008f0| 13 00 00 00 00 00 00 00 | 53 75 62 6d 65 6e 75 00 |........|Submenu.|
|00000900| 20 59 00 00 47 ff ff ff | 0d 07 ab 68 4f 03 00 00 | Y..G...|...hO...|
|00000910| 13 00 00 00 00 00 00 00 | 43 6f 6c 6f 75 72 4d 65 |........|ColourMe|
|00000920| 6e 75 00 00 70 5c 00 00 | 47 ff ff ff d4 09 ab 68 |nu..p\..|G......h|
|00000930| 01 02 00 00 13 00 00 00 | 00 00 00 00 43 6f 6c 6f |........|....Colo|
|00000940| 75 72 73 00 74 5e 00 00 | 47 ff ff ff 19 78 ab 68 |urs.t^..|G....x.h|
|00000950| 49 02 00 00 13 00 00 00 | 00 00 00 00 54 69 63 6b |I.......|....Tick|
|00000960| 4f 6e 6c 79 00 00 00 00 | c0 60 00 00 47 ff ff ff |Only....|.`..G...|
|00000970| 6e 0b ac 68 87 0e 00 00 | 13 00 00 00 00 00 00 00 |n..h....|........|
|00000980| 4f 76 65 72 76 69 65 77 | 00 00 00 00 48 6f 00 00 |Overview|....Ho..|
|00000990| 47 ff ff ff d0 90 aa 68 | e7 01 00 00 13 00 00 00 |G......h|........|
|000009a0| 00 00 00 00 46 6f 6e 74 | 4d 65 6e 75 00 00 00 00 |....Font|Menu....|
|000009b0| 44 41 54 41 27 03 00 00 | 4d 65 6e 75 55 74 69 6c |DATA'...|MenuUtil|
|000009c0| 5f 49 6e 69 74 69 61 6c | 69 73 65 20 28 53 57 49 |_Initial|ise (SWI|
|000009d0| 20 26 34 35 42 43 30 29 | 0a 23 50 61 72 65 6e 74 | &45BC0)|.#Parent|
|000009e0| 20 4d 65 6e 75 55 74 69 | 6c 73 3a 21 52 6f 6f 74 | MenuUti|ls:!Root|
|000009f0| 0a 20 54 6f 20 72 65 67 | 69 73 74 65 72 20 74 68 |. To reg|ister th|
|00000a00| 65 20 74 61 73 6b 20 61 | 73 20 4d 65 6e 75 55 74 |e task a|s MenuUt|
|00000a10| 69 6c 73 20 63 6c 69 65 | 6e 74 0a 20 0a 20 45 6e |ils clie|nt. . En|
|00000a20| 74 72 79 3a 0a 20 20 20 | 20 20 52 30 20 6c 61 73 |try:. | R0 las|
|00000a30| 74 20 4d 65 6e 75 55 74 | 69 6c 73 20 76 65 72 73 |t MenuUt|ils vers|
|00000a40| 69 6f 6e 20 6e 75 6d 62 | 65 72 20 6b 6e 6f 77 6e |ion numb|er known|
|00000a50| 20 74 6f 20 74 61 73 6b | 20 2a 20 31 30 30 20 20 | to task| * 100 |
|00000a60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 0a 20 | | . |
|00000a70| 20 20 20 20 52 31 20 69 | 6e 69 74 69 61 6c 69 73 | R1 i|nitialis|
|00000a80| 61 74 69 6f 6e 20 74 79 | 70 65 20 28 73 65 65 20 |ation ty|pe (see |
|00000a90| 6c 61 74 65 72 29 0a 20 | 20 20 20 20 20 20 20 62 |later). | b|
|00000aa0| 69 74 20 30 0a 20 20 20 | 20 20 20 20 20 20 20 20 |it 0. | |
|00000ab0| 20 30 20 2d 20 22 42 41 | 53 49 43 22 0a 20 20 20 | 0 - "BA|SIC". |
|00000ac0| 20 20 20 20 20 20 20 20 | 20 31 20 2d 20 22 6d 61 | | 1 - "ma|
|00000ad0| 63 68 69 6e 65 20 63 6f | 64 65 22 20 28 6e 6f 74 |chine co|de" (not|
|00000ae0| 20 73 75 70 70 6f 72 74 | 65 64 20 62 79 20 63 75 | support|ed by cu|
|00000af0| 72 72 65 6e 74 20 76 65 | 72 73 69 6f 6e 29 0a 20 |rrent ve|rsion). |
|00000b00| 45 78 69 74 3a 0a 20 20 | 20 20 20 52 30 20 76 65 |Exit:. | R0 ve|
|00000b10| 72 73 69 6f 6e 20 6e 75 | 6d 62 65 72 20 2a 20 31 |rsion nu|mber * 1|
|00000b20| 30 30 0a 20 20 20 20 20 | 52 31 2c 52 32 20 70 72 |00. |R1,R2 pr|
|00000b30| 65 73 65 72 76 65 64 20 | 20 20 20 20 0a 0a 4d 65 |eserved | ..Me|
|00000b40| 6e 75 55 74 69 6c 5f 49 | 6e 69 74 69 61 6c 69 73 |nuUtil_I|nitialis|
|00000b50| 65 20 73 68 6f 75 6c 64 | 20 6f 6e 6c 79 20 62 65 |e should| only be|
|00000b60| 20 63 61 6c 6c 65 64 20 | 6f 6e 63 65 20 77 68 65 | called |once whe|
|00000b70| 6e 20 74 68 65 20 74 61 | 73 6b 20 73 74 61 72 74 |n the ta|sk start|
|00000b80| 73 20 75 70 2e 20 49 74 | 0a 6d 75 73 74 20 62 65 |s up. It|.must be|
|00000b90| 20 63 61 6c 6c 65 64 20 | 61 66 74 65 72 20 57 69 | called |after Wi|
|00000ba0| 6d 70 5f 49 6e 69 74 69 | 61 6c 69 73 65 20 68 61 |mp_Initi|alise ha|
|00000bb0| 73 20 62 65 65 6e 20 63 | 61 6c 6c 65 64 20 61 6e |s been c|alled an|
|00000bc0| 64 20 62 65 66 6f 72 65 | 20 61 6e 79 0a 6f 74 68 |d before| any.oth|
|00000bd0| 65 72 20 63 61 6c 6c 20 | 74 6f 20 74 68 65 20 4d |er call |to the M|
|00000be0| 65 6e 75 55 74 69 6c 73 | 20 6d 6f 64 75 6c 65 20 |enuUtils| module |
|00000bf0| 69 73 20 6d 61 64 65 2e | 0a 0a 4d 65 6e 75 55 74 |is made.|..MenuUt|
|00000c00| 69 6c 73 20 70 65 72 66 | 6f 72 6d 73 20 61 6c 6c |ils perf|orms all|
|00000c10| 20 74 68 65 20 63 6c 6f | 73 65 64 6f 77 6e 20 77 | the clo|sedown w|
|00000c20| 6f 72 6b 20 61 75 74 6f | 6d 61 74 69 63 61 6c 6c |ork auto|maticall|
|00000c30| 79 20 77 68 65 6e 20 74 | 68 65 0a 74 61 73 6b 20 |y when t|he.task |
|00000c40| 66 69 6e 69 73 68 65 73 | 20 73 6f 20 6e 6f 20 73 |finishes| so no s|
|00000c50| 70 65 63 69 61 6c 20 4d | 65 6e 75 55 74 69 6c 5f |pecial M|enuUtil_|
|00000c60| 43 6c 6f 73 65 44 6f 77 | 6e 20 53 57 49 20 69 73 |CloseDow|n SWI is|
|00000c70| 20 70 72 6f 76 69 64 65 | 64 2e 0a 0a 20 45 78 61 | provide|d... Exa|
|00000c80| 6d 70 6c 65 20 63 6f 64 | 65 3a 0a 20 52 65 67 69 |mple cod|e:. Regi|
|00000c90| 73 74 65 72 20 74 68 65 | 20 74 61 73 6b 20 77 69 |ster the| task wi|
|00000ca0| 74 68 20 61 6e 79 20 76 | 65 72 73 69 6f 6e 20 6f |th any v|ersion o|
|00000cb0| 66 20 74 68 65 20 6d 6f | 64 75 6c 65 0a 20 53 59 |f the mo|dule. SY|
|00000cc0| 53 20 22 4d 65 6e 75 55 | 74 69 6c 5f 49 6e 69 74 |S "MenuU|til_Init|
|00000cd0| 69 61 6c 69 73 65 22 00 | 44 41 54 41 fb 06 00 00 |ialise".|DATA....|
|00000ce0| 4d 65 6e 75 55 74 69 6c | 5f 4e 65 77 20 28 53 57 |MenuUtil|_New (SW|
|00000cf0| 49 20 26 34 35 42 43 31 | 29 0a 23 50 61 72 65 6e |I &45BC1|).#Paren|
|00000d00| 74 20 4d 65 6e 75 55 74 | 69 6c 73 3a 21 52 6f 6f |t MenuUt|ils:!Roo|
|00000d10| 74 0a 20 43 72 65 61 74 | 65 73 20 6e 65 77 20 65 |t. Creat|es new e|
|00000d20| 6d 70 74 79 20 6d 65 6e | 75 2e 0a 0a 20 45 6e 74 |mpty men|u... Ent|
|00000d30| 72 79 3a 0a 20 20 20 20 | 20 52 31 20 70 6f 69 6e |ry:. | R1 poin|
|00000d40| 74 65 72 20 74 6f 20 6d | 65 6e 75 20 74 69 74 6c |ter to m|enu titl|
|00000d50| 65 20 73 74 72 69 6e 67 | 0a 20 20 20 20 20 52 32 |e string|. R2|
|00000d60| 20 61 70 70 72 6f 78 69 | 6d 61 74 65 20 6e 75 6d | approxi|mate num|
|00000d70| 62 65 72 20 6f 66 20 69 | 74 65 6d 73 20 28 64 65 |ber of i|tems (de|
|00000d80| 66 61 75 6c 74 20 35 29 | 0a 0a 20 45 78 69 74 3a |fault 5)|.. Exit:|
|00000d90| 0a 20 20 20 20 20 52 30 | 20 68 61 6e 64 6c 65 20 |. R0| handle |
|00000da0| 6f 66 20 63 72 65 61 74 | 65 64 20 6d 65 6e 75 0a |of creat|ed menu.|
|00000db0| 20 20 20 20 0a 54 68 69 | 73 20 63 61 6c 6c 20 63 | .Thi|s call c|
|00000dc0| 72 65 61 74 65 73 20 6e | 65 77 20 65 6d 70 74 79 |reates n|ew empty|
|00000dd0| 20 6d 65 6e 75 20 77 69 | 74 68 20 73 70 65 63 69 | menu wi|th speci|
|00000de0| 66 69 65 64 20 74 69 74 | 6c 65 20 73 74 72 69 6e |fied tit|le strin|
|00000df0| 67 2e 20 43 6f 6c 6f 75 | 72 73 0a 61 6e 64 20 64 |g. Colou|rs.and d|
|00000e00| 69 6d 65 6e 73 69 6f 6e | 73 20 6f 66 20 74 68 65 |imension|s of the|
|00000e10| 20 6d 65 6e 75 20 61 72 | 65 20 69 6e 20 73 74 61 | menu ar|e in sta|
|00000e20| 6e 64 61 72 64 20 52 49 | 53 43 20 4f 53 20 73 74 |ndard RI|SC OS st|
|00000e30| 79 6c 65 2e 20 59 6f 75 | 20 63 61 6e 0a 73 70 65 |yle. You| can.spe|
|00000e40| 63 69 66 79 20 6e 75 6d | 62 65 72 20 6f 66 20 69 |cify num|ber of i|
|00000e50| 74 65 6d 73 20 79 6f 75 | 20 61 72 65 20 67 6f 69 |tems you| are goi|
|00000e60| 6e 67 20 74 6f 20 68 61 | 76 65 20 69 6e 20 74 68 |ng to ha|ve in th|
|00000e70| 69 73 20 6d 65 6e 75 2e | 20 54 68 69 73 20 69 73 |is menu.| This is|
|00000e80| 0a 6f 70 74 69 6f 6e 61 | 6c 20 62 75 74 20 69 74 |.optiona|l but it|
|00000e90| 20 63 61 6e 20 73 70 65 | 65 64 20 75 70 20 74 68 | can spe|ed up th|
|00000ea0| 65 20 70 72 6f 63 65 73 | 73 20 6f 66 20 6d 65 6e |e proces|s of men|
|00000eb0| 75 20 63 72 65 61 74 69 | 6f 6e 2e 20 49 74 0a 6d |u creati|on. It.m|
|00000ec0| 61 79 20 62 65 20 69 6d | 70 6f 72 74 61 6e 74 20 |ay be im|portant |
|00000ed0| 66 6f 72 20 62 69 67 20 | 6d 65 6e 75 73 20 28 66 |for big |menus (f|
|00000ee0| 6f 72 20 65 78 61 6d 70 | 6c 65 20 66 6f 72 20 6f |or examp|le for o|
|00000ef0| 6c 64 73 74 79 6c 65 20 | 66 6f 6e 74 73 20 6d 65 |ldstyle |fonts me|
|00000f00| 6e 75 29 2e 0a 0a 41 73 | 20 57 69 6e 64 6f 77 20 |nu)...As| Window |
|00000f10| 4d 61 6e 61 67 65 72 20 | 64 6f 65 73 6e 27 74 20 |Manager |doesn't |
|00000f20| 61 6c 6c 6f 77 20 79 6f | 75 20 74 6f 20 68 61 76 |allow yo|u to hav|
|00000f30| 65 20 6d 65 6e 75 73 20 | 61 62 73 6f 6c 75 74 65 |e menus |absolute|
|00000f40| 6c 79 20 77 69 74 68 6f | 75 74 0a 6d 65 6e 75 20 |ly witho|ut.menu |
|00000f50| 69 74 65 6d 73 20 73 6f | 20 65 61 63 68 20 6e 65 |items so| each ne|
|00000f60| 77 20 6d 65 6e 75 20 69 | 73 20 63 72 65 61 74 65 |w menu i|s create|
|00000f70| 64 20 74 6f 67 65 74 68 | 65 72 20 77 69 74 68 20 |d togeth|er with |
|00000f80| 6f 6e 65 20 73 70 65 63 | 69 61 6c 20 69 74 65 6d |one spec|ial item|
|00000f90| 2e 0a 54 68 69 73 20 69 | 74 65 6d 20 69 73 20 63 |..This i|tem is c|
|00000fa0| 72 65 61 74 65 64 20 77 | 69 74 68 20 74 68 65 20 |reated w|ith the |
|00000fb0| 6f 6e 6c 79 20 61 69 6d | 20 74 6f 20 70 72 65 76 |only aim| to prev|
|00000fc0| 65 6e 74 20 63 72 61 73 | 68 65 73 20 69 6e 20 63 |ent cras|hes in c|
|00000fd0| 61 73 65 20 79 6f 75 0a | 77 69 6c 6c 20 61 63 63 |ase you.|will acc|
|00000fe0| 69 64 65 6e 74 69 61 6c | 6c 79 20 74 72 79 20 74 |idential|ly try t|
|00000ff0| 6f 20 6f 70 65 6e 20 75 | 6e 66 69 6e 69 73 68 65 |o open u|nfinishe|
|00001000| 64 20 6d 65 6e 75 2e 20 | 54 68 65 20 73 70 65 63 |d menu. |The spec|
|00001010| 69 61 6c 20 69 74 65 6d | 20 77 69 6c 6c 0a 62 65 |ial item| will.be|
|00001020| 20 72 65 6d 6f 76 65 64 | 20 61 75 74 6f 6d 61 74 | removed| automat|
|00001030| 69 63 61 6c 6c 79 20 6a | 75 73 74 20 61 66 74 65 |ically j|ust afte|
|00001040| 72 20 79 6f 75 20 61 64 | 64 20 79 6f 75 72 20 66 |r you ad|d your f|
|00001050| 69 72 73 74 20 69 74 65 | 6d 20 74 6f 20 74 68 69 |irst ite|m to thi|
|00001060| 73 0a 6d 65 6e 75 2e 0a | 0a 49 66 20 79 6f 75 72 |s.menu..|.If your|
|00001070| 20 70 72 6f 67 72 61 6d | 20 68 61 73 20 63 6f 6d | program| has com|
|00001080| 70 6c 65 78 20 6d 65 6e | 75 20 73 74 72 75 63 74 |plex men|u struct|
|00001090| 75 72 65 20 77 69 74 68 | 20 73 75 62 6d 65 6e 75 |ure with| submenu|
|000010a0| 73 20 74 68 65 6e 20 79 | 6f 75 20 63 61 6e 0a 75 |s then y|ou can.u|
|000010b0| 73 65 20 74 68 69 73 20 | 63 61 6c 6c 20 74 6f 20 |se this |call to |
|000010c0| 63 72 65 61 74 65 20 6e | 6f 74 20 6f 6e 6c 79 20 |create n|ot only |
|000010d0| 6d 61 69 6e 20 6d 65 6e | 75 20 62 75 74 20 61 6c |main men|u but al|
|000010e0| 73 6f 20 61 6c 6c 20 73 | 75 62 6d 65 6e 75 73 2e |so all s|ubmenus.|
|000010f0| 20 41 6e 64 0a 79 6f 75 | 20 68 61 76 65 20 74 6f | And.you| have to|
|00001100| 20 72 65 6d 65 6d 62 65 | 72 20 74 68 65 20 68 61 | remembe|r the ha|
|00001110| 6e 64 6c 65 73 20 6f 66 | 20 61 6c 6c 20 73 75 62 |ndles of| all sub|
|00001120| 6d 65 6e 75 73 20 69 6e | 20 6f 72 64 65 72 20 74 |menus in| order t|
|00001130| 6f 20 6c 69 6e 6b 20 74 | 68 65 6d 0a 6c 61 74 65 |o link t|hem.late|
|00001140| 72 20 74 6f 20 63 6f 72 | 72 65 73 70 6f 6e 64 69 |r to cor|respondi|
|00001150| 6e 67 20 6d 65 6e 75 20 | 69 74 65 6d 73 20 69 6e |ng menu |items in|
|00001160| 20 70 61 72 65 6e 74 20 | 6d 65 6e 75 2e 20 49 66 | parent |menu. If|
|00001170| 20 6f 6e 20 74 68 65 20 | 6f 74 68 65 72 20 68 61 | on the |other ha|
|00001180| 6e 64 0a 79 6f 75 72 20 | 70 72 6f 67 72 61 6d 20 |nd.your |program |
|00001190| 68 61 76 65 20 6f 6e 6c | 79 20 6f 6e 65 20 6d 65 |have onl|y one me|
|000011a0| 6e 75 20 77 69 74 68 6f | 75 74 20 73 75 62 6d 65 |nu witho|ut subme|
|000011b0| 6e 75 73 20 74 68 65 6e | 20 79 6f 75 20 6d 61 79 |nus then| you may|
|000011c0| 20 69 67 6e 6f 72 65 0a | 74 68 65 20 72 65 74 75 | ignore.|the retu|
|000011d0| 72 6e 65 64 20 6d 65 6e | 75 20 68 61 6e 64 6c 65 |rned men|u handle|
|000011e0| 20 62 65 63 61 75 73 65 | 20 69 74 20 77 69 6c 6c | because| it will|
|000011f0| 20 62 65 20 61 6e 79 77 | 61 79 20 75 73 65 64 20 | be anyw|ay used |
|00001200| 61 73 20 64 65 66 61 75 | 6c 74 20 69 6e 0a 61 6c |as defau|lt in.al|
|00001210| 6c 20 66 75 74 75 72 65 | 20 63 61 6c 6c 73 20 74 |l future| calls t|
|00001220| 6f 20 4d 65 6e 75 55 74 | 69 6c 73 2e 0a 0a 41 66 |o MenuUt|ils...Af|
|00001230| 74 65 72 20 74 68 69 73 | 20 63 61 6c 6c 20 74 68 |ter this| call th|
|00001240| 65 20 6e 65 77 20 6d 65 | 6e 75 20 62 65 63 6f 6d |e new me|nu becom|
|00001250| 65 73 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 6d |es the c|urrent m|
|00001260| 65 6e 75 2e 0a 0a 20 45 | 78 61 6d 70 6c 65 20 63 |enu... E|xample c|
|00001270| 6f 64 65 3a 0a 20 53 74 | 61 72 74 20 63 6f 6e 73 |ode:. St|art cons|
|00001280| 74 72 75 63 74 69 6f 6e | 20 6f 66 20 73 69 6d 70 |truction| of simp|
|00001290| 6c 65 20 6d 65 6e 75 20 | 6c 69 6b 65 20 6f 6e 65 |le menu |like one|
|000012a0| 20 69 6e 20 50 61 6c 65 | 74 74 65 20 55 74 69 6c | in Pale|tte Util|
|000012b0| 69 74 79 0a 20 53 59 53 | 20 22 4d 65 6e 75 55 74 |ity. SYS| "MenuUt|
|000012c0| 69 6c 5f 4e 65 77 22 2c | 2c 22 50 61 6c 65 74 74 |il_New",|,"Palett|
|000012d0| 65 22 20 0a 20 0a 20 49 | 66 20 79 6f 75 20 70 72 |e" . . I|f you pr|
|000012e0| 6f 67 72 61 6d 20 68 61 | 73 20 63 6f 6d 70 6c 65 |ogram ha|s comple|
|000012f0| 78 20 6d 65 6e 75 20 73 | 74 72 75 63 74 75 72 65 |x menu s|tructure|
|00001300| 20 28 6c 69 6b 65 20 53 | 6f 75 72 63 65 20 45 64 | (like S|ource Ed|
|00001310| 69 74 6f 72 29 20 74 68 | 65 6e 20 79 6f 75 0a 68 |itor) th|en you.h|
|00001320| 61 76 65 20 74 6f 20 72 | 65 6d 65 6d 62 65 72 20 |ave to r|emember |
|00001330| 74 68 65 20 68 61 6e 64 | 6c 65 73 20 6f 66 20 61 |the hand|les of a|
|00001340| 6c 6c 20 73 75 62 6d 65 | 6e 75 73 0a 20 53 59 53 |ll subme|nus. SYS|
|00001350| 20 22 4d 65 6e 75 55 74 | 69 6c 5f 4e 65 77 22 2c | "MenuUt|il_New",|
|00001360| 2c 22 53 72 63 45 64 69 | 74 22 20 54 4f 20 6d 61 |,"SrcEdi|t" TO ma|
|00001370| 69 6e 4d 65 6e 75 25 0a | 20 53 59 53 20 22 4d 65 |inMenu%.| SYS "Me|
|00001380| 6e 75 55 74 69 6c 5f 4e | 65 77 22 2c 2c 22 44 69 |nuUtil_N|ew",,"Di|
|00001390| 73 70 6c 61 79 22 20 54 | 4f 20 64 69 73 70 4d 65 |splay" T|O dispMe|
|000013a0| 6e 75 25 0a 20 53 59 53 | 20 22 4d 65 6e 75 55 74 |nu%. SYS| "MenuUt|
|000013b0| 69 6c 5f 4e 65 77 22 2c | 2c 22 46 6f 6e 74 73 22 |il_New",|,"Fonts"|
|000013c0| 2c 32 30 30 20 20 54 4f | 20 66 6f 6e 74 73 4d 65 |,200 TO| fontsMe|
|000013d0| 6e 75 25 00 44 41 54 41 | a0 0a 00 00 4d 65 6e 75 |nu%.DATA|....Menu|
|000013e0| 55 74 69 6c 5f 41 64 64 | 20 28 53 57 49 20 26 34 |Util_Add| (SWI &4|
|000013f0| 35 42 43 32 29 0a 23 50 | 61 72 65 6e 74 20 4d 65 |5BC2).#P|arent Me|
|00001400| 6e 75 55 74 69 6c 73 3a | 21 52 6f 6f 74 0a 20 41 |nuUtils:|!Root. A|
|00001410| 64 64 73 20 6e 65 77 20 | 69 74 65 6d 20 74 6f 20 |dds new |item to |
|00001420| 65 78 69 73 74 69 6e 67 | 20 6d 65 6e 75 2e 0a 0a |existing| menu...|
|00001430| 20 45 6e 74 72 79 3a 0a | 20 20 20 20 20 52 30 20 | Entry:.| R0 |
|00001440| 68 61 6e 64 6c 65 20 6f | 66 20 74 68 65 20 6d 65 |handle o|f the me|
|00001450| 6e 75 20 6f 72 20 6f 66 | 20 74 68 65 20 6d 65 6e |nu or of| the men|
|00001460| 75 20 69 74 65 6d 20 6f | 72 20 7a 65 72 6f 20 66 |u item o|r zero f|
|00001470| 6f 72 20 63 75 72 72 65 | 6e 74 20 6d 65 6e 75 0a |or curre|nt menu.|
|00001480| 20 20 20 20 20 52 31 20 | 70 6f 69 6e 74 65 72 20 | R1 |pointer |
|00001490| 74 6f 20 69 74 65 6d 20 | 74 65 78 74 0a 20 20 20 |to item |text. |
|000014a0| 20 20 52 32 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 | R2 poi|nter to |
|000014b0| 69 74 65 6d 20 68 61 6e | 64 6c 65 72 0a 0a 20 45 |item han|dler.. E|
|000014c0| 78 69 74 3a 0a 20 20 20 | 20 20 52 30 20 68 61 6e |xit:. | R0 han|
|000014d0| 64 6c 65 20 6f 66 20 6d | 65 6e 75 20 69 74 65 6d |dle of m|enu item|
|000014e0| 0a 20 20 20 20 20 52 31 | 2c 52 32 20 70 72 65 73 |. R1|,R2 pres|
|000014f0| 65 72 76 65 64 0a 0a 0a | 54 68 69 73 20 63 61 6c |erved...|This cal|
|00001500| 6c 20 61 64 64 73 20 6f | 6e 65 20 69 74 65 6d 20 |l adds o|ne item |
|00001510| 74 6f 20 74 68 65 20 65 | 78 69 73 74 69 6e 67 20 |to the e|xisting |
|00001520| 6d 65 6e 75 2e 20 49 66 | 20 68 61 6e 64 6c 65 20 |menu. If| handle |
|00001530| 69 73 20 74 68 65 20 68 | 61 6e 64 6c 65 0a 6f 66 |is the h|andle.of|
|00001540| 20 6d 65 6e 75 20 74 68 | 65 6e 20 6e 65 77 20 69 | menu th|en new i|
|00001550| 74 65 6d 20 77 69 6c 6c | 20 62 65 20 61 64 64 65 |tem will| be adde|
|00001560| 64 20 74 6f 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |d to the| end of |
|00001570| 74 68 69 73 20 6d 65 6e | 75 2e 20 49 66 20 68 61 |this men|u. If ha|
|00001580| 6e 64 6c 65 0a 69 73 20 | 74 68 65 20 68 61 6e 64 |ndle.is |the hand|
|00001590| 6c 65 20 6f 66 20 74 68 | 65 20 69 74 65 6d 20 74 |le of th|e item t|
|000015a0| 68 65 6e 20 6e 65 77 20 | 69 74 65 6d 20 77 69 6c |hen new |item wil|
|000015b0| 6c 20 62 65 20 69 6e 73 | 65 72 74 65 64 20 69 6e |l be ins|erted in|
|000015c0| 74 6f 20 6d 65 6e 75 0a | 6a 75 73 74 20 62 65 66 |to menu.|just bef|
|000015d0| 6f 72 65 20 74 68 69 73 | 20 69 74 65 6d 2e 20 49 |ore this| item. I|
|000015e0| 66 20 52 30 20 69 73 20 | 7a 65 72 6f 20 6f 6e 20 |f R0 is |zero on |
|000015f0| 65 6e 74 72 79 20 74 68 | 65 6e 20 69 74 65 6d 20 |entry th|en item |
|00001600| 77 69 6c 6c 20 62 65 20 | 61 64 64 65 64 0a 74 6f |will be |added.to|
|00001610| 20 74 68 65 20 65 6e 64 | 20 6f 66 20 63 75 72 72 | the end| of curr|
|00001620| 65 6e 74 20 6d 65 6e 75 | 2e 0a 0a 44 75 72 69 6e |ent menu|...Durin|
|00001630| 67 20 74 68 69 73 20 63 | 61 6c 6c 20 74 68 65 20 |g this c|all the |
|00001640| 63 75 72 72 65 6e 74 20 | 6d 65 6e 75 20 6d 61 79 |current |menu may|
|00001650| 20 62 65 20 6d 6f 76 65 | 64 20 69 6e 20 6d 65 6d | be move|d in mem|
|00001660| 6f 72 79 20 73 6f 20 69 | 66 20 79 6f 75 0a 6b 65 |ory so i|f you.ke|
|00001670| 65 70 20 64 69 72 65 63 | 74 20 70 6f 69 6e 74 65 |ep direc|t pointe|
|00001680| 72 73 20 74 6f 20 74 68 | 65 20 6d 65 6e 75 20 64 |rs to th|e menu d|
|00001690| 61 74 61 20 73 74 72 75 | 63 74 75 72 65 20 74 68 |ata stru|cture th|
|000016a0| 65 79 20 6d 61 79 20 62 | 65 63 6f 6d 65 0a 69 6e |ey may b|ecome.in|
|000016b0| 76 61 6c 69 64 2e 20 4f | 6e 20 74 68 65 20 6f 74 |valid. O|n the ot|
|000016c0| 68 65 72 20 68 61 6e 64 | 20 69 66 20 74 68 65 72 |her hand| if ther|
|000016d0| 65 20 61 72 65 20 61 6e | 79 20 6d 65 6e 75 20 69 |e are an|y menu i|
|000016e0| 74 65 6d 73 20 6c 69 6e | 6b 65 64 20 77 69 74 68 |tems lin|ked with|
|000016f0| 0a 74 68 69 73 20 6d 65 | 6e 75 20 62 79 20 6d 65 |.this me|nu by me|
|00001700| 61 6e 73 20 6f 66 20 4d | 65 6e 75 55 74 69 6c 5f |ans of M|enuUtil_|
|00001710| 53 75 62 6d 65 6e 75 20 | 74 68 65 6e 20 61 6c 6c |Submenu |then all|
|00001720| 20 70 6f 69 6e 74 65 72 | 73 20 77 69 6c 6c 20 62 | pointer|s will b|
|00001730| 65 0a 72 65 63 61 6c 63 | 75 6c 61 74 65 64 20 61 |e.recalc|ulated a|
|00001740| 75 74 6f 6d 61 74 69 63 | 61 6c 6c 79 20 62 79 20 |utomatic|ally by |
|00001750| 74 68 65 20 6d 6f 64 75 | 6c 65 20 61 6e 64 20 77 |the modu|le and w|
|00001760| 69 6c 6c 20 72 65 6d 61 | 69 6e 20 76 61 6c 69 64 |ill rema|in valid|
|00001770| 2e 0a 0a 4d 65 6e 75 55 | 74 69 6c 73 20 6d 61 6b |...MenuU|tils mak|
|00001780| 65 73 20 68 69 73 20 6f | 77 6e 20 63 6f 70 79 20 |es his o|wn copy |
|00001790| 6f 66 20 74 68 65 20 73 | 74 72 69 6e 67 20 70 6f |of the s|tring po|
|000017a0| 69 6e 74 65 64 20 74 6f | 20 62 79 20 52 31 20 62 |inted to| by R1 b|
|000017b0| 75 74 0a 69 6e 73 70 69 | 74 65 20 6f 66 20 74 68 |ut.inspi|te of th|
|000017c0| 69 73 20 79 6f 75 20 73 | 74 69 6c 6c 20 63 61 6e |is you s|till can|
|000017d0| 20 65 61 73 69 6c 79 20 | 63 68 61 6e 67 65 20 69 | easily |change i|
|000017e0| 74 20 77 69 74 68 20 4d | 65 6e 75 55 74 69 6c 5f |t with M|enuUtil_|
|000017f0| 54 65 78 74 2e 20 49 66 | 20 52 31 0a 69 73 20 7a |Text. If| R1.is z|
|00001800| 65 72 6f 20 6f 6e 20 65 | 6e 74 72 79 20 74 68 65 |ero on e|ntry the|
|00001810| 6e 20 6e 75 6c 6c 20 73 | 74 72 69 6e 67 20 28 22 |n null s|tring ("|
|00001820| 22 29 20 77 69 6c 6c 20 | 62 65 20 75 73 65 64 20 |") will |be used |
|00001830| 61 73 20 69 74 65 6d 20 | 74 65 78 74 2e 0a 0a 49 |as item |text...I|
|00001840| 66 20 52 32 20 69 73 20 | 6e 6f 74 20 7a 65 72 6f |f R2 is |not zero|
|00001850| 20 6f 6e 20 65 6e 74 72 | 79 20 74 68 65 6e 20 69 | on entr|y then i|
|00001860| 6e 74 65 72 70 72 65 74 | 61 74 69 6f 6e 20 6f 66 |nterpret|ation of|
|00001870| 20 69 74 20 63 6f 6e 74 | 65 6e 74 73 20 64 65 70 | it cont|ents dep|
|00001880| 65 6e 64 73 0a 6f 6e 20 | 74 68 65 20 69 6e 69 74 |ends.on |the init|
|00001890| 69 61 6c 69 73 61 74 69 | 6f 6e 20 74 79 70 65 20 |ialisati|on type |
|000018a0| 73 70 65 63 69 66 69 65 | 64 20 65 61 72 6c 79 20 |specifie|d early |
|000018b0| 64 75 72 69 6e 67 20 74 | 68 65 20 63 61 6c 6c 20 |during t|he call |
|000018c0| 74 6f 0a 4d 65 6e 75 55 | 74 69 6c 5f 49 6e 69 74 |to.MenuU|til_Init|
|000018d0| 69 61 6c 69 73 65 2e 20 | 49 66 20 69 6e 69 74 69 |ialise. |If initi|
|000018e0| 61 6c 69 73 61 74 69 6f | 6e 20 74 79 70 65 20 77 |alisatio|n type w|
|000018f0| 61 73 20 73 70 65 63 69 | 66 69 65 64 20 61 73 20 |as speci|fied as |
|00001900| 22 42 41 53 49 43 22 20 | 74 68 65 6e 0a 69 74 20 |"BASIC" |then.it |
|00001910| 69 73 20 61 73 73 75 6d | 65 64 20 74 68 61 74 20 |is assum|ed that |
|00001920| 52 32 20 69 73 20 61 20 | 70 6f 69 6e 74 65 72 20 |R2 is a |pointer |
|00001930| 74 6f 20 74 68 65 20 63 | 74 72 6c 2d 74 65 72 6d |to the c|trl-term|
|00001940| 69 6e 61 74 65 64 20 74 | 65 78 74 20 73 74 72 69 |inated t|ext stri|
|00001950| 6e 67 2e 0a 49 6e 20 74 | 68 69 73 20 63 61 73 65 |ng..In t|his case|
|00001960| 20 74 68 65 20 6d 6f 64 | 75 6c 65 20 6d 61 6b 65 | the mod|ule make|
|00001970| 73 20 68 69 73 20 6f 77 | 6e 20 63 6f 70 79 20 6f |s his ow|n copy o|
|00001980| 66 20 74 68 65 20 73 74 | 72 69 6e 67 20 66 6f 72 |f the st|ring for|
|00001990| 20 6c 61 74 65 72 20 75 | 73 65 0a 69 6e 20 4d 65 | later u|se.in Me|
|000019a0| 6e 75 55 74 69 6c 5f 44 | 65 63 6f 64 65 2e 20 49 |nuUtil_D|ecode. I|
|000019b0| 66 20 69 6e 69 74 69 61 | 6c 69 73 61 74 69 6f 6e |f initia|lisation|
|000019c0| 20 74 79 70 65 20 77 61 | 73 20 22 6d 61 63 68 69 | type wa|s "machi|
|000019d0| 6e 65 20 63 6f 64 65 22 | 20 28 6e 6f 74 0a 73 75 |ne code"| (not.su|
|000019e0| 70 70 6f 72 74 65 64 20 | 62 79 20 63 75 72 72 65 |pported |by curre|
|000019f0| 6e 74 20 76 65 72 73 69 | 6f 6e 29 20 74 68 65 6e |nt versi|on) then|
|00001a00| 20 6f 6e 6c 79 20 74 68 | 65 20 63 6f 6e 74 65 6e | only th|e conten|
|00001a10| 74 73 20 6f 66 20 52 32 | 20 69 73 20 73 61 76 65 |ts of R2| is save|
|00001a20| 64 20 62 79 0a 74 68 65 | 20 6d 6f 64 75 6c 65 2e |d by.the| module.|
|00001a30| 20 54 68 69 73 20 66 65 | 61 74 75 72 65 20 61 6c | This fe|ature al|
|00001a40| 6c 6f 77 73 20 79 6f 75 | 20 74 6f 20 61 74 74 61 |lows you| to atta|
|00001a50| 63 68 20 61 20 68 61 6e | 64 6c 65 72 20 74 6f 20 |ch a han|dler to |
|00001a60| 74 68 65 20 6d 65 6e 75 | 0a 69 74 65 6d 2e 20 49 |the menu|.item. I|
|00001a70| 6e 20 63 61 73 65 20 6f | 66 20 22 42 41 53 49 43 |n case o|f "BASIC|
|00001a80| 22 20 79 6f 75 20 63 61 | 6e 20 70 72 6f 76 69 64 |" you ca|n provid|
|00001a90| 65 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 42 41 |e the na|me of BA|
|00001aa0| 53 49 43 20 66 75 6e 63 | 74 69 6f 6e 2e 0a 49 6e |SIC func|tion..In|
|00001ab0| 20 63 61 73 65 20 6f 66 | 20 22 6d 61 63 68 69 6e | case of| "machin|
|00001ac0| 65 20 63 6f 64 65 22 20 | 2d 20 74 68 65 20 61 64 |e code" |- the ad|
|00001ad0| 64 72 65 73 73 20 6f 66 | 20 41 52 4d 20 73 75 62 |dress of| ARM sub|
|00001ae0| 72 6f 75 74 69 6e 65 2e | 20 53 65 65 20 61 6c 73 |routine.| See als|
|00001af0| 6f 0a 4d 65 6e 75 55 74 | 69 6c 5f 44 65 63 6f 64 |o.MenuUt|il_Decod|
|00001b00| 65 20 61 6e 64 20 66 6f | 72 20 70 6f 73 73 69 62 |e and fo|r possib|
|00001b10| 6c 65 20 75 73 65 20 6f | 66 20 69 74 65 6d 20 68 |le use o|f item h|
|00001b20| 61 6e 64 6c 65 72 73 2e | 0a 20 20 20 20 20 20 20 |andlers.|. |
|00001b30| 20 20 20 20 20 20 20 20 | 0a 0a 20 45 78 61 6d 70 | |.. Examp|
|00001b40| 6c 65 20 63 6f 64 65 3a | 20 20 20 20 20 20 20 20 |le code:| |
|00001b50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b60| 20 20 20 20 20 20 0a 0a | 20 41 64 64 20 69 74 65 | ..| Add ite|
|00001b70| 6d 20 22 49 6e 66 6f 22 | 20 74 6f 20 74 68 65 20 |m "Info"| to the |
|00001b80| 63 75 72 72 65 6e 74 20 | 6d 65 6e 75 0a 20 53 59 |current |menu. SY|
|00001b90| 53 20 22 4d 65 6e 75 55 | 74 69 6c 5f 41 64 64 22 |S "MenuU|til_Add"|
|00001ba0| 2c 2c 22 49 6e 66 6f 22 | 20 54 4f 20 69 6e 66 6f |,,"Info"| TO info|
|00001bb0| 49 74 65 6d 25 20 20 20 | 20 0a 0a 20 41 64 64 20 |Item% | .. Add |
|00001bc0| 69 74 65 6d 20 22 51 75 | 69 74 22 20 61 6e 64 20 |item "Qu|it" and |
|00001bd0| 74 68 65 6e 20 69 6e 73 | 65 72 74 20 69 74 65 6d |then ins|ert item|
|00001be0| 20 22 43 72 65 61 74 65 | 22 20 6a 75 73 74 20 62 | "Create|" just b|
|00001bf0| 65 66 6f 72 65 20 69 74 | 2e 20 20 4c 65 74 27 73 |efore it|. Let's|
|00001c00| 0a 74 68 65 20 66 69 72 | 73 74 20 69 74 65 6d 20 |.the fir|st item |
|00001c10| 77 69 6c 6c 20 68 61 76 | 65 20 74 68 65 20 68 61 |will hav|e the ha|
|00001c20| 6e 64 6c 65 72 2e 20 54 | 68 65 20 68 61 6e 64 6c |ndler. T|he handl|
|00001c30| 65 72 20 69 73 20 61 73 | 73 75 6d 65 64 20 74 6f |er is as|sumed to|
|00001c40| 20 62 65 0a 42 41 53 49 | 43 20 66 75 6e 63 74 69 | be.BASI|C functi|
|00001c50| 6f 6e 20 46 4e 71 75 69 | 74 2e 20 28 53 65 65 20 |on FNqui|t. (See |
|00001c60| 4d 65 6e 75 55 74 69 6c | 5f 44 65 63 6f 64 65 20 |MenuUtil|_Decode |
|00001c70| 6f 6e 20 68 6f 77 20 74 | 68 69 73 20 68 61 6e 64 |on how t|his hand|
|00001c80| 6c 65 72 20 6d 61 79 20 | 62 65 0a 63 61 6c 6c 65 |ler may |be.calle|
|00001c90| 64 29 20 0a 20 53 59 53 | 20 22 4d 65 6e 75 55 74 |d) . SYS| "MenuUt|
|00001ca0| 69 6c 5f 41 64 64 22 2c | 2c 22 51 75 69 74 22 2c |il_Add",|,"Quit",|
|00001cb0| 22 71 75 69 74 22 20 54 | 4f 20 71 75 69 74 49 74 |"quit" T|O quitIt|
|00001cc0| 65 6d 25 0a 20 53 59 53 | 20 22 4d 65 6e 75 55 74 |em%. SYS| "MenuUt|
|00001cd0| 69 6c 5f 41 64 64 22 2c | 71 75 69 74 49 74 65 6d |il_Add",|quitItem|
|00001ce0| 25 2c 22 43 72 65 61 74 | 65 22 20 54 4f 20 63 72 |%,"Creat|e" TO cr|
|00001cf0| 65 61 74 65 49 74 65 6d | 25 20 20 20 20 20 20 20 |eateItem|% |
|00001d00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001d10| 20 20 20 20 20 20 20 20 | 20 20 20 0a 20 43 72 65 | | . Cre|
|00001d20| 61 74 65 20 6d 65 6e 75 | 20 73 69 6d 69 6c 61 72 |ate menu| similar|
|00001d30| 20 74 6f 20 44 69 73 70 | 6c 61 79 20 73 75 62 6d | to Disp|lay subm|
|00001d40| 65 6e 75 20 69 6e 20 46 | 69 6c 65 72 2e 20 57 68 |enu in F|iler. Wh|
|00001d50| 65 6e 20 69 74 65 6d 73 | 20 61 72 65 20 61 64 64 |en items| are add|
|00001d60| 65 64 0a 74 6f 20 63 75 | 72 72 65 6e 74 20 6d 65 |ed.to cu|rrent me|
|00001d70| 6e 75 20 6d 65 6e 75 20 | 68 61 6e 64 6c 65 20 28 |nu menu |handle (|
|00001d80| 64 69 73 70 4d 65 6e 75 | 25 29 20 6d 61 79 20 62 |dispMenu|%) may b|
|00001d90| 65 20 6f 6d 69 74 74 65 | 64 20 61 73 20 69 74 20 |e omitte|d as it |
|00001da0| 77 69 6c 6c 20 62 65 0a | 75 73 65 64 20 62 79 20 |will be.|used by |
|00001db0| 64 65 66 61 75 6c 74 2e | 0a 20 53 59 53 20 22 4d |default.|. SYS "M|
|00001dc0| 65 6e 75 55 74 69 6c 5f | 4e 65 77 22 2c 2c 22 44 |enuUtil_|New",,"D|
|00001dd0| 69 73 70 6c 61 79 22 20 | 54 4f 20 64 69 73 70 4d |isplay" |TO dispM|
|00001de0| 65 6e 75 25 0a 20 53 59 | 53 20 22 4d 65 6e 75 55 |enu%. SY|S "MenuU|
|00001df0| 74 69 6c 5f 41 64 64 22 | 2c 2c 22 4c 61 72 67 65 |til_Add"|,,"Large|
|00001e00| 20 69 63 6f 6e 73 22 20 | 54 4f 20 6c 61 72 67 65 | icons" |TO large|
|00001e10| 49 74 65 6d 25 0a 20 53 | 59 53 20 22 4d 65 6e 75 |Item%. S|YS "Menu|
|00001e20| 55 74 69 6c 5f 41 64 64 | 22 2c 2c 22 53 6d 61 6c |Util_Add|",,"Smal|
|00001e30| 6c 20 69 63 6f 6e 73 22 | 20 54 4f 20 73 6d 61 6c |l icons"| TO smal|
|00001e40| 6c 49 74 65 6d 25 0a 20 | 53 59 53 20 22 4d 65 6e |lItem%. |SYS "Men|
|00001e50| 75 55 74 69 6c 5f 41 64 | 64 22 2c 2c 22 46 75 6c |uUtil_Ad|d",,"Ful|
|00001e60| 6c 20 69 6e 66 6f 22 20 | 54 4f 20 66 75 6c 6c 49 |l info" |TO fullI|
|00001e70| 74 65 6d 25 44 41 54 41 | 25 05 00 00 4d 65 6e 75 |tem%DATA|%...Menu|
|00001e80| 55 74 69 6c 5f 44 65 6c | 65 74 65 20 28 53 57 49 |Util_Del|ete (SWI|
|00001e90| 20 26 34 35 42 43 33 29 | 0a 23 50 61 72 65 6e 74 | &45BC3)|.#Parent|
|00001ea0| 20 4d 65 6e 75 55 74 69 | 6c 73 3a 21 52 6f 6f 74 | MenuUti|ls:!Root|
|00001eb0| 0a 20 52 65 6d 6f 76 65 | 73 20 6d 65 6e 75 20 6f |. Remove|s menu o|
|00001ec0| 72 20 6d 65 6e 75 20 69 | 74 65 6d 0a 0a 20 45 6e |r menu i|tem.. En|
|00001ed0| 74 72 79 3a 0a 20 20 20 | 20 20 52 30 20 3d 20 68 |try:. | R0 = h|
|00001ee0| 61 6e 64 6c 65 20 6f 66 | 20 74 68 65 20 6d 65 6e |andle of| the men|
|00001ef0| 75 20 6f 72 20 6f 66 20 | 74 68 65 20 6d 65 6e 75 |u or of |the menu|
|00001f00| 20 69 74 65 6d 20 6f 72 | 20 7a 65 72 6f 20 66 6f | item or| zero fo|
|00001f10| 72 20 63 75 72 72 65 6e | 74 20 6d 65 6e 75 0a 20 |r curren|t menu. |
|00001f20| 20 20 20 20 69 66 20 52 | 31 3c 3e 30 20 74 68 65 | if R|1<>0 the|
|00001f30| 6e 20 72 65 63 75 72 73 | 69 76 65 6c 79 20 64 65 |n recurs|ively de|
|00001f40| 6c 65 74 65 20 61 6c 6c | 20 73 75 62 6d 65 6e 75 |lete all| submenu|
|00001f50| 73 20 0a 20 45 78 69 74 | 3a 0a 20 20 20 20 20 52 |s . Exit|:. R|
|00001f60| 30 2c 52 31 20 70 72 65 | 73 65 72 76 65 64 0a 0a |0,R1 pre|served..|
|00001f70| 54 68 69 73 20 63 61 6c | 6c 20 61 6c 6c 6f 77 73 |This cal|l allows|
|00001f80| 20 79 6f 75 20 74 6f 20 | 64 65 6c 65 74 65 20 74 | you to |delete t|
|00001f90| 68 65 20 77 68 6f 6c 65 | 20 6d 65 6e 75 20 6f 72 |he whole| menu or|
|00001fa0| 20 74 68 65 20 70 61 72 | 74 69 63 75 6c 61 72 20 | the par|ticular |
|00001fb0| 6d 65 6e 75 20 69 74 65 | 6d 2e 0a 49 66 20 79 6f |menu ite|m..If yo|
|00001fc0| 75 20 77 69 6c 6c 20 64 | 65 6c 65 74 65 20 6d 65 |u will d|elete me|
|00001fd0| 6e 75 20 69 74 65 6d 20 | 74 68 65 6e 20 72 65 6d |nu item |then rem|
|00001fe0| 61 69 6e 65 64 20 69 74 | 65 6d 73 20 6f 66 20 74 |ained it|ems of t|
|00001ff0| 68 69 73 20 6d 65 6e 75 | 20 77 68 69 63 68 20 61 |his menu| which a|
|00002000| 72 65 0a 70 6f 73 69 74 | 69 6f 6e 65 64 20 62 65 |re.posit|ioned be|
|00002010| 6c 6c 6f 77 20 69 74 20 | 77 69 6c 6c 20 62 65 20 |llow it |will be |
|00002020| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 20 73 68 |automati|cally sh|
|00002030| 69 66 74 65 64 20 69 6e | 20 6d 65 6d 6f 72 79 20 |ifted in| memory |
|00002040| 74 6f 20 66 69 6c 6c 20 | 74 68 65 0a 68 6f 6c 65 |to fill |the.hole|
|00002050| 2e 20 44 65 73 70 69 74 | 65 20 74 68 65 20 66 61 |. Despit|e the fa|
|00002060| 63 74 20 74 68 61 74 20 | 6d 65 6d 6f 72 79 20 6c |ct that |memory l|
|00002070| 6f 63 61 74 69 6f 6e 20 | 61 6e 64 20 70 6f 73 69 |ocation |and posi|
|00002080| 74 69 6f 6e 20 69 6e 20 | 6d 65 6e 75 20 6f 66 20 |tion in |menu of |
|00002090| 73 6f 6d 65 0a 69 74 65 | 6d 73 20 6d 61 79 20 62 |some.ite|ms may b|
|000020a0| 65 20 63 68 61 6e 67 65 | 64 20 74 68 65 20 68 61 |e change|d the ha|
|000020b0| 6e 64 6c 65 73 20 6f 66 | 20 74 68 65 20 69 74 65 |ndles of| the ite|
|000020c0| 6d 73 20 77 69 6c 6c 20 | 72 65 6d 61 69 6e 20 76 |ms will |remain v|
|000020d0| 61 6c 69 64 2e 0a 0a 49 | 66 20 79 6f 75 20 77 61 |alid...I|f you wa|
|000020e0| 6e 74 20 74 6f 20 64 65 | 6c 65 74 65 20 6e 6f 74 |nt to de|lete not|
|000020f0| 20 6f 6e 6c 79 20 74 68 | 65 20 69 74 65 6d 20 62 | only th|e item b|
|00002100| 75 74 20 61 6c 73 6f 20 | 74 68 65 20 77 68 6f 6c |ut also |the whol|
|00002110| 65 20 6d 65 6e 75 20 73 | 75 62 74 72 65 65 0a 63 |e menu s|ubtree.c|
|00002120| 6f 6e 6e 65 63 74 65 64 | 20 77 69 74 68 20 69 74 |onnected| with it|
|00002130| 20 74 68 65 6e 20 79 6f | 75 20 6d 75 73 74 20 73 | then yo|u must s|
|00002140| 65 74 20 52 31 3c 3e 30 | 20 6f 6e 20 65 6e 74 72 |et R1<>0| on entr|
|00002150| 79 2e 20 49 66 20 52 30 | 20 63 6f 6e 74 61 69 6e |y. If R0| contain|
|00002160| 73 20 74 68 65 0a 68 61 | 6e 64 6c 65 20 6f 66 20 |s the.ha|ndle of |
|00002170| 6d 65 6e 75 20 74 68 65 | 6e 20 74 68 69 73 20 6d |menu the|n this m|
|00002180| 65 6e 75 20 77 69 6c 6c | 20 62 65 20 64 65 6c 65 |enu will| be dele|
|00002190| 74 65 64 20 61 6c 6f 6e | 65 20 6f 72 20 74 6f 67 |ted alon|e or tog|
|000021a0| 65 74 68 65 72 20 77 69 | 74 68 20 61 6c 6c 0a 73 |ether wi|th all.s|
|000021b0| 75 62 6d 65 6e 75 73 20 | 64 65 70 65 6e 64 69 6e |ubmenus |dependin|
|000021c0| 67 20 6f 6e 20 52 31 2e | 20 0a 0a 55 73 65 20 72 |g on R1.| ..Use r|
|000021d0| 65 63 75 72 73 69 76 65 | 20 64 65 6c 65 74 69 6f |ecursive| deletio|
|000021e0| 6e 20 77 69 74 68 20 63 | 61 75 74 69 6f 6e 20 61 |n with c|aution a|
|000021f0| 73 20 79 6f 75 20 6d 61 | 79 20 61 63 63 69 64 65 |s you ma|y accide|
|00002200| 6e 74 61 6c 6c 79 20 64 | 65 6c 65 74 65 0a 73 75 |ntally d|elete.su|
|00002210| 62 6d 65 6e 75 73 20 77 | 68 69 63 68 20 61 72 65 |bmenus w|hich are|
|00002220| 20 63 6f 6e 6e 65 63 74 | 65 64 20 77 69 74 68 20 | connect|ed with |
|00002230| 6f 74 68 65 72 20 6d 65 | 6e 75 20 69 74 65 6d 73 |other me|nu items|
|00002240| 2e 0a 0a 54 68 69 73 20 | 63 61 6c 6c 20 69 73 20 |...This |call is |
|00002250| 73 75 70 70 6f 73 65 64 | 20 74 6f 20 62 65 20 75 |supposed| to be u|
|00002260| 73 65 64 20 77 68 65 6e | 20 6d 65 6e 75 73 20 77 |sed when| menus w|
|00002270| 69 74 68 20 76 61 72 69 | 61 62 6c 65 20 6e 75 6d |ith vari|able num|
|00002280| 62 65 72 20 6f 66 20 69 | 74 65 6d 73 0a 61 72 65 |ber of i|tems.are|
|00002290| 20 6e 65 65 64 65 64 2e | 20 49 74 20 6d 61 79 20 | needed.| It may |
|000022a0| 62 65 20 66 6f 72 20 65 | 78 61 6d 70 6c 65 20 6d |be for e|xample m|
|000022b0| 65 6e 75 20 77 69 74 68 | 20 74 68 65 20 6c 69 73 |enu with| the lis|
|000022c0| 74 20 6f 66 20 63 75 72 | 72 65 6e 74 6c 79 20 6f |t of cur|rently o|
|000022d0| 70 65 6e 65 64 0a 64 6f | 63 75 6d 65 6e 74 73 20 |pened.do|cuments |
|000022e0| 6f 72 20 61 72 63 68 69 | 76 65 73 2e 0a 0a 20 45 |or archi|ves... E|
|000022f0| 78 61 6d 70 6c 65 20 63 | 6f 64 65 3a 0a 20 44 65 |xample c|ode:. De|
|00002300| 6c 65 74 65 20 69 74 65 | 6d 20 77 69 74 68 20 68 |lete ite|m with h|
|00002310| 61 6e 64 6c 65 20 74 6d | 70 49 74 65 6d 25 0a 20 |andle tm|pItem%. |
|00002320| 53 59 53 20 22 4d 65 6e | 75 55 74 69 6c 5f 44 65 |SYS "Men|uUtil_De|
|00002330| 6c 65 74 65 22 2c 74 6d | 70 49 74 65 6d 25 0a 0a |lete",tm|pItem%..|
|00002340| 20 52 65 63 75 72 73 69 | 76 65 6c 79 20 64 65 6c | Recursi|vely del|
|00002350| 65 74 65 20 61 6c 6c 20 | 6d 65 6e 75 73 20 6c 69 |ete all |menus li|
|00002360| 6e 6b 65 64 20 77 69 74 | 68 20 6d 61 69 6e 4d 65 |nked wit|h mainMe|
|00002370| 6e 75 25 0a 20 53 59 53 | 20 22 4d 65 6e 75 55 74 |nu%. SYS| "MenuUt|
|00002380| 69 6c 5f 44 65 6c 65 74 | 65 22 2c 6d 61 69 6e 4d |il_Delet|e",mainM|
|00002390| 65 6e 75 25 2c 54 52 55 | 45 00 00 00 44 41 54 41 |enu%,TRU|E...DATA|
|000023a0| 6c 0a 00 00 4d 65 6e 75 | 55 74 69 6c 5f 44 65 63 |l...Menu|Util_Dec|
|000023b0| 6f 64 65 20 28 53 57 49 | 20 26 34 35 42 43 34 29 |ode (SWI| &45BC4)|
|000023c0| 0a 23 50 61 72 65 6e 74 | 20 4d 65 6e 75 55 74 69 |.#Parent| MenuUti|
|000023d0| 6c 73 3a 21 52 6f 6f 74 | 0a 20 44 65 63 6f 64 65 |ls:!Root|. Decode|
|000023e0| 73 20 6d 65 6e 75 20 61 | 66 74 65 72 20 75 73 65 |s menu a|fter use|
|000023f0| 72 20 73 65 6c 65 63 74 | 69 6f 6e 2e 0a 0a 20 45 |r select|ion... E|
|00002400| 6e 74 72 79 3a 0a 0a 20 | 20 20 20 20 52 30 20 3d |ntry:.. | R0 =|
|00002410| 20 6d 65 6e 75 20 68 61 | 6e 64 6c 65 20 6f 72 20 | menu ha|ndle or |
|00002420| 7a 65 72 6f 20 69 66 20 | 63 75 72 72 65 6e 74 20 |zero if |current |
|00002430| 6d 65 6e 75 0a 20 20 20 | 20 20 52 31 20 2d 3e 20 |menu. | R1 -> |
|00002440| 70 6f 69 6e 74 65 72 20 | 74 6f 20 74 68 65 20 6c |pointer |to the l|
|00002450| 69 73 74 20 6f 66 20 6d | 65 6e 75 20 73 65 6c 65 |ist of m|enu sele|
|00002460| 63 74 69 6f 6e 73 0a 20 | 45 78 69 74 3a 0a 20 20 |ctions. |Exit:. |
|00002470| 20 20 20 52 30 20 2d 3e | 20 70 6f 69 6e 74 65 72 | R0 ->| pointer|
|00002480| 20 74 6f 20 69 74 65 6d | 20 68 61 6e 64 6c 65 72 | to item| handler|
|00002490| 20 6f 72 20 7a 65 72 6f | 20 0a 20 20 20 20 20 52 | or zero| . R|
|000024a0| 31 20 2d 3e 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |1 -> poi|nter to |
|000024b0| 62 6c 6f 63 6b 20 28 72 | 65 74 75 72 6e 73 20 54 |block (r|eturns T|
|000024c0| 52 55 45 20 69 66 20 41 | 44 4a 55 53 54 20 77 61 |RUE if A|DJUST wa|
|000024d0| 73 20 63 6c 69 63 6b 65 | 64 29 0a 20 20 20 20 20 |s clicke|d). |
|000024e0| 52 32 20 2d 3e 20 70 6f | 69 6e 74 65 72 20 74 6f |R2 -> po|inter to|
|000024f0| 20 73 70 65 63 69 61 6c | 20 62 6c 6f 63 6b 0a 0a | special| block..|
|00002500| 42 6c 6f 63 6b 20 70 6f | 69 6e 74 65 64 20 74 6f |Block po|inted to|
|00002510| 20 62 79 20 52 31 20 6d | 75 73 74 20 63 6f 6e 74 | by R1 m|ust cont|
|00002520| 61 69 6e 20 74 68 65 20 | 6c 69 73 74 20 6f 66 20 |ain the |list of |
|00002530| 6d 65 6e 75 20 73 65 6c | 65 63 74 69 6f 6e 73 20 |menu sel|ections |
|00002540| 69 6e 20 74 68 65 20 73 | 61 6d 65 0a 66 6f 72 6d |in the s|ame.form|
|00002550| 61 74 20 61 73 20 72 65 | 74 75 72 6e 65 64 20 62 |at as re|turned b|
|00002560| 79 20 57 69 6d 70 5f 50 | 6f 6c 6c 20 69 6e 20 63 |y Wimp_P|oll in c|
|00002570| 61 73 65 20 6f 66 20 6d | 65 6e 75 20 73 65 6c 65 |ase of m|enu sele|
|00002580| 63 74 69 6f 6e 20 65 76 | 65 6e 74 2e 20 0a 0a 20 |ction ev|ent. .. |
|00002590| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 52 31 | | R1|
|000025a0| 20 2b 20 30 20 20 69 74 | 65 6d 20 69 6e 20 6d 61 | + 0 it|em in ma|
|000025b0| 69 6e 20 6d 65 6e 75 20 | 77 68 69 63 68 20 77 61 |in menu |which wa|
|000025c0| 73 20 73 65 6c 65 63 74 | 65 64 20 28 73 74 61 72 |s select|ed (star|
|000025d0| 74 69 6e 67 20 66 72 6f | 6d 20 30 29 0a 20 20 20 |ting fro|m 0). |
|000025e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 52 31 20 2b | | R1 +|
|000025f0| 20 34 20 20 69 74 65 6d | 20 69 6e 20 66 69 72 73 | 4 item| in firs|
|00002600| 74 20 73 75 62 6d 65 6e | 75 20 77 68 69 63 68 20 |t submen|u which |
|00002610| 77 61 73 20 73 65 6c 65 | 63 74 65 64 0a 20 20 20 |was sele|cted. |
|00002620| 20 20 20 20 20 20 20 20 | 20 20 20 20 52 31 20 2b | | R1 +|
|00002630| 20 38 20 20 69 74 65 6d | 20 69 6e 20 73 65 63 6f | 8 item| in seco|
|00002640| 6e 64 20 73 75 62 6d 65 | 6e 75 20 77 68 69 63 68 |nd subme|nu which|
|00002650| 20 77 61 73 20 73 65 6c | 65 63 74 65 64 0a 20 20 | was sel|ected. |
|00002660| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002670| 20 20 20 20 20 2e 2e 2e | 0a 20 20 20 20 20 20 20 | ...|. |
|00002680| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002690| 74 65 72 6d 69 6e 61 74 | 65 64 20 62 79 20 2d 31 |terminat|ed by -1|
|000026a0| 0a 0a 54 68 69 73 20 63 | 61 6c 6c 20 6d 61 70 73 |..This c|all maps|
|000026b0| 20 74 68 65 20 6c 69 73 | 74 20 6f 66 20 6d 65 6e | the lis|t of men|
|000026c0| 75 20 73 65 6c 65 63 74 | 69 6f 6e 73 20 6f 6e 74 |u select|ions ont|
|000026d0| 6f 20 6d 65 6e 75 20 64 | 61 74 61 20 73 74 72 75 |o menu d|ata stru|
|000026e0| 63 74 75 72 65 20 61 6e | 64 0a 64 65 74 65 72 6d |cture an|d.determ|
|000026f0| 69 6e 65 73 20 63 6f 72 | 72 65 73 70 6f 6e 64 69 |ines cor|respondi|
|00002700| 6e 67 20 6d 65 6e 75 20 | 69 74 65 6d 73 2e 20 56 |ng menu |items. V|
|00002710| 61 72 69 6f 75 73 20 69 | 6e 66 6f 72 6d 61 74 69 |arious i|nformati|
|00002720| 6f 6e 20 61 62 6f 75 74 | 20 6c 61 73 74 20 74 77 |on about| last tw|
|00002730| 6f 0a 69 74 65 6d 73 20 | 66 72 6f 6d 20 74 68 69 |o.items |from thi|
|00002740| 73 20 6c 69 73 74 20 28 | 73 65 6c 65 63 74 65 64 |s list (|selected|
|00002750| 20 69 74 65 6d 20 61 6e | 64 20 70 61 72 65 6e 74 | item an|d parent|
|00002760| 20 69 74 65 6d 20 66 72 | 6f 6d 20 6d 65 6e 75 20 | item fr|om menu |
|00002770| 6f 6e 65 20 6c 65 76 65 | 6c 20 75 70 0a 69 66 20 |one leve|l up.if |
|00002780| 61 6e 79 29 20 69 73 20 | 77 72 69 74 74 65 6e 20 |any) is |written |
|00002790| 69 6e 74 6f 20 73 70 65 | 63 69 61 6c 20 62 6c 6f |into spe|cial blo|
|000027a0| 63 6b 2e 20 50 6f 69 6e | 74 65 72 20 74 6f 20 74 |ck. Poin|ter to t|
|000027b0| 68 69 73 20 62 6c 6f 63 | 6b 20 69 73 20 72 65 74 |his bloc|k is ret|
|000027c0| 75 72 6e 65 64 20 69 6e | 0a 52 32 2e 20 46 6f 72 |urned in|.R2. For|
|000027d0| 6d 61 74 20 6f 66 20 74 | 68 65 20 72 65 74 75 72 |mat of t|he retur|
|000027e0| 6e 65 64 20 62 6c 6f 63 | 6b 20 69 73 20 61 73 20 |ned bloc|k is as |
|000027f0| 66 6f 6c 6c 6f 77 73 3a | 20 0a 0a 20 52 32 2b 30 |follows:| .. R2+0|
|00002800| 20 20 70 6f 73 69 74 69 | 6f 6e 20 6f 66 20 73 65 | positi|on of se|
|00002810| 6c 65 63 74 65 64 20 6d | 65 6e 75 20 69 74 65 6d |lected m|enu item|
|00002820| 20 69 6e 20 6d 65 6e 75 | 20 28 73 74 61 72 74 69 | in menu| (starti|
|00002830| 6e 67 20 66 72 6f 6d 20 | 30 29 0a 20 52 32 2b 34 |ng from |0). R2+4|
|00002840| 20 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 73 65 6c | pointe|r to sel|
|00002850| 65 63 74 65 64 20 69 74 | 65 6d 20 64 61 74 61 0a |ected it|em data.|
|00002860| 20 52 32 2b 38 20 20 73 | 65 6c 65 63 74 65 64 20 | R2+8 s|elected |
|00002870| 69 74 65 6d 20 68 61 6e | 64 6c 65 20 6f 72 20 7a |item han|dle or z|
|00002880| 65 72 6f 20 69 66 20 69 | 74 65 6d 20 77 61 73 20 |ero if i|tem was |
|00002890| 63 72 65 61 74 65 64 20 | 77 69 74 68 6f 75 74 20 |created |without |
|000028a0| 4d 65 6e 75 55 74 69 6c | 73 0a 20 52 32 2b 31 32 |MenuUtil|s. R2+12|
|000028b0| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 74 65 78 74 | pointer| to text|
|000028c0| 20 73 74 72 69 6e 67 20 | 6f 66 20 73 65 6c 65 63 | string |of selec|
|000028d0| 74 65 64 20 69 74 65 6d | 0a 20 52 32 2b 31 36 20 |ted item|. R2+16 |
|000028e0| 70 6f 73 69 74 69 6f 6e | 20 6f 66 20 70 61 72 65 |position| of pare|
|000028f0| 6e 74 20 6d 65 6e 75 20 | 69 74 65 6d 20 69 6e 20 |nt menu |item in |
|00002900| 6d 65 6e 75 20 28 73 74 | 61 72 74 69 6e 67 20 66 |menu (st|arting f|
|00002910| 72 6f 6d 20 30 29 0a 20 | 52 32 2b 32 30 20 70 6f |rom 0). |R2+20 po|
|00002920| 69 6e 74 65 72 20 74 6f | 20 70 61 72 65 6e 74 20 |inter to| parent |
|00002930| 69 74 65 6d 20 64 61 74 | 61 0a 20 52 32 2b 32 34 |item dat|a. R2+24|
|00002940| 20 70 61 72 65 6e 74 20 | 69 74 65 6d 20 68 61 6e | parent |item han|
|00002950| 64 6c 65 20 6f 72 20 7a | 65 72 6f 20 69 66 20 69 |dle or z|ero if i|
|00002960| 74 65 6d 20 77 61 73 20 | 63 72 65 61 74 65 64 20 |tem was |created |
|00002970| 77 69 74 68 6f 75 74 20 | 4d 65 6e 75 55 74 69 6c |without |MenuUtil|
|00002980| 73 0a 20 52 32 2b 32 38 | 20 70 6f 69 6e 74 65 72 |s. R2+28| pointer|
|00002990| 20 74 6f 20 74 65 78 74 | 20 73 74 72 69 6e 67 20 | to text| string |
|000029a0| 6f 66 20 70 61 72 65 6e | 74 20 69 74 65 6d 20 20 |of paren|t item |
|000029b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000029c0| 20 20 20 20 20 20 20 0a | 0a 49 66 20 74 68 65 20 | .|.If the |
|000029d0| 69 74 65 6d 20 68 61 73 | 20 62 65 65 6e 20 73 65 |item has| been se|
|000029e0| 6c 65 63 74 65 64 20 66 | 72 6f 6d 20 74 68 65 20 |lected f|rom the |
|000029f0| 74 6f 70 2d 6c 65 76 65 | 6c 20 6d 65 6e 75 20 74 |top-leve|l menu t|
|00002a00| 68 65 6e 20 74 68 65 72 | 65 20 77 69 6c 6c 20 62 |hen ther|e will b|
|00002a10| 65 20 6e 6f 0a 70 61 72 | 65 6e 74 20 69 74 65 6d |e no.par|ent item|
|00002a20| 20 61 6e 64 20 63 6f 72 | 72 65 73 70 6f 6e 64 69 | and cor|respondi|
|00002a30| 6e 67 20 70 61 72 74 20 | 6f 66 20 74 68 65 20 62 |ng part |of the b|
|00002a40| 6c 6f 63 6b 20 77 69 6c | 6c 20 62 65 20 66 69 6c |lock wil|l be fil|
|00002a50| 6c 65 64 20 77 69 74 68 | 20 7a 65 72 6f 73 2e 20 |led with| zeros. |
|00002a60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002a70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002a80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002a90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002aa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002ab0| 20 20 20 20 0a 49 66 20 | 64 75 72 69 6e 67 20 63 | .If |during c|
|00002ac0| 72 65 61 74 69 6f 6e 20 | 6f 66 20 74 68 69 73 20 |reation |of this |
|00002ad0| 69 74 65 6d 20 79 6f 75 | 20 68 61 76 65 20 73 70 |item you| have sp|
|00002ae0| 65 63 69 66 69 65 64 20 | 74 68 65 20 68 61 6e 64 |ecified |the hand|
|00002af0| 6c 65 72 20 74 68 65 6e | 20 52 30 20 6f 6e 0a 65 |ler then| R0 on.e|
|00002b00| 78 69 74 20 77 69 6c 6c | 20 63 6f 6e 74 61 69 6e |xit will| contain|
|00002b10| 20 74 68 65 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 | the poi|nter to |
|00002b20| 74 68 69 73 20 68 61 6e | 64 6c 65 72 20 6f 74 68 |this han|dler oth|
|00002b30| 65 72 77 69 73 65 20 52 | 30 20 77 69 6c 6c 20 62 |erwise R|0 will b|
|00002b40| 65 20 7a 65 72 6f 2e 0a | 49 6e 74 65 72 70 72 65 |e zero..|Interpre|
|00002b50| 74 61 74 69 6f 6e 20 6f | 66 20 69 74 65 6d 20 68 |tation o|f item h|
|00002b60| 61 6e 64 6c 65 72 20 69 | 73 20 64 65 74 65 72 6d |andler i|s determ|
|00002b70| 65 6e 74 20 62 79 20 69 | 6e 69 74 69 61 6c 69 73 |ent by i|nitialis|
|00002b80| 61 74 69 6f 6e 20 74 79 | 70 65 20 28 73 65 65 0a |ation ty|pe (see.|
|00002b90| 4d 65 6e 75 55 74 69 6c | 5f 49 6e 69 74 69 61 6c |MenuUtil|_Initial|
|00002ba0| 69 73 65 29 2e 20 49 66 | 20 69 6e 69 74 69 61 6c |ise). If| initial|
|00002bb0| 69 73 61 74 69 6f 6e 20 | 74 79 70 65 20 77 61 73 |isation |type was|
|00002bc0| 20 22 42 41 53 49 43 22 | 20 74 68 65 6e 20 52 30 | "BASIC"| then R0|
|00002bd0| 20 77 69 6c 6c 20 70 6f | 69 6e 74 20 74 6f 0a 63 | will po|int to.c|
|00002be0| 74 72 6c 2d 74 65 72 6d | 69 6e 61 74 65 64 20 74 |trl-term|inated t|
|00002bf0| 65 78 74 20 73 74 72 69 | 6e 67 2e 20 49 66 20 69 |ext stri|ng. If i|
|00002c00| 6e 69 74 69 61 6c 69 73 | 61 74 69 6f 6e 20 74 79 |nitialis|ation ty|
|00002c10| 70 65 20 77 61 73 20 22 | 6d 61 63 68 69 6e 65 20 |pe was "|machine |
|00002c20| 63 6f 64 65 22 20 28 6e | 6f 74 0a 73 75 70 70 6f |code" (n|ot.suppo|
|00002c30| 72 74 65 64 20 62 79 20 | 63 75 72 72 65 6e 74 20 |rted by |current |
|00002c40| 76 65 72 73 69 6f 6e 29 | 20 74 68 65 6e 20 52 30 |version)| then R0|
|00002c50| 20 77 69 6c 6c 20 63 6f | 6e 74 61 69 6e 20 74 68 | will co|ntain th|
|00002c60| 65 20 76 61 6c 75 65 20 | 70 61 73 73 65 64 20 69 |e value |passed i|
|00002c70| 6e 20 52 32 20 74 6f 0a | 4d 65 6e 75 55 74 69 6c |n R2 to.|MenuUtil|
|00002c80| 5f 41 64 64 2e 20 54 6f | 20 69 6e 76 6f 6b 65 20 |_Add. To| invoke |
|00002c90| 42 41 53 49 43 20 68 61 | 6e 64 6c 65 72 20 79 6f |BASIC ha|ndler yo|
|00002ca0| 75 20 63 61 6e 20 75 73 | 65 20 45 56 41 4c 20 73 |u can us|e EVAL s|
|00002cb0| 74 61 74 65 6d 65 6e 74 | 2e 0a 0a 45 78 61 6d 70 |tatement|...Examp|
|00002cc0| 6c 65 20 63 6f 64 65 3a | 0a 20 53 75 70 70 6f 73 |le code:|. Suppos|
|00002cd0| 65 20 57 69 6d 70 5f 50 | 6f 6c 6c 20 68 61 73 20 |e Wimp_P|oll has |
|00002ce0| 72 65 74 75 72 6e 65 64 | 20 72 65 61 73 6f 6e 20 |returned| reason |
|00002cf0| 63 6f 64 65 20 39 20 28 | 4d 65 6e 75 5f 53 65 6c |code 9 (|Menu_Sel|
|00002d00| 65 63 74 69 6f 6e 29 20 | 61 6e 64 20 71 25 0a 70 |ection) |and q%.p|
|00002d10| 6f 69 6e 74 73 20 74 6f | 20 74 68 65 20 63 6f 72 |oints to| the cor|
|00002d20| 72 65 73 70 6f 6e 64 69 | 6e 67 20 62 6c 6f 63 6b |respondi|ng block|
|00002d30| 2e 20 59 6f 75 20 63 61 | 6e 20 75 73 65 20 4d 65 |. You ca|n use Me|
|00002d40| 6e 75 55 74 69 6c 5f 44 | 65 63 6f 64 65 20 74 6f |nuUtil_D|ecode to|
|00002d50| 20 63 61 6c 6c 20 74 68 | 65 0a 69 74 65 6d 20 68 | call th|e.item h|
|00002d60| 61 6e 64 6c 65 72 20 69 | 6e 20 74 68 65 20 66 6f |andler i|n the fo|
|00002d70| 6c 6c 6f 77 69 6e 67 20 | 77 61 79 3a 0a 20 53 59 |llowing |way:. SY|
|00002d80| 53 20 22 4d 65 6e 75 55 | 74 69 6c 5f 44 65 63 6f |S "MenuU|til_Deco|
|00002d90| 64 65 22 2c 2c 71 25 20 | 54 4f 20 68 61 6e 64 6c |de",,q% |TO handl|
|00002da0| 65 72 25 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |er% | |
|00002db0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 0a | | .|
|00002dc0| 20 49 46 20 68 61 6e 64 | 6c 65 72 25 20 54 48 45 | IF hand|ler% THE|
|00002dd0| 4e 0a 20 20 20 68 61 6e | 64 6c 65 72 24 3d 22 46 |N. han|dler$="F|
|00002de0| 4e 22 2b 24 68 61 6e 64 | 6c 65 72 25 0a 20 20 20 |N"+$hand|ler%. |
|00002df0| 49 46 20 45 56 41 4c 28 | 68 61 6e 64 6c 65 72 24 |IF EVAL(|handler$|
|00002e00| 29 0a 20 45 4e 44 49 46 | 44 41 54 41 0b 05 00 00 |). ENDIF|DATA....|
|00002e10| 4d 65 6e 75 55 74 69 6c | 5f 53 68 6f 77 20 28 53 |MenuUtil|_Show (S|
|00002e20| 57 49 20 26 34 35 42 43 | 35 29 0a 23 50 61 72 65 |WI &45BC|5).#Pare|
|00002e30| 6e 74 20 4d 65 6e 75 55 | 74 69 6c 73 3a 21 52 6f |nt MenuU|tils:!Ro|
|00002e40| 6f 74 0a 20 44 69 73 70 | 6c 61 79 73 20 6d 65 6e |ot. Disp|lays men|
|00002e50| 75 20 6f 6e 20 73 63 72 | 65 65 6e 0a 0a 20 45 6e |u on scr|een.. En|
|00002e60| 74 72 79 3a 0a 20 20 20 | 20 20 52 30 20 3d 20 68 |try:. | R0 = h|
|00002e70| 61 6e 64 6c 65 20 6f 66 | 20 74 68 65 20 6d 65 6e |andle of| the men|
|00002e80| 75 20 6f 72 20 7a 65 72 | 6f 20 66 6f 72 20 63 75 |u or zer|o for cu|
|00002e90| 72 72 65 6e 74 20 6d 65 | 6e 75 0a 20 20 20 20 20 |rrent me|nu. |
|00002ea0| 52 31 20 2d 3e 20 70 6f | 69 6e 74 65 72 20 74 6f |R1 -> po|inter to|
|00002eb0| 20 62 6c 6f 63 6b 20 6f | 72 20 7a 65 72 6f 0a 20 | block o|r zero. |
|00002ec0| 45 78 69 74 3a 0a 20 20 | 20 20 20 52 30 2c 52 31 |Exit:. | R0,R1|
|00002ed0| 20 70 72 65 73 65 72 76 | 65 64 0a 0a 54 68 69 73 | preserv|ed..This|
|00002ee0| 20 63 61 6c 6c 20 6d 61 | 79 20 62 65 20 75 73 65 | call ma|y be use|
|00002ef0| 64 20 74 6f 20 64 69 73 | 70 6c 61 79 20 6d 65 6e |d to dis|play men|
|00002f00| 75 20 6f 6e 20 73 63 72 | 65 65 6e 2e 20 53 63 72 |u on scr|een. Scr|
|00002f10| 65 65 6e 20 70 6f 73 69 | 74 69 6f 6e 20 66 6f 72 |een posi|tion for|
|00002f20| 20 6d 65 6e 75 0a 77 69 | 6c 6c 20 62 65 20 63 61 | menu.wi|ll be ca|
|00002f30| 6c 63 75 6c 61 74 65 64 | 20 61 63 63 6f 72 64 69 |lculated| accordi|
|00002f40| 6e 67 20 74 6f 20 72 75 | 6c 65 73 20 64 65 73 63 |ng to ru|les desc|
|00002f50| 72 69 62 65 64 20 69 6e | 20 50 52 4d 2e 20 42 6c |ribed in| PRM. Bl|
|00002f60| 6f 63 6b 20 70 6f 69 6e | 74 65 64 20 74 6f 20 62 |ock poin|ted to b|
|00002f70| 79 0a 52 31 20 6d 75 73 | 74 20 63 6f 6e 74 61 69 |y.R1 mus|t contai|
|00002f80| 6e 20 74 68 65 20 73 61 | 6d 65 20 69 6e 66 6f 72 |n the sa|me infor|
|00002f90| 6d 61 74 69 6f 6e 20 61 | 73 20 72 65 74 75 72 6e |mation a|s return|
|00002fa0| 65 64 20 62 79 20 57 69 | 6d 70 5f 50 6f 6c 6c 20 |ed by Wi|mp_Poll |
|00002fb0| 69 6e 20 63 61 73 65 20 | 6f 66 0a 6d 6f 75 73 65 |in case |of.mouse|
|00002fc0| 20 63 6c 69 63 6b 20 65 | 76 65 6e 74 20 28 69 6e | click e|vent (in|
|00002fd0| 20 66 61 63 74 20 6f 6e | 6c 79 20 6d 6f 75 73 65 | fact on|ly mouse|
|00002fe0| 20 63 6f 6f 72 64 69 6e | 61 74 65 73 20 61 6e 64 | coordin|ates and|
|00002ff0| 20 77 69 6e 64 6f 77 20 | 68 61 6e 64 6c 65 20 77 | window |handle w|
|00003000| 69 6c 6c 20 62 65 0a 75 | 73 65 64 29 20 3a 0a 20 |ill be.u|sed) :. |
|00003010| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003020| 20 20 20 20 52 31 20 2b | 20 30 20 20 6d 6f 75 73 | R1 +| 0 mous|
|00003030| 65 20 58 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |e X. | |
|00003040| 20 20 20 20 20 20 20 20 | 20 52 31 20 2b 20 34 20 | | R1 + 4 |
|00003050| 20 6d 6f 75 73 65 20 59 | 0a 20 20 20 20 20 20 20 | mouse Y|. |
|00003060| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 52 31 | | R1|
|00003070| 20 2b 20 38 20 20 62 75 | 74 74 6f 6e 73 0a 20 20 | + 8 bu|ttons. |
|00003080| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003090| 20 20 20 52 31 20 2b 31 | 32 20 20 77 69 6e 64 6f | R1 +1|2 windo|
|000030a0| 77 20 68 61 6e 64 6c 65 | 20 28 2d 32 20 69 66 20 |w handle| (-2 if |
|000030b0| 69 63 6f 6e 20 62 61 72 | 29 0a 20 20 20 20 20 20 |icon bar|). |
|000030c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 52 | | R|
|000030d0| 31 20 2b 31 36 20 20 69 | 63 6f 6e 20 68 61 6e 64 |1 +16 i|con hand|
|000030e0| 6c 65 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |le | |
|000030f0| 20 20 0a 0a 4d 65 6e 75 | 55 74 69 6c 73 20 61 75 | ..Menu|Utils au|
|00003100| 74 6f 6d 61 74 69 63 61 | 6c 6c 79 20 64 69 73 74 |tomatica|lly dist|
|00003110| 69 6e 67 75 69 73 68 65 | 73 20 69 63 6f 6e 62 61 |inguishe|s iconba|
|00003120| 72 20 6d 65 6e 75 73 20 | 66 72 6f 6d 20 6f 72 64 |r menus |from ord|
|00003130| 69 6e 61 72 79 0a 77 69 | 6e 64 6f 77 20 6d 65 6e |inary.wi|ndow men|
|00003140| 75 73 2e 20 49 66 20 6d | 65 6e 75 20 69 73 20 61 |us. If m|enu is a|
|00003150| 6c 72 65 61 64 79 20 6f | 6e 20 73 63 72 65 65 6e |lready o|n screen|
|00003160| 20 61 6e 64 20 79 6f 75 | 20 77 61 6e 74 20 74 6f | and you| want to|
|00003170| 20 72 65 6f 70 65 6e 20 | 69 74 0a 61 66 74 65 72 | reopen |it.after|
|00003180| 20 75 73 65 72 20 73 65 | 6c 65 63 74 69 6f 6e 20 | user se|lection |
|00003190| 77 69 74 68 20 41 64 6a | 75 73 74 20 62 75 74 74 |with Adj|ust butt|
|000031a0| 6f 6e 20 74 68 65 6e 20 | 70 6f 69 6e 74 65 72 20 |on then |pointer |
|000031b0| 74 6f 20 74 68 65 20 62 | 6c 6f 63 6b 20 6d 61 79 |to the b|lock may|
|000031c0| 20 62 65 0a 6f 6d 69 74 | 74 65 64 2e 0a 0a 20 45 | be.omit|ted... E|
|000031d0| 78 61 6d 70 6c 65 20 63 | 6f 64 65 3a 0a 20 53 75 |xample c|ode:. Su|
|000031e0| 70 70 6f 73 65 20 57 69 | 6d 70 5f 50 6f 6c 6c 20 |ppose Wi|mp_Poll |
|000031f0| 68 61 73 20 72 65 74 75 | 72 6e 65 64 20 72 65 61 |has retu|rned rea|
|00003200| 73 6f 6e 20 63 6f 64 65 | 20 36 20 28 4d 6f 75 73 |son code| 6 (Mous|
|00003210| 65 5f 43 6c 69 63 6b 29 | 20 61 6e 64 20 71 25 20 |e_Click)| and q% |
|00003220| 70 6f 69 6e 74 73 20 74 | 6f 0a 74 68 65 20 72 65 |points t|o.the re|
|00003230| 74 75 72 6e 65 64 20 62 | 6c 6f 63 6b 2e 20 44 69 |turned b|lock. Di|
|00003240| 73 70 6c 61 79 20 6d 65 | 6e 75 20 6f 6e 20 73 63 |splay me|nu on sc|
|00003250| 72 65 65 6e 20 69 66 20 | 74 68 65 20 63 6c 69 63 |reen if |the clic|
|00003260| 6b 20 69 73 20 77 69 74 | 68 20 4d 65 6e 75 20 62 |k is wit|h Menu b|
|00003270| 75 74 74 6f 6e 2e 0a 20 | 62 75 74 74 6f 6e 73 25 |utton.. |buttons%|
|00003280| 3d 71 25 21 38 0a 20 49 | 46 20 28 62 75 74 74 6f |=q%!8. I|F (butto|
|00003290| 6e 73 25 20 41 4e 44 32 | 29 3c 3e 30 20 54 48 45 |ns% AND2|)<>0 THE|
|000032a0| 4e 20 53 59 53 20 22 4d | 65 6e 75 55 74 69 6c 5f |N SYS "M|enuUtil_|
|000032b0| 53 68 6f 77 22 2c 6d 61 | 69 6e 4d 65 6e 75 25 2c |Show",ma|inMenu%,|
|000032c0| 71 25 0a 20 20 0a 20 4c | 65 61 76 65 20 6d 65 6e |q%. . L|eave men|
|000032d0| 75 20 6f 6e 20 73 63 72 | 65 65 6e 20 61 66 74 65 |u on scr|een afte|
|000032e0| 72 20 73 65 6c 65 63 74 | 69 6f 6e 20 77 69 74 68 |r select|ion with|
|000032f0| 20 41 64 6a 75 73 74 20 | 62 75 74 74 6f 6e 0a 20 | Adjust |button. |
|00003300| 53 59 53 20 22 4d 65 6e | 75 55 74 69 6c 5f 53 68 |SYS "Men|uUtil_Sh|
|00003310| 6f 77 22 00 44 41 54 41 | 34 04 00 00 4d 65 6e 75 |ow".DATA|4...Menu|
|00003320| 55 74 69 6c 5f 53 68 6f | 77 53 75 62 4d 65 6e 75 |Util_Sho|wSubMenu|
|00003330| 20 28 53 57 49 20 26 34 | 35 42 43 36 29 0a 23 50 | (SWI &4|5BC6).#P|
|00003340| 61 72 65 6e 74 20 4d 65 | 6e 75 55 74 69 6c 73 3a |arent Me|nuUtils:|
|00003350| 21 52 6f 6f 74 0a 20 44 | 69 73 70 6c 61 79 20 73 |!Root. D|isplay s|
|00003360| 75 62 6d 65 6e 75 20 61 | 66 74 65 72 20 72 65 63 |ubmenu a|fter rec|
|00003370| 65 69 76 69 6e 67 20 4d | 65 73 73 61 67 65 5f 4d |eiving M|essage_M|
|00003380| 65 6e 75 57 61 72 6e 69 | 6e 67 0a 20 0a 20 45 6e |enuWarni|ng. . En|
|00003390| 74 72 79 3a 0a 20 20 20 | 20 20 52 30 20 3d 20 68 |try:. | R0 = h|
|000033a0| 61 6e 64 6c 65 20 6f 66 | 20 74 68 65 20 73 75 62 |andle of| the sub|
|000033b0| 6d 65 6e 75 20 6f 72 20 | 7a 65 72 6f 20 66 6f 72 |menu or |zero for|
|000033c0| 20 63 75 72 72 65 6e 74 | 20 6d 65 6e 75 0a 20 20 | current| menu. |
|000033d0| 20 20 20 52 31 20 2d 3e | 20 70 6f 69 6e 74 65 72 | R1 ->| pointer|
|000033e0| 20 74 6f 20 62 6c 6f 63 | 6b 0a 20 45 78 69 74 3a | to bloc|k. Exit:|
|000033f0| 0a 20 20 20 20 20 52 30 | 2c 52 31 20 70 72 65 73 |. R0|,R1 pres|
|00003400| 65 72 76 65 64 0a 0a 54 | 68 69 73 20 63 61 6c 6c |erved..T|his call|
|00003410| 20 6d 61 79 20 62 65 20 | 75 73 65 64 20 74 6f 20 | may be |used to |
|00003420| 64 69 73 70 6c 61 79 20 | 73 75 62 6d 65 6e 75 20 |display |submenu |
|00003430| 77 68 65 6e 20 61 20 6d | 65 73 73 61 67 65 20 74 |when a m|essage t|
|00003440| 79 70 65 20 4d 65 6e 75 | 57 61 72 6e 69 6e 67 0a |ype Menu|Warning.|
|00003450| 28 26 34 30 30 43 30 29 | 20 69 73 20 72 65 63 65 |(&400C0)| is rece|
|00003460| 69 76 65 64 20 62 79 20 | 61 6e 20 61 70 70 6c 69 |ived by |an appli|
|00003470| 63 61 74 69 6f 6e 2e 20 | 54 68 69 73 20 6d 65 73 |cation. |This mes|
|00003480| 73 61 67 65 20 69 73 20 | 73 65 6e 74 20 62 79 20 |sage is |sent by |
|00003490| 74 68 65 20 57 69 6d 70 | 0a 77 68 65 6e 20 73 75 |the Wimp|.when su|
|000034a0| 62 6d 65 6e 75 20 69 73 | 20 61 62 6f 75 74 20 74 |bmenu is| about t|
|000034b0| 6f 20 62 65 20 61 63 63 | 65 73 73 65 64 20 62 79 |o be acc|essed by|
|000034c0| 20 74 68 65 20 70 6f 69 | 6e 74 65 72 20 6d 6f 76 | the poi|nter mov|
|000034d0| 69 6e 67 20 6f 76 65 72 | 20 74 68 65 0a 72 69 67 |ing over| the.rig|
|000034e0| 68 74 2d 70 6f 69 6e 74 | 69 6e 67 20 61 72 72 6f |ht-point|ing arro|
|000034f0| 77 20 6f 66 20 74 68 65 | 20 70 61 72 65 6e 74 20 |w of the| parent |
|00003500| 6d 65 6e 75 2e 20 28 54 | 6f 20 66 69 6e 64 20 6f |menu. (T|o find o|
|00003510| 75 74 20 74 68 65 20 68 | 61 6e 64 6c 65 20 6f 66 |ut the h|andle of|
|00003520| 20 74 68 65 0a 6d 65 6e | 75 20 69 74 65 6d 20 69 | the.men|u item i|
|00003530| 6e 20 70 61 72 65 6e 74 | 20 6d 65 6e 75 20 79 6f |n parent| menu yo|
|00003540| 75 20 63 61 6e 20 75 73 | 65 20 4d 65 6e 75 55 74 |u can us|e MenuUt|
|00003550| 69 6c 5f 44 65 63 6f 64 | 65 29 2e 0a 0a 52 31 20 |il_Decod|e)...R1 |
|00003560| 6f 6e 20 65 6e 74 72 79 | 20 6d 75 73 74 20 70 6f |on entry| must po|
|00003570| 69 6e 74 20 74 6f 20 6d | 65 73 73 61 67 65 20 62 |int to m|essage b|
|00003580| 6c 6f 63 6b 20 28 69 6e | 20 66 61 63 74 20 6f 6e |lock (in| fact on|
|00003590| 6c 79 20 74 77 6f 20 77 | 6f 72 64 73 20 61 74 20 |ly two w|ords at |
|000035a0| 6f 66 66 73 65 74 73 0a | 2b 32 34 20 61 6e 64 20 |offsets.|+24 and |
|000035b0| 2b 32 38 20 77 69 6c 6c | 20 62 65 20 75 73 65 64 |+28 will| be used|
|000035c0| 29 2e 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |).. | |
|000035d0| 20 20 20 20 0a 4e 6f 74 | 65 3a 20 49 66 20 79 6f | .Not|e: If yo|
|000035e0| 75 20 70 6c 61 6e 20 74 | 6f 20 75 73 65 20 4d 65 |u plan t|o use Me|
|000035f0| 6e 75 55 74 69 6c 5f 44 | 65 63 6f 64 65 20 74 68 |nuUtil_D|ecode th|
|00003600| 65 6e 20 61 6c 6c 20 73 | 75 62 6d 65 6e 75 20 70 |en all s|ubmenu p|
|00003610| 6f 69 6e 74 65 72 73 20 | 6d 75 73 74 20 62 65 0a |ointers |must be.|
|00003620| 76 61 6c 69 64 2e 20 49 | 74 20 6d 65 61 6e 73 20 |valid. I|t means |
|00003630| 74 68 61 74 20 79 6f 75 | 20 68 61 76 65 20 74 6f |that you| have to|
|00003640| 20 6c 69 6e 6b 20 73 75 | 62 6d 65 6e 75 20 70 6f | link su|bmenu po|
|00003650| 69 6e 74 65 64 20 74 6f | 20 62 79 20 52 30 20 77 |inted to| by R0 w|
|00003660| 69 74 68 0a 63 6f 72 72 | 65 73 70 6f 6e 64 69 6e |ith.corr|espondin|
|00003670| 67 20 6d 65 6e 75 20 69 | 74 65 6d 2e 20 54 68 69 |g menu i|tem. Thi|
|00003680| 73 20 63 61 6e 20 62 65 | 20 64 6f 6e 65 20 62 79 |s can be| done by|
|00003690| 20 4d 65 6e 75 55 74 69 | 6c 5f 53 75 62 4d 65 6e | MenuUti|l_SubMen|
|000036a0| 75 2e 0a 0a 20 45 78 61 | 6d 70 6c 65 20 63 6f 64 |u... Exa|mple cod|
|000036b0| 65 3a 0a 20 44 69 73 70 | 6c 61 79 20 66 6f 6e 74 |e:. Disp|lay font|
|000036c0| 73 20 73 75 62 6d 65 6e | 75 20 6f 6e 20 73 63 72 |s submen|u on scr|
|000036d0| 65 65 6e 20 61 66 74 65 | 72 20 72 65 63 65 69 76 |een afte|r receiv|
|000036e0| 69 6e 67 20 4d 65 6e 75 | 57 61 72 6e 69 6e 67 3a |ing Menu|Warning:|
|000036f0| 0a 20 53 59 53 20 22 4d | 65 6e 75 55 74 69 6c 5f |. SYS "M|enuUtil_|
|00003700| 53 75 62 4d 65 6e 75 22 | 2c 66 6f 6e 74 73 49 74 |SubMenu"|,fontsIt|
|00003710| 65 6d 25 2c 66 6f 6e 74 | 73 4d 65 6e 75 25 0a 20 |em%,font|sMenu%. |
|00003720| 53 59 53 20 22 4d 65 6e | 75 55 74 69 6c 5f 53 68 |SYS "Men|uUtil_Sh|
|00003730| 6f 77 53 75 62 4d 65 6e | 75 22 2c 66 6f 6e 74 73 |owSubMen|u",fonts|
|00003740| 4d 65 6e 75 25 2c 71 25 | 44 41 54 41 75 02 00 00 |Menu%,q%|DATAu...|
|00003750| 20 4d 65 6e 75 55 74 69 | 6c 5f 49 6e 66 6f 20 28 | MenuUti|l_Info (|
|00003760| 53 57 49 20 26 34 35 42 | 43 37 29 0a 23 50 61 72 |SWI &45B|C7).#Par|
|00003770| 65 6e 74 20 4d 65 6e 75 | 55 74 69 6c 73 3a 21 52 |ent Menu|Utils:!R|
|00003780| 6f 6f 74 0a 54 68 69 73 | 20 63 61 6c 6c 20 72 65 |oot.This| call re|
|00003790| 74 75 72 6e 73 20 76 61 | 72 69 6f 75 73 20 69 6e |turns va|rious in|
|000037a0| 66 6f 72 6d 61 74 69 6f | 6e 20 61 62 6f 75 74 20 |formatio|n about |
|000037b0| 74 68 65 20 77 68 6f 6c | 65 20 6d 65 6e 75 20 6f |the whol|e menu o|
|000037c0| 72 20 61 62 6f 75 74 20 | 74 68 65 0a 70 61 72 74 |r about |the.part|
|000037d0| 69 63 75 6c 61 72 20 6d | 65 6e 75 20 69 74 65 6d |icular m|enu item|
|000037e0| 2e 0a 0a 20 45 6e 74 72 | 79 3a 0a 20 20 20 20 20 |... Entr|y:. |
|000037f0| 52 30 20 3d 20 68 61 6e | 64 6c 65 20 6f 66 20 74 |R0 = han|dle of t|
|00003800| 68 65 20 6d 65 6e 75 20 | 6f 72 20 6f 66 20 74 68 |he menu |or of th|
|00003810| 65 20 6d 65 6e 75 20 69 | 74 65 6d 20 6f 72 20 7a |e menu i|tem or z|
|00003820| 65 72 6f 20 66 6f 72 20 | 63 75 72 72 65 6e 74 20 |ero for |current |
|00003830| 69 74 65 6d 0a 20 45 78 | 69 74 3a 0a 20 20 20 20 |item. Ex|it:. |
|00003840| 20 52 30 20 2d 3e 20 70 | 6f 69 6e 74 65 72 20 74 | R0 -> p|ointer t|
|00003850| 6f 20 62 6c 6f 63 6b 0a | 0a 52 65 74 75 72 6e 65 |o block.|.Returne|
|00003860| 64 20 62 6c 6f 63 6b 20 | 63 6f 6e 74 61 69 6e 73 |d block |contains|
|00003870| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 69 | the fol|lowing i|
|00003880| 6e 66 6f 72 6d 61 74 69 | 6f 6e 3a 0a 20 20 20 52 |nformati|on:. R|
|00003890| 30 20 2b 20 30 20 70 6f | 69 6e 74 65 72 20 74 6f |0 + 0 po|inter to|
|000038a0| 20 6d 65 6e 75 20 64 61 | 74 61 20 73 74 72 75 63 | menu da|ta struc|
|000038b0| 74 75 72 65 0a 20 20 20 | 52 30 20 2b 20 34 20 70 |ture. |R0 + 4 p|
|000038c0| 6f 69 6e 74 65 72 20 74 | 6f 20 69 74 65 6d 20 64 |ointer t|o item d|
|000038d0| 61 74 61 20 6f 72 20 7a | 65 72 6f 0a 0a 4d 65 6e |ata or z|ero..Men|
|000038e0| 75 73 20 63 72 65 61 74 | 65 64 20 77 69 74 68 20 |us creat|ed with |
|000038f0| 4d 65 6e 75 55 74 69 6c | 73 20 61 72 65 20 6e 6f |MenuUtil|s are no|
|00003900| 74 20 73 74 61 74 69 63 | 20 61 6e 64 20 6d 61 79 |t static| and may|
|00003910| 20 62 65 20 6d 6f 76 65 | 64 20 69 6e 0a 6d 65 6d | be move|d in.mem|
|00003920| 6f 72 79 2c 20 66 6f 72 | 20 65 78 61 6d 70 6c 65 |ory, for| example|
|00003930| 20 61 66 74 65 72 20 61 | 64 64 69 6e 67 20 6e 65 | after a|dding ne|
|00003940| 77 20 69 74 65 6d 73 2e | 20 53 6f 20 79 6f 75 20 |w items.| So you |
|00003950| 6d 75 73 74 20 75 73 65 | 20 64 69 72 65 63 74 0a |must use| direct.|
|00003960| 70 6f 69 6e 74 65 72 73 | 20 74 6f 20 74 68 69 73 |pointers| to this|
|00003970| 20 6d 65 6e 75 73 20 77 | 69 74 68 20 63 61 75 74 | menus w|ith caut|
|00003980| 69 6f 6e 20 75 6e 74 69 | 6c 20 79 6f 75 20 68 61 |ion unti|l you ha|
|00003990| 76 65 20 63 6f 6d 70 6c | 65 74 65 6c 79 20 66 69 |ve compl|etely fi|
|000039a0| 6e 69 73 68 65 64 0a 74 | 68 65 20 6d 65 6e 75 20 |nished.t|he menu |
|000039b0| 63 6f 6e 73 74 72 75 63 | 74 69 6f 6e 2e 00 00 00 |construc|tion....|
|000039c0| 44 41 54 41 64 05 00 00 | 4d 65 6e 75 55 74 69 6c |DATAd...|MenuUtil|
|000039d0| 5f 54 65 78 74 20 28 53 | 57 49 20 26 34 35 42 43 |_Text (S|WI &45BC|
|000039e0| 38 29 0a 23 50 61 72 65 | 6e 74 20 4d 65 6e 75 55 |8).#Pare|nt MenuU|
|000039f0| 74 69 6c 73 3a 21 52 6f | 6f 74 0a 20 43 68 61 6e |tils:!Ro|ot. Chan|
|00003a00| 67 65 73 20 6d 65 6e 75 | 20 74 69 74 6c 65 20 73 |ges menu| title s|
|00003a10| 74 72 69 6e 67 20 6f 72 | 20 74 65 78 74 20 6f 66 |tring or| text of|
|00003a20| 20 6d 65 6e 75 20 69 74 | 65 6d 0a 0a 20 45 6e 74 | menu it|em.. Ent|
|00003a30| 72 79 3a 0a 20 20 20 20 | 20 52 30 20 3d 20 68 61 |ry:. | R0 = ha|
|00003a40| 6e 64 6c 65 20 6f 66 20 | 6d 65 6e 75 20 69 74 65 |ndle of |menu ite|
|00003a50| 6d 20 6f 72 20 68 61 6e | 64 6c 65 20 6f 66 20 6d |m or han|dle of m|
|00003a60| 65 6e 75 20 6f 72 20 20 | 7a 65 72 6f 20 66 6f 72 |enu or |zero for|
|00003a70| 20 63 75 72 72 65 6e 74 | 20 69 74 65 6d 0a 20 20 | current| item. |
|00003a80| 20 20 20 52 31 20 2d 3e | 20 70 6f 69 6e 74 65 72 | R1 ->| pointer|
|00003a90| 20 74 6f 20 74 65 78 74 | 20 73 74 72 69 6e 67 20 | to text| string |
|00003aa0| 0a 20 45 78 69 74 3a 0a | 20 20 20 20 20 52 30 2c |. Exit:.| R0,|
|00003ab0| 52 31 20 70 72 65 73 65 | 72 76 65 64 0a 20 0a 54 |R1 prese|rved. .T|
|00003ac0| 68 69 73 20 63 61 6c 6c | 20 61 6c 6c 6f 77 73 20 |his call| allows |
|00003ad0| 79 6f 75 20 74 6f 20 63 | 68 61 6e 67 65 20 74 69 |you to c|hange ti|
|00003ae0| 74 6c 65 20 73 74 72 69 | 6e 67 20 6f 66 20 6d 65 |tle stri|ng of me|
|00003af0| 6e 75 20 6f 72 20 74 65 | 78 74 20 6f 66 20 6d 65 |nu or te|xt of me|
|00003b00| 6e 75 20 69 74 65 6d 2e | 0a 54 68 65 20 73 74 72 |nu item.|.The str|
|00003b10| 75 63 74 75 72 65 20 6f | 66 20 6d 65 6e 75 20 74 |ucture o|f menu t|
|00003b20| 72 65 65 20 72 65 6d 61 | 69 6e 73 20 75 6e 63 68 |ree rema|ins unch|
|00003b30| 61 6e 67 65 64 20 62 75 | 74 20 70 6f 69 6e 74 65 |anged bu|t pointe|
|00003b40| 72 20 74 6f 20 69 74 65 | 6d 20 74 65 78 74 20 6d |r to ite|m text m|
|00003b50| 61 79 20 62 65 0a 63 68 | 61 6e 67 65 64 2e 20 54 |ay be.ch|anged. T|
|00003b60| 68 65 20 68 61 6e 64 6c | 65 20 6f 66 20 74 68 65 |he handl|e of the|
|00003b70| 20 6d 65 6e 75 20 6f 72 | 20 6d 65 6e 75 20 69 74 | menu or| menu it|
|00003b80| 65 6d 20 6d 75 73 74 20 | 62 65 20 73 70 65 63 69 |em must |be speci|
|00003b90| 66 69 65 64 20 69 6e 20 | 52 30 2e 20 49 66 20 52 |fied in |R0. If R|
|00003ba0| 30 0a 69 73 20 7a 65 72 | 6f 20 6f 6e 20 65 6e 74 |0.is zer|o on ent|
|00003bb0| 72 79 20 74 68 65 6e 20 | 74 68 65 20 74 65 78 74 |ry then |the text|
|00003bc0| 20 6f 66 20 63 75 72 72 | 65 6e 74 20 69 74 65 6d | of curr|ent item|
|00003bd0| 20 77 69 6c 6c 20 62 65 | 20 63 68 61 6e 67 65 64 | will be| changed|
|00003be0| 2e 20 52 31 20 6d 75 73 | 74 0a 70 6f 69 6e 74 20 |. R1 mus|t.point |
|00003bf0| 74 6f 20 74 68 65 20 63 | 74 72 6c 2d 74 65 72 6d |to the c|trl-term|
|00003c00| 69 6e 61 74 65 64 20 74 | 65 78 74 20 73 74 72 69 |inated t|ext stri|
|00003c10| 6e 67 2e 20 49 66 20 52 | 31 20 69 73 20 7a 65 72 |ng. If R|1 is zer|
|00003c20| 6f 20 6f 6e 20 65 6e 74 | 72 79 20 74 68 65 6e 20 |o on ent|ry then |
|00003c30| 6e 75 6c 6c 0a 73 74 72 | 69 6e 67 20 77 69 6c 6c |null.str|ing will|
|00003c40| 20 62 65 20 75 73 65 64 | 2e 20 52 65 6d 65 6d 62 | be used|. Rememb|
|00003c50| 65 72 20 74 68 61 74 20 | 74 68 65 20 6c 65 6e 67 |er that |the leng|
|00003c60| 74 68 20 6f 66 20 6d 65 | 6e 75 20 74 69 74 6c 65 |th of me|nu title|
|00003c70| 20 69 73 20 6c 69 6d 69 | 74 65 64 20 62 79 20 31 | is limi|ted by 1|
|00003c80| 32 0a 73 79 6d 62 6f 6c | 73 2e 0a 0a 20 45 78 61 |2.symbol|s... Exa|
|00003c90| 6d 70 6c 65 20 63 6f 64 | 65 20 0a 20 53 65 74 20 |mple cod|e . Set |
|00003ca0| 6e 65 77 20 6d 65 6e 75 | 20 74 69 74 6c 65 20 73 |new menu| title s|
|00003cb0| 74 72 69 6e 67 3a 0a 20 | 53 59 53 20 22 4d 65 6e |tring:. |SYS "Men|
|00003cc0| 75 55 74 69 6c 5f 54 65 | 78 74 22 2c 6f 62 6a 65 |uUtil_Te|xt",obje|
|00003cd0| 63 74 4d 65 6e 75 25 2c | 22 44 69 72 65 63 74 6f |ctMenu%,|"Directo|
|00003ce0| 72 79 22 0a 0a 20 4c 65 | 74 27 73 20 76 61 72 69 |ry".. Le|t's vari|
|00003cf0| 61 62 6c 65 20 74 79 70 | 65 25 20 63 6f 6e 74 61 |able typ|e% conta|
|00003d00| 69 6e 73 20 6f 6e 65 20 | 6f 66 20 74 68 65 20 76 |ins one |of the v|
|00003d10| 61 6c 75 65 73 20 30 2c | 31 2c 32 20 6f 72 20 33 |alues 0,|1,2 or 3|
|00003d20| 20 64 65 70 65 6e 64 69 | 6e 67 20 6f 6e 20 74 68 | dependi|ng on th|
|00003d30| 65 0a 6f 62 6a 65 63 74 | 20 73 65 6c 65 63 74 65 |e.object| selecte|
|00003d40| 64 20 69 6e 20 46 69 6c | 65 72 20 77 69 6e 64 6f |d in Fil|er windo|
|00003d50| 77 20 61 6e 64 20 76 61 | 72 69 61 62 6c 65 20 6e |w and va|riable n|
|00003d60| 61 6d 65 24 20 63 6f 6e | 74 61 69 6e 73 20 74 68 |ame$ con|tains th|
|00003d70| 65 20 6e 61 6d 65 20 6f | 66 20 74 68 65 0a 66 69 |e name o|f the.fi|
|00003d80| 6c 65 20 6f 72 20 64 69 | 72 65 63 74 6f 72 79 20 |le or di|rectory |
|00003d90| 73 65 6c 65 63 74 65 64 | 2e 20 20 0a 0a 43 41 53 |selected|. ..CAS|
|00003da0| 45 20 74 79 70 65 25 20 | 4f 46 0a 20 20 57 48 45 |E type% |OF. WHE|
|00003db0| 4e 20 30 3a 69 24 3d 22 | 46 69 6c 65 20 27 27 22 |N 0:i$="|File ''"|
|00003dc0| 0a 20 20 57 48 45 4e 20 | 31 3a 69 24 3d 22 46 69 |. WHEN |1:i$="Fi|
|00003dd0| 6c 65 20 27 22 2b 6e 61 | 6d 65 24 2b 22 27 22 3a |le '"+na|me$+"'":|
|00003de0| 73 24 3d 22 46 69 6c 65 | 22 0a 20 20 57 48 45 4e |s$="File|". WHEN|
|00003df0| 20 32 3a 69 24 3d 22 44 | 69 72 2e 20 27 22 2b 6e | 2:i$="D|ir. '"+n|
|00003e00| 61 6d 65 24 2b 22 27 22 | 3a 73 24 3d 22 44 69 72 |ame$+"'"|:s$="Dir|
|00003e10| 65 63 74 6f 72 79 22 0a | 20 20 57 48 45 4e 20 33 |ectory".| WHEN 3|
|00003e20| 3a 69 24 3d 22 53 65 6c | 65 63 74 69 6f 6e 22 3a |:i$="Sel|ection":|
|00003e30| 73 24 3d 69 24 0a 45 4e | 44 43 41 53 45 0a 20 20 |s$=i$.EN|DCASE. |
|00003e40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003e50| 20 0a 52 45 4d 20 66 61 | 64 65 20 74 68 65 20 69 | .REM fa|de the i|
|00003e60| 74 65 6d 20 69 66 20 6e | 6f 74 68 69 6e 67 20 69 |tem if n|othing i|
|00003e70| 73 20 73 65 6c 65 63 74 | 65 64 0a 53 59 53 20 22 |s select|ed.SYS "|
|00003e80| 4d 65 6e 75 55 74 69 6c | 5f 46 61 64 65 22 2c 6f |MenuUtil|_Fade",o|
|00003e90| 62 6a 65 63 74 49 74 65 | 6d 25 2c 74 79 70 65 25 |bjectIte|m%,type%|
|00003ea0| 3d 30 20 20 20 20 20 20 | 20 20 20 20 20 0a 0a 52 |=0 | ..R|
|00003eb0| 45 4d 20 73 65 74 20 6e | 65 77 20 69 74 65 6d 20 |EM set n|ew item |
|00003ec0| 74 65 78 74 0a 53 59 53 | 20 22 4d 65 6e 75 55 74 |text.SYS| "MenuUt|
|00003ed0| 69 6c 5f 54 65 78 74 22 | 2c 2c 69 24 0a 20 20 20 |il_Text"|,,i$. |
|00003ee0| 20 20 20 20 20 20 20 20 | 0a 52 45 4d 20 73 65 74 | |.REM set|
|00003ef0| 20 6e 65 77 20 73 75 62 | 6d 65 6e 75 20 74 69 74 | new sub|menu tit|
|00003f00| 6c 65 0a 53 59 53 20 22 | 4d 65 6e 75 55 74 69 6c |le.SYS "|MenuUtil|
|00003f10| 5f 54 65 78 74 22 2c 74 | 6f 6f 6c 73 4d 65 6e 75 |_Text",t|oolsMenu|
|00003f20| 25 2c 73 24 44 41 54 41 | 28 04 00 00 4d 65 6e 75 |%,s$DATA|(...Menu|
|00003f30| 55 74 69 6c 5f 54 69 63 | 6b 20 28 53 57 49 20 26 |Util_Tic|k (SWI &|
|00003f40| 34 35 42 43 39 29 0a 23 | 50 61 72 65 6e 74 20 4d |45BC9).#|Parent M|
|00003f50| 65 6e 75 55 74 69 6c 73 | 3a 21 52 6f 6f 74 20 20 |enuUtils|:!Root |
|00003f60| 20 20 20 20 20 20 20 20 | 20 0a 54 68 69 73 20 63 | | .This c|
|00003f70| 61 6c 6c 20 6d 61 79 20 | 62 65 20 75 73 65 64 20 |all may |be used |
|00003f80| 74 6f 20 6d 6f 64 69 66 | 79 20 74 68 65 20 73 74 |to modif|y the st|
|00003f90| 61 74 65 20 6f 66 20 6d | 65 6e 75 20 66 6c 61 67 |ate of m|enu flag|
|00003fa0| 20 77 68 69 63 68 20 63 | 6f 6e 74 72 6f 6c 73 0a | which c|ontrols.|
|00003fb0| 74 68 65 20 74 69 63 6b | 20 64 69 73 70 6c 61 79 |the tick| display|
|00003fc0| 65 64 20 6f 6e 20 74 68 | 65 20 6c 65 66 74 20 6f |ed on th|e left o|
|00003fd0| 66 20 74 68 65 20 6d 65 | 6e 75 20 69 74 65 6d 2e |f the me|nu item.|
|00003fe0| 20 0a 0a 20 45 6e 74 72 | 79 3a 0a 20 20 20 20 20 | .. Entr|y:. |
|00003ff0| 52 30 20 68 61 6e 64 6c | 65 20 6f 66 20 6d 65 6e |R0 handl|e of men|
|00004000| 75 20 69 74 65 6d 20 6f | 72 20 7a 65 72 6f 20 66 |u item o|r zero f|
|00004010| 6f 72 20 63 75 72 72 65 | 6e 74 20 6d 65 6e 75 20 |or curre|nt menu |
|00004020| 69 74 65 6d 20 6f 72 20 | 68 61 6e 64 6c 65 20 6f |item or |handle o|
|00004030| 66 20 6d 65 6e 75 0a 20 | 20 20 20 20 52 31 20 64 |f menu. | R1 d|
|00004040| 65 66 69 6e 65 73 20 61 | 63 74 69 6f 6e 0a 20 20 |efines a|ction. |
|00004050| 20 20 20 20 20 20 69 66 | 20 52 31 20 3d 30 20 74 | if| R1 =0 t|
|00004060| 68 65 6e 20 63 6c 65 61 | 72 20 74 69 63 6b 20 66 |hen clea|r tick f|
|00004070| 6c 61 67 20 0a 20 20 20 | 20 20 20 20 20 69 66 20 |lag . | if |
|00004080| 52 31 20 3c 3e 30 20 74 | 68 65 6e 20 73 65 74 20 |R1 <>0 t|hen set |
|00004090| 74 69 63 6b 20 66 6c 61 | 67 20 20 0a 20 45 78 69 |tick fla|g . Exi|
|000040a0| 74 3a 0a 20 20 20 20 52 | 30 2c 52 31 20 70 72 65 |t:. R|0,R1 pre|
|000040b0| 73 65 72 76 65 64 0a 20 | 20 20 20 20 20 20 20 20 |served. | |
|000040c0| 20 20 20 0a 52 30 20 6d | 75 73 74 20 63 6f 6e 74 | .R0 m|ust cont|
|000040d0| 61 69 6e 20 74 68 65 20 | 69 74 65 6d 20 68 61 6e |ain the |item han|
|000040e0| 64 6c 65 20 6f 72 20 7a | 65 72 6f 20 66 6f 72 20 |dle or z|ero for |
|000040f0| 74 68 65 20 63 75 72 72 | 65 6e 74 20 6d 65 6e 75 |the curr|ent menu|
|00004100| 20 69 74 65 6d 2e 20 52 | 31 0a 64 65 66 69 6e 65 | item. R|1.define|
|00004110| 73 20 74 6f 20 73 65 74 | 20 6f 72 20 74 6f 20 63 |s to set| or to c|
|00004120| 6c 65 61 72 20 74 68 65 | 20 66 6c 61 67 2e 20 49 |lear the| flag. I|
|00004130| 66 20 52 31 20 69 73 20 | 7a 65 72 6f 20 74 68 65 |f R1 is |zero the|
|00004140| 6e 20 74 68 65 20 66 6c | 61 67 20 77 69 6c 6c 0a |n the fl|ag will.|
|00004150| 62 65 20 63 6c 65 61 72 | 65 64 20 61 6e 64 20 69 |be clear|ed and i|
|00004160| 66 20 52 31 20 69 73 20 | 6e 6f 6e 20 7a 65 72 6f |f R1 is |non zero|
|00004170| 20 74 68 65 6e 20 74 68 | 65 20 66 6c 61 67 20 77 | then th|e flag w|
|00004180| 69 6c 6c 20 62 65 20 73 | 65 74 2e 0a 0a 49 66 20 |ill be s|et...If |
|00004190| 52 30 20 69 6e 73 74 65 | 61 64 20 6f 66 20 69 74 |R0 inste|ad of it|
|000041a0| 65 6d 20 68 61 6e 64 6c | 65 20 63 6f 6e 74 61 69 |em handl|e contai|
|000041b0| 6e 73 20 6d 65 6e 75 20 | 68 61 6e 64 6c 65 20 74 |ns menu |handle t|
|000041c0| 68 65 6e 20 74 68 65 20 | 73 74 61 74 65 20 6f 66 |hen the |state of|
|000041d0| 0a 74 68 65 20 66 6c 61 | 67 20 77 69 6c 6c 20 62 |.the fla|g will b|
|000041e0| 65 20 63 68 61 6e 67 65 | 64 20 69 6e 20 61 6c 6c |e change|d in all|
|000041f0| 20 69 74 65 6d 73 20 6f | 66 20 74 68 69 73 20 6d | items o|f this m|
|00004200| 65 6e 75 2e 0a 0a 49 74 | 20 69 73 20 63 6f 6e 76 |enu...It| is conv|
|00004210| 65 6e 69 65 6e 74 20 74 | 6f 20 70 61 73 73 20 69 |enient t|o pass i|
|00004220| 6e 20 52 31 20 74 68 65 | 20 72 65 73 75 6c 74 20 |n R1 the| result |
|00004230| 6f 66 20 6c 6f 67 69 63 | 61 6c 20 65 78 70 72 65 |of logic|al expre|
|00004240| 73 73 69 6f 6e 20 28 74 | 6f 0a 73 65 74 20 66 6c |ssion (t|o.set fl|
|00004250| 61 67 20 69 66 20 72 65 | 73 75 6c 74 20 69 73 20 |ag if re|sult is |
|00004260| 54 52 55 45 20 61 6e 64 | 20 74 6f 20 63 6c 65 61 |TRUE and| to clea|
|00004270| 72 20 69 74 20 69 66 20 | 46 41 4c 53 45 29 2e 0a |r it if |FALSE)..|
|00004280| 0a 20 45 78 61 6d 70 6c | 65 20 63 6f 64 65 3a 0a |. Exampl|e code:.|
|00004290| 20 54 69 63 6b 20 6f 6e | 65 20 6f 66 20 74 68 65 | Tick on|e of the|
|000042a0| 20 69 74 65 6d 73 20 64 | 65 70 65 6e 64 69 6e 67 | items d|epending|
|000042b0| 20 6f 6e 20 74 68 65 20 | 76 61 6c 75 65 20 6f 66 | on the |value of|
|000042c0| 20 76 61 72 69 61 62 6c | 65 20 64 69 73 70 25 3a | variabl|e disp%:|
|000042d0| 0a 20 53 59 53 20 22 4d | 65 6e 75 55 74 69 6c 5f |. SYS "M|enuUtil_|
|000042e0| 54 69 63 6b 22 2c 6c 61 | 72 67 65 49 74 65 6d 25 |Tick",la|rgeItem%|
|000042f0| 2c 28 64 69 73 70 25 3d | 31 29 0a 20 53 59 53 20 |,(disp%=|1). SYS |
|00004300| 22 4d 65 6e 75 55 74 69 | 6c 5f 54 69 63 6b 22 2c |"MenuUti|l_Tick",|
|00004310| 73 6d 61 6c 6c 49 74 65 | 6d 2c 28 64 69 73 70 25 |smallIte|m,(disp%|
|00004320| 3d 32 29 0a 20 53 59 53 | 20 22 4d 65 6e 75 55 74 |=2). SYS| "MenuUt|
|00004330| 69 6c 5f 54 69 63 6b 22 | 2c 66 75 6c 6c 49 74 65 |il_Tick"|,fullIte|
|00004340| 6d 25 2c 28 64 69 73 70 | 25 3d 33 29 44 41 54 41 |m%,(disp|%=3)DATA|
|00004350| b9 03 00 00 4d 65 6e 75 | 55 74 69 6c 5f 44 6f 74 |....Menu|Util_Dot|
|00004360| 73 20 28 53 57 49 20 20 | 26 34 35 42 43 41 29 0a |s (SWI |&45BCA).|
|00004370| 23 50 61 72 65 6e 74 20 | 43 68 61 72 74 65 72 3a |#Parent |Charter:|
|00004380| 43 6c 61 73 73 4d 65 6e | 75 20 20 20 20 20 20 20 |ClassMen|u |
|00004390| 20 20 20 20 0a 54 68 69 | 73 20 63 61 6c 6c 20 6d | .Thi|s call m|
|000043a0| 61 79 20 62 65 20 75 73 | 65 64 20 74 6f 20 6d 6f |ay be us|ed to mo|
|000043b0| 64 69 66 79 20 74 68 65 | 20 73 74 61 74 65 20 6f |dify the| state o|
|000043c0| 66 20 6d 65 6e 75 20 66 | 6c 61 67 20 77 68 69 63 |f menu f|lag whic|
|000043d0| 68 20 63 6f 6e 74 72 6f | 6c 73 0a 74 68 65 20 64 |h contro|ls.the d|
|000043e0| 6f 74 74 65 64 20 6c 69 | 6e 65 20 64 69 73 70 6c |otted li|ne displ|
|000043f0| 61 79 65 64 20 62 65 6c | 6c 6f 77 20 74 68 65 20 |ayed bel|low the |
|00004400| 6d 65 6e 75 20 69 74 65 | 6d 2e 20 0a 0a 20 45 6e |menu ite|m. .. En|
|00004410| 74 72 79 3a 0a 20 20 20 | 20 20 52 30 20 68 61 6e |try:. | R0 han|
|00004420| 64 6c 65 20 6f 66 20 6d | 65 6e 75 20 69 74 65 6d |dle of m|enu item|
|00004430| 20 6f 72 20 7a 65 72 6f | 20 66 6f 72 20 63 75 72 | or zero| for cur|
|00004440| 72 65 6e 74 20 6d 65 6e | 75 20 69 74 65 6d 20 6f |rent men|u item o|
|00004450| 72 20 68 61 6e 64 6c 65 | 20 6f 66 20 6d 65 6e 75 |r handle| of menu|
|00004460| 0a 20 20 20 20 20 52 31 | 20 64 65 66 69 6e 65 73 |. R1| defines|
|00004470| 20 61 63 74 69 6f 6e 0a | 20 20 20 20 20 20 20 20 | action.| |
|00004480| 69 66 20 52 31 20 3d 30 | 20 74 68 65 6e 20 63 6c |if R1 =0| then cl|
|00004490| 65 61 72 20 64 6f 74 73 | 20 66 6c 61 67 20 0a 20 |ear dots| flag . |
|000044a0| 20 20 20 20 20 20 20 69 | 66 20 52 31 20 3c 3e 30 | i|f R1 <>0|
|000044b0| 20 74 68 65 6e 20 73 65 | 74 20 64 6f 74 73 20 66 | then se|t dots f|
|000044c0| 6c 61 67 20 20 0a 20 45 | 78 69 74 3a 0a 20 20 20 |lag . E|xit:. |
|000044d0| 20 52 30 2c 52 31 20 70 | 72 65 73 65 72 76 65 64 | R0,R1 p|reserved|
|000044e0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 0a 52 30 |. | .R0|
|000044f0| 20 6d 75 73 74 20 63 6f | 6e 74 61 69 6e 20 74 68 | must co|ntain th|
|00004500| 65 20 69 74 65 6d 20 68 | 61 6e 64 6c 65 20 6f 72 |e item h|andle or|
|00004510| 20 7a 65 72 6f 20 66 6f | 72 20 74 68 65 20 63 75 | zero fo|r the cu|
|00004520| 72 72 65 6e 74 20 6d 65 | 6e 75 20 69 74 65 6d 2e |rrent me|nu item.|
|00004530| 20 52 31 0a 64 65 66 69 | 6e 65 73 20 74 6f 20 73 | R1.defi|nes to s|
|00004540| 65 74 20 6f 72 20 74 6f | 20 63 6c 65 61 72 20 74 |et or to| clear t|
|00004550| 68 65 20 66 6c 61 67 2e | 20 49 66 20 52 31 20 69 |he flag.| If R1 i|
|00004560| 73 20 7a 65 72 6f 20 74 | 68 65 6e 20 74 68 65 20 |s zero t|hen the |
|00004570| 66 6c 61 67 20 77 69 6c | 6c 0a 62 65 20 63 6c 65 |flag wil|l.be cle|
|00004580| 61 72 65 64 20 61 6e 64 | 20 69 66 20 52 31 20 69 |ared and| if R1 i|
|00004590| 73 20 6e 6f 6e 20 7a 65 | 72 6f 20 74 68 65 6e 20 |s non ze|ro then |
|000045a0| 74 68 65 20 66 6c 61 67 | 20 77 69 6c 6c 20 62 65 |the flag| will be|
|000045b0| 20 73 65 74 2e 0a 0a 49 | 66 20 52 30 20 69 6e 73 | set...I|f R0 ins|
|000045c0| 74 65 61 64 20 6f 66 20 | 69 74 65 6d 20 68 61 6e |tead of |item han|
|000045d0| 64 6c 65 20 63 6f 6e 74 | 61 69 6e 73 20 6d 65 6e |dle cont|ains men|
|000045e0| 75 20 68 61 6e 64 6c 65 | 20 74 68 65 6e 20 74 68 |u handle| then th|
|000045f0| 65 20 73 74 61 74 65 20 | 6f 66 0a 74 68 65 20 66 |e state |of.the f|
|00004600| 6c 61 67 20 77 69 6c 6c | 20 62 65 20 63 68 61 6e |lag will| be chan|
|00004610| 67 65 64 20 69 6e 20 61 | 6c 6c 20 69 74 65 6d 73 |ged in a|ll items|
|00004620| 20 6f 66 20 74 68 69 73 | 20 6d 65 6e 75 2e 0a 0a | of this| menu...|
|00004630| 49 74 20 69 73 20 63 6f | 6e 76 65 6e 69 65 6e 74 |It is co|nvenient|
|00004640| 20 74 6f 20 70 61 73 73 | 20 69 6e 20 52 31 20 74 | to pass| in R1 t|
|00004650| 68 65 20 72 65 73 75 6c | 74 20 6f 66 20 6c 6f 67 |he resul|t of log|
|00004660| 69 63 61 6c 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |ical exp|ression |
|00004670| 28 74 6f 0a 73 65 74 20 | 66 6c 61 67 20 69 66 20 |(to.set |flag if |
|00004680| 72 65 73 75 6c 74 20 69 | 73 20 54 52 55 45 20 61 |result i|s TRUE a|
|00004690| 6e 64 20 74 6f 20 63 6c | 65 61 72 20 69 74 20 69 |nd to cl|ear it i|
|000046a0| 66 20 46 41 4c 53 45 29 | 2e 0a 0a 20 45 78 61 6d |f FALSE)|... Exam|
|000046b0| 70 6c 65 20 63 6f 64 65 | 3a 0a 20 44 69 73 70 6c |ple code|:. Displ|
|000046c0| 61 79 20 64 6f 74 74 65 | 64 20 6c 69 6e 65 20 61 |ay dotte|d line a|
|000046d0| 66 74 65 72 20 74 68 65 | 20 63 75 72 72 65 6e 74 |fter the| current|
|000046e0| 20 6d 65 6e 75 20 69 74 | 65 6d 0a 20 53 59 53 20 | menu it|em. SYS |
|000046f0| 22 4d 65 6e 75 55 74 69 | 6c 5f 44 6f 74 73 22 2c |"MenuUti|l_Dots",|
|00004700| 2c 54 52 55 45 00 00 00 | 44 41 54 41 0d 04 00 00 |,TRUE...|DATA....|
|00004710| 4d 65 6e 75 55 74 69 6c | 5f 46 61 64 65 20 28 26 |MenuUtil|_Fade (&|
|00004720| 34 35 42 43 42 29 0a 23 | 50 61 72 65 6e 74 20 43 |45BCB).#|Parent C|
|00004730| 68 61 72 74 65 72 3a 43 | 6c 61 73 73 4d 65 6e 75 |harter:C|lassMenu|
|00004740| 20 20 20 20 20 20 20 20 | 20 20 20 0a 54 68 69 73 | | .This|
|00004750| 20 63 61 6c 6c 20 63 61 | 6e 20 62 65 20 75 73 65 | call ca|n be use|
|00004760| 64 20 74 6f 20 6d 61 6b | 65 20 6d 65 6e 75 20 69 |d to mak|e menu i|
|00004770| 74 65 6d 20 6e 6f 6e 2d | 70 69 63 6b 61 62 6c 65 |tem non-|pickable|
|00004780| 20 0a 0a 20 45 6e 74 72 | 79 3a 0a 20 20 20 20 20 | .. Entr|y:. |
|00004790| 52 30 20 68 61 6e 64 6c | 65 20 6f 66 20 6d 65 6e |R0 handl|e of men|
|000047a0| 75 20 69 74 65 6d 20 6f | 72 20 7a 65 72 6f 20 66 |u item o|r zero f|
|000047b0| 6f 72 20 63 75 72 72 65 | 6e 74 20 6d 65 6e 75 20 |or curre|nt menu |
|000047c0| 69 74 65 6d 20 6f 72 20 | 68 61 6e 64 6c 65 20 6f |item or |handle o|
|000047d0| 66 20 6d 65 6e 75 0a 20 | 20 20 20 20 52 31 20 64 |f menu. | R1 d|
|000047e0| 65 66 69 6e 65 73 20 61 | 63 74 69 6f 6e 0a 20 20 |efines a|ction. |
|000047f0| 20 20 20 20 20 20 69 66 | 20 52 31 20 3d 30 20 63 | if| R1 =0 c|
|00004800| 6c 65 61 72 20 73 68 61 | 64 65 64 20 6d 65 6e 75 |lear sha|ded menu|
|00004810| 20 66 6c 61 67 0a 20 20 | 20 20 20 20 20 20 69 66 | flag. | if|
|00004820| 20 52 31 20 3c 3e 30 20 | 66 61 64 65 20 74 68 69 | R1 <>0 |fade thi|
|00004830| 73 20 6d 65 6e 75 20 69 | 74 65 6d 20 28 69 65 2e |s menu i|tem (ie.|
|00004840| 20 75 6e 70 69 63 6b 61 | 62 6c 65 29 20 0a 20 45 | unpicka|ble) . E|
|00004850| 78 69 74 3a 0a 20 20 20 | 20 52 30 2c 52 31 20 70 |xit:. | R0,R1 p|
|00004860| 72 65 73 65 72 76 65 64 | 0a 20 20 20 20 20 20 20 |reserved|. |
|00004870| 20 20 20 20 20 0a 52 30 | 20 6d 75 73 74 20 63 6f | .R0| must co|
|00004880| 6e 74 61 69 6e 20 74 68 | 65 20 69 74 65 6d 20 68 |ntain th|e item h|
|00004890| 61 6e 64 6c 65 20 6f 72 | 20 7a 65 72 6f 20 66 6f |andle or| zero fo|
|000048a0| 72 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 6d 65 |r the cu|rrent me|
|000048b0| 6e 75 20 69 74 65 6d 2e | 20 52 31 0a 64 65 66 69 |nu item.| R1.defi|
|000048c0| 6e 65 73 20 74 6f 20 73 | 65 74 20 6f 72 20 74 6f |nes to s|et or to|
|000048d0| 20 63 6c 65 61 72 20 74 | 68 65 20 66 6c 61 67 20 | clear t|he flag |
|000048e0| 77 68 69 63 68 20 6d 61 | 6b 65 73 20 6d 65 6e 75 |which ma|kes menu|
|000048f0| 20 69 74 65 6d 20 75 6e | 70 69 63 6b 61 62 6c 65 | item un|pickable|
|00004900| 2e 20 49 66 20 52 31 0a | 69 73 20 7a 65 72 6f 20 |. If R1.|is zero |
|00004910| 74 68 65 6e 20 74 68 65 | 20 66 6c 61 67 20 77 69 |then the| flag wi|
|00004920| 6c 6c 20 62 65 20 63 6c | 65 61 72 65 64 20 61 6e |ll be cl|eared an|
|00004930| 64 20 69 66 20 52 31 20 | 69 73 20 6e 6f 6e 20 7a |d if R1 |is non z|
|00004940| 65 72 6f 20 74 68 65 6e | 20 74 68 65 20 66 6c 61 |ero then| the fla|
|00004950| 67 0a 77 69 6c 6c 20 62 | 65 20 73 65 74 20 61 6e |g.will b|e set an|
|00004960| 64 20 74 68 65 20 69 74 | 65 6d 20 77 69 6c 6c 20 |d the it|em will |
|00004970| 62 65 20 73 68 61 64 65 | 64 2e 0a 0a 49 66 20 52 |be shade|d...If R|
|00004980| 30 20 69 6e 73 74 65 61 | 64 20 6f 66 20 69 74 65 |0 instea|d of ite|
|00004990| 6d 20 68 61 6e 64 6c 65 | 20 63 6f 6e 74 61 69 6e |m handle| contain|
|000049a0| 73 20 6d 65 6e 75 20 68 | 61 6e 64 6c 65 20 74 68 |s menu h|andle th|
|000049b0| 65 6e 20 74 68 65 20 73 | 74 61 74 65 20 6f 66 0a |en the s|tate of.|
|000049c0| 74 68 65 20 66 6c 61 67 | 20 77 69 6c 6c 20 62 65 |the flag| will be|
|000049d0| 20 63 68 61 6e 67 65 64 | 20 69 6e 20 61 6c 6c 20 | changed| in all |
|000049e0| 69 74 65 6d 73 20 6f 66 | 20 74 68 69 73 20 6d 65 |items of| this me|
|000049f0| 6e 75 2e 0a 0a 49 74 20 | 69 73 20 63 6f 6e 76 65 |nu...It |is conve|
|00004a00| 6e 69 65 6e 74 20 74 6f | 20 70 61 73 73 20 69 6e |nient to| pass in|
|00004a10| 20 52 31 20 74 68 65 20 | 72 65 73 75 6c 74 20 6f | R1 the |result o|
|00004a20| 66 20 6c 6f 67 69 63 61 | 6c 20 65 78 70 72 65 73 |f logica|l expres|
|00004a30| 73 69 6f 6e 20 28 74 6f | 0a 73 65 74 20 66 6c 61 |sion (to|.set fla|
|00004a40| 67 20 69 66 20 72 65 73 | 75 6c 74 20 69 73 20 54 |g if res|ult is T|
|00004a50| 52 55 45 20 61 6e 64 20 | 74 6f 20 63 6c 65 61 72 |RUE and |to clear|
|00004a60| 20 69 74 20 69 66 20 46 | 41 4c 53 45 29 2e 0a 0a | it if F|ALSE)...|
|00004a70| 20 45 78 61 6d 70 6c 65 | 20 63 6f 64 65 3a 0a 20 | Example| code:. |
|00004a80| 46 61 64 65 20 63 75 72 | 72 65 6e 74 20 6d 65 6e |Fade cur|rent men|
|00004a90| 75 20 69 74 65 6d 3a 0a | 20 53 59 53 20 22 4d 65 |u item:.| SYS "Me|
|00004aa0| 6e 75 55 74 69 6c 5f 46 | 61 64 65 22 2c 2c 54 52 |nuUtil_F|ade",,TR|
|00004ab0| 55 45 0a 20 0a 20 46 61 | 64 65 20 61 6c 6c 20 69 |UE. . Fa|de all i|
|00004ac0| 74 65 6d 73 20 69 6e 20 | 22 53 65 6c 65 63 74 22 |tems in |"Select"|
|00004ad0| 20 73 75 62 6d 65 6e 75 | 20 77 69 74 68 20 68 61 | submenu| with ha|
|00004ae0| 6e 64 6c 65 20 73 65 6c | 63 74 4d 65 6e 75 25 0a |ndle sel|ctMenu%.|
|00004af0| 20 53 59 53 20 22 4d 65 | 6e 75 55 74 69 6c 5f 46 | SYS "Me|nuUtil_F|
|00004b00| 61 64 65 22 2c 73 65 6c | 65 63 74 4d 65 6e 75 25 |ade",sel|ectMenu%|
|00004b10| 2c 54 52 55 45 00 00 00 | 44 41 54 41 55 04 00 00 |,TRUE...|DATAU...|
|00004b20| 4d 65 6e 75 55 74 69 6c | 5f 57 61 72 6e 69 6e 67 |MenuUtil|_Warning|
|00004b30| 20 28 53 57 49 20 26 34 | 35 42 43 43 29 0a 23 50 | (SWI &4|5BCC).#P|
|00004b40| 61 72 65 6e 74 20 4d 65 | 6e 75 55 74 69 6c 73 3a |arent Me|nuUtils:|
|00004b50| 21 52 6f 6f 74 20 20 20 | 20 20 20 20 20 20 20 20 |!Root | |
|00004b60| 0a 54 68 69 73 20 63 61 | 6c 6c 20 63 61 6e 20 62 |.This ca|ll can b|
|00004b70| 65 20 75 73 65 64 20 74 | 6f 20 6d 61 6b 65 20 6d |e used t|o make m|
|00004b80| 65 6e 75 20 69 74 65 6d | 20 67 65 6e 65 72 61 74 |enu item| generat|
|00004b90| 65 20 61 20 6d 65 73 73 | 61 67 65 20 77 68 65 6e |e a mess|age when|
|00004ba0| 20 6d 6f 76 69 6e 67 20 | 74 6f 0a 74 68 65 20 73 | moving |to.the s|
|00004bb0| 75 62 6d 65 6e 75 20 0a | 0a 20 45 6e 74 72 79 3a |ubmenu .|. Entry:|
|00004bc0| 0a 20 20 20 20 20 52 30 | 20 68 61 6e 64 6c 65 20 |. R0| handle |
|00004bd0| 6f 66 20 6d 65 6e 75 20 | 69 74 65 6d 20 6f 72 20 |of menu |item or |
|00004be0| 7a 65 72 6f 20 66 6f 72 | 20 63 75 72 72 65 6e 74 |zero for| current|
|00004bf0| 20 6d 65 6e 75 20 69 74 | 65 6d 20 6f 72 20 68 61 | menu it|em or ha|
|00004c00| 6e 64 6c 65 20 6f 66 20 | 6d 65 6e 75 0a 20 20 20 |ndle of |menu. |
|00004c10| 20 20 52 31 20 64 65 66 | 69 6e 65 73 20 61 63 74 | R1 def|ines act|
|00004c20| 69 6f 6e 0a 20 20 20 20 | 20 20 20 20 69 66 20 52 |ion. | if R|
|00004c30| 31 20 3d 30 20 63 6c 65 | 61 72 20 6d 65 73 73 61 |1 =0 cle|ar messa|
|00004c40| 67 65 20 6d 65 6e 75 20 | 66 6c 61 67 0a 20 20 20 |ge menu |flag. |
|00004c50| 20 20 20 20 20 69 66 20 | 52 31 20 3c 3e 30 20 73 | if |R1 <>0 s|
|00004c60| 65 74 20 6d 65 73 73 61 | 67 65 20 66 6c 61 67 20 |et messa|ge flag |
|00004c70| 28 69 65 2e 20 6d 65 73 | 73 61 67 65 20 77 69 6c |(ie. mes|sage wil|
|00004c80| 6c 20 62 65 20 67 65 6e | 65 72 61 74 65 64 29 20 |l be gen|erated) |
|00004c90| 0a 20 45 78 69 74 3a 0a | 20 20 20 20 52 30 2c 52 |. Exit:.| R0,R|
|00004ca0| 31 20 70 72 65 73 65 72 | 76 65 64 0a 20 20 20 20 |1 preser|ved. |
|00004cb0| 20 20 20 20 20 20 20 20 | 0a 52 30 20 6d 75 73 74 | |.R0 must|
|00004cc0| 20 63 6f 6e 74 61 69 6e | 20 74 68 65 20 69 74 65 | contain| the ite|
|00004cd0| 6d 20 68 61 6e 64 6c 65 | 20 6f 72 20 7a 65 72 6f |m handle| or zero|
|00004ce0| 20 66 6f 72 20 74 68 65 | 20 63 75 72 72 65 6e 74 | for the| current|
|00004cf0| 20 6d 65 6e 75 20 69 74 | 65 6d 2e 20 52 31 0a 64 | menu it|em. R1.d|
|00004d00| 65 66 69 6e 65 73 20 74 | 6f 20 73 65 74 20 6f 72 |efines t|o set or|
|00004d10| 20 74 6f 20 63 6c 65 61 | 72 20 74 68 65 20 66 6c | to clea|r the fl|
|00004d20| 61 67 20 77 68 69 63 68 | 20 63 68 61 6e 67 65 73 |ag which| changes|
|00004d30| 20 73 75 62 6d 65 6e 75 | 20 62 65 68 61 76 69 6f | submenu| behavio|
|00004d40| 75 72 2e 20 49 66 20 52 | 31 0a 69 73 20 6e 6f 74 |ur. If R|1.is not|
|00004d50| 20 7a 65 72 6f 2c 20 74 | 68 65 6e 20 6d 6f 76 69 | zero, t|hen movi|
|00004d60| 6e 67 20 6f 76 65 72 20 | 74 68 65 20 72 69 67 68 |ng over |the righ|
|00004d70| 74 20 61 72 72 6f 77 20 | 77 69 6c 6c 20 63 61 75 |t arrow |will cau|
|00004d80| 73 65 20 61 20 4d 65 6e | 75 57 61 72 6e 69 6e 67 |se a Men|uWarning|
|00004d90| 0a 6d 65 73 73 61 67 65 | 20 28 26 34 30 30 43 30 |.message| (&400C0|
|00004da0| 29 20 74 6f 20 62 65 20 | 67 65 6e 65 72 61 74 65 |) to be |generate|
|00004db0| 64 2e 20 54 68 65 20 61 | 70 70 6c 69 63 61 74 69 |d. The a|pplicati|
|00004dc0| 6f 6e 20 63 61 6e 20 72 | 65 73 70 6f 6e 64 20 62 |on can r|espond b|
|00004dd0| 79 20 63 61 6c 6c 69 6e | 67 0a 4d 65 6e 75 55 74 |y callin|g.MenuUt|
|00004de0| 69 6c 5f 53 68 6f 77 53 | 75 62 4d 65 6e 75 20 74 |il_ShowS|ubMenu t|
|00004df0| 6f 20 64 69 73 70 6c 61 | 79 20 61 70 70 72 6f 70 |o displa|y approp|
|00004e00| 72 69 61 74 65 20 6f 62 | 6a 65 63 74 2e 0a 0a 49 |riate ob|ject...I|
|00004e10| 66 20 52 30 20 69 6e 73 | 74 65 61 64 20 6f 66 20 |f R0 ins|tead of |
|00004e20| 69 74 65 6d 20 68 61 6e | 64 6c 65 20 63 6f 6e 74 |item han|dle cont|
|00004e30| 61 69 6e 73 20 6d 65 6e | 75 20 68 61 6e 64 6c 65 |ains men|u handle|
|00004e40| 20 74 68 65 6e 20 74 68 | 65 20 73 74 61 74 65 20 | then th|e state |
|00004e50| 6f 66 0a 74 68 65 20 66 | 6c 61 67 20 77 69 6c 6c |of.the f|lag will|
|00004e60| 20 62 65 20 63 68 61 6e | 67 65 64 20 69 6e 20 61 | be chan|ged in a|
|00004e70| 6c 6c 20 69 74 65 6d 73 | 20 6f 66 20 74 68 69 73 |ll items| of this|
|00004e80| 20 6d 65 6e 75 2e 0a 0a | 49 74 20 69 73 20 63 6f | menu...|It is co|
|00004e90| 6e 76 65 6e 69 65 6e 74 | 20 74 6f 20 70 61 73 73 |nvenient| to pass|
|00004ea0| 20 69 6e 20 52 31 20 74 | 68 65 20 72 65 73 75 6c | in R1 t|he resul|
|00004eb0| 74 20 6f 66 20 6c 6f 67 | 69 63 61 6c 20 65 78 70 |t of log|ical exp|
|00004ec0| 72 65 73 73 69 6f 6e 20 | 28 74 6f 0a 73 65 74 20 |ression |(to.set |
|00004ed0| 66 6c 61 67 20 69 66 20 | 72 65 73 75 6c 74 20 69 |flag if |result i|
|00004ee0| 73 20 54 52 55 45 20 61 | 6e 64 20 74 6f 20 63 6c |s TRUE a|nd to cl|
|00004ef0| 65 61 72 20 69 74 20 69 | 66 20 46 41 4c 53 45 29 |ear it i|f FALSE)|
|00004f00| 2e 0a 0a 20 45 78 61 6d | 70 6c 65 20 63 6f 64 65 |... Exam|ple code|
|00004f10| 3a 0a 20 47 65 6e 65 72 | 61 74 65 20 6d 65 73 73 |:. Gener|ate mess|
|00004f20| 61 67 65 20 77 68 65 6e | 20 6d 6f 76 69 6e 67 20 |age when| moving |
|00004f30| 74 6f 20 74 68 65 20 66 | 6f 6e 74 73 20 73 75 62 |to the f|onts sub|
|00004f40| 6d 65 6e 75 3a 0a 20 53 | 59 53 20 22 4d 65 6e 75 |menu:. S|YS "Menu|
|00004f50| 55 74 69 6c 5f 57 61 72 | 6e 69 6e 67 22 2c 66 6f |Util_War|ning",fo|
|00004f60| 6e 74 73 49 74 65 6d 25 | 2c 54 52 55 45 00 00 00 |ntsItem%|,TRUE...|
|00004f70| 44 41 54 41 4a 05 00 00 | 4d 65 6e 75 55 74 69 6c |DATAJ...|MenuUtil|
|00004f80| 5f 57 72 69 74 61 62 6c | 65 20 28 53 57 49 20 26 |_Writabl|e (SWI &|
|00004f90| 34 35 42 43 44 29 0a 23 | 50 61 72 65 6e 74 20 4d |45BCD).#|Parent M|
|00004fa0| 65 6e 75 55 74 69 6c 73 | 3a 21 52 6f 6f 74 0a 20 |enuUtils|:!Root. |
|00004fb0| 4d 61 6b 65 73 20 6d 65 | 6e 75 20 69 74 65 6d 20 |Makes me|nu item |
|00004fc0| 77 72 69 74 61 62 6c 65 | 2e 0a 0a 20 45 6e 74 72 |writable|... Entr|
|00004fd0| 79 3a 0a 20 20 20 20 20 | 52 30 20 3d 20 68 61 6e |y:. |R0 = han|
|00004fe0| 64 6c 65 20 6f 66 20 6d | 65 6e 75 20 69 74 65 6d |dle of m|enu item|
|00004ff0| 20 6f 72 20 7a 65 72 6f | 20 66 6f 72 20 63 75 72 | or zero| for cur|
|00005000| 72 65 6e 74 20 69 74 65 | 6d 20 6f 72 20 68 61 6e |rent ite|m or han|
|00005010| 64 6c 65 20 6f 66 20 74 | 68 65 20 6d 65 6e 75 0a |dle of t|he menu.|
|00005020| 20 20 20 20 20 52 31 20 | 3c 3e 30 20 61 6e 64 0a | R1 |<>0 and.|
|00005030| 20 20 20 20 20 52 32 20 | 3d 20 62 75 66 66 65 72 | R2 |= buffer|
|00005040| 20 73 69 7a 65 0a 20 20 | 20 20 20 52 33 20 2d 3e | size. | R3 ->|
|00005050| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 76 61 6c 69 | pointer| to vali|
|00005060| 64 61 74 69 6f 6e 20 73 | 74 72 69 6e 67 2c 20 6f |dation s|tring, o|
|00005070| 72 0a 0a 20 20 20 20 20 | 52 31 20 3d 30 20 6d 61 |r.. |R1 =0 ma|
|00005080| 6b 65 73 20 69 74 65 6d | 20 6e 6f 74 20 77 72 69 |kes item| not wri|
|00005090| 74 61 62 6c 65 0a 45 78 | 69 74 3a 0a 20 20 20 20 |table.Ex|it:. |
|000050a0| 20 52 30 2d 52 33 20 70 | 72 65 73 65 72 76 65 64 | R0-R3 p|reserved|
|000050b0| 0a 0a 49 66 20 52 31 20 | 69 73 20 6e 6f 74 20 7a |..If R1 |is not z|
|000050c0| 65 72 6f 20 6f 6e 20 65 | 6e 74 72 79 20 74 68 65 |ero on e|ntry the|
|000050d0| 6e 20 74 68 69 73 20 63 | 61 6c 6c 20 77 69 6c 6c |n this c|all will|
|000050e0| 20 63 6f 6e 76 65 72 74 | 20 65 78 69 73 74 69 6e | convert| existin|
|000050f0| 67 20 6d 65 6e 75 20 69 | 74 65 6d 0a 69 6e 74 6f |g menu i|tem.into|
|00005100| 20 77 72 69 74 61 62 6c | 65 20 69 74 65 6d 2e 20 | writabl|e item. |
|00005110| 52 30 20 6d 75 73 74 20 | 63 6f 6e 74 61 69 6e 20 |R0 must |contain |
|00005120| 74 68 65 20 68 61 6e 64 | 6c 65 20 6f 66 20 74 68 |the hand|le of th|
|00005130| 65 20 6d 65 6e 75 20 69 | 74 65 6d 20 6f 72 20 7a |e menu i|tem or z|
|00005140| 65 72 6f 20 66 6f 72 0a | 63 75 72 72 65 6e 74 20 |ero for.|current |
|00005150| 69 74 65 6d 2e 20 49 66 | 20 52 30 20 63 6f 6e 74 |item. If| R0 cont|
|00005160| 61 69 6e 73 20 68 61 6e | 64 6c 65 20 6f 66 20 74 |ains han|dle of t|
|00005170| 68 65 20 6d 65 6e 75 20 | 74 68 65 6e 20 61 6c 6c |he menu |then all|
|00005180| 20 74 68 65 20 69 74 65 | 6d 73 20 69 6e 20 74 68 | the ite|ms in th|
|00005190| 69 73 0a 6d 65 6e 75 20 | 77 69 6c 6c 20 62 65 20 |is.menu |will be |
|000051a0| 63 6f 6e 76 65 72 74 65 | 64 2e 20 0a 0a 52 32 20 |converte|d. ..R2 |
|000051b0| 6f 6e 20 65 6e 74 72 79 | 20 63 6f 6e 74 61 69 6e |on entry| contain|
|000051c0| 73 20 74 68 65 20 6c 65 | 6e 67 74 68 20 6f 66 20 |s the le|ngth of |
|000051d0| 74 68 65 20 62 75 66 66 | 65 72 20 66 6f 72 20 74 |the buff|er for t|
|000051e0| 68 65 20 69 6e 70 75 74 | 20 73 74 72 69 6e 67 2e |he input| string.|
|000051f0| 0a 54 68 65 20 76 61 6c | 75 65 20 69 6e 20 52 32 |.The val|ue in R2|
|00005200| 20 6d 75 73 74 20 62 65 | 20 6e 6f 74 20 6c 65 73 | must be| not les|
|00005210| 73 20 74 68 65 6e 20 74 | 68 65 20 6c 65 6e 67 74 |s then t|he lengt|
|00005220| 68 20 6f 66 20 74 68 65 | 20 63 75 72 72 65 6e 74 |h of the| current|
|00005230| 20 69 74 65 6d 0a 74 65 | 78 74 2e 20 49 6e 20 74 | item.te|xt. In t|
|00005240| 68 65 20 6c 61 74 74 65 | 72 20 63 61 73 65 20 74 |he latte|r case t|
|00005250| 68 65 20 62 75 66 66 65 | 72 20 77 69 6c 6c 20 72 |he buffe|r will r|
|00005260| 65 6d 61 69 6e 20 75 6e | 63 68 61 6e 67 65 64 2e |emain un|changed.|
|00005270| 0a 0a 49 66 20 52 33 3c | 3e 30 20 6f 6e 20 65 6e |..If R3<|>0 on en|
|00005280| 74 72 79 20 74 68 65 6e | 20 69 74 20 70 6f 69 6e |try then| it poin|
|00005290| 74 73 20 74 6f 20 74 68 | 65 20 63 74 72 6c 2d 74 |ts to th|e ctrl-t|
|000052a0| 65 72 6d 69 6e 61 74 65 | 64 20 76 61 6c 69 64 61 |erminate|d valida|
|000052b0| 74 69 6f 6e 0a 73 74 72 | 69 6e 67 2e 20 54 68 65 |tion.str|ing. The|
|000052c0| 20 6d 6f 64 75 6c 65 20 | 6d 61 6b 65 73 20 69 74 | module |makes it|
|000052d0| 73 20 6f 77 6e 20 63 6f | 70 79 20 6f 66 20 74 68 |s own co|py of th|
|000052e0| 65 20 73 74 72 69 6e 67 | 2e 20 49 66 20 52 33 3d |e string|. If R3=|
|000052f0| 30 20 6f 6e 20 65 6e 74 | 72 79 0a 74 68 65 6e 20 |0 on ent|ry.then |
|00005300| 6e 6f 20 76 61 6c 69 64 | 61 74 69 6f 6e 20 73 74 |no valid|ation st|
|00005310| 72 69 6e 67 20 77 69 6c | 6c 20 62 65 20 75 73 65 |ring wil|l be use|
|00005320| 64 2e 0a 0a 49 66 20 52 | 31 20 69 73 20 7a 65 72 |d...If R|1 is zer|
|00005330| 6f 20 6f 6e 20 65 6e 74 | 72 79 20 74 68 65 6e 20 |o on ent|ry then |
|00005340| 74 68 65 20 69 74 65 6d | 20 77 69 6c 6c 20 62 65 |the item| will be|
|00005350| 20 63 6f 6e 76 65 72 74 | 65 64 20 62 61 63 6b 20 | convert|ed back |
|00005360| 69 6e 74 6f 20 6f 72 64 | 69 6e 61 72 79 0a 6d 65 |into ord|inary.me|
|00005370| 6e 75 20 69 74 65 6d 2e | 20 49 6e 20 74 68 69 73 |nu item.| In this|
|00005380| 20 63 61 73 65 20 63 6f | 6e 74 65 6e 74 73 20 6f | case co|ntents o|
|00005390| 66 20 72 65 67 69 73 74 | 65 72 73 20 52 32 20 61 |f regist|ers R2 a|
|000053a0| 6e 64 20 52 33 20 77 69 | 6c 6c 20 62 65 20 69 67 |nd R3 wi|ll be ig|
|000053b0| 6e 6f 72 65 64 2e 0a 0a | 20 45 78 61 6d 70 6c 65 |nored...| Example|
|000053c0| 20 63 6f 64 65 3a 0a 20 | 4d 61 6b 65 20 63 75 72 | code:. |Make cur|
|000053d0| 72 65 6e 74 20 69 74 65 | 6d 20 77 72 69 74 61 62 |rent ite|m writab|
|000053e0| 6c 65 20 77 69 74 68 6f | 75 74 20 76 61 6c 69 64 |le witho|ut valid|
|000053f0| 61 74 69 6f 6e 20 73 74 | 72 69 6e 67 0a 20 53 59 |ation st|ring. SY|
|00005400| 53 20 22 4d 65 6e 75 55 | 74 69 6c 5f 57 72 69 74 |S "MenuU|til_Writ|
|00005410| 61 62 6c 65 22 2c 2c 54 | 52 55 45 0a 0a 20 4d 61 |able",,T|RUE.. Ma|
|00005420| 6b 65 20 6d 65 6e 75 20 | 69 74 65 6d 20 77 69 74 |ke menu |item wit|
|00005430| 68 20 68 61 6e 64 6c 65 | 20 77 69 64 74 68 49 74 |h handle| widthIt|
|00005440| 65 6d 25 20 77 72 69 74 | 61 62 6c 65 2c 20 77 69 |em% writ|able, wi|
|00005450| 74 68 20 62 75 66 66 65 | 72 20 73 69 7a 65 20 34 |th buffe|r size 4|
|00005460| 30 20 61 6e 64 0a 61 6c | 6c 6f 77 20 74 6f 20 65 |0 and.al|low to e|
|00005470| 6e 74 65 72 20 74 6f 20 | 69 74 20 6f 6e 6c 79 20 |nter to |it only |
|00005480| 64 69 67 69 74 73 2e 0a | 20 53 59 53 20 22 4d 65 |digits..| SYS "Me|
|00005490| 6e 75 55 74 69 6c 5f 57 | 72 69 74 61 62 6c 65 22 |nuUtil_W|ritable"|
|000054a0| 2c 77 69 64 74 68 49 74 | 65 6d 25 2c 54 52 55 45 |,widthIt|em%,TRUE|
|000054b0| 2c 34 30 2c 22 41 30 2d | 39 22 00 00 44 41 54 41 |,40,"A0-|9"..DATA|
|000054c0| 61 04 00 00 4d 65 6e 75 | 55 74 69 6c 5f 53 75 62 |a...Menu|Util_Sub|
|000054d0| 6d 65 6e 75 20 28 53 57 | 49 20 26 34 35 42 43 45 |menu (SW|I &45BCE|
|000054e0| 29 0a 23 50 61 72 65 6e | 74 20 4d 65 6e 75 55 74 |).#Paren|t MenuUt|
|000054f0| 69 6c 73 3a 21 52 6f 6f | 74 0a 20 4c 69 6e 6b 73 |ils:!Roo|t. Links|
|00005500| 20 73 75 62 6d 65 6e 75 | 20 74 6f 20 6d 65 6e 75 | submenu| to menu|
|00005510| 20 69 74 65 6d 0a 0a 20 | 45 6e 74 72 79 3a 0a 20 | item.. |Entry:. |
|00005520| 20 20 20 20 52 30 20 68 | 61 6e 64 6c 65 20 6f 66 | R0 h|andle of|
|00005530| 20 74 68 65 20 6d 65 6e | 75 20 69 74 65 6d 20 6f | the men|u item o|
|00005540| 72 20 7a 65 72 6f 20 69 | 66 20 63 75 72 72 65 6e |r zero i|f curren|
|00005550| 74 20 6d 65 6e 75 20 69 | 74 65 6d 0a 20 20 20 20 |t menu i|tem. |
|00005560| 20 52 31 20 68 61 6e 64 | 6c 65 20 6f 66 20 73 75 | R1 hand|le of su|
|00005570| 62 6d 65 6e 75 20 6f 72 | 20 70 6f 69 6e 74 65 72 |bmenu or| pointer|
|00005580| 20 74 6f 20 73 75 62 6d | 65 6e 75 20 6f 72 20 77 | to subm|enu or w|
|00005590| 69 6e 64 6f 77 20 68 61 | 6e 64 6c 65 0a 20 20 20 |indow ha|ndle. |
|000055a0| 20 20 20 20 20 69 66 20 | 52 31 3c 26 38 30 30 30 | if |R1<&8000|
|000055b0| 20 74 68 65 6e 20 52 31 | 20 69 73 20 77 69 6e 64 | then R1| is wind|
|000055c0| 6f 77 20 68 61 6e 64 6c | 65 0a 20 20 20 20 20 20 |ow handl|e. |
|000055d0| 20 20 69 66 20 52 31 3e | 26 38 30 30 30 20 74 68 | if R1>|&8000 th|
|000055e0| 65 6e 20 52 31 20 69 73 | 20 70 6f 69 6e 74 65 72 |en R1 is| pointer|
|000055f0| 20 74 6f 20 6d 65 6e 75 | 20 0a 20 20 20 20 20 20 | to menu| . |
|00005600| 20 20 69 66 20 52 31 3c | 30 20 74 68 65 6e 20 52 | if R1<|0 then R|
|00005610| 31 20 69 73 20 6d 65 6e | 75 20 68 61 6e 64 6c 65 |1 is men|u handle|
|00005620| 0a 0a 20 45 78 69 74 3a | 0a 20 20 20 20 20 52 30 |.. Exit:|. R0|
|00005630| 2c 52 31 20 70 72 65 73 | 65 72 76 65 64 0a 0a 54 |,R1 pres|erved..T|
|00005640| 68 69 73 20 63 61 6c 6c | 20 69 73 20 75 73 65 64 |his call| is used|
|00005650| 20 66 6f 72 20 63 6f 6e | 73 74 72 75 63 74 69 6e | for con|structin|
|00005660| 67 20 6d 75 6c 74 69 6c | 65 76 65 6c 20 6d 65 6e |g multil|evel men|
|00005670| 75 73 2e 20 52 30 20 6f | 6e 20 65 6e 74 72 79 0a |us. R0 o|n entry.|
|00005680| 63 6f 6e 74 61 69 6e 73 | 20 74 68 65 20 68 61 6e |contains| the han|
|00005690| 64 6c 65 20 6f 66 20 6d | 65 6e 75 20 69 74 65 6d |dle of m|enu item|
|000056a0| 2e 20 54 68 69 73 20 69 | 74 65 6d 20 69 73 20 6c |. This i|tem is l|
|000056b0| 69 6e 6b 65 64 20 77 69 | 74 68 20 73 75 62 6d 65 |inked wi|th subme|
|000056c0| 6e 75 20 6f 72 0a 64 69 | 61 6c 6f 67 20 62 6f 78 |nu or.di|alog box|
|000056d0| 20 64 65 70 65 6e 64 69 | 6e 67 20 6f 6e 20 63 6f | dependi|ng on co|
|000056e0| 6e 74 65 6e 74 73 20 6f | 66 20 52 31 2e 20 54 6f |ntents o|f R1. To|
|000056f0| 20 63 6f 6e 6e 65 63 74 | 20 73 75 62 6d 65 6e 75 | connect| submenu|
|00005700| 20 52 31 20 6d 61 79 0a | 63 6f 6e 74 61 69 6e 20 | R1 may.|contain |
|00005710| 6d 65 6e 75 20 68 61 6e | 64 6c 65 20 28 61 73 20 |menu han|dle (as |
|00005720| 72 65 74 75 72 6e 65 64 | 20 62 79 20 22 4d 65 6e |returned| by "Men|
|00005730| 75 55 74 69 6c 5f 4e 65 | 77 22 29 20 6f 72 20 61 |uUtil_Ne|w") or a|
|00005740| 62 73 6f 6c 75 74 65 20 | 70 6f 69 6e 74 65 72 20 |bsolute |pointer |
|00005750| 74 6f 0a 74 68 65 20 6d | 65 6e 75 20 64 61 74 61 |to.the m|enu data|
|00005760| 20 73 74 72 75 63 74 75 | 72 65 2e 20 54 6f 20 63 | structu|re. To c|
|00005770| 6f 6e 6e 65 63 74 20 64 | 69 61 6c 6f 67 20 62 6f |onnect d|ialog bo|
|00005780| 78 20 52 31 20 6d 75 73 | 74 20 63 6f 6e 74 61 69 |x R1 mus|t contai|
|00005790| 6e 20 77 69 6e 64 6f 77 | 0a 68 61 6e 64 6c 65 20 |n window|.handle |
|000057a0| 6f 66 20 64 69 61 6c 6f | 67 20 62 6f 78 20 28 61 |of dialo|g box (a|
|000057b0| 73 20 72 65 74 75 72 6e | 65 64 20 62 79 20 22 57 |s return|ed by "W|
|000057c0| 69 6d 70 5f 43 72 65 61 | 74 65 57 69 6e 64 6f 77 |imp_Crea|teWindow|
|000057d0| 22 29 2e 0a 0a 0a 20 45 | 78 61 6d 70 6c 65 20 63 |").... E|xample c|
|000057e0| 6f 64 65 3a 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ode:. | |
|000057f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 0a 20 43 | | . C|
|00005800| 6f 6e 6e 65 63 74 20 22 | 41 62 6f 75 74 20 74 68 |onnect "|About th|
|00005810| 69 73 20 70 72 6f 67 72 | 61 6d 22 20 77 69 6e 64 |is progr|am" wind|
|00005820| 6f 77 20 74 6f 20 74 68 | 65 20 69 74 65 6d 20 22 |ow to th|e item "|
|00005830| 49 6e 66 6f 22 0a 20 53 | 59 53 20 22 57 69 6d 70 |Info". S|YS "Wimp|
|00005840| 5f 43 72 65 61 74 65 57 | 69 6e 64 6f 77 22 2c 2c |_CreateW|indow",,|
|00005850| 62 6c 6f 63 6b 25 20 54 | 4f 20 69 6e 66 6f 57 69 |block% T|O infoWi|
|00005860| 6e 64 6f 77 25 0a 20 53 | 59 53 20 22 4d 65 6e 75 |ndow%. S|YS "Menu|
|00005870| 55 74 69 6c 5f 53 75 62 | 6d 65 6e 75 22 2c 69 6e |Util_Sub|menu",in|
|00005880| 66 6f 49 74 65 6d 25 2c | 69 6e 66 6f 57 69 6e 64 |foItem%,|infoWind|
|00005890| 6f 77 25 0a 0a 20 43 72 | 65 61 74 65 20 22 44 69 |ow%.. Cr|eate "Di|
|000058a0| 73 70 6c 61 79 22 20 69 | 74 65 6d 20 69 6e 20 66 |splay" i|tem in f|
|000058b0| 69 6c 65 72 20 6d 65 6e | 75 20 20 0a 20 53 59 53 |iler men|u . SYS|
|000058c0| 20 22 4d 65 6e 75 55 74 | 69 6c 5f 4e 65 77 22 2c | "MenuUt|il_New",|
|000058d0| 2c 22 46 69 6c 65 72 22 | 0a 20 53 59 53 20 22 4d |,"Filer"|. SYS "M|
|000058e0| 65 6e 75 55 74 69 6c 5f | 41 64 64 22 2c 2c 22 44 |enuUtil_|Add",,"D|
|000058f0| 69 73 70 6c 61 79 22 0a | 20 53 59 53 20 22 4d 65 |isplay".| SYS "Me|
|00005900| 6e 75 55 74 69 6c 5f 53 | 75 62 6d 65 6e 75 22 2c |nuUtil_S|ubmenu",|
|00005910| 2c 64 69 73 70 4d 65 6e | 75 25 20 20 20 00 00 00 |,dispMen|u% ...|
|00005920| 44 41 54 41 4f 03 00 00 | 4d 65 6e 75 55 74 69 6c |DATAO...|MenuUtil|
|00005930| 5f 43 6f 6c 6f 75 72 4d | 65 6e 75 20 28 53 57 49 |_ColourM|enu (SWI|
|00005940| 20 26 34 35 42 43 46 29 | 0a 23 50 61 72 65 6e 74 | &45BCF)|.#Parent|
|00005950| 20 4d 65 6e 75 55 74 69 | 6c 73 3a 21 52 6f 6f 74 | MenuUti|ls:!Root|
|00005960| 0a 20 43 72 65 61 74 65 | 73 20 61 20 77 69 6d 70 |. Create|s a wimp|
|00005970| 20 63 6f 6c 6f 75 72 20 | 73 65 74 74 69 6e 67 20 | colour |setting |
|00005980| 6d 65 6e 75 0a 20 45 6e | 74 72 79 3a 0a 20 20 20 |menu. En|try:. |
|00005990| 20 20 52 31 20 2d 3e 20 | 6d 65 6e 75 20 74 69 74 | R1 -> |menu tit|
|000059a0| 6c 65 20 73 74 72 69 6e | 67 0a 20 20 20 20 20 52 |le strin|g. R|
|000059b0| 32 20 2d 3e 20 6d 65 6e | 75 20 68 61 6e 64 6c 65 |2 -> men|u handle|
|000059c0| 0a 20 45 78 69 74 3a 20 | 20 20 20 20 20 20 20 20 |. Exit: | |
|000059d0| 20 20 20 20 20 20 20 20 | 0a 20 20 20 20 20 52 30 | |. R0|
|000059e0| 20 3d 20 68 61 6e 64 6c | 65 20 6f 66 20 74 68 65 | = handl|e of the|
|000059f0| 20 6d 65 6e 75 0a 20 20 | 20 20 20 52 31 20 70 72 | menu. | R1 pr|
|00005a00| 65 73 65 72 76 65 64 0a | 0a 54 68 69 73 20 63 61 |eserved.|.This ca|
|00005a10| 6c 6c 20 63 72 65 61 74 | 65 73 20 73 74 61 6e 64 |ll creat|es stand|
|00005a20| 61 72 64 20 57 49 4d 50 | 20 63 6f 6c 6f 75 72 20 |ard WIMP| colour |
|00005a30| 73 65 74 74 69 6e 67 20 | 6d 65 6e 75 2e 20 52 31 |setting |menu. R1|
|00005a40| 20 6f 6e 20 65 6e 74 72 | 79 0a 70 6f 69 6e 74 73 | on entr|y.points|
|00005a50| 20 74 6f 20 74 68 65 20 | 74 69 74 6c 65 20 73 74 | to the |title st|
|00005a60| 72 69 6e 67 20 66 6f 72 | 20 74 68 65 20 6d 65 6e |ring for| the men|
|00005a70| 75 2e 20 49 66 20 52 32 | 3c 3e 30 20 74 68 65 6e |u. If R2|<>0 then|
|00005a80| 20 69 74 20 70 6f 69 6e | 74 73 20 74 6f 0a 74 68 | it poin|ts to.th|
|00005a90| 65 20 68 61 6e 64 6c 65 | 72 20 63 6f 6d 6d 6f 6e |e handle|r common|
|00005aa0| 20 66 6f 72 20 61 6c 6c | 20 31 36 20 69 74 65 6d | for all| 16 item|
|00005ab0| 73 2e 20 28 53 65 65 20 | 61 6c 73 6f 20 22 4d 65 |s. (See |also "Me|
|00005ac0| 6e 75 55 74 69 6c 5f 41 | 64 64 22 20 66 6f 72 20 |nuUtil_A|dd" for |
|00005ad0| 6d 6f 72 65 0a 69 6e 66 | 6f 20 61 62 6f 75 74 20 |more.inf|o about |
|00005ae0| 69 74 65 6d 20 68 61 6e | 64 6c 65 72 73 29 2e 20 |item han|dlers). |
|00005af0| 44 65 73 70 69 74 65 20 | 74 68 65 20 66 61 63 74 |Despite |the fact|
|00005b00| 20 74 68 61 74 20 74 68 | 65 20 73 61 6d 65 20 68 | that th|e same h|
|00005b10| 61 6e 64 6c 65 72 20 69 | 73 0a 69 6e 76 6f 6b 65 |andler i|s.invoke|
|00005b20| 64 20 77 69 74 68 20 61 | 6c 6c 20 69 74 65 6d 73 |d with a|ll items|
|00005b30| 20 69 74 20 69 73 20 73 | 74 69 6c 6c 20 70 6f 73 | it is s|till pos|
|00005b40| 73 69 62 6c 65 20 74 6f | 20 64 69 73 74 69 6e 67 |sible to| disting|
|00005b50| 75 69 73 68 20 75 73 65 | 72 0a 73 65 6c 65 63 74 |uish use|r.select|
|00005b60| 69 6f 6e 2e 20 4d 65 6e | 75 55 74 69 6c 5f 44 65 |ion. Men|uUtil_De|
|00005b70| 63 6f 64 65 20 72 65 74 | 75 72 6e 73 20 6e 6f 74 |code ret|urns not|
|00005b80| 20 6f 6e 6c 79 20 70 6f | 69 6e 74 65 72 20 74 6f | only po|inter to|
|00005b90| 20 74 68 65 20 68 61 6e | 64 6c 65 72 20 62 75 74 | the han|dler but|
|00005ba0| 0a 61 6c 73 6f 20 74 68 | 65 20 6e 75 6d 62 65 72 |.also th|e number|
|00005bb0| 20 28 70 6f 73 69 74 69 | 6f 6e 29 20 6f 66 20 73 | (positi|on) of s|
|00005bc0| 65 6c 65 63 74 65 64 20 | 69 74 65 6d 20 69 6e 20 |elected |item in |
|00005bd0| 74 68 65 20 6d 65 6e 75 | 2e 20 41 63 74 75 61 6c |the menu|. Actual|
|00005be0| 6c 79 20 74 68 69 73 0a | 6e 75 6d 62 65 72 20 69 |ly this.|number i|
|00005bf0| 73 20 65 71 75 61 6c 20 | 74 6f 20 74 68 65 20 63 |s equal |to the c|
|00005c00| 6f 6c 6f 75 72 20 6e 75 | 6d 62 65 72 2e 0a 0a 0a |olour nu|mber....|
|00005c10| 20 45 78 61 6d 70 6c 65 | 20 63 6f 64 65 3a 0a 20 | Example| code:. |
|00005c20| 43 72 65 61 74 65 20 63 | 6f 6c 6f 75 72 20 73 65 |Create c|olour se|
|00005c30| 74 74 69 6e 67 20 6d 65 | 6e 75 3a 0a 20 53 59 53 |tting me|nu:. SYS|
|00005c40| 20 22 4d 65 6e 75 55 74 | 69 6c 5f 43 6f 6c 6f 75 | "MenuUt|il_Colou|
|00005c50| 72 4d 65 6e 75 22 2c 2c | 22 43 6f 6c 6f 75 72 22 |rMenu",,|"Colour"|
|00005c60| 20 54 4f 20 63 6f 6c 6f | 75 72 4d 65 6e 75 25 00 | TO colo|urMenu%.|
|00005c70| 44 41 54 41 01 02 00 00 | 4d 65 6e 75 55 74 69 6c |DATA....|MenuUtil|
|00005c80| 5f 43 6f 6c 6f 75 72 73 | 20 28 53 57 49 20 26 34 |_Colours| (SWI &4|
|00005c90| 35 42 44 30 29 0a 23 50 | 61 72 65 6e 74 20 4d 65 |5BD0).#P|arent Me|
|00005ca0| 6e 75 55 74 69 6c 73 3a | 21 52 6f 6f 74 0a 20 53 |nuUtils:|!Root. S|
|00005cb0| 65 74 73 20 6e 65 77 20 | 66 6f 72 65 67 72 6f 75 |ets new |foregrou|
|00005cc0| 6e 64 20 61 6e 64 20 62 | 61 63 6b 67 72 6f 75 6e |nd and b|ackgroun|
|00005cd0| 64 20 63 6f 6c 6f 75 72 | 73 20 6f 66 20 6d 65 6e |d colour|s of men|
|00005ce0| 75 20 69 74 65 6d 0a 0a | 20 45 6e 74 72 79 3a 0a |u item..| Entry:.|
|00005cf0| 20 20 20 20 20 52 30 20 | 3d 20 68 61 6e 64 6c 65 | R0 |= handle|
|00005d00| 20 6f 66 20 74 68 65 20 | 6d 65 6e 75 20 69 74 65 | of the |menu ite|
|00005d10| 6d 20 6f 72 20 7a 65 72 | 6f 20 66 6f 72 20 63 75 |m or zer|o for cu|
|00005d20| 72 72 65 6e 74 20 69 74 | 65 6d 0a 20 20 20 20 20 |rrent it|em. |
|00005d30| 52 31 20 3d 20 66 6f 72 | 65 67 72 6f 75 6e 64 20 |R1 = for|eground |
|00005d40| 63 6f 6c 6f 75 72 0a 20 | 20 20 20 20 52 32 20 3d |colour. | R2 =|
|00005d50| 20 62 61 63 6b 67 72 6f | 75 6e 64 20 63 6f 6c 6f | backgro|und colo|
|00005d60| 75 72 0a 20 45 78 69 74 | 3a 0a 20 20 20 20 20 52 |ur. Exit|:. R|
|00005d70| 30 2d 52 32 20 70 72 65 | 73 65 72 76 65 64 0a 0a |0-R2 pre|served..|
|00005d80| 54 68 69 73 20 63 61 6c | 6c 20 61 6c 6c 6f 77 73 |This cal|l allows|
|00005d90| 20 79 6f 75 20 74 6f 20 | 63 68 61 6e 67 65 20 63 | you to |change c|
|00005da0| 6f 6c 6f 75 72 73 20 6f | 66 20 70 61 72 74 69 63 |olours o|f partic|
|00005db0| 75 6c 61 72 20 6d 65 6e | 75 20 69 74 65 6d 2e 20 |ular men|u item. |
|00005dc0| 43 6f 6c 6f 75 72 73 20 | 6d 75 73 74 0a 62 65 20 |Colours |must.be |
|00005dd0| 73 65 6c 65 63 74 65 64 | 20 66 72 6f 6d 20 31 36 |selected| from 16|
|00005de0| 20 57 69 6d 70 20 63 6f | 6c 6f 75 72 73 2e 0a 20 | Wimp co|lours.. |
|00005df0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005e00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005e10| 20 20 0a 20 45 78 61 6d | 70 6c 65 20 63 6f 64 65 | . Exam|ple code|
|00005e20| 3a 0a 20 43 68 61 6e 67 | 65 20 63 6f 6c 6f 75 72 |:. Chang|e colour|
|00005e30| 73 20 6f 66 20 63 75 72 | 72 65 6e 74 20 69 74 65 |s of cur|rent ite|
|00005e40| 6d 20 74 6f 20 62 6c 61 | 63 6b 20 6f 6e 20 79 65 |m to bla|ck on ye|
|00005e50| 6c 6c 6f 77 0a 20 53 59 | 53 20 22 4d 65 6e 75 55 |llow. SY|S "MenuU|
|00005e60| 74 69 6c 5f 43 6f 6c 6f | 75 72 73 22 2c 2c 37 2c |til_Colo|urs",,7,|
|00005e70| 39 00 00 00 44 41 54 41 | 49 02 00 00 4d 65 6e 75 |9...DATA|I...Menu|
|00005e80| 55 74 69 6c 5f 54 69 63 | 6b 4f 6e 6c 79 20 28 53 |Util_Tic|kOnly (S|
|00005e90| 57 49 20 26 34 35 42 44 | 31 29 0a 23 50 61 72 65 |WI &45BD|1).#Pare|
|00005ea0| 6e 74 20 4d 65 6e 75 55 | 74 69 6c 73 3a 21 52 6f |nt MenuU|tils:!Ro|
|00005eb0| 6f 74 0a 20 54 69 63 6b | 20 6f 6e 6c 79 20 73 70 |ot. Tick| only sp|
|00005ec0| 65 63 69 66 69 65 64 20 | 6d 65 6e 75 20 69 74 65 |ecified |menu ite|
|00005ed0| 6d 0a 0a 20 45 6e 74 72 | 79 3a 0a 20 20 20 20 20 |m.. Entr|y:. |
|00005ee0| 52 30 20 3d 20 68 61 6e | 64 6c 65 20 6f 66 20 74 |R0 = han|dle of t|
|00005ef0| 68 65 20 6d 65 6e 75 20 | 69 74 65 6d 20 6f 72 20 |he menu |item or |
|00005f00| 7a 65 72 6f 20 66 6f 72 | 20 63 75 72 72 65 6e 74 |zero for| current|
|00005f10| 20 69 74 65 6d 2c 20 6f | 72 0a 20 20 20 20 20 20 | item, o|r. |
|00005f20| 20 20 20 20 0a 20 20 20 | 20 20 52 30 20 3d 20 68 | . | R0 = h|
|00005f30| 61 6e 64 6c 65 20 6f 66 | 20 74 68 65 20 6d 65 6e |andle of| the men|
|00005f40| 75 0a 20 20 20 20 20 52 | 31 20 3d 20 69 74 65 6d |u. R|1 = item|
|00005f50| 20 70 6f 73 69 74 69 6f | 6e 20 69 6e 20 74 68 65 | positio|n in the|
|00005f60| 20 6d 65 6e 75 20 28 73 | 74 61 72 74 69 6e 67 20 | menu (s|tarting |
|00005f70| 66 72 6f 6d 20 7a 65 72 | 6f 29 0a 20 45 78 69 74 |from zer|o). Exit|
|00005f80| 3a 0a 20 20 20 20 20 52 | 30 2c 52 31 20 70 72 65 |:. R|0,R1 pre|
|00005f90| 73 65 72 76 65 64 0a 0a | 54 68 69 73 20 63 61 6c |served..|This cal|
|00005fa0| 6c 20 74 69 63 6b 73 20 | 73 70 65 63 69 66 69 65 |l ticks |specifie|
|00005fb0| 64 20 69 74 65 6d 20 61 | 6e 64 20 63 6c 65 61 72 |d item a|nd clear|
|00005fc0| 73 20 74 69 63 6b 20 66 | 6c 61 67 73 20 69 6e 20 |s tick f|lags in |
|00005fd0| 72 65 6d 61 69 6e 69 6e | 67 20 69 74 65 6d 73 20 |remainin|g items |
|00005fe0| 69 6e 0a 74 68 65 20 6d | 65 6e 75 2e 20 49 66 20 |in.the m|enu. If |
|00005ff0| 79 6f 75 20 64 6f 6e 27 | 74 20 6b 6e 6f 77 20 74 |you don'|t know t|
|00006000| 68 65 20 68 61 6e 64 6c | 65 20 6f 66 20 74 68 65 |he handl|e of the|
|00006010| 20 6d 65 6e 75 20 74 68 | 65 6e 20 79 6f 75 20 63 | menu th|en you c|
|00006020| 61 6e 20 73 70 65 63 69 | 66 79 0a 68 61 6e 64 6c |an speci|fy.handl|
|00006030| 65 20 6f 66 20 74 68 65 | 20 6d 65 6e 75 20 69 6e |e of the| menu in|
|00006040| 20 52 30 20 61 6e 64 20 | 70 6f 73 69 74 69 6f 6e | R0 and |position|
|00006050| 20 6f 66 20 74 68 65 20 | 69 74 65 6d 20 69 6e 20 | of the |item in |
|00006060| 52 31 2e 0a 0a 0a 20 45 | 78 61 6d 70 6c 65 20 63 |R1.... E|xample c|
|00006070| 6f 64 65 3a 0a 20 54 69 | 63 6b 20 62 6c 61 63 6b |ode:. Ti|ck black|
|00006080| 20 63 6f 6c 6f 75 72 20 | 69 6e 20 63 6f 6c 6f 75 | colour |in colou|
|00006090| 72 20 6d 65 6e 75 0a 20 | 53 59 53 20 22 4d 65 6e |r menu. |SYS "Men|
|000060a0| 75 55 74 69 6c 5f 54 69 | 63 6b 4f 6e 6c 79 22 2c |uUtil_Ti|ckOnly",|
|000060b0| 63 6f 6c 6f 75 72 4d 65 | 6e 75 25 2c 37 00 00 00 |colourMe|nu%,7...|
|000060c0| 44 41 54 41 87 0e 00 00 | 4d 65 6e 75 55 74 69 6c |DATA....|MenuUtil|
|000060d0| 73 20 56 65 72 73 69 6f | 6e 20 30 2e 31 32 0a 23 |s Versio|n 0.12.#|
|000060e0| 50 61 72 65 6e 74 20 4d | 65 6e 75 55 74 69 6c 73 |Parent M|enuUtils|
|000060f0| 3a 21 52 6f 6f 74 0a 23 | 41 6c 69 67 6e 20 43 65 |:!Root.#|Align Ce|
|00006100| 6e 74 72 65 0a 49 6e 74 | 72 6f 64 75 63 74 69 6f |ntre.Int|roductio|
|00006110| 6e 0a 23 41 6c 69 67 6e | 20 4c 65 66 74 0a 20 20 |n.#Align| Left. |
|00006120| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00006130| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00006140| 20 20 20 20 20 20 0a 54 | 68 69 73 20 6d 6f 64 75 | .T|his modu|
|00006150| 6c 65 20 69 73 20 6d 61 | 69 6e 6c 79 20 69 6e 74 |le is ma|inly int|
|00006160| 65 6e 64 65 64 20 66 6f | 72 20 70 65 6f 70 6c 65 |ended fo|r people|
|00006170| 20 77 68 6f 20 77 72 69 | 74 65 20 52 49 53 43 20 | who wri|te RISC |
|00006180| 4f 53 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 73 20 |OS appli|cations |
|00006190| 69 6e 20 42 42 43 20 42 | 41 53 49 43 2e 20 49 74 |in BBC B|ASIC. It|
|000061a0| 20 63 61 6e 20 73 61 76 | 65 20 70 72 6f 67 72 61 | can sav|e progra|
|000061b0| 6d 6d 65 72 20 66 72 6f | 6d 20 74 68 65 20 6e 65 |mmer fro|m the ne|
|000061c0| 65 64 20 74 6f 20 77 72 | 69 74 65 20 68 69 73 20 |ed to wr|ite his |
|000061d0| 6f 77 6e 20 70 72 6f 63 | 65 64 75 72 65 73 20 69 |own proc|edures i|
|000061e0| 6e 20 42 41 53 49 43 20 | 66 6f 72 20 68 61 6e 64 |n BASIC |for hand|
|000061f0| 6c 69 6e 67 20 6d 65 6e | 75 73 2e 20 4d 65 6e 75 |ling men|us. Menu|
|00006200| 55 74 69 6c 73 20 6d 6f | 64 75 6c 65 20 63 61 6e |Utils mo|dule can|
|00006210| 20 70 65 72 66 6f 72 6d | 20 61 6c 6c 20 74 68 65 | perform| all the|
|00006220| 20 77 6f 72 6b 20 6e 65 | 65 64 65 64 20 74 6f 20 | work ne|eded to |
|00006230| 63 72 65 61 74 65 2c 20 | 65 64 69 74 2c 20 64 69 |create, |edit, di|
|00006240| 73 70 6c 61 79 20 61 6e | 64 20 64 65 63 6f 64 65 |splay an|d decode|
|00006250| 20 6d 65 6e 75 73 2e 20 | 54 68 65 20 6d 6f 64 75 | menus. |The modu|
|00006260| 6c 65 20 69 73 20 76 65 | 72 79 20 73 69 6d 70 6c |le is ve|ry simpl|
|00006270| 65 20 69 6e 20 75 73 65 | 20 61 6e 64 20 69 73 20 |e in use| and is |
|00006280| 69 64 65 61 6c 20 66 6f | 72 20 63 72 65 61 74 69 |ideal fo|r creati|
|00006290| 6e 67 20 73 69 6d 70 6c | 65 20 6d 65 6e 75 73 2e |ng simpl|e menus.|
|000062a0| 20 4f 6e 20 74 68 65 20 | 6f 74 68 65 72 20 68 61 | On the |other ha|
|000062b0| 6e 64 20 6d 6f 64 75 6c | 65 27 73 20 61 64 76 61 |nd modul|e's adva|
|000062c0| 6e 63 65 64 20 66 65 61 | 74 75 72 65 73 20 61 6c |nced fea|tures al|
|000062d0| 6c 6f 77 73 20 65 61 73 | 69 6c 79 20 63 72 65 61 |lows eas|ily crea|
|000062e0| 74 65 20 61 6e 64 20 6d | 61 6e 69 70 75 6c 61 74 |te and m|anipulat|
|000062f0| 65 20 65 76 65 6e 20 76 | 65 72 79 20 63 6f 6d 70 |e even v|ery comp|
|00006300| 6c 65 78 20 6d 75 6c 74 | 69 2d 6c 65 76 65 6c 20 |lex mult|i-level |
|00006310| 64 79 6e 61 6d 69 63 20 | 6d 65 6e 75 73 2e 0a 0a |dynamic |menus...|
|00006320| 23 41 6c 69 67 6e 20 43 | 65 6e 74 72 65 0a 57 68 |#Align C|entre.Wh|
|00006330| 61 74 20 64 6f 65 73 20 | 4d 65 6e 75 55 74 69 6c |at does |MenuUtil|
|00006340| 73 20 64 6f 20 3f 0a 23 | 41 6c 69 67 6e 20 4c 65 |s do ?.#|Align Le|
|00006350| 66 74 0a 0a 54 68 65 20 | 4d 65 6e 75 55 74 69 6c |ft..The |MenuUtil|
|00006360| 73 20 6d 6f 64 75 6c 65 | 20 69 73 20 6e 6f 74 20 |s module| is not |
|00006370| 74 68 65 20 65 78 74 65 | 6e 73 69 6f 6e 20 74 6f |the exte|nsion to|
|00006380| 20 74 68 65 20 57 69 6e | 64 6f 77 20 4d 61 6e 61 | the Win|dow Mana|
|00006390| 67 65 72 20 61 6e 64 20 | 69 74 20 64 6f 65 73 6e |ger and |it doesn|
|000063a0| 27 74 20 70 72 6f 76 69 | 64 65 20 61 6e 79 20 65 |'t provi|de any e|
|000063b0| 78 74 72 61 20 66 65 61 | 74 75 72 65 2e 20 54 68 |xtra fea|ture. Th|
|000063c0| 65 20 6d 6f 64 75 6c 65 | 20 6f 6e 6c 79 20 70 72 |e module| only pr|
|000063d0| 6f 76 69 64 65 73 20 61 | 20 63 6f 6e 76 65 6e 69 |ovides a| conveni|
|000063e0| 65 6e 74 20 69 6e 74 65 | 72 66 61 63 65 20 66 6f |ent inte|rface fo|
|000063f0| 72 20 74 68 65 20 70 72 | 6f 67 72 61 6d 6d 65 72 |r the pr|ogrammer|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.