Home » Archimedes archive » Acorn Computing » 1994 08 subscription disc.adf » 9408s » Shareware/Event/!ShellSys/FntMenuDoc
Shareware/Event/!ShellSys/FntMenuDoc
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Archimedes archive » Acorn Computing » 1994 08 subscription disc.adf » 9408s |
Filename: | Shareware/Event/!ShellSys/FntMenuDoc |
Read OK: | ✔ |
File size: | 405A bytes |
Load address: | 0000 |
Exec address: | 0000 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- Archimedes archive » Acorn Computing » 1994 08 subscription disc.adf » 9408s » Shareware/Event/!ShellSys/FntMenuDoc
- Archimedes archive » Archimedes World » AW-1995-01-Disc2.adf » Disk2Jan95 » !AWJan95/Goodies/Event/!EvntShell/FntMenuDoc
File contents
Documentation for the FontMenu module v.1.16 � J.R�ling 1990 WARNING The SWI I use is NOT official allocated by ACORN. I did try to get one, but they refused. Why, I don't know. Probably because I have no ISV status, and I did the work on FontMenu not on behalf of one company in particular. I did discover though that there are a lot of people interrested, and I undestand that some of them are actually implementing it in their code. So if anyone at ACORN is reading this, please reconsider my request. ---------------------------------------------------------------------------- Introduction As more and more outlined fonts for the Archimedes are becoming available, a problem arises for applications accessing these fonts. The number of fonts is not known in advance, so to create a font menu the application has to figure out the number of fonts, claim enough space to hold a font menu, and create it. This can be done in the dull single level (straight forward) way. This saves some space, and code complexity, but it is not preferred, as the user will be presented by a sometimes very long menu containing items with the same prefix, e.g. Trinity Trinity.Bold Trinity.Bold.Italic Trinity.Medium Trinity.Medium.Italic etc. The more fonts become available, the longer this menu becomes, the more irritating it is. Many applications now are even uncapable of creating menus longer then a certain amount. Examples of these are !Edit (48 entries), !Draw (64 entries), and even !Impression reacts sick. When running more then one application with a font menu, there is arises another disadvantage of this method. Several applications using a identical menu structure but not sharing the resource, is not the policy of Acorn on other subjects. So here is a neat solution for everyone who wants a proper font menu, without the hassel to create one, and without claiming extra space. What does FontMenu do ? The FontMenu module is able of creating a multi-level font menu, and lets every application share the joy. It contains several SWI's to create, and access this resource. If no application is using the structure anymore (because they were all quited for example) the memory for the menu structure will be realesed by FontMenu, so no unnecessary memory is in use. It has no problems if more than one font directory is in use. The menu is sorted alphabeticly (even when more than one font directoris are used), so the user is able to find the required font at an instance. It requires a minimum of disc access when a new menu is created. New menus are only created if one is required, and there isn't already a valid one. When a font menu exsists, and the user has selected a new font directory, the font menu will be rebuild as soon as the application accesses this font menu. FontMenu creates an multi-leveled font menu. In the example above this is a menu where 'Trinity' occurs only once, but it will have a submenu containing two items: 'Bold' and 'Medium'. Because there are two types of 'Trinity.Bold' ('Trinity.Bold' and 'Trinity.Bold.Italic') 'Bold' will have another submenu. In this submenu the first item will be 'Plain'. This name is made up, but it is more clear then a empty menu entry. The second entry will of course be 'Italic'. How does FontMenu work ? To use FontMenu it is necessary to understand how the Wimp works, and how to create a application on the Archimedes environment. It is assumed that the reader understands the above for the rest of this document. When a application wants to access the FontMenu menu structure, it has to call SWI "FontMenu_Create" before any other FontMenu SWI's are called. This will assure that a proper font menu structure will be available. This can be done on initialisation of the application, but is not absolutely necessary. When exiting the application, SWI "FontMenu_Release" has to be called, so if this was the only application using the font menu, FontMenu can release the memory for it. Every time SWI "FontMenu_Create" is called, a counter is incremented, and if it was zero (this is the initial value), it will create a new font menu. When calling SWI "FontMenu_Release", the counter is decremented, and if it reached zero FontMenu will release the menu memory, as no application is using the menu structure anymore. From here on there are two ways of programming when using FontMenu. The first is the simple one, the second a little bit more complicated, as it involves the use the Wimp message system. The easy way ------------ Whenever the user opens the menu structure of the application by pressing the MENU button, a call has to be made to FontMenu_Select with R0 pointing to a point sepearted (zero terminated) font string, and in R1 the value 0 or 1 to tell FontMenu if it allows the user to select the SystemFont. The call will return with a pointer to the font menu structure in R1. Now it is up to the programmer what to do with this pointer. When passed in R1 when calling Wimp_CreateMenu, the menu tree will consist entirely of FontMenu structures. If the font menu should be a submenu of the applications own menu structure, the pointer should be put in the submenu-word of the parent menu entry, and Wimp_CreateMenu should be called with a pointer to the applications own menu structure. When a menu selection was done, the application should determine by the returned 'menu tree so far' values if the user selected a entry in the font menu. If so, it should set an internal flag (say 'FontMenuSelected') to TRUE, else it should set it to FALSE, so later on it is still known if the user may have selected a new font. After that it should call SWI "FontMenu_DecodeFontMenu" with R0 pointing to the first menu selection in the 'menu tree so far' block which determines the selected font. R1 should point to a buffer to contain the answer. This buffer must be at least 48 bytes. If on return of this call R0 > 0, the user selected a new font. The buffer passed in R1 will contain the font name (a point seperated, zero terminated font string). After a menu selection, and taking appropriate actions, the application should check the mouse button state to see if it has to call SWI "Wimp_CreateMenu" again. If adjust was used to make the selection, it has to check the 'FontMenuSelected' flag to determine if the user selected a font menu entry. If so, it should call FontMenu_Select as described above. This should be done with R0 pointing to the string FontMenu_DecodeFontMenu returned. The menu pointer returned by FontMenu_Select has to be put in the 'sub-menu pointer' word of the 'Fonts' entry. Now the call to Wimp_CreateMenu can be done. In this way it is possible for the user to click with adjust in the font menu, and keeping the menu on screen after the selection. There is one little drawback of this method. If the user selected a new !Fonts directory, it will be noted be the FontMenu_Select code, and a new font menu structure will be generated. This is always the case, also with the method described below. But it could be possible that the user was going to do something else in the menu, not selecting a font at all. He could for instance want to quit. Now he (she) has to wait for the FontMenu module to create the new menu structure, before he (she) is able to access the 'Quit' entry. So the next solution is to wait with calling FontMenu_Select, until the user wants to select a new font. This can only be done by making use of the Wimp message system. The difficult thing of this method (as described later) is that the Wimp is unable to re-open the menu structure entirely after a menu selection using the ADJUST button. So a little trick has to solve this problem. The hard way ------------ In the applications own menu structure, there should be a menu entry (e.g. 'Fonts') with bit 3 if its menu flags set. The application has to assure that this bit is set whenever it calls SWI "Wimp_CreateMenu" as it may be corrupted (see below). So whenever the user puts the pointer above the arrow on the right of this entry, a warning message (&400C0) will be send by the Wimp. On receiving of this message, the application should respond by calling SWI "FontMenu_Select" with R0 pointing to a point seperated (zero terminated) font string, and in R1 the value 0 or 1 to tell FontMenu if it allows the user to select the SystemFont. The font string may be a zero length string, wich means that no current font is selected. FontMenu will select the font in its menu structure. If 1 was passed in R1, the first item in the menu structure will be 'SystemFonts'. In case R1 = 0, this entry will not be there. This call will return with a pointer to the menu structure in R1. This pointer should be passed to SWI "Wimp_CreateSubMenu". When a menu selection was done, the application should determine by the returned 'menu tree so far' values if the user selected a entry in the font menu. If so, it should set an internal flag (say 'FontMenuSelected') to TRUE, else it should set it to FALSE, so later on it is still known if the user may have selected a new font. After that it should call SWI "FontMenu_DecodeFontMenu" with R0 pointing to the first menu selection in the 'menu tree so far' block which determines the selected font. R1 should point to a buffer to contain the answer. This buffer must be at least 48 bytes. If on return of this call R0 > 0, the user selected a new font. The buffer passed in R1 will contain the font name (a point seperated, zero terminated font string). After a menu selction, and taking appropriate actions, the application should check the mouse button state to see if it has to call SWI "Wimp_CreateMenu" again. If adjust was used to make the selection, it has to check the 'FontMenuSelected' flag to determine if the user selected a font menu entry. If so, it should call SWI "FontMenu_Select" as described above. This should be done with R0 pointing to the string SWI "FontMenu_DecodeFontMenu" returned. As the MenuWarningFlag in the menu flags of the menu entry (e.g. 'Fonts') preceding the font menu was set (phhh!), the Wimp is unable to recreating the whole menu tree automatically. So a litle trick has to assure that it will work correct. The menu pointer returned by SWI "FontMenu_Select" has to be put in the 'sub-menu pointer' word of the 'Fonts' entry, and the MenuWarningFlag (bit 3) of the menu flags word of this entry should be cleared. Now the call to SWI "Wimp_CreateMenu" can be done. In this way it is possible for the user to click with adjust in the font menu, and keeping the menu on screen after the selection. The next time the user opens the application menu, the MenuWarningFlag (bit 3) should be set again, as other applications may have used the font menu in the meanwhile, and it is necessary that SWI "FontMenu_Select" is called just before the font menu opens. Because some FontMenu SWI's may take some time before they return (this is due to Font_ListFonts), the Hourglass On & Off SWI's are used on entry and exit respectively. So in theory it is possible that whenever one of the FontMenu SWI's take longer than 1/3 of a second, a hourglass appears. In practice this only occurs when FontMenu_Create or FontMenu_Select is called and they have to actually create a new menu structure (Because of a first call, or a changed Font$Path). Notes from the author The reason why I wrote this module, is because I'm not only a programmer, but also a user who likes to work with the Archimedes. This is because it's a fast machine and because most parts of Risc-OS allow applications to be very intuitive. I didn't like the way the available fonts were presented in most applications, so I started to figure out a proper solution: FontMenu. I hope that future applications adopt to this method, so please pass it on. Everybody is free to use it, even in commercial code. The only restriction is that this document should not be seperated from the FontMenu module, and that both the module and this document remain unchanged. In case of commercial use I would like to know this in advance (I could than provide you with its latest release). My address is at the end of this document. You can always contact me if you found some bug, or when having other suggestions. ----------------------------------------------------------------------------- FontMenu SWI's Below are the short discriptions of the FontMenu SWI's. FontMenu_Create &8D080 ---------------------- On entry: -- On exit : R0 = Number of fonts found This will create a font menu structure in RMA, if not already done so. An error occurs if there is not enough room in RMA to create the menu. FontMenu_Release &8D081 ----------------------- On entry: -- On exit : -- This will release the memory taken by the font menu if no tasks are using it anymore. FontMenu_Select &8D082 ---------------------- On entry: R0 = pointer to point seperated, ctrl terminated font string R1 = SystemFont flag On exit : R0 = State flag R1 = pointer to font menu structure This will tick the font passed in R0 on entry. R1 determines if 'SystemFont' should occur in the menu as follows: Value Meaning 0 'SystemFont' does not occur in the menu 1 'SystemFont' does occur in the menu On exit R0 shows the selection state as follows: Value Meaning 0 To be selected font not found, no ticks 1 To be selected font found, and ticked 2 No font entries found, menu consists one item; 'SystemFont', and is ticked R1 will point to the font menu on exit. An error occurs if no font menu exists. FontMenu_Deselect &8D083 ------------------------ On entry: --- On exit : -- This will clear all ticks and marks of the font menu. It is not necessary to call this SWI before a FontMenu_Select call, as FontMenu_Select will take care of cleaning up old selection. An error occurs if no font menu exists. FontMenu_DecodeFontMenu &8D084 ------------------------------ On entry: R0 = pointer to a list of font menu selections R1 = pointer to a buffer to contain the answer (at least 48 bytes long) On exit : R0 = Flag (0 = non-sensible/ 1= sensible selection) This will decode the font menu selection into a font string for the FontManager. This string can be passed back to FontMenu_Select to tick the appropriate entries. An error occurs if no font menu exists. This call makes use of Wimp_DecodeMenu, but as it is possible that the returned string ends with 'Plain' (a made up name to distinguise an empty sub-name from the rest of the sub-names), it has to check for this, and throw away this last sub-name so the FontManager can recognise the required font. On exit R0 conatains a flag telling you if the selection the user made was a sensible one. If, for example, the user selected non-leaf menu entry (e.g. 'Trinity.Medium') then this flag will be 0. If the flag is 0, you are advised not to do anything. FontMenu_Smash &8D085 --------------------- On entry: -- On exit : -- This will release the font menu memory without looking at the amount of times FontMenu_Create was called. FontMenu_ReCreate &8D086 ------------------------ On entry: -- On exit : R0 = Number of fonts found This will release a existing font menu, and recreate it. =========================================================== To contact the author of FontMenu, please write to: Joris R�ling Oudestraat 186 8261 CW Kampen The Netherlands Tel:05202-27989
00000000 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 00000010 20 44 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 | Documentation f| 00000020 6f 72 20 74 68 65 20 46 6f 6e 74 4d 65 6e 75 20 |or the FontMenu | 00000030 6d 6f 64 75 6c 65 20 76 2e 31 2e 31 36 0a 0a 20 |module v.1.16.. | 00000040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000050 20 20 20 20 20 20 20 20 20 20 20 20 a9 20 4a 2e | . J.| 00000060 52 d6 6c 69 6e 67 20 31 39 39 30 0a 20 20 20 20 |R.ling 1990. | 00000070 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000080 20 20 20 20 0a 0a 0a 20 20 20 20 20 20 20 20 20 | ... | 00000090 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000000a0 20 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 | . | 000000b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000000c0 20 20 20 20 20 20 20 20 20 20 20 57 41 52 4e 49 | WARNI| 000000d0 4e 47 0a 0a 20 54 68 65 20 53 57 49 20 49 20 75 |NG.. The SWI I u| 000000e0 73 65 20 69 73 20 4e 4f 54 20 6f 66 66 69 63 69 |se is NOT offici| 000000f0 61 6c 20 61 6c 6c 6f 63 61 74 65 64 20 62 79 20 |al allocated by | 00000100 41 43 4f 52 4e 2e 20 49 20 64 69 64 20 74 72 79 |ACORN. I did try| 00000110 20 74 6f 20 67 65 74 20 6f 6e 65 2c 20 62 75 74 | to get one, but| 00000120 0a 74 68 65 79 20 72 65 66 75 73 65 64 2e 20 20 |.they refused. | 00000130 57 68 79 2c 20 49 20 64 6f 6e 27 74 20 6b 6e 6f |Why, I don't kno| 00000140 77 2e 20 50 72 6f 62 61 62 6c 79 20 62 65 63 61 |w. Probably beca| 00000150 75 73 65 20 49 20 68 61 76 65 20 6e 6f 20 49 53 |use I have no IS| 00000160 56 20 73 74 61 74 75 73 2c 20 61 6e 64 0a 49 20 |V status, and.I | 00000170 64 69 64 20 74 68 65 20 77 6f 72 6b 20 6f 6e 20 |did the work on | 00000180 46 6f 6e 74 4d 65 6e 75 20 6e 6f 74 20 6f 6e 20 |FontMenu not on | 00000190 62 65 68 61 6c 66 20 6f 66 20 6f 6e 65 20 63 6f |behalf of one co| 000001a0 6d 70 61 6e 79 20 69 6e 20 70 61 72 74 69 63 75 |mpany in particu| 000001b0 6c 61 72 2e 20 49 20 64 69 64 0a 64 69 73 63 6f |lar. I did.disco| 000001c0 76 65 72 20 74 68 6f 75 67 68 20 74 68 61 74 20 |ver though that | 000001d0 74 68 65 72 65 20 61 72 65 20 61 20 6c 6f 74 20 |there are a lot | 000001e0 6f 66 20 70 65 6f 70 6c 65 20 69 6e 74 65 72 72 |of people interr| 000001f0 65 73 74 65 64 2c 20 61 6e 64 20 49 20 75 6e 64 |ested, and I und| 00000200 65 73 74 61 6e 64 0a 74 68 61 74 20 73 6f 6d 65 |estand.that some| 00000210 20 6f 66 20 74 68 65 6d 20 61 72 65 20 61 63 74 | of them are act| 00000220 75 61 6c 6c 79 20 69 6d 70 6c 65 6d 65 6e 74 69 |ually implementi| 00000230 6e 67 20 69 74 20 69 6e 20 74 68 65 69 72 20 63 |ng it in their c| 00000240 6f 64 65 2e 20 53 6f 20 69 66 20 61 6e 79 6f 6e |ode. So if anyon| 00000250 65 0a 61 74 20 41 43 4f 52 4e 20 69 73 20 72 65 |e.at ACORN is re| 00000260 61 64 69 6e 67 20 74 68 69 73 2c 20 70 6c 65 61 |ading this, plea| 00000270 73 65 20 72 65 63 6f 6e 73 69 64 65 72 20 6d 79 |se reconsider my| 00000280 20 72 65 71 75 65 73 74 2e 0a 0a 0a 0a 0a 2d 2d | request......--| 00000290 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000002d0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 20 20 20 20 |----------.. | 000002e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000002f0 20 20 20 20 20 20 20 20 20 20 20 49 6e 74 72 6f | Intro| 00000300 64 75 63 74 69 6f 6e 0a 0a 20 41 73 20 6d 6f 72 |duction.. As mor| 00000310 65 20 61 6e 64 20 6d 6f 72 65 20 6f 75 74 6c 69 |e and more outli| 00000320 6e 65 64 20 66 6f 6e 74 73 20 66 6f 72 20 74 68 |ned fonts for th| 00000330 65 20 41 72 63 68 69 6d 65 64 65 73 20 61 72 65 |e Archimedes are| 00000340 20 62 65 63 6f 6d 69 6e 67 20 61 76 61 69 6c 61 | becoming availa| 00000350 62 6c 65 2c 0a 61 20 70 72 6f 62 6c 65 6d 20 61 |ble,.a problem a| 00000360 72 69 73 65 73 20 66 6f 72 20 61 70 70 6c 69 63 |rises for applic| 00000370 61 74 69 6f 6e 73 20 61 63 63 65 73 73 69 6e 67 |ations accessing| 00000380 20 74 68 65 73 65 20 66 6f 6e 74 73 2e 20 54 68 | these fonts. Th| 00000390 65 20 6e 75 6d 62 65 72 20 6f 66 0a 66 6f 6e 74 |e number of.font| 000003a0 73 20 69 73 20 6e 6f 74 20 6b 6e 6f 77 6e 20 69 |s is not known i| 000003b0 6e 20 61 64 76 61 6e 63 65 2c 20 73 6f 20 74 6f |n advance, so to| 000003c0 20 63 72 65 61 74 65 20 61 20 66 6f 6e 74 20 6d | create a font m| 000003d0 65 6e 75 20 74 68 65 20 61 70 70 6c 69 63 61 74 |enu the applicat| 000003e0 69 6f 6e 20 68 61 73 0a 74 6f 20 66 69 67 75 72 |ion has.to figur| 000003f0 65 20 6f 75 74 20 74 68 65 20 6e 75 6d 62 65 72 |e out the number| 00000400 20 6f 66 20 66 6f 6e 74 73 2c 20 63 6c 61 69 6d | of fonts, claim| 00000410 20 65 6e 6f 75 67 68 20 73 70 61 63 65 20 74 6f | enough space to| 00000420 20 68 6f 6c 64 20 61 20 66 6f 6e 74 20 6d 65 6e | hold a font men| 00000430 75 2c 0a 61 6e 64 20 63 72 65 61 74 65 20 69 74 |u,.and create it| 00000440 2e 20 54 68 69 73 20 63 61 6e 20 62 65 20 64 6f |. This can be do| 00000450 6e 65 20 69 6e 20 74 68 65 20 64 75 6c 6c 20 73 |ne in the dull s| 00000460 69 6e 67 6c 65 20 6c 65 76 65 6c 20 28 73 74 72 |ingle level (str| 00000470 61 69 67 68 74 20 66 6f 72 77 61 72 64 29 0a 77 |aight forward).w| 00000480 61 79 2e 20 54 68 69 73 20 73 61 76 65 73 20 73 |ay. This saves s| 00000490 6f 6d 65 20 73 70 61 63 65 2c 20 61 6e 64 20 63 |ome space, and c| 000004a0 6f 64 65 20 63 6f 6d 70 6c 65 78 69 74 79 2c 20 |ode complexity, | 000004b0 62 75 74 20 69 74 20 69 73 20 6e 6f 74 20 70 72 |but it is not pr| 000004c0 65 66 65 72 72 65 64 2c 20 61 73 0a 74 68 65 20 |eferred, as.the | 000004d0 75 73 65 72 20 77 69 6c 6c 20 62 65 20 70 72 65 |user will be pre| 000004e0 73 65 6e 74 65 64 20 62 79 20 61 20 73 6f 6d 65 |sented by a some| 000004f0 74 69 6d 65 73 20 76 65 72 79 20 6c 6f 6e 67 20 |times very long | 00000500 6d 65 6e 75 20 63 6f 6e 74 61 69 6e 69 6e 67 20 |menu containing | 00000510 69 74 65 6d 73 0a 77 69 74 68 20 74 68 65 20 73 |items.with the s| 00000520 61 6d 65 20 70 72 65 66 69 78 2c 20 65 2e 67 2e |ame prefix, e.g.| 00000530 20 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | .. | 00000540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000550 54 72 69 6e 69 74 79 0a 20 20 20 20 20 20 20 20 |Trinity. | 00000560 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000570 20 20 20 20 20 54 72 69 6e 69 74 79 2e 42 6f 6c | Trinity.Bol| 00000580 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |d. | 00000590 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 | T| 000005a0 72 69 6e 69 74 79 2e 42 6f 6c 64 2e 49 74 61 6c |rinity.Bold.Ital| 000005b0 69 63 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |ic. | 000005c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000005d0 54 72 69 6e 69 74 79 2e 4d 65 64 69 75 6d 0a 20 |Trinity.Medium. | 000005e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000005f0 20 20 20 20 20 20 20 20 20 20 20 20 54 72 69 6e | Trin| 00000600 69 74 79 2e 4d 65 64 69 75 6d 2e 49 74 61 6c 69 |ity.Medium.Itali| 00000610 63 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |c. | 00000620 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 | e| 00000630 74 63 2e 0a 0a 20 54 68 65 20 6d 6f 72 65 20 66 |tc... The more f| 00000640 6f 6e 74 73 20 62 65 63 6f 6d 65 20 61 76 61 69 |onts become avai| 00000650 6c 61 62 6c 65 2c 20 74 68 65 20 6c 6f 6e 67 65 |lable, the longe| 00000660 72 20 74 68 69 73 20 6d 65 6e 75 20 62 65 63 6f |r this menu beco| 00000670 6d 65 73 2c 20 74 68 65 20 6d 6f 72 65 0a 69 72 |mes, the more.ir| 00000680 72 69 74 61 74 69 6e 67 20 69 74 20 69 73 2e 20 |ritating it is. | 00000690 0a 0a 20 4d 61 6e 79 20 61 70 70 6c 69 63 61 74 |.. Many applicat| 000006a0 69 6f 6e 73 20 6e 6f 77 20 61 72 65 20 65 76 65 |ions now are eve| 000006b0 6e 20 75 6e 63 61 70 61 62 6c 65 20 6f 66 20 63 |n uncapable of c| 000006c0 72 65 61 74 69 6e 67 20 6d 65 6e 75 73 20 6c 6f |reating menus lo| 000006d0 6e 67 65 72 20 74 68 65 6e 20 61 0a 63 65 72 74 |nger then a.cert| 000006e0 61 69 6e 20 61 6d 6f 75 6e 74 2e 20 45 78 61 6d |ain amount. Exam| 000006f0 70 6c 65 73 20 6f 66 20 74 68 65 73 65 20 61 72 |ples of these ar| 00000700 65 20 21 45 64 69 74 20 28 34 38 20 65 6e 74 72 |e !Edit (48 entr| 00000710 69 65 73 29 2c 20 21 44 72 61 77 20 28 36 34 0a |ies), !Draw (64.| 00000720 65 6e 74 72 69 65 73 29 2c 20 61 6e 64 20 65 76 |entries), and ev| 00000730 65 6e 20 21 49 6d 70 72 65 73 73 69 6f 6e 20 72 |en !Impression r| 00000740 65 61 63 74 73 20 73 69 63 6b 2e 0a 0a 20 57 68 |eacts sick... Wh| 00000750 65 6e 20 72 75 6e 6e 69 6e 67 20 6d 6f 72 65 20 |en running more | 00000760 74 68 65 6e 20 6f 6e 65 20 61 70 70 6c 69 63 61 |then one applica| 00000770 74 69 6f 6e 20 77 69 74 68 20 61 20 66 6f 6e 74 |tion with a font| 00000780 20 6d 65 6e 75 2c 20 74 68 65 72 65 20 69 73 20 | menu, there is | 00000790 61 72 69 73 65 73 0a 61 6e 6f 74 68 65 72 20 64 |arises.another d| 000007a0 69 73 61 64 76 61 6e 74 61 67 65 20 6f 66 20 74 |isadvantage of t| 000007b0 68 69 73 20 6d 65 74 68 6f 64 2e 20 53 65 76 65 |his method. Seve| 000007c0 72 61 6c 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 |ral applications| 000007d0 20 75 73 69 6e 67 20 61 20 69 64 65 6e 74 69 63 | using a identic| 000007e0 61 6c 0a 6d 65 6e 75 20 73 74 72 75 63 74 75 72 |al.menu structur| 000007f0 65 20 62 75 74 20 6e 6f 74 20 73 68 61 72 69 6e |e but not sharin| 00000800 67 20 74 68 65 20 72 65 73 6f 75 72 63 65 2c 20 |g the resource, | 00000810 69 73 20 6e 6f 74 20 74 68 65 20 70 6f 6c 69 63 |is not the polic| 00000820 79 20 6f 66 20 41 63 6f 72 6e 20 6f 6e 0a 6f 74 |y of Acorn on.ot| 00000830 68 65 72 20 73 75 62 6a 65 63 74 73 2e 20 0a 0a |her subjects. ..| 00000840 20 53 6f 20 68 65 72 65 20 69 73 20 61 20 6e 65 | So here is a ne| 00000850 61 74 20 73 6f 6c 75 74 69 6f 6e 20 66 6f 72 20 |at solution for | 00000860 65 76 65 72 79 6f 6e 65 20 77 68 6f 20 77 61 6e |everyone who wan| 00000870 74 73 20 61 20 70 72 6f 70 65 72 20 66 6f 6e 74 |ts a proper font| 00000880 20 6d 65 6e 75 2c 0a 77 69 74 68 6f 75 74 20 74 | menu,.without t| 00000890 68 65 20 68 61 73 73 65 6c 20 74 6f 20 63 72 65 |he hassel to cre| 000008a0 61 74 65 20 6f 6e 65 2c 20 61 6e 64 20 77 69 74 |ate one, and wit| 000008b0 68 6f 75 74 20 63 6c 61 69 6d 69 6e 67 20 65 78 |hout claiming ex| 000008c0 74 72 61 20 73 70 61 63 65 2e 0a 0a 20 20 20 20 |tra space... | 000008d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000008f0 20 20 20 20 20 20 20 20 20 20 20 20 20 0a 20 20 | . | 00000900 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000910 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 | .. | 00000920 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000930 20 20 20 20 57 68 61 74 20 64 6f 65 73 20 46 6f | What does Fo| 00000940 6e 74 4d 65 6e 75 20 64 6f 20 3f 0a 0a 20 54 68 |ntMenu do ?.. Th| 00000950 65 20 46 6f 6e 74 4d 65 6e 75 20 6d 6f 64 75 6c |e FontMenu modul| 00000960 65 20 69 73 20 61 62 6c 65 20 6f 66 20 63 72 65 |e is able of cre| 00000970 61 74 69 6e 67 20 61 20 6d 75 6c 74 69 2d 6c 65 |ating a multi-le| 00000980 76 65 6c 20 66 6f 6e 74 20 6d 65 6e 75 2c 20 61 |vel font menu, a| 00000990 6e 64 20 6c 65 74 73 0a 65 76 65 72 79 20 61 70 |nd lets.every ap| 000009a0 70 6c 69 63 61 74 69 6f 6e 20 73 68 61 72 65 20 |plication share | 000009b0 74 68 65 20 6a 6f 79 2e 20 49 74 20 63 6f 6e 74 |the joy. It cont| 000009c0 61 69 6e 73 20 73 65 76 65 72 61 6c 20 53 57 49 |ains several SWI| 000009d0 27 73 20 74 6f 20 63 72 65 61 74 65 2c 20 61 6e |'s to create, an| 000009e0 64 0a 61 63 63 65 73 73 20 74 68 69 73 20 72 65 |d.access this re| 000009f0 73 6f 75 72 63 65 2e 20 49 66 20 6e 6f 20 61 70 |source. If no ap| 00000a00 70 6c 69 63 61 74 69 6f 6e 20 69 73 20 75 73 69 |plication is usi| 00000a10 6e 67 20 74 68 65 20 73 74 72 75 63 74 75 72 65 |ng the structure| 00000a20 20 61 6e 79 6d 6f 72 65 0a 28 62 65 63 61 75 73 | anymore.(becaus| 00000a30 65 20 74 68 65 79 20 77 65 72 65 20 61 6c 6c 20 |e they were all | 00000a40 71 75 69 74 65 64 20 66 6f 72 20 65 78 61 6d 70 |quited for examp| 00000a50 6c 65 29 20 74 68 65 20 6d 65 6d 6f 72 79 20 66 |le) the memory f| 00000a60 6f 72 20 74 68 65 20 6d 65 6e 75 20 73 74 72 75 |or the menu stru| 00000a70 63 74 75 72 65 0a 77 69 6c 6c 20 62 65 20 72 65 |cture.will be re| 00000a80 61 6c 65 73 65 64 20 62 79 20 46 6f 6e 74 4d 65 |alesed by FontMe| 00000a90 6e 75 2c 20 73 6f 20 6e 6f 20 75 6e 6e 65 63 65 |nu, so no unnece| 00000aa0 73 73 61 72 79 20 6d 65 6d 6f 72 79 20 69 73 20 |ssary memory is | 00000ab0 69 6e 20 75 73 65 2e 20 49 74 20 68 61 73 20 6e |in use. It has n| 00000ac0 6f 0a 70 72 6f 62 6c 65 6d 73 20 69 66 20 6d 6f |o.problems if mo| 00000ad0 72 65 20 74 68 61 6e 20 6f 6e 65 20 66 6f 6e 74 |re than one font| 00000ae0 20 64 69 72 65 63 74 6f 72 79 20 69 73 20 69 6e | directory is in| 00000af0 20 75 73 65 2e 20 54 68 65 20 6d 65 6e 75 20 69 | use. The menu i| 00000b00 73 20 73 6f 72 74 65 64 0a 61 6c 70 68 61 62 65 |s sorted.alphabe| 00000b10 74 69 63 6c 79 20 28 65 76 65 6e 20 77 68 65 6e |ticly (even when| 00000b20 20 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 66 | more than one f| 00000b30 6f 6e 74 20 64 69 72 65 63 74 6f 72 69 73 20 61 |ont directoris a| 00000b40 72 65 20 75 73 65 64 29 2c 20 73 6f 20 74 68 65 |re used), so the| 00000b50 20 75 73 65 72 0a 69 73 20 61 62 6c 65 20 74 6f | user.is able to| 00000b60 20 66 69 6e 64 20 74 68 65 20 72 65 71 75 69 72 | find the requir| 00000b70 65 64 20 66 6f 6e 74 20 61 74 20 61 6e 20 69 6e |ed font at an in| 00000b80 73 74 61 6e 63 65 2e 20 49 74 20 72 65 71 75 69 |stance. It requi| 00000b90 72 65 73 20 61 20 6d 69 6e 69 6d 75 6d 20 6f 66 |res a minimum of| 00000ba0 0a 64 69 73 63 20 61 63 63 65 73 73 20 77 68 65 |.disc access whe| 00000bb0 6e 20 61 20 6e 65 77 20 6d 65 6e 75 20 69 73 20 |n a new menu is | 00000bc0 63 72 65 61 74 65 64 2e 20 4e 65 77 20 6d 65 6e |created. New men| 00000bd0 75 73 20 61 72 65 20 6f 6e 6c 79 20 63 72 65 61 |us are only crea| 00000be0 74 65 64 20 69 66 20 6f 6e 65 20 69 73 0a 72 65 |ted if one is.re| 00000bf0 71 75 69 72 65 64 2c 20 61 6e 64 20 74 68 65 72 |quired, and ther| 00000c00 65 20 69 73 6e 27 74 20 61 6c 72 65 61 64 79 20 |e isn't already | 00000c10 61 20 76 61 6c 69 64 20 6f 6e 65 2e 20 57 68 65 |a valid one. Whe| 00000c20 6e 20 61 20 66 6f 6e 74 20 6d 65 6e 75 20 65 78 |n a font menu ex| 00000c30 73 69 73 74 73 2c 20 61 6e 64 0a 74 68 65 20 75 |sists, and.the u| 00000c40 73 65 72 20 68 61 73 20 73 65 6c 65 63 74 65 64 |ser has selected| 00000c50 20 61 20 6e 65 77 20 66 6f 6e 74 20 64 69 72 65 | a new font dire| 00000c60 63 74 6f 72 79 2c 20 74 68 65 20 66 6f 6e 74 20 |ctory, the font | 00000c70 6d 65 6e 75 20 77 69 6c 6c 20 62 65 20 72 65 62 |menu will be reb| 00000c80 75 69 6c 64 20 61 73 0a 73 6f 6f 6e 20 61 73 20 |uild as.soon as | 00000c90 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 |the application | 00000ca0 61 63 63 65 73 73 65 73 20 74 68 69 73 20 66 6f |accesses this fo| 00000cb0 6e 74 20 6d 65 6e 75 2e 20 0a 0a 20 46 6f 6e 74 |nt menu. .. Font| 00000cc0 4d 65 6e 75 20 63 72 65 61 74 65 73 20 61 6e 20 |Menu creates an | 00000cd0 6d 75 6c 74 69 2d 6c 65 76 65 6c 65 64 20 66 6f |multi-leveled fo| 00000ce0 6e 74 20 6d 65 6e 75 2e 20 49 6e 20 74 68 65 20 |nt menu. In the | 00000cf0 65 78 61 6d 70 6c 65 20 61 62 6f 76 65 20 74 68 |example above th| 00000d00 69 73 20 69 73 20 61 0a 6d 65 6e 75 20 77 68 65 |is is a.menu whe| 00000d10 72 65 20 27 54 72 69 6e 69 74 79 27 20 6f 63 63 |re 'Trinity' occ| 00000d20 75 72 73 20 6f 6e 6c 79 20 6f 6e 63 65 2c 20 62 |urs only once, b| 00000d30 75 74 20 69 74 20 77 69 6c 6c 20 68 61 76 65 20 |ut it will have | 00000d40 61 20 73 75 62 6d 65 6e 75 20 63 6f 6e 74 61 69 |a submenu contai| 00000d50 6e 69 6e 67 0a 74 77 6f 20 69 74 65 6d 73 3a 20 |ning.two items: | 00000d60 27 42 6f 6c 64 27 20 61 6e 64 20 27 4d 65 64 69 |'Bold' and 'Medi| 00000d70 75 6d 27 2e 20 42 65 63 61 75 73 65 20 74 68 65 |um'. Because the| 00000d80 72 65 20 61 72 65 20 74 77 6f 20 74 79 70 65 73 |re are two types| 00000d90 20 6f 66 0a 27 54 72 69 6e 69 74 79 2e 42 6f 6c | of.'Trinity.Bol| 00000da0 64 27 20 28 27 54 72 69 6e 69 74 79 2e 42 6f 6c |d' ('Trinity.Bol| 00000db0 64 27 20 61 6e 64 20 27 54 72 69 6e 69 74 79 2e |d' and 'Trinity.| 00000dc0 42 6f 6c 64 2e 49 74 61 6c 69 63 27 29 20 27 42 |Bold.Italic') 'B| 00000dd0 6f 6c 64 27 20 77 69 6c 6c 20 68 61 76 65 0a 61 |old' will have.a| 00000de0 6e 6f 74 68 65 72 20 73 75 62 6d 65 6e 75 2e 20 |nother submenu. | 00000df0 49 6e 20 74 68 69 73 20 73 75 62 6d 65 6e 75 20 |In this submenu | 00000e00 74 68 65 20 66 69 72 73 74 20 69 74 65 6d 20 77 |the first item w| 00000e10 69 6c 6c 20 62 65 20 27 50 6c 61 69 6e 27 2e 20 |ill be 'Plain'. | 00000e20 54 68 69 73 20 6e 61 6d 65 0a 69 73 20 6d 61 64 |This name.is mad| 00000e30 65 20 75 70 2c 20 62 75 74 20 69 74 20 69 73 20 |e up, but it is | 00000e40 6d 6f 72 65 20 63 6c 65 61 72 20 74 68 65 6e 20 |more clear then | 00000e50 61 20 65 6d 70 74 79 20 6d 65 6e 75 20 65 6e 74 |a empty menu ent| 00000e60 72 79 2e 20 54 68 65 20 73 65 63 6f 6e 64 20 65 |ry. The second e| 00000e70 6e 74 72 79 0a 77 69 6c 6c 20 6f 66 20 63 6f 75 |ntry.will of cou| 00000e80 72 73 65 20 62 65 20 27 49 74 61 6c 69 63 27 2e |rse be 'Italic'.| 00000e90 0a 0a 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 |.... | 00000ea0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 48 6f | Ho| 00000eb0 77 20 64 6f 65 73 20 46 6f 6e 74 4d 65 6e 75 20 |w does FontMenu | 00000ec0 77 6f 72 6b 20 3f 0a 0a 20 54 6f 20 75 73 65 20 |work ?.. To use | 00000ed0 46 6f 6e 74 4d 65 6e 75 20 69 74 20 69 73 20 6e |FontMenu it is n| 00000ee0 65 63 65 73 73 61 72 79 20 74 6f 20 75 6e 64 65 |ecessary to unde| 00000ef0 72 73 74 61 6e 64 20 68 6f 77 20 74 68 65 20 57 |rstand how the W| 00000f00 69 6d 70 20 77 6f 72 6b 73 2c 20 61 6e 64 20 68 |imp works, and h| 00000f10 6f 77 0a 74 6f 20 63 72 65 61 74 65 20 61 20 61 |ow.to create a a| 00000f20 70 70 6c 69 63 61 74 69 6f 6e 20 6f 6e 20 74 68 |pplication on th| 00000f30 65 20 41 72 63 68 69 6d 65 64 65 73 20 65 6e 76 |e Archimedes env| 00000f40 69 72 6f 6e 6d 65 6e 74 2e 20 49 74 20 69 73 20 |ironment. It is | 00000f50 61 73 73 75 6d 65 64 20 74 68 61 74 0a 74 68 65 |assumed that.the| 00000f60 20 72 65 61 64 65 72 20 75 6e 64 65 72 73 74 61 | reader understa| 00000f70 6e 64 73 20 74 68 65 20 61 62 6f 76 65 20 66 6f |nds the above fo| 00000f80 72 20 74 68 65 20 72 65 73 74 20 6f 66 20 74 68 |r the rest of th| 00000f90 69 73 20 64 6f 63 75 6d 65 6e 74 2e 0a 0a 20 57 |is document... W| 00000fa0 68 65 6e 20 61 20 61 70 70 6c 69 63 61 74 69 6f |hen a applicatio| 00000fb0 6e 20 77 61 6e 74 73 20 74 6f 20 61 63 63 65 73 |n wants to acces| 00000fc0 73 20 74 68 65 20 46 6f 6e 74 4d 65 6e 75 20 6d |s the FontMenu m| 00000fd0 65 6e 75 20 73 74 72 75 63 74 75 72 65 2c 20 69 |enu structure, i| 00000fe0 74 20 68 61 73 20 74 6f 0a 63 61 6c 6c 20 53 57 |t has to.call SW| 00000ff0 49 20 22 46 6f 6e 74 4d 65 6e 75 5f 43 72 65 61 |I "FontMenu_Crea| 00001000 74 65 22 20 62 65 66 6f 72 65 20 61 6e 79 20 6f |te" before any o| 00001010 74 68 65 72 20 46 6f 6e 74 4d 65 6e 75 20 53 57 |ther FontMenu SW| 00001020 49 27 73 20 61 72 65 20 63 61 6c 6c 65 64 2e 20 |I's are called. | 00001030 54 68 69 73 0a 77 69 6c 6c 20 61 73 73 75 72 65 |This.will assure| 00001040 20 74 68 61 74 20 61 20 70 72 6f 70 65 72 20 66 | that a proper f| 00001050 6f 6e 74 20 6d 65 6e 75 20 73 74 72 75 63 74 75 |ont menu structu| 00001060 72 65 20 77 69 6c 6c 20 62 65 20 61 76 61 69 6c |re will be avail| 00001070 61 62 6c 65 2e 20 54 68 69 73 20 63 61 6e 20 62 |able. This can b| 00001080 65 0a 64 6f 6e 65 20 6f 6e 20 69 6e 69 74 69 61 |e.done on initia| 00001090 6c 69 73 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 |lisation of the | 000010a0 61 70 70 6c 69 63 61 74 69 6f 6e 2c 20 62 75 74 |application, but| 000010b0 20 69 73 20 6e 6f 74 20 61 62 73 6f 6c 75 74 65 | is not absolute| 000010c0 6c 79 20 6e 65 63 65 73 73 61 72 79 2e 0a 57 68 |ly necessary..Wh| 000010d0 65 6e 20 65 78 69 74 69 6e 67 20 74 68 65 20 61 |en exiting the a| 000010e0 70 70 6c 69 63 61 74 69 6f 6e 2c 20 53 57 49 20 |pplication, SWI | 000010f0 22 46 6f 6e 74 4d 65 6e 75 5f 52 65 6c 65 61 73 |"FontMenu_Releas| 00001100 65 22 20 68 61 73 20 74 6f 20 62 65 20 63 61 6c |e" has to be cal| 00001110 6c 65 64 2c 20 73 6f 20 69 66 0a 74 68 69 73 20 |led, so if.this | 00001120 77 61 73 20 74 68 65 20 6f 6e 6c 79 20 61 70 70 |was the only app| 00001130 6c 69 63 61 74 69 6f 6e 20 75 73 69 6e 67 20 74 |lication using t| 00001140 68 65 20 66 6f 6e 74 20 6d 65 6e 75 2c 20 46 6f |he font menu, Fo| 00001150 6e 74 4d 65 6e 75 20 63 61 6e 20 72 65 6c 65 61 |ntMenu can relea| 00001160 73 65 20 74 68 65 0a 6d 65 6d 6f 72 79 20 66 6f |se the.memory fo| 00001170 72 20 69 74 2e 20 45 76 65 72 79 20 74 69 6d 65 |r it. Every time| 00001180 20 53 57 49 20 22 46 6f 6e 74 4d 65 6e 75 5f 43 | SWI "FontMenu_C| 00001190 72 65 61 74 65 22 20 69 73 20 63 61 6c 6c 65 64 |reate" is called| 000011a0 2c 20 61 20 63 6f 75 6e 74 65 72 20 69 73 0a 69 |, a counter is.i| 000011b0 6e 63 72 65 6d 65 6e 74 65 64 2c 20 61 6e 64 20 |ncremented, and | 000011c0 69 66 20 69 74 20 77 61 73 20 7a 65 72 6f 20 28 |if it was zero (| 000011d0 74 68 69 73 20 69 73 20 74 68 65 20 69 6e 69 74 |this is the init| 000011e0 69 61 6c 20 76 61 6c 75 65 29 2c 20 69 74 20 77 |ial value), it w| 000011f0 69 6c 6c 20 63 72 65 61 74 65 0a 61 20 6e 65 77 |ill create.a new| 00001200 20 66 6f 6e 74 20 6d 65 6e 75 2e 20 57 68 65 6e | font menu. When| 00001210 20 63 61 6c 6c 69 6e 67 20 53 57 49 20 22 46 6f | calling SWI "Fo| 00001220 6e 74 4d 65 6e 75 5f 52 65 6c 65 61 73 65 22 2c |ntMenu_Release",| 00001230 20 74 68 65 20 63 6f 75 6e 74 65 72 20 69 73 0a | the counter is.| 00001240 64 65 63 72 65 6d 65 6e 74 65 64 2c 20 61 6e 64 |decremented, and| 00001250 20 69 66 20 69 74 20 72 65 61 63 68 65 64 20 7a | if it reached z| 00001260 65 72 6f 20 46 6f 6e 74 4d 65 6e 75 20 77 69 6c |ero FontMenu wil| 00001270 6c 20 72 65 6c 65 61 73 65 20 74 68 65 20 6d 65 |l release the me| 00001280 6e 75 20 6d 65 6d 6f 72 79 2c 0a 61 73 20 6e 6f |nu memory,.as no| 00001290 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 69 73 20 | application is | 000012a0 75 73 69 6e 67 20 74 68 65 20 6d 65 6e 75 20 73 |using the menu s| 000012b0 74 72 75 63 74 75 72 65 20 61 6e 79 6d 6f 72 65 |tructure anymore| 000012c0 2e 0a 0a 0a 20 46 72 6f 6d 20 68 65 72 65 20 6f |.... From here o| 000012d0 6e 20 74 68 65 72 65 20 61 72 65 20 74 77 6f 20 |n there are two | 000012e0 77 61 79 73 20 6f 66 20 70 72 6f 67 72 61 6d 6d |ways of programm| 000012f0 69 6e 67 20 77 68 65 6e 20 75 73 69 6e 67 20 46 |ing when using F| 00001300 6f 6e 74 4d 65 6e 75 2e 20 54 68 65 0a 66 69 72 |ontMenu. The.fir| 00001310 73 74 20 69 73 20 74 68 65 20 73 69 6d 70 6c 65 |st is the simple| 00001320 20 6f 6e 65 2c 20 74 68 65 20 73 65 63 6f 6e 64 | one, the second| 00001330 20 61 20 6c 69 74 74 6c 65 20 62 69 74 20 6d 6f | a little bit mo| 00001340 72 65 20 63 6f 6d 70 6c 69 63 61 74 65 64 2c 20 |re complicated, | 00001350 61 73 20 69 74 0a 69 6e 76 6f 6c 76 65 73 20 74 |as it.involves t| 00001360 68 65 20 75 73 65 20 74 68 65 20 57 69 6d 70 20 |he use the Wimp | 00001370 6d 65 73 73 61 67 65 20 73 79 73 74 65 6d 2e 0a |message system..| 00001380 0a 20 54 68 65 20 65 61 73 79 20 77 61 79 0a 20 |. The easy way. | 00001390 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 20 57 68 |------------. Wh| 000013a0 65 6e 65 76 65 72 20 74 68 65 20 75 73 65 72 20 |enever the user | 000013b0 6f 70 65 6e 73 20 74 68 65 20 6d 65 6e 75 20 73 |opens the menu s| 000013c0 74 72 75 63 74 75 72 65 20 6f 66 20 74 68 65 20 |tructure of the | 000013d0 61 70 70 6c 69 63 61 74 69 6f 6e 20 62 79 20 70 |application by p| 000013e0 72 65 73 73 69 6e 67 0a 74 68 65 20 4d 45 4e 55 |ressing.the MENU| 000013f0 20 62 75 74 74 6f 6e 2c 20 61 20 63 61 6c 6c 20 | button, a call | 00001400 68 61 73 20 74 6f 20 62 65 20 6d 61 64 65 20 74 |has to be made t| 00001410 6f 20 46 6f 6e 74 4d 65 6e 75 5f 53 65 6c 65 63 |o FontMenu_Selec| 00001420 74 20 77 69 74 68 20 52 30 20 70 6f 69 6e 74 69 |t with R0 pointi| 00001430 6e 67 0a 74 6f 20 61 20 70 6f 69 6e 74 20 73 65 |ng.to a point se| 00001440 70 65 61 72 74 65 64 20 28 7a 65 72 6f 20 74 65 |pearted (zero te| 00001450 72 6d 69 6e 61 74 65 64 29 20 66 6f 6e 74 20 73 |rminated) font s| 00001460 74 72 69 6e 67 2c 20 61 6e 64 20 69 6e 20 52 31 |tring, and in R1| 00001470 20 74 68 65 20 76 61 6c 75 65 20 30 20 6f 72 0a | the value 0 or.| 00001480 31 20 74 6f 20 74 65 6c 6c 20 46 6f 6e 74 4d 65 |1 to tell FontMe| 00001490 6e 75 20 69 66 20 69 74 20 61 6c 6c 6f 77 73 20 |nu if it allows | 000014a0 74 68 65 20 75 73 65 72 20 74 6f 20 73 65 6c 65 |the user to sele| 000014b0 63 74 20 74 68 65 20 53 79 73 74 65 6d 46 6f 6e |ct the SystemFon| 000014c0 74 2e 20 54 68 65 20 63 61 6c 6c 0a 77 69 6c 6c |t. The call.will| 000014d0 20 72 65 74 75 72 6e 20 77 69 74 68 20 61 20 70 | return with a p| 000014e0 6f 69 6e 74 65 72 20 74 6f 20 74 68 65 20 66 6f |ointer to the fo| 000014f0 6e 74 20 6d 65 6e 75 20 73 74 72 75 63 74 75 72 |nt menu structur| 00001500 65 20 69 6e 20 52 31 2e 20 4e 6f 77 20 69 74 20 |e in R1. Now it | 00001510 69 73 20 75 70 20 74 6f 0a 74 68 65 20 70 72 6f |is up to.the pro| 00001520 67 72 61 6d 6d 65 72 20 77 68 61 74 20 74 6f 20 |grammer what to | 00001530 64 6f 20 77 69 74 68 20 74 68 69 73 20 70 6f 69 |do with this poi| 00001540 6e 74 65 72 2e 20 57 68 65 6e 20 70 61 73 73 65 |nter. When passe| 00001550 64 20 69 6e 20 52 31 20 77 68 65 6e 20 63 61 6c |d in R1 when cal| 00001560 6c 69 6e 67 0a 57 69 6d 70 5f 43 72 65 61 74 65 |ling.Wimp_Create| 00001570 4d 65 6e 75 2c 20 74 68 65 20 6d 65 6e 75 20 74 |Menu, the menu t| 00001580 72 65 65 20 77 69 6c 6c 20 63 6f 6e 73 69 73 74 |ree will consist| 00001590 20 65 6e 74 69 72 65 6c 79 20 6f 66 20 46 6f 6e | entirely of Fon| 000015a0 74 4d 65 6e 75 20 73 74 72 75 63 74 75 72 65 73 |tMenu structures| 000015b0 2e 0a 49 66 20 74 68 65 20 66 6f 6e 74 20 6d 65 |..If the font me| 000015c0 6e 75 20 73 68 6f 75 6c 64 20 62 65 20 61 20 73 |nu should be a s| 000015d0 75 62 6d 65 6e 75 20 6f 66 20 74 68 65 20 61 70 |ubmenu of the ap| 000015e0 70 6c 69 63 61 74 69 6f 6e 73 20 6f 77 6e 20 6d |plications own m| 000015f0 65 6e 75 20 73 74 72 75 63 74 75 72 65 2c 0a 74 |enu structure,.t| 00001600 68 65 20 70 6f 69 6e 74 65 72 20 73 68 6f 75 6c |he pointer shoul| 00001610 64 20 62 65 20 70 75 74 20 69 6e 20 74 68 65 20 |d be put in the | 00001620 73 75 62 6d 65 6e 75 2d 77 6f 72 64 20 6f 66 20 |submenu-word of | 00001630 74 68 65 20 70 61 72 65 6e 74 20 6d 65 6e 75 20 |the parent menu | 00001640 65 6e 74 72 79 2c 20 61 6e 64 0a 57 69 6d 70 5f |entry, and.Wimp_| 00001650 43 72 65 61 74 65 4d 65 6e 75 20 73 68 6f 75 6c |CreateMenu shoul| 00001660 64 20 62 65 20 63 61 6c 6c 65 64 20 77 69 74 68 |d be called with| 00001670 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 | a pointer to th| 00001680 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 6f |e applications o| 00001690 77 6e 20 6d 65 6e 75 0a 73 74 72 75 63 74 75 72 |wn menu.structur| 000016a0 65 2e 0a 0a 20 57 68 65 6e 20 61 20 6d 65 6e 75 |e... When a menu| 000016b0 20 73 65 6c 65 63 74 69 6f 6e 20 77 61 73 20 64 | selection was d| 000016c0 6f 6e 65 2c 20 74 68 65 20 61 70 70 6c 69 63 61 |one, the applica| 000016d0 74 69 6f 6e 20 73 68 6f 75 6c 64 20 64 65 74 65 |tion should dete| 000016e0 72 6d 69 6e 65 20 62 79 20 74 68 65 0a 72 65 74 |rmine by the.ret| 000016f0 75 72 6e 65 64 20 27 6d 65 6e 75 20 74 72 65 65 |urned 'menu tree| 00001700 20 73 6f 20 66 61 72 27 20 76 61 6c 75 65 73 20 | so far' values | 00001710 69 66 20 74 68 65 20 75 73 65 72 20 73 65 6c 65 |if the user sele| 00001720 63 74 65 64 20 61 20 65 6e 74 72 79 20 69 6e 20 |cted a entry in | 00001730 74 68 65 20 66 6f 6e 74 0a 6d 65 6e 75 2e 20 49 |the font.menu. I| 00001740 66 20 73 6f 2c 20 69 74 20 73 68 6f 75 6c 64 20 |f so, it should | 00001750 73 65 74 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 |set an internal | 00001760 66 6c 61 67 20 28 73 61 79 20 27 46 6f 6e 74 4d |flag (say 'FontM| 00001770 65 6e 75 53 65 6c 65 63 74 65 64 27 29 20 74 6f |enuSelected') to| 00001780 0a 54 52 55 45 2c 20 65 6c 73 65 20 69 74 20 73 |.TRUE, else it s| 00001790 68 6f 75 6c 64 20 73 65 74 20 69 74 20 74 6f 20 |hould set it to | 000017a0 46 41 4c 53 45 2c 20 73 6f 20 6c 61 74 65 72 20 |FALSE, so later | 000017b0 6f 6e 20 69 74 20 69 73 20 73 74 69 6c 6c 20 6b |on it is still k| 000017c0 6e 6f 77 6e 20 69 66 20 74 68 65 0a 75 73 65 72 |nown if the.user| 000017d0 20 6d 61 79 20 68 61 76 65 20 73 65 6c 65 63 74 | may have select| 000017e0 65 64 20 61 20 6e 65 77 20 66 6f 6e 74 2e 20 41 |ed a new font. A| 000017f0 66 74 65 72 20 74 68 61 74 20 69 74 20 73 68 6f |fter that it sho| 00001800 75 6c 64 20 63 61 6c 6c 20 53 57 49 0a 22 46 6f |uld call SWI."Fo| 00001810 6e 74 4d 65 6e 75 5f 44 65 63 6f 64 65 46 6f 6e |ntMenu_DecodeFon| 00001820 74 4d 65 6e 75 22 20 77 69 74 68 20 52 30 20 70 |tMenu" with R0 p| 00001830 6f 69 6e 74 69 6e 67 20 74 6f 20 74 68 65 20 66 |ointing to the f| 00001840 69 72 73 74 20 6d 65 6e 75 20 73 65 6c 65 63 74 |irst menu select| 00001850 69 6f 6e 20 69 6e 0a 74 68 65 20 27 6d 65 6e 75 |ion in.the 'menu| 00001860 20 74 72 65 65 20 73 6f 20 66 61 72 27 20 62 6c | tree so far' bl| 00001870 6f 63 6b 20 77 68 69 63 68 20 64 65 74 65 72 6d |ock which determ| 00001880 69 6e 65 73 20 74 68 65 20 73 65 6c 65 63 74 65 |ines the selecte| 00001890 64 20 66 6f 6e 74 2e 20 52 31 20 73 68 6f 75 6c |d font. R1 shoul| 000018a0 64 0a 70 6f 69 6e 74 20 74 6f 20 61 20 62 75 66 |d.point to a buf| 000018b0 66 65 72 20 74 6f 20 63 6f 6e 74 61 69 6e 20 74 |fer to contain t| 000018c0 68 65 20 61 6e 73 77 65 72 2e 20 54 68 69 73 20 |he answer. This | 000018d0 62 75 66 66 65 72 20 6d 75 73 74 20 62 65 20 61 |buffer must be a| 000018e0 74 20 6c 65 61 73 74 20 34 38 0a 62 79 74 65 73 |t least 48.bytes| 000018f0 2e 20 49 66 20 6f 6e 20 72 65 74 75 72 6e 20 6f |. If on return o| 00001900 66 20 74 68 69 73 20 63 61 6c 6c 20 52 30 20 3e |f this call R0 >| 00001910 20 30 2c 20 74 68 65 20 75 73 65 72 20 73 65 6c | 0, the user sel| 00001920 65 63 74 65 64 20 61 20 6e 65 77 20 66 6f 6e 74 |ected a new font| 00001930 2e 20 54 68 65 0a 62 75 66 66 65 72 20 70 61 73 |. The.buffer pas| 00001940 73 65 64 20 69 6e 20 52 31 20 77 69 6c 6c 20 63 |sed in R1 will c| 00001950 6f 6e 74 61 69 6e 20 74 68 65 20 66 6f 6e 74 20 |ontain the font | 00001960 6e 61 6d 65 20 28 61 20 70 6f 69 6e 74 20 73 65 |name (a point se| 00001970 70 65 72 61 74 65 64 2c 20 7a 65 72 6f 0a 74 65 |perated, zero.te| 00001980 72 6d 69 6e 61 74 65 64 20 66 6f 6e 74 20 73 74 |rminated font st| 00001990 72 69 6e 67 29 2e 0a 0a 20 41 66 74 65 72 20 61 |ring)... After a| 000019a0 20 6d 65 6e 75 20 73 65 6c 65 63 74 69 6f 6e 2c | menu selection,| 000019b0 20 61 6e 64 20 74 61 6b 69 6e 67 20 61 70 70 72 | and taking appr| 000019c0 6f 70 72 69 61 74 65 20 61 63 74 69 6f 6e 73 2c |opriate actions,| 000019d0 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e | the application| 000019e0 0a 73 68 6f 75 6c 64 20 63 68 65 63 6b 20 74 68 |.should check th| 000019f0 65 20 6d 6f 75 73 65 20 62 75 74 74 6f 6e 20 73 |e mouse button s| 00001a00 74 61 74 65 20 74 6f 20 73 65 65 20 69 66 20 69 |tate to see if i| 00001a10 74 20 68 61 73 20 74 6f 20 63 61 6c 6c 20 53 57 |t has to call SW| 00001a20 49 0a 22 57 69 6d 70 5f 43 72 65 61 74 65 4d 65 |I."Wimp_CreateMe| 00001a30 6e 75 22 20 61 67 61 69 6e 2e 20 49 66 20 61 64 |nu" again. If ad| 00001a40 6a 75 73 74 20 77 61 73 20 75 73 65 64 20 74 6f |just was used to| 00001a50 20 6d 61 6b 65 20 74 68 65 20 73 65 6c 65 63 74 | make the select| 00001a60 69 6f 6e 2c 20 69 74 20 68 61 73 20 74 6f 0a 63 |ion, it has to.c| 00001a70 68 65 63 6b 20 20 74 68 65 20 27 46 6f 6e 74 4d |heck the 'FontM| 00001a80 65 6e 75 53 65 6c 65 63 74 65 64 27 20 66 6c 61 |enuSelected' fla| 00001a90 67 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 69 |g to determine i| 00001aa0 66 20 74 68 65 20 75 73 65 72 20 73 65 6c 65 63 |f the user selec| 00001ab0 74 65 64 20 61 20 66 6f 6e 74 0a 6d 65 6e 75 20 |ted a font.menu | 00001ac0 65 6e 74 72 79 2e 20 49 66 20 73 6f 2c 20 69 74 |entry. If so, it| 00001ad0 20 73 68 6f 75 6c 64 20 63 61 6c 6c 20 46 6f 6e | should call Fon| 00001ae0 74 4d 65 6e 75 5f 53 65 6c 65 63 74 20 61 73 20 |tMenu_Select as | 00001af0 64 65 73 63 72 69 62 65 64 20 61 62 6f 76 65 2e |described above.| 00001b00 20 54 68 69 73 0a 73 68 6f 75 6c 64 20 62 65 20 | This.should be | 00001b10 64 6f 6e 65 20 77 69 74 68 20 52 30 20 70 6f 69 |done with R0 poi| 00001b20 6e 74 69 6e 67 20 74 6f 20 74 68 65 20 73 74 72 |nting to the str| 00001b30 69 6e 67 20 46 6f 6e 74 4d 65 6e 75 5f 44 65 63 |ing FontMenu_Dec| 00001b40 6f 64 65 46 6f 6e 74 4d 65 6e 75 0a 72 65 74 75 |odeFontMenu.retu| 00001b50 72 6e 65 64 2e 20 54 68 65 20 6d 65 6e 75 20 70 |rned. The menu p| 00001b60 6f 69 6e 74 65 72 20 72 65 74 75 72 6e 65 64 20 |ointer returned | 00001b70 62 79 20 46 6f 6e 74 4d 65 6e 75 5f 53 65 6c 65 |by FontMenu_Sele| 00001b80 63 74 20 68 61 73 20 74 6f 20 62 65 20 70 75 74 |ct has to be put| 00001b90 20 69 6e 20 74 68 65 0a 27 73 75 62 2d 6d 65 6e | in the.'sub-men| 00001ba0 75 20 70 6f 69 6e 74 65 72 27 20 77 6f 72 64 20 |u pointer' word | 00001bb0 6f 66 20 74 68 65 20 27 46 6f 6e 74 73 27 20 65 |of the 'Fonts' e| 00001bc0 6e 74 72 79 2e 20 4e 6f 77 20 74 68 65 20 63 61 |ntry. Now the ca| 00001bd0 6c 6c 20 74 6f 0a 57 69 6d 70 5f 43 72 65 61 74 |ll to.Wimp_Creat| 00001be0 65 4d 65 6e 75 20 63 61 6e 20 62 65 20 64 6f 6e |eMenu can be don| 00001bf0 65 2e 20 49 6e 20 74 68 69 73 20 77 61 79 20 69 |e. In this way i| 00001c00 74 20 69 73 20 70 6f 73 73 69 62 6c 65 20 66 6f |t is possible fo| 00001c10 72 20 74 68 65 20 75 73 65 72 20 74 6f 0a 63 6c |r the user to.cl| 00001c20 69 63 6b 20 77 69 74 68 20 61 64 6a 75 73 74 20 |ick with adjust | 00001c30 69 6e 20 74 68 65 20 66 6f 6e 74 20 6d 65 6e 75 |in the font menu| 00001c40 2c 20 61 6e 64 20 6b 65 65 70 69 6e 67 20 74 68 |, and keeping th| 00001c50 65 20 6d 65 6e 75 20 6f 6e 20 73 63 72 65 65 6e |e menu on screen| 00001c60 20 61 66 74 65 72 20 74 68 65 0a 73 65 6c 65 63 | after the.selec| 00001c70 74 69 6f 6e 2e 0a 0a 20 54 68 65 72 65 20 69 73 |tion... There is| 00001c80 20 6f 6e 65 20 6c 69 74 74 6c 65 20 64 72 61 77 | one little draw| 00001c90 62 61 63 6b 20 6f 66 20 74 68 69 73 20 6d 65 74 |back of this met| 00001ca0 68 6f 64 2e 20 49 66 20 74 68 65 20 75 73 65 72 |hod. If the user| 00001cb0 20 73 65 6c 65 63 74 65 64 20 61 20 6e 65 77 0a | selected a new.| 00001cc0 21 46 6f 6e 74 73 20 64 69 72 65 63 74 6f 72 79 |!Fonts directory| 00001cd0 2c 20 69 74 20 77 69 6c 6c 20 62 65 20 6e 6f 74 |, it will be not| 00001ce0 65 64 20 62 65 20 74 68 65 20 46 6f 6e 74 4d 65 |ed be the FontMe| 00001cf0 6e 75 5f 53 65 6c 65 63 74 20 63 6f 64 65 2c 20 |nu_Select code, | 00001d00 61 6e 64 20 61 20 6e 65 77 0a 66 6f 6e 74 20 6d |and a new.font m| 00001d10 65 6e 75 20 73 74 72 75 63 74 75 72 65 20 77 69 |enu structure wi| 00001d20 6c 6c 20 62 65 20 67 65 6e 65 72 61 74 65 64 2e |ll be generated.| 00001d30 20 54 68 69 73 20 69 73 20 61 6c 77 61 79 73 20 | This is always | 00001d40 74 68 65 20 63 61 73 65 2c 20 61 6c 73 6f 20 77 |the case, also w| 00001d50 69 74 68 0a 74 68 65 20 6d 65 74 68 6f 64 20 64 |ith.the method d| 00001d60 65 73 63 72 69 62 65 64 20 62 65 6c 6f 77 2e 20 |escribed below. | 00001d70 42 75 74 20 69 74 20 63 6f 75 6c 64 20 62 65 20 |But it could be | 00001d80 70 6f 73 73 69 62 6c 65 20 74 68 61 74 20 74 68 |possible that th| 00001d90 65 20 75 73 65 72 20 77 61 73 20 67 6f 69 6e 67 |e user was going| 00001da0 0a 74 6f 20 64 6f 20 73 6f 6d 65 74 68 69 6e 67 |.to do something| 00001db0 20 65 6c 73 65 20 69 6e 20 74 68 65 20 6d 65 6e | else in the men| 00001dc0 75 2c 20 6e 6f 74 20 73 65 6c 65 63 74 69 6e 67 |u, not selecting| 00001dd0 20 61 20 66 6f 6e 74 20 61 74 20 61 6c 6c 2e 20 | a font at all. | 00001de0 48 65 20 63 6f 75 6c 64 20 66 6f 72 0a 69 6e 73 |He could for.ins| 00001df0 74 61 6e 63 65 20 77 61 6e 74 20 74 6f 20 71 75 |tance want to qu| 00001e00 69 74 2e 20 4e 6f 77 20 68 65 20 28 73 68 65 29 |it. Now he (she)| 00001e10 20 68 61 73 20 74 6f 20 77 61 69 74 20 66 6f 72 | has to wait for| 00001e20 20 74 68 65 20 46 6f 6e 74 4d 65 6e 75 20 6d 6f | the FontMenu mo| 00001e30 64 75 6c 65 20 74 6f 0a 63 72 65 61 74 65 20 74 |dule to.create t| 00001e40 68 65 20 6e 65 77 20 6d 65 6e 75 20 73 74 72 75 |he new menu stru| 00001e50 63 74 75 72 65 2c 20 62 65 66 6f 72 65 20 68 65 |cture, before he| 00001e60 20 28 73 68 65 29 20 69 73 20 61 62 6c 65 20 74 | (she) is able t| 00001e70 6f 20 61 63 63 65 73 73 20 74 68 65 20 27 51 75 |o access the 'Qu| 00001e80 69 74 27 0a 65 6e 74 72 79 2e 20 53 6f 20 74 68 |it'.entry. So th| 00001e90 65 20 6e 65 78 74 20 73 6f 6c 75 74 69 6f 6e 20 |e next solution | 00001ea0 69 73 20 74 6f 20 77 61 69 74 20 77 69 74 68 20 |is to wait with | 00001eb0 63 61 6c 6c 69 6e 67 20 46 6f 6e 74 4d 65 6e 75 |calling FontMenu| 00001ec0 5f 53 65 6c 65 63 74 2c 20 75 6e 74 69 6c 0a 74 |_Select, until.t| 00001ed0 68 65 20 75 73 65 72 20 77 61 6e 74 73 20 74 6f |he user wants to| 00001ee0 20 73 65 6c 65 63 74 20 61 20 6e 65 77 20 66 6f | select a new fo| 00001ef0 6e 74 2e 20 54 68 69 73 20 63 61 6e 20 6f 6e 6c |nt. This can onl| 00001f00 79 20 62 65 20 64 6f 6e 65 20 62 79 20 6d 61 6b |y be done by mak| 00001f10 69 6e 67 20 75 73 65 20 6f 66 0a 74 68 65 20 57 |ing use of.the W| 00001f20 69 6d 70 20 6d 65 73 73 61 67 65 20 73 79 73 74 |imp message syst| 00001f30 65 6d 2e 20 54 68 65 20 64 69 66 66 69 63 75 6c |em. The difficul| 00001f40 74 20 74 68 69 6e 67 20 6f 66 20 74 68 69 73 20 |t thing of this | 00001f50 6d 65 74 68 6f 64 20 28 61 73 20 64 65 73 63 72 |method (as descr| 00001f60 69 62 65 64 0a 6c 61 74 65 72 29 20 69 73 20 74 |ibed.later) is t| 00001f70 68 61 74 20 74 68 65 20 57 69 6d 70 20 69 73 20 |hat the Wimp is | 00001f80 75 6e 61 62 6c 65 20 74 6f 20 72 65 2d 6f 70 65 |unable to re-ope| 00001f90 6e 20 74 68 65 20 6d 65 6e 75 20 73 74 72 75 63 |n the menu struc| 00001fa0 74 75 72 65 20 65 6e 74 69 72 65 6c 79 0a 61 66 |ture entirely.af| 00001fb0 74 65 72 20 61 20 6d 65 6e 75 20 73 65 6c 65 63 |ter a menu selec| 00001fc0 74 69 6f 6e 20 75 73 69 6e 67 20 74 68 65 20 41 |tion using the A| 00001fd0 44 4a 55 53 54 20 62 75 74 74 6f 6e 2e 20 53 6f |DJUST button. So| 00001fe0 20 61 20 6c 69 74 74 6c 65 20 74 72 69 63 6b 20 | a little trick | 00001ff0 68 61 73 20 74 6f 0a 73 6f 6c 76 65 20 74 68 69 |has to.solve thi| 00002000 73 20 70 72 6f 62 6c 65 6d 2e 0a 0a 20 54 68 65 |s problem... The| 00002010 20 68 61 72 64 20 77 61 79 0a 20 2d 2d 2d 2d 2d | hard way. -----| 00002020 2d 2d 2d 2d 2d 2d 2d 0a 20 49 6e 20 74 68 65 20 |-------. In the | 00002030 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 6f 77 6e |applications own| 00002040 20 6d 65 6e 75 20 73 74 72 75 63 74 75 72 65 2c | menu structure,| 00002050 20 74 68 65 72 65 20 73 68 6f 75 6c 64 20 62 65 | there should be| 00002060 20 61 20 6d 65 6e 75 20 65 6e 74 72 79 20 28 65 | a menu entry (e| 00002070 2e 67 2e 0a 27 46 6f 6e 74 73 27 29 20 77 69 74 |.g..'Fonts') wit| 00002080 68 20 62 69 74 20 33 20 69 66 20 69 74 73 20 6d |h bit 3 if its m| 00002090 65 6e 75 20 66 6c 61 67 73 20 73 65 74 2e 20 54 |enu flags set. T| 000020a0 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 68 |he application h| 000020b0 61 73 20 74 6f 20 61 73 73 75 72 65 0a 74 68 61 |as to assure.tha| 000020c0 74 20 74 68 69 73 20 62 69 74 20 69 73 20 73 65 |t this bit is se| 000020d0 74 20 77 68 65 6e 65 76 65 72 20 69 74 20 63 61 |t whenever it ca| 000020e0 6c 6c 73 20 53 57 49 20 22 57 69 6d 70 5f 43 72 |lls SWI "Wimp_Cr| 000020f0 65 61 74 65 4d 65 6e 75 22 20 61 73 20 69 74 20 |eateMenu" as it | 00002100 6d 61 79 20 62 65 0a 63 6f 72 72 75 70 74 65 64 |may be.corrupted| 00002110 20 28 73 65 65 20 62 65 6c 6f 77 29 2e 20 53 6f | (see below). So| 00002120 20 77 68 65 6e 65 76 65 72 20 74 68 65 20 75 73 | whenever the us| 00002130 65 72 20 70 75 74 73 20 74 68 65 20 70 6f 69 6e |er puts the poin| 00002140 74 65 72 20 61 62 6f 76 65 20 74 68 65 20 61 72 |ter above the ar| 00002150 72 6f 77 0a 6f 6e 20 74 68 65 20 72 69 67 68 74 |row.on the right| 00002160 20 6f 66 20 74 68 69 73 20 65 6e 74 72 79 2c 20 | of this entry, | 00002170 61 20 77 61 72 6e 69 6e 67 20 6d 65 73 73 61 67 |a warning messag| 00002180 65 20 28 26 34 30 30 43 30 29 20 77 69 6c 6c 20 |e (&400C0) will | 00002190 62 65 20 73 65 6e 64 20 62 79 20 74 68 65 0a 57 |be send by the.W| 000021a0 69 6d 70 2e 20 4f 6e 20 72 65 63 65 69 76 69 6e |imp. On receivin| 000021b0 67 20 6f 66 20 74 68 69 73 20 6d 65 73 73 61 67 |g of this messag| 000021c0 65 2c 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 |e, the applicati| 000021d0 6f 6e 20 73 68 6f 75 6c 64 20 72 65 73 70 6f 6e |on should respon| 000021e0 64 20 62 79 20 63 61 6c 6c 69 6e 67 0a 53 57 49 |d by calling.SWI| 000021f0 20 22 46 6f 6e 74 4d 65 6e 75 5f 53 65 6c 65 63 | "FontMenu_Selec| 00002200 74 22 20 77 69 74 68 20 52 30 20 70 6f 69 6e 74 |t" with R0 point| 00002210 69 6e 67 20 74 6f 20 61 20 70 6f 69 6e 74 20 73 |ing to a point s| 00002220 65 70 65 72 61 74 65 64 20 28 7a 65 72 6f 0a 74 |eperated (zero.t| 00002230 65 72 6d 69 6e 61 74 65 64 29 20 66 6f 6e 74 20 |erminated) font | 00002240 73 74 72 69 6e 67 2c 20 61 6e 64 20 69 6e 20 52 |string, and in R| 00002250 31 20 74 68 65 20 76 61 6c 75 65 20 30 20 6f 72 |1 the value 0 or| 00002260 20 31 20 74 6f 20 74 65 6c 6c 20 46 6f 6e 74 4d | 1 to tell FontM| 00002270 65 6e 75 20 69 66 20 69 74 0a 61 6c 6c 6f 77 73 |enu if it.allows| 00002280 20 74 68 65 20 75 73 65 72 20 74 6f 20 73 65 6c | the user to sel| 00002290 65 63 74 20 74 68 65 20 53 79 73 74 65 6d 46 6f |ect the SystemFo| 000022a0 6e 74 2e 20 54 68 65 20 66 6f 6e 74 20 73 74 72 |nt. The font str| 000022b0 69 6e 67 20 6d 61 79 20 62 65 20 61 20 7a 65 72 |ing may be a zer| 000022c0 6f 0a 6c 65 6e 67 74 68 20 73 74 72 69 6e 67 2c |o.length string,| 000022d0 20 77 69 63 68 20 6d 65 61 6e 73 20 74 68 61 74 | wich means that| 000022e0 20 6e 6f 20 63 75 72 72 65 6e 74 20 66 6f 6e 74 | no current font| 000022f0 20 69 73 20 73 65 6c 65 63 74 65 64 2e 20 46 6f | is selected. Fo| 00002300 6e 74 4d 65 6e 75 20 77 69 6c 6c 0a 73 65 6c 65 |ntMenu will.sele| 00002310 63 74 20 74 68 65 20 66 6f 6e 74 20 69 6e 20 69 |ct the font in i| 00002320 74 73 20 6d 65 6e 75 20 73 74 72 75 63 74 75 72 |ts menu structur| 00002330 65 2e 20 49 66 20 31 20 77 61 73 20 70 61 73 73 |e. If 1 was pass| 00002340 65 64 20 69 6e 20 52 31 2c 20 74 68 65 20 66 69 |ed in R1, the fi| 00002350 72 73 74 20 69 74 65 6d 0a 69 6e 20 74 68 65 20 |rst item.in the | 00002360 6d 65 6e 75 20 73 74 72 75 63 74 75 72 65 20 77 |menu structure w| 00002370 69 6c 6c 20 62 65 20 27 53 79 73 74 65 6d 46 6f |ill be 'SystemFo| 00002380 6e 74 73 27 2e 20 49 6e 20 63 61 73 65 20 52 31 |nts'. In case R1| 00002390 20 3d 20 30 2c 20 74 68 69 73 20 65 6e 74 72 79 | = 0, this entry| 000023a0 20 77 69 6c 6c 0a 6e 6f 74 20 62 65 20 74 68 65 | will.not be the| 000023b0 72 65 2e 20 54 68 69 73 20 63 61 6c 6c 20 77 69 |re. This call wi| 000023c0 6c 6c 20 72 65 74 75 72 6e 20 77 69 74 68 20 61 |ll return with a| 000023d0 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 65 20 | pointer to the | 000023e0 6d 65 6e 75 20 73 74 72 75 63 74 75 72 65 20 69 |menu structure i| 000023f0 6e 0a 52 31 2e 20 54 68 69 73 20 70 6f 69 6e 74 |n.R1. This point| 00002400 65 72 20 73 68 6f 75 6c 64 20 62 65 20 70 61 73 |er should be pas| 00002410 73 65 64 20 74 6f 20 53 57 49 20 22 57 69 6d 70 |sed to SWI "Wimp| 00002420 5f 43 72 65 61 74 65 53 75 62 4d 65 6e 75 22 2e |_CreateSubMenu".| 00002430 0a 0a 20 57 68 65 6e 20 61 20 6d 65 6e 75 20 73 |.. When a menu s| 00002440 65 6c 65 63 74 69 6f 6e 20 77 61 73 20 64 6f 6e |election was don| 00002450 65 2c 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 |e, the applicati| 00002460 6f 6e 20 73 68 6f 75 6c 64 20 64 65 74 65 72 6d |on should determ| 00002470 69 6e 65 20 62 79 20 74 68 65 0a 72 65 74 75 72 |ine by the.retur| 00002480 6e 65 64 20 27 6d 65 6e 75 20 74 72 65 65 20 73 |ned 'menu tree s| 00002490 6f 20 66 61 72 27 20 76 61 6c 75 65 73 20 69 66 |o far' values if| 000024a0 20 74 68 65 20 75 73 65 72 20 73 65 6c 65 63 74 | the user select| 000024b0 65 64 20 61 20 65 6e 74 72 79 20 69 6e 20 74 68 |ed a entry in th| 000024c0 65 20 66 6f 6e 74 0a 6d 65 6e 75 2e 20 49 66 20 |e font.menu. If | 000024d0 73 6f 2c 20 69 74 20 73 68 6f 75 6c 64 20 73 65 |so, it should se| 000024e0 74 20 61 6e 20 69 6e 74 65 72 6e 61 6c 20 66 6c |t an internal fl| 000024f0 61 67 20 28 73 61 79 20 27 46 6f 6e 74 4d 65 6e |ag (say 'FontMen| 00002500 75 53 65 6c 65 63 74 65 64 27 29 20 74 6f 0a 54 |uSelected') to.T| 00002510 52 55 45 2c 20 65 6c 73 65 20 69 74 20 73 68 6f |RUE, else it sho| 00002520 75 6c 64 20 73 65 74 20 69 74 20 74 6f 20 46 41 |uld set it to FA| 00002530 4c 53 45 2c 20 73 6f 20 6c 61 74 65 72 20 6f 6e |LSE, so later on| 00002540 20 69 74 20 69 73 20 73 74 69 6c 6c 20 6b 6e 6f | it is still kno| 00002550 77 6e 20 69 66 20 74 68 65 0a 75 73 65 72 20 6d |wn if the.user m| 00002560 61 79 20 68 61 76 65 20 73 65 6c 65 63 74 65 64 |ay have selected| 00002570 20 61 20 6e 65 77 20 66 6f 6e 74 2e 20 41 66 74 | a new font. Aft| 00002580 65 72 20 74 68 61 74 20 69 74 20 73 68 6f 75 6c |er that it shoul| 00002590 64 20 63 61 6c 6c 20 53 57 49 0a 22 46 6f 6e 74 |d call SWI."Font| 000025a0 4d 65 6e 75 5f 44 65 63 6f 64 65 46 6f 6e 74 4d |Menu_DecodeFontM| 000025b0 65 6e 75 22 20 77 69 74 68 20 52 30 20 70 6f 69 |enu" with R0 poi| 000025c0 6e 74 69 6e 67 20 74 6f 20 74 68 65 20 66 69 72 |nting to the fir| 000025d0 73 74 20 6d 65 6e 75 20 73 65 6c 65 63 74 69 6f |st menu selectio| 000025e0 6e 20 69 6e 0a 74 68 65 20 27 6d 65 6e 75 20 74 |n in.the 'menu t| 000025f0 72 65 65 20 73 6f 20 66 61 72 27 20 62 6c 6f 63 |ree so far' bloc| 00002600 6b 20 77 68 69 63 68 20 64 65 74 65 72 6d 69 6e |k which determin| 00002610 65 73 20 74 68 65 20 73 65 6c 65 63 74 65 64 20 |es the selected | 00002620 66 6f 6e 74 2e 20 52 31 20 73 68 6f 75 6c 64 0a |font. R1 should.| 00002630 70 6f 69 6e 74 20 74 6f 20 61 20 62 75 66 66 65 |point to a buffe| 00002640 72 20 74 6f 20 63 6f 6e 74 61 69 6e 20 74 68 65 |r to contain the| 00002650 20 61 6e 73 77 65 72 2e 20 54 68 69 73 20 62 75 | answer. This bu| 00002660 66 66 65 72 20 6d 75 73 74 20 62 65 20 61 74 20 |ffer must be at | 00002670 6c 65 61 73 74 20 34 38 0a 62 79 74 65 73 2e 20 |least 48.bytes. | 00002680 49 66 20 6f 6e 20 72 65 74 75 72 6e 20 6f 66 20 |If on return of | 00002690 74 68 69 73 20 63 61 6c 6c 20 52 30 20 3e 20 30 |this call R0 > 0| 000026a0 2c 20 74 68 65 20 75 73 65 72 20 73 65 6c 65 63 |, the user selec| 000026b0 74 65 64 20 61 20 6e 65 77 20 66 6f 6e 74 2e 20 |ted a new font. | 000026c0 54 68 65 0a 62 75 66 66 65 72 20 70 61 73 73 65 |The.buffer passe| 000026d0 64 20 69 6e 20 52 31 20 77 69 6c 6c 20 63 6f 6e |d in R1 will con| 000026e0 74 61 69 6e 20 74 68 65 20 66 6f 6e 74 20 6e 61 |tain the font na| 000026f0 6d 65 20 28 61 20 70 6f 69 6e 74 20 73 65 70 65 |me (a point sepe| 00002700 72 61 74 65 64 2c 20 7a 65 72 6f 0a 74 65 72 6d |rated, zero.term| 00002710 69 6e 61 74 65 64 20 66 6f 6e 74 20 73 74 72 69 |inated font stri| 00002720 6e 67 29 2e 0a 0a 20 41 66 74 65 72 20 61 20 6d |ng)... After a m| 00002730 65 6e 75 20 73 65 6c 63 74 69 6f 6e 2c 20 61 6e |enu selction, an| 00002740 64 20 74 61 6b 69 6e 67 20 61 70 70 72 6f 70 72 |d taking appropr| 00002750 69 61 74 65 20 61 63 74 69 6f 6e 73 2c 20 74 68 |iate actions, th| 00002760 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 0a 73 68 |e application.sh| 00002770 6f 75 6c 64 20 63 68 65 63 6b 20 74 68 65 20 6d |ould check the m| 00002780 6f 75 73 65 20 62 75 74 74 6f 6e 20 73 74 61 74 |ouse button stat| 00002790 65 20 74 6f 20 73 65 65 20 69 66 20 69 74 20 68 |e to see if it h| 000027a0 61 73 20 74 6f 20 63 61 6c 6c 20 53 57 49 0a 22 |as to call SWI."| 000027b0 57 69 6d 70 5f 43 72 65 61 74 65 4d 65 6e 75 22 |Wimp_CreateMenu"| 000027c0 20 61 67 61 69 6e 2e 20 49 66 20 61 64 6a 75 73 | again. If adjus| 000027d0 74 20 77 61 73 20 75 73 65 64 20 74 6f 20 6d 61 |t was used to ma| 000027e0 6b 65 20 74 68 65 20 73 65 6c 65 63 74 69 6f 6e |ke the selection| 000027f0 2c 20 69 74 20 68 61 73 20 74 6f 0a 63 68 65 63 |, it has to.chec| 00002800 6b 20 20 74 68 65 20 27 46 6f 6e 74 4d 65 6e 75 |k the 'FontMenu| 00002810 53 65 6c 65 63 74 65 64 27 20 66 6c 61 67 20 74 |Selected' flag t| 00002820 6f 20 64 65 74 65 72 6d 69 6e 65 20 69 66 20 74 |o determine if t| 00002830 68 65 20 75 73 65 72 20 73 65 6c 65 63 74 65 64 |he user selected| 00002840 20 61 20 66 6f 6e 74 0a 6d 65 6e 75 20 65 6e 74 | a font.menu ent| 00002850 72 79 2e 20 49 66 20 73 6f 2c 20 69 74 20 73 68 |ry. If so, it sh| 00002860 6f 75 6c 64 20 63 61 6c 6c 20 53 57 49 20 22 46 |ould call SWI "F| 00002870 6f 6e 74 4d 65 6e 75 5f 53 65 6c 65 63 74 22 20 |ontMenu_Select" | 00002880 61 73 20 64 65 73 63 72 69 62 65 64 20 61 62 6f |as described abo| 00002890 76 65 2e 0a 54 68 69 73 20 73 68 6f 75 6c 64 20 |ve..This should | 000028a0 62 65 20 64 6f 6e 65 20 77 69 74 68 20 52 30 20 |be done with R0 | 000028b0 70 6f 69 6e 74 69 6e 67 20 74 6f 20 74 68 65 20 |pointing to the | 000028c0 73 74 72 69 6e 67 20 53 57 49 0a 22 46 6f 6e 74 |string SWI."Font| 000028d0 4d 65 6e 75 5f 44 65 63 6f 64 65 46 6f 6e 74 4d |Menu_DecodeFontM| 000028e0 65 6e 75 22 20 72 65 74 75 72 6e 65 64 2e 20 20 |enu" returned. | 000028f0 41 73 20 74 68 65 20 4d 65 6e 75 57 61 72 6e 69 |As the MenuWarni| 00002900 6e 67 46 6c 61 67 20 69 6e 20 74 68 65 20 6d 65 |ngFlag in the me| 00002910 6e 75 0a 66 6c 61 67 73 20 6f 66 20 74 68 65 20 |nu.flags of the | 00002920 6d 65 6e 75 20 65 6e 74 72 79 20 28 65 2e 67 2e |menu entry (e.g.| 00002930 20 27 46 6f 6e 74 73 27 29 20 70 72 65 63 65 64 | 'Fonts') preced| 00002940 69 6e 67 20 74 68 65 20 66 6f 6e 74 20 6d 65 6e |ing the font men| 00002950 75 20 77 61 73 20 73 65 74 0a 28 70 68 68 68 21 |u was set.(phhh!| 00002960 29 2c 20 74 68 65 20 57 69 6d 70 20 69 73 20 75 |), the Wimp is u| 00002970 6e 61 62 6c 65 20 74 6f 20 72 65 63 72 65 61 74 |nable to recreat| 00002980 69 6e 67 20 74 68 65 20 77 68 6f 6c 65 20 6d 65 |ing the whole me| 00002990 6e 75 20 74 72 65 65 20 61 75 74 6f 6d 61 74 69 |nu tree automati| 000029a0 63 61 6c 6c 79 2e 0a 53 6f 20 61 20 6c 69 74 6c |cally..So a litl| 000029b0 65 20 74 72 69 63 6b 20 68 61 73 20 74 6f 20 61 |e trick has to a| 000029c0 73 73 75 72 65 20 74 68 61 74 20 69 74 20 77 69 |ssure that it wi| 000029d0 6c 6c 20 77 6f 72 6b 20 63 6f 72 72 65 63 74 2e |ll work correct.| 000029e0 20 54 68 65 20 6d 65 6e 75 20 70 6f 69 6e 74 65 | The menu pointe| 000029f0 72 0a 72 65 74 75 72 6e 65 64 20 62 79 20 53 57 |r.returned by SW| 00002a00 49 20 22 46 6f 6e 74 4d 65 6e 75 5f 53 65 6c 65 |I "FontMenu_Sele| 00002a10 63 74 22 20 68 61 73 20 74 6f 20 62 65 20 70 75 |ct" has to be pu| 00002a20 74 20 69 6e 20 74 68 65 20 27 73 75 62 2d 6d 65 |t in the 'sub-me| 00002a30 6e 75 20 70 6f 69 6e 74 65 72 27 0a 77 6f 72 64 |nu pointer'.word| 00002a40 20 6f 66 20 74 68 65 20 27 46 6f 6e 74 73 27 20 | of the 'Fonts' | 00002a50 65 6e 74 72 79 2c 20 61 6e 64 20 74 68 65 20 4d |entry, and the M| 00002a60 65 6e 75 57 61 72 6e 69 6e 67 46 6c 61 67 20 28 |enuWarningFlag (| 00002a70 62 69 74 20 33 29 20 6f 66 20 74 68 65 20 6d 65 |bit 3) of the me| 00002a80 6e 75 20 66 6c 61 67 73 0a 77 6f 72 64 20 6f 66 |nu flags.word of| 00002a90 20 74 68 69 73 20 65 6e 74 72 79 20 73 68 6f 75 | this entry shou| 00002aa0 6c 64 20 62 65 20 63 6c 65 61 72 65 64 2e 20 4e |ld be cleared. N| 00002ab0 6f 77 20 74 68 65 20 63 61 6c 6c 20 74 6f 20 53 |ow the call to S| 00002ac0 57 49 20 22 57 69 6d 70 5f 43 72 65 61 74 65 4d |WI "Wimp_CreateM| 00002ad0 65 6e 75 22 0a 63 61 6e 20 62 65 20 64 6f 6e 65 |enu".can be done| 00002ae0 2e 20 49 6e 20 74 68 69 73 20 77 61 79 20 69 74 |. In this way it| 00002af0 20 69 73 20 70 6f 73 73 69 62 6c 65 20 66 6f 72 | is possible for| 00002b00 20 74 68 65 20 75 73 65 72 20 74 6f 20 63 6c 69 | the user to cli| 00002b10 63 6b 20 77 69 74 68 20 61 64 6a 75 73 74 20 69 |ck with adjust i| 00002b20 6e 0a 74 68 65 20 66 6f 6e 74 20 6d 65 6e 75 2c |n.the font menu,| 00002b30 20 61 6e 64 20 6b 65 65 70 69 6e 67 20 74 68 65 | and keeping the| 00002b40 20 6d 65 6e 75 20 6f 6e 20 73 63 72 65 65 6e 20 | menu on screen | 00002b50 61 66 74 65 72 20 74 68 65 20 73 65 6c 65 63 74 |after the select| 00002b60 69 6f 6e 2e 20 54 68 65 20 6e 65 78 74 0a 74 69 |ion. The next.ti| 00002b70 6d 65 20 74 68 65 20 75 73 65 72 20 6f 70 65 6e |me the user open| 00002b80 73 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f |s the applicatio| 00002b90 6e 20 6d 65 6e 75 2c 20 74 68 65 20 4d 65 6e 75 |n menu, the Menu| 00002ba0 57 61 72 6e 69 6e 67 46 6c 61 67 20 28 62 69 74 |WarningFlag (bit| 00002bb0 20 33 29 20 73 68 6f 75 6c 64 0a 62 65 20 73 65 | 3) should.be se| 00002bc0 74 20 61 67 61 69 6e 2c 20 61 73 20 6f 74 68 65 |t again, as othe| 00002bd0 72 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 6d |r applications m| 00002be0 61 79 20 68 61 76 65 20 75 73 65 64 20 74 68 65 |ay have used the| 00002bf0 20 66 6f 6e 74 20 6d 65 6e 75 20 69 6e 20 74 68 | font menu in th| 00002c00 65 0a 6d 65 61 6e 77 68 69 6c 65 2c 20 61 6e 64 |e.meanwhile, and| 00002c10 20 69 74 20 69 73 20 6e 65 63 65 73 73 61 72 79 | it is necessary| 00002c20 20 74 68 61 74 20 53 57 49 20 22 46 6f 6e 74 4d | that SWI "FontM| 00002c30 65 6e 75 5f 53 65 6c 65 63 74 22 20 69 73 20 63 |enu_Select" is c| 00002c40 61 6c 6c 65 64 20 6a 75 73 74 0a 62 65 66 6f 72 |alled just.befor| 00002c50 65 20 74 68 65 20 66 6f 6e 74 20 6d 65 6e 75 20 |e the font menu | 00002c60 6f 70 65 6e 73 2e 0a 0a 20 42 65 63 61 75 73 65 |opens... Because| 00002c70 20 73 6f 6d 65 20 46 6f 6e 74 4d 65 6e 75 20 53 | some FontMenu S| 00002c80 57 49 27 73 20 6d 61 79 20 74 61 6b 65 20 73 6f |WI's may take so| 00002c90 6d 65 20 74 69 6d 65 20 62 65 66 6f 72 65 20 74 |me time before t| 00002ca0 68 65 79 20 72 65 74 75 72 6e 0a 28 74 68 69 73 |hey return.(this| 00002cb0 20 69 73 20 64 75 65 20 74 6f 20 46 6f 6e 74 5f | is due to Font_| 00002cc0 4c 69 73 74 46 6f 6e 74 73 29 2c 20 74 68 65 20 |ListFonts), the | 00002cd0 48 6f 75 72 67 6c 61 73 73 20 4f 6e 20 26 20 4f |Hourglass On & O| 00002ce0 66 66 20 53 57 49 27 73 20 61 72 65 20 75 73 65 |ff SWI's are use| 00002cf0 64 0a 6f 6e 20 65 6e 74 72 79 20 61 6e 64 20 65 |d.on entry and e| 00002d00 78 69 74 20 72 65 73 70 65 63 74 69 76 65 6c 79 |xit respectively| 00002d10 2e 20 53 6f 20 69 6e 20 74 68 65 6f 72 79 20 69 |. So in theory i| 00002d20 74 20 69 73 20 70 6f 73 73 69 62 6c 65 20 74 68 |t is possible th| 00002d30 61 74 0a 77 68 65 6e 65 76 65 72 20 6f 6e 65 20 |at.whenever one | 00002d40 6f 66 20 74 68 65 20 46 6f 6e 74 4d 65 6e 75 20 |of the FontMenu | 00002d50 53 57 49 27 73 20 74 61 6b 65 20 6c 6f 6e 67 65 |SWI's take longe| 00002d60 72 20 74 68 61 6e 20 31 2f 33 20 6f 66 20 61 20 |r than 1/3 of a | 00002d70 73 65 63 6f 6e 64 2c 20 61 0a 68 6f 75 72 67 6c |second, a.hourgl| 00002d80 61 73 73 20 61 70 70 65 61 72 73 2e 20 49 6e 20 |ass appears. In | 00002d90 70 72 61 63 74 69 63 65 20 74 68 69 73 20 6f 6e |practice this on| 00002da0 6c 79 20 6f 63 63 75 72 73 20 77 68 65 6e 20 46 |ly occurs when F| 00002db0 6f 6e 74 4d 65 6e 75 5f 43 72 65 61 74 65 0a 6f |ontMenu_Create.o| 00002dc0 72 20 46 6f 6e 74 4d 65 6e 75 5f 53 65 6c 65 63 |r FontMenu_Selec| 00002dd0 74 20 69 73 20 63 61 6c 6c 65 64 20 61 6e 64 20 |t is called and | 00002de0 74 68 65 79 20 68 61 76 65 20 74 6f 20 61 63 74 |they have to act| 00002df0 75 61 6c 6c 79 20 63 72 65 61 74 65 20 61 20 6e |ually create a n| 00002e00 65 77 0a 6d 65 6e 75 20 73 74 72 75 63 74 75 72 |ew.menu structur| 00002e10 65 20 28 42 65 63 61 75 73 65 20 6f 66 20 61 20 |e (Because of a | 00002e20 66 69 72 73 74 20 63 61 6c 6c 2c 20 6f 72 20 61 |first call, or a| 00002e30 20 63 68 61 6e 67 65 64 20 46 6f 6e 74 24 50 61 | changed Font$Pa| 00002e40 74 68 29 2e 0a 0a 0a 0a 0a 20 20 20 20 20 20 20 |th)...... | 00002e50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002e60 20 20 20 20 20 4e 6f 74 65 73 20 66 72 6f 6d 20 | Notes from | 00002e70 74 68 65 20 61 75 74 68 6f 72 0a 0a 20 54 68 65 |the author.. The| 00002e80 20 72 65 61 73 6f 6e 20 77 68 79 20 49 20 77 72 | reason why I wr| 00002e90 6f 74 65 20 74 68 69 73 20 6d 6f 64 75 6c 65 2c |ote this module,| 00002ea0 20 69 73 20 62 65 63 61 75 73 65 20 49 27 6d 20 | is because I'm | 00002eb0 6e 6f 74 20 6f 6e 6c 79 20 61 20 70 72 6f 67 72 |not only a progr| 00002ec0 61 6d 6d 65 72 2c 0a 62 75 74 20 61 6c 73 6f 20 |ammer,.but also | 00002ed0 61 20 75 73 65 72 20 77 68 6f 20 6c 69 6b 65 73 |a user who likes| 00002ee0 20 74 6f 20 77 6f 72 6b 20 77 69 74 68 20 74 68 | to work with th| 00002ef0 65 20 41 72 63 68 69 6d 65 64 65 73 2e 20 54 68 |e Archimedes. Th| 00002f00 69 73 20 69 73 20 62 65 63 61 75 73 65 20 69 74 |is is because it| 00002f10 27 73 0a 61 20 66 61 73 74 20 6d 61 63 68 69 6e |'s.a fast machin| 00002f20 65 20 61 6e 64 20 62 65 63 61 75 73 65 20 6d 6f |e and because mo| 00002f30 73 74 20 70 61 72 74 73 20 6f 66 20 52 69 73 63 |st parts of Risc| 00002f40 2d 4f 53 20 61 6c 6c 6f 77 20 61 70 70 6c 69 63 |-OS allow applic| 00002f50 61 74 69 6f 6e 73 20 74 6f 20 62 65 0a 76 65 72 |ations to be.ver| 00002f60 79 20 69 6e 74 75 69 74 69 76 65 2e 20 49 20 64 |y intuitive. I d| 00002f70 69 64 6e 27 74 20 6c 69 6b 65 20 74 68 65 20 77 |idn't like the w| 00002f80 61 79 20 74 68 65 20 61 76 61 69 6c 61 62 6c 65 |ay the available| 00002f90 20 66 6f 6e 74 73 20 77 65 72 65 20 70 72 65 73 | fonts were pres| 00002fa0 65 6e 74 65 64 20 69 6e 0a 6d 6f 73 74 20 61 70 |ented in.most ap| 00002fb0 70 6c 69 63 61 74 69 6f 6e 73 2c 20 73 6f 20 49 |plications, so I| 00002fc0 20 73 74 61 72 74 65 64 20 74 6f 20 66 69 67 75 | started to figu| 00002fd0 72 65 20 6f 75 74 20 61 20 70 72 6f 70 65 72 20 |re out a proper | 00002fe0 73 6f 6c 75 74 69 6f 6e 3a 20 46 6f 6e 74 4d 65 |solution: FontMe| 00002ff0 6e 75 2e 0a 0a 20 49 20 68 6f 70 65 20 74 68 61 |nu... I hope tha| 00003000 74 20 66 75 74 75 72 65 20 61 70 70 6c 69 63 61 |t future applica| 00003010 74 69 6f 6e 73 20 61 64 6f 70 74 20 74 6f 20 74 |tions adopt to t| 00003020 68 69 73 20 6d 65 74 68 6f 64 2c 20 73 6f 20 70 |his method, so p| 00003030 6c 65 61 73 65 20 70 61 73 73 20 69 74 20 6f 6e |lease pass it on| 00003040 2e 0a 45 76 65 72 79 62 6f 64 79 20 69 73 20 66 |..Everybody is f| 00003050 72 65 65 20 74 6f 20 75 73 65 20 69 74 2c 20 65 |ree to use it, e| 00003060 76 65 6e 20 69 6e 20 63 6f 6d 6d 65 72 63 69 61 |ven in commercia| 00003070 6c 20 63 6f 64 65 2e 20 54 68 65 20 6f 6e 6c 79 |l code. The only| 00003080 20 72 65 73 74 72 69 63 74 69 6f 6e 0a 69 73 20 | restriction.is | 00003090 74 68 61 74 20 74 68 69 73 20 64 6f 63 75 6d 65 |that this docume| 000030a0 6e 74 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 |nt should not be| 000030b0 20 73 65 70 65 72 61 74 65 64 20 66 72 6f 6d 20 | seperated from | 000030c0 74 68 65 20 46 6f 6e 74 4d 65 6e 75 20 6d 6f 64 |the FontMenu mod| 000030d0 75 6c 65 2c 20 61 6e 64 0a 74 68 61 74 20 62 6f |ule, and.that bo| 000030e0 74 68 20 74 68 65 20 6d 6f 64 75 6c 65 20 61 6e |th the module an| 000030f0 64 20 74 68 69 73 20 64 6f 63 75 6d 65 6e 74 20 |d this document | 00003100 72 65 6d 61 69 6e 20 75 6e 63 68 61 6e 67 65 64 |remain unchanged| 00003110 2e 20 49 6e 20 63 61 73 65 20 6f 66 0a 63 6f 6d |. In case of.com| 00003120 6d 65 72 63 69 61 6c 20 75 73 65 20 49 20 77 6f |mercial use I wo| 00003130 75 6c 64 20 6c 69 6b 65 20 74 6f 20 6b 6e 6f 77 |uld like to know| 00003140 20 74 68 69 73 20 69 6e 20 61 64 76 61 6e 63 65 | this in advance| 00003150 20 28 49 20 63 6f 75 6c 64 20 74 68 61 6e 20 70 | (I could than p| 00003160 72 6f 76 69 64 65 0a 79 6f 75 20 77 69 74 68 20 |rovide.you with | 00003170 69 74 73 20 6c 61 74 65 73 74 20 72 65 6c 65 61 |its latest relea| 00003180 73 65 29 2e 20 4d 79 20 61 64 64 72 65 73 73 20 |se). My address | 00003190 69 73 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66 |is at the end of| 000031a0 20 74 68 69 73 20 64 6f 63 75 6d 65 6e 74 2e 20 | this document. | 000031b0 59 6f 75 0a 63 61 6e 20 61 6c 77 61 79 73 20 63 |You.can always c| 000031c0 6f 6e 74 61 63 74 20 6d 65 20 69 66 20 79 6f 75 |ontact me if you| 000031d0 20 66 6f 75 6e 64 20 73 6f 6d 65 20 62 75 67 2c | found some bug,| 000031e0 20 6f 72 20 77 68 65 6e 20 68 61 76 69 6e 67 20 | or when having | 000031f0 6f 74 68 65 72 0a 73 75 67 67 65 73 74 69 6f 6e |other.suggestion| 00003200 73 2e 0a 0a 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |s....-----------| 00003210 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 00003250 2d 2d 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 |--.. | 00003260 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003270 20 20 20 20 46 6f 6e 74 4d 65 6e 75 20 53 57 49 | FontMenu SWI| 00003280 27 73 0a 0a 20 20 20 20 20 20 20 20 20 20 20 42 |'s.. B| 00003290 65 6c 6f 77 20 61 72 65 20 74 68 65 20 73 68 6f |elow are the sho| 000032a0 72 74 20 64 69 73 63 72 69 70 74 69 6f 6e 73 20 |rt discriptions | 000032b0 6f 66 20 74 68 65 20 46 6f 6e 74 4d 65 6e 75 20 |of the FontMenu | 000032c0 53 57 49 27 73 2e 0a 20 20 20 20 20 20 20 20 20 |SWI's.. | 000032d0 20 20 0a 0a 46 6f 6e 74 4d 65 6e 75 5f 43 72 65 | ..FontMenu_Cre| 000032e0 61 74 65 20 26 38 44 30 38 30 0a 2d 2d 2d 2d 2d |ate &8D080.-----| 000032f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00003300 2d 0a 4f 6e 20 65 6e 74 72 79 3a 20 2d 2d 0a 4f |-.On entry: --.O| 00003310 6e 20 65 78 69 74 20 3a 20 52 30 20 3d 20 4e 75 |n exit : R0 = Nu| 00003320 6d 62 65 72 20 6f 66 20 66 6f 6e 74 73 20 66 6f |mber of fonts fo| 00003330 75 6e 64 0a 0a 20 54 68 69 73 20 77 69 6c 6c 20 |und.. This will | 00003340 63 72 65 61 74 65 20 61 20 66 6f 6e 74 20 6d 65 |create a font me| 00003350 6e 75 20 73 74 72 75 63 74 75 72 65 20 69 6e 20 |nu structure in | 00003360 52 4d 41 2c 20 69 66 20 6e 6f 74 20 61 6c 72 65 |RMA, if not alre| 00003370 61 64 79 20 64 6f 6e 65 20 73 6f 2e 20 41 6e 0a |ady done so. An.| 00003380 65 72 72 6f 72 20 6f 63 63 75 72 73 20 69 66 20 |error occurs if | 00003390 74 68 65 72 65 20 69 73 20 6e 6f 74 20 65 6e 6f |there is not eno| 000033a0 75 67 68 20 72 6f 6f 6d 20 69 6e 20 52 4d 41 20 |ugh room in RMA | 000033b0 74 6f 20 63 72 65 61 74 65 20 74 68 65 20 6d 65 |to create the me| 000033c0 6e 75 2e 0a 0a 0a 0a 46 6f 6e 74 4d 65 6e 75 5f |nu.....FontMenu_| 000033d0 52 65 6c 65 61 73 65 20 26 38 44 30 38 31 0a 2d |Release &8D081.-| 000033e0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000033f0 2d 2d 2d 2d 2d 2d 0a 4f 6e 20 65 6e 74 72 79 3a |------.On entry:| 00003400 20 2d 2d 0a 4f 6e 20 65 78 69 74 20 3a 20 2d 2d | --.On exit : --| 00003410 0a 0a 20 54 68 69 73 20 77 69 6c 6c 20 72 65 6c |.. This will rel| 00003420 65 61 73 65 20 74 68 65 20 6d 65 6d 6f 72 79 20 |ease the memory | 00003430 74 61 6b 65 6e 20 62 79 20 74 68 65 20 66 6f 6e |taken by the fon| 00003440 74 20 6d 65 6e 75 20 69 66 20 6e 6f 20 74 61 73 |t menu if no tas| 00003450 6b 73 20 61 72 65 20 75 73 69 6e 67 0a 69 74 20 |ks are using.it | 00003460 61 6e 79 6d 6f 72 65 2e 0a 0a 0a 0a 46 6f 6e 74 |anymore.....Font| 00003470 4d 65 6e 75 5f 53 65 6c 65 63 74 20 26 38 44 30 |Menu_Select &8D0| 00003480 38 32 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |82.-------------| 00003490 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 4f 6e 20 65 6e 74 |---------.On ent| 000034a0 72 79 3a 20 52 30 20 3d 20 70 6f 69 6e 74 65 72 |ry: R0 = pointer| 000034b0 20 74 6f 20 70 6f 69 6e 74 20 73 65 70 65 72 61 | to point sepera| 000034c0 74 65 64 2c 20 63 74 72 6c 20 74 65 72 6d 69 6e |ted, ctrl termin| 000034d0 61 74 65 64 20 66 6f 6e 74 20 73 74 72 69 6e 67 |ated font string| 000034e0 20 0a 20 20 20 20 20 20 20 20 20 20 52 31 20 3d | . R1 =| 000034f0 20 53 79 73 74 65 6d 46 6f 6e 74 20 66 6c 61 67 | SystemFont flag| 00003500 20 20 20 20 20 20 20 20 20 20 20 20 0a 0a 4f 6e | ..On| 00003510 20 65 78 69 74 20 3a 20 52 30 20 3d 20 53 74 61 | exit : R0 = Sta| 00003520 74 65 20 66 6c 61 67 0a 20 20 20 20 20 20 20 20 |te flag. | 00003530 20 20 52 31 20 3d 20 70 6f 69 6e 74 65 72 20 74 | R1 = pointer t| 00003540 6f 20 66 6f 6e 74 20 6d 65 6e 75 20 73 74 72 75 |o font menu stru| 00003550 63 74 75 72 65 0a 0a 20 54 68 69 73 20 77 69 6c |cture.. This wil| 00003560 6c 20 74 69 63 6b 20 74 68 65 20 66 6f 6e 74 20 |l tick the font | 00003570 70 61 73 73 65 64 20 69 6e 20 52 30 20 6f 6e 20 |passed in R0 on | 00003580 65 6e 74 72 79 2e 20 52 31 20 64 65 74 65 72 6d |entry. R1 determ| 00003590 69 6e 65 73 20 69 66 0a 27 53 79 73 74 65 6d 46 |ines if.'SystemF| 000035a0 6f 6e 74 27 20 73 68 6f 75 6c 64 20 6f 63 63 75 |ont' should occu| 000035b0 72 20 69 6e 20 74 68 65 20 6d 65 6e 75 20 61 73 |r in the menu as| 000035c0 20 66 6f 6c 6c 6f 77 73 3a 0a 0a 20 20 56 61 6c | follows:.. Val| 000035d0 75 65 20 4d 65 61 6e 69 6e 67 0a 20 20 20 20 30 |ue Meaning. 0| 000035e0 20 20 20 27 53 79 73 74 65 6d 46 6f 6e 74 27 20 | 'SystemFont' | 000035f0 64 6f 65 73 20 6e 6f 74 20 6f 63 63 75 72 20 69 |does not occur i| 00003600 6e 20 74 68 65 20 6d 65 6e 75 0a 20 20 20 20 31 |n the menu. 1| 00003610 20 20 20 27 53 79 73 74 65 6d 46 6f 6e 74 27 20 | 'SystemFont' | 00003620 64 6f 65 73 20 6f 63 63 75 72 20 69 6e 20 74 68 |does occur in th| 00003630 65 20 6d 65 6e 75 0a 20 20 20 20 20 20 20 20 20 |e menu. | 00003640 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003650 0a 20 4f 6e 20 65 78 69 74 20 52 30 20 73 68 6f |. On exit R0 sho| 00003660 77 73 20 74 68 65 20 73 65 6c 65 63 74 69 6f 6e |ws the selection| 00003670 20 73 74 61 74 65 20 61 73 20 66 6f 6c 6c 6f 77 | state as follow| 00003680 73 3a 0a 0a 20 20 56 61 6c 75 65 20 4d 65 61 6e |s:.. Value Mean| 00003690 69 6e 67 0a 20 20 20 20 30 20 20 20 54 6f 20 62 |ing. 0 To b| 000036a0 65 20 73 65 6c 65 63 74 65 64 20 66 6f 6e 74 20 |e selected font | 000036b0 6e 6f 74 20 66 6f 75 6e 64 2c 20 6e 6f 20 74 69 |not found, no ti| 000036c0 63 6b 73 0a 20 20 20 20 31 20 20 20 54 6f 20 62 |cks. 1 To b| 000036d0 65 20 73 65 6c 65 63 74 65 64 20 66 6f 6e 74 20 |e selected font | 000036e0 66 6f 75 6e 64 2c 20 61 6e 64 20 74 69 63 6b 65 |found, and ticke| 000036f0 64 20 20 0a 20 20 20 20 32 20 20 20 4e 6f 20 66 |d . 2 No f| 00003700 6f 6e 74 20 65 6e 74 72 69 65 73 20 66 6f 75 6e |ont entries foun| 00003710 64 2c 20 6d 65 6e 75 20 63 6f 6e 73 69 73 74 73 |d, menu consists| 00003720 20 6f 6e 65 20 69 74 65 6d 3b 20 27 53 79 73 74 | one item; 'Syst| 00003730 65 6d 46 6f 6e 74 27 2c 0a 20 20 20 20 20 20 20 |emFont',. | 00003740 20 61 6e 64 20 69 73 20 74 69 63 6b 65 64 0a 20 | and is ticked. | 00003750 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 000037a0 20 0a 20 52 31 20 77 69 6c 6c 20 70 6f 69 6e 74 | . R1 will point| 000037b0 20 74 6f 20 74 68 65 20 66 6f 6e 74 20 6d 65 6e | to the font men| 000037c0 75 20 6f 6e 20 65 78 69 74 2e 20 41 6e 20 65 72 |u on exit. An er| 000037d0 72 6f 72 20 6f 63 63 75 72 73 20 69 66 20 6e 6f |ror occurs if no| 000037e0 20 66 6f 6e 74 20 6d 65 6e 75 20 65 78 69 73 74 | font menu exist| 000037f0 73 2e 20 0a 0a 0a 0a 46 6f 6e 74 4d 65 6e 75 5f |s. ....FontMenu_| 00003800 44 65 73 65 6c 65 63 74 20 26 38 44 30 38 33 0a |Deselect &8D083.| 00003810 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00003820 2d 2d 2d 2d 2d 2d 2d 2d 0a 4f 6e 20 65 6e 74 72 |--------.On entr| 00003830 79 3a 20 2d 2d 2d 0a 4f 6e 20 65 78 69 74 20 3a |y: ---.On exit :| 00003840 20 2d 2d 0a 0a 20 54 68 69 73 20 77 69 6c 6c 20 | --.. This will | 00003850 63 6c 65 61 72 20 61 6c 6c 20 74 69 63 6b 73 20 |clear all ticks | 00003860 61 6e 64 20 6d 61 72 6b 73 20 6f 66 20 74 68 65 |and marks of the| 00003870 20 66 6f 6e 74 20 6d 65 6e 75 2e 20 49 74 20 69 | font menu. It i| 00003880 73 20 6e 6f 74 20 6e 65 63 65 73 73 61 72 79 0a |s not necessary.| 00003890 74 6f 20 63 61 6c 6c 20 74 68 69 73 20 53 57 49 |to call this SWI| 000038a0 20 62 65 66 6f 72 65 20 61 20 46 6f 6e 74 4d 65 | before a FontMe| 000038b0 6e 75 5f 53 65 6c 65 63 74 20 63 61 6c 6c 2c 20 |nu_Select call, | 000038c0 61 73 20 46 6f 6e 74 4d 65 6e 75 5f 53 65 6c 65 |as FontMenu_Sele| 000038d0 63 74 20 77 69 6c 6c 20 74 61 6b 65 0a 63 61 72 |ct will take.car| 000038e0 65 20 6f 66 20 63 6c 65 61 6e 69 6e 67 20 75 70 |e of cleaning up| 000038f0 20 6f 6c 64 20 73 65 6c 65 63 74 69 6f 6e 2e 20 | old selection. | 00003900 41 6e 20 65 72 72 6f 72 20 6f 63 63 75 72 73 20 |An error occurs | 00003910 69 66 20 6e 6f 20 66 6f 6e 74 20 6d 65 6e 75 20 |if no font menu | 00003920 65 78 69 73 74 73 2e 20 0a 20 20 0a 20 20 20 20 |exists. . . | 00003930 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003940 20 20 20 20 20 20 20 20 20 20 0a 0a 46 6f 6e 74 | ..Font| 00003950 4d 65 6e 75 5f 44 65 63 6f 64 65 46 6f 6e 74 4d |Menu_DecodeFontM| 00003960 65 6e 75 20 26 38 44 30 38 34 0a 2d 2d 2d 2d 2d |enu &8D084.-----| 00003970 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00003980 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 4f 6e 20 65 6e 74 |---------.On ent| 00003990 72 79 3a 20 52 30 20 3d 20 70 6f 69 6e 74 65 72 |ry: R0 = pointer| 000039a0 20 74 6f 20 61 20 6c 69 73 74 20 6f 66 20 66 6f | to a list of fo| 000039b0 6e 74 20 6d 65 6e 75 20 73 65 6c 65 63 74 69 6f |nt menu selectio| 000039c0 6e 73 0a 20 20 20 20 20 20 20 20 20 20 52 31 20 |ns. R1 | 000039d0 3d 20 70 6f 69 6e 74 65 72 20 74 6f 20 61 20 62 |= pointer to a b| 000039e0 75 66 66 65 72 20 74 6f 20 63 6f 6e 74 61 69 6e |uffer to contain| 000039f0 20 74 68 65 20 61 6e 73 77 65 72 20 0a 20 20 20 | the answer . | 00003a00 20 20 20 20 20 20 20 20 20 20 20 20 28 61 74 20 | (at | 00003a10 6c 65 61 73 74 20 34 38 20 62 79 74 65 73 20 6c |least 48 bytes l| 00003a20 6f 6e 67 29 0a 4f 6e 20 65 78 69 74 20 3a 20 52 |ong).On exit : R| 00003a30 30 20 3d 20 46 6c 61 67 20 28 30 20 3d 20 6e 6f |0 = Flag (0 = no| 00003a40 6e 2d 73 65 6e 73 69 62 6c 65 2f 20 31 3d 20 73 |n-sensible/ 1= s| 00003a50 65 6e 73 69 62 6c 65 20 73 65 6c 65 63 74 69 6f |ensible selectio| 00003a60 6e 29 0a 0a 20 54 68 69 73 20 77 69 6c 6c 20 64 |n).. This will d| 00003a70 65 63 6f 64 65 20 74 68 65 20 66 6f 6e 74 20 6d |ecode the font m| 00003a80 65 6e 75 20 73 65 6c 65 63 74 69 6f 6e 20 69 6e |enu selection in| 00003a90 74 6f 20 61 20 66 6f 6e 74 20 73 74 72 69 6e 67 |to a font string| 00003aa0 20 66 6f 72 20 74 68 65 0a 46 6f 6e 74 4d 61 6e | for the.FontMan| 00003ab0 61 67 65 72 2e 20 54 68 69 73 20 73 74 72 69 6e |ager. This strin| 00003ac0 67 20 63 61 6e 20 62 65 20 70 61 73 73 65 64 20 |g can be passed | 00003ad0 62 61 63 6b 20 74 6f 20 46 6f 6e 74 4d 65 6e 75 |back to FontMenu| 00003ae0 5f 53 65 6c 65 63 74 20 74 6f 20 74 69 63 6b 20 |_Select to tick | 00003af0 74 68 65 0a 61 70 70 72 6f 70 72 69 61 74 65 20 |the.appropriate | 00003b00 65 6e 74 72 69 65 73 2e 20 41 6e 20 65 72 72 6f |entries. An erro| 00003b10 72 20 6f 63 63 75 72 73 20 69 66 20 6e 6f 20 66 |r occurs if no f| 00003b20 6f 6e 74 20 6d 65 6e 75 20 65 78 69 73 74 73 2e |ont menu exists.| 00003b30 20 54 68 69 73 20 63 61 6c 6c 20 6d 61 6b 65 73 | This call makes| 00003b40 0a 75 73 65 20 6f 66 20 57 69 6d 70 5f 44 65 63 |.use of Wimp_Dec| 00003b50 6f 64 65 4d 65 6e 75 2c 20 62 75 74 20 61 73 20 |odeMenu, but as | 00003b60 69 74 20 69 73 20 70 6f 73 73 69 62 6c 65 20 74 |it is possible t| 00003b70 68 61 74 20 74 68 65 20 72 65 74 75 72 6e 65 64 |hat the returned| 00003b80 20 73 74 72 69 6e 67 20 65 6e 64 73 0a 77 69 74 | string ends.wit| 00003b90 68 20 27 50 6c 61 69 6e 27 20 28 61 20 6d 61 64 |h 'Plain' (a mad| 00003ba0 65 20 75 70 20 6e 61 6d 65 20 74 6f 20 64 69 73 |e up name to dis| 00003bb0 74 69 6e 67 75 69 73 65 20 61 6e 20 65 6d 70 74 |tinguise an empt| 00003bc0 79 20 73 75 62 2d 6e 61 6d 65 20 66 72 6f 6d 20 |y sub-name from | 00003bd0 74 68 65 20 72 65 73 74 0a 6f 66 20 74 68 65 20 |the rest.of the | 00003be0 73 75 62 2d 6e 61 6d 65 73 29 2c 20 69 74 20 68 |sub-names), it h| 00003bf0 61 73 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 20 |as to check for | 00003c00 74 68 69 73 2c 20 61 6e 64 20 74 68 72 6f 77 20 |this, and throw | 00003c10 61 77 61 79 20 74 68 69 73 20 6c 61 73 74 0a 73 |away this last.s| 00003c20 75 62 2d 6e 61 6d 65 20 73 6f 20 74 68 65 20 46 |ub-name so the F| 00003c30 6f 6e 74 4d 61 6e 61 67 65 72 20 63 61 6e 20 72 |ontManager can r| 00003c40 65 63 6f 67 6e 69 73 65 20 74 68 65 20 72 65 71 |ecognise the req| 00003c50 75 69 72 65 64 20 66 6f 6e 74 2e 20 0a 20 20 4f |uired font. . O| 00003c60 6e 20 65 78 69 74 20 52 30 20 63 6f 6e 61 74 61 |n exit R0 conata| 00003c70 69 6e 73 20 61 20 66 6c 61 67 20 74 65 6c 6c 69 |ins a flag telli| 00003c80 6e 67 20 79 6f 75 20 69 66 20 74 68 65 20 73 65 |ng you if the se| 00003c90 6c 65 63 74 69 6f 6e 20 74 68 65 20 75 73 65 72 |lection the user| 00003ca0 20 6d 61 64 65 20 77 61 73 0a 61 20 73 65 6e 73 | made was.a sens| 00003cb0 69 62 6c 65 20 6f 6e 65 2e 20 49 66 2c 20 66 6f |ible one. If, fo| 00003cc0 72 20 65 78 61 6d 70 6c 65 2c 20 74 68 65 20 75 |r example, the u| 00003cd0 73 65 72 20 73 65 6c 65 63 74 65 64 20 6e 6f 6e |ser selected non| 00003ce0 2d 6c 65 61 66 20 6d 65 6e 75 20 65 6e 74 72 79 |-leaf menu entry| 00003cf0 20 28 65 2e 67 2e 0a 27 54 72 69 6e 69 74 79 2e | (e.g..'Trinity.| 00003d00 4d 65 64 69 75 6d 27 29 20 74 68 65 6e 20 74 68 |Medium') then th| 00003d10 69 73 20 66 6c 61 67 20 77 69 6c 6c 20 62 65 20 |is flag will be | 00003d20 30 2e 20 49 66 20 74 68 65 20 66 6c 61 67 20 69 |0. If the flag i| 00003d30 73 20 30 2c 20 79 6f 75 20 61 72 65 0a 61 64 76 |s 0, you are.adv| 00003d40 69 73 65 64 20 6e 6f 74 20 74 6f 20 64 6f 20 61 |ised not to do a| 00003d50 6e 79 74 68 69 6e 67 2e 0a 0a 0a 0a 46 6f 6e 74 |nything.....Font| 00003d60 4d 65 6e 75 5f 53 6d 61 73 68 20 26 38 44 30 38 |Menu_Smash &8D08| 00003d70 35 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |5.--------------| 00003d80 2d 2d 2d 2d 2d 2d 2d 0a 4f 6e 20 65 6e 74 72 79 |-------.On entry| 00003d90 3a 20 2d 2d 0a 4f 6e 20 65 78 69 74 20 3a 20 2d |: --.On exit : -| 00003da0 2d 0a 0a 20 54 68 69 73 20 77 69 6c 6c 20 72 65 |-.. This will re| 00003db0 6c 65 61 73 65 20 74 68 65 20 66 6f 6e 74 20 6d |lease the font m| 00003dc0 65 6e 75 20 6d 65 6d 6f 72 79 20 77 69 74 68 6f |enu memory witho| 00003dd0 75 74 20 6c 6f 6f 6b 69 6e 67 20 61 74 20 74 68 |ut looking at th| 00003de0 65 20 61 6d 6f 75 6e 74 20 6f 66 0a 74 69 6d 65 |e amount of.time| 00003df0 73 20 46 6f 6e 74 4d 65 6e 75 5f 43 72 65 61 74 |s FontMenu_Creat| 00003e00 65 20 77 61 73 20 63 61 6c 6c 65 64 2e 0a 0a 0a |e was called....| 00003e10 0a 46 6f 6e 74 4d 65 6e 75 5f 52 65 43 72 65 61 |.FontMenu_ReCrea| 00003e20 74 65 20 26 38 44 30 38 36 0a 2d 2d 2d 2d 2d 2d |te &8D086.------| 00003e30 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00003e40 2d 2d 0a 4f 6e 20 65 6e 74 72 79 3a 20 2d 2d 0a |--.On entry: --.| 00003e50 4f 6e 20 65 78 69 74 20 3a 20 52 30 20 3d 20 4e |On exit : R0 = N| 00003e60 75 6d 62 65 72 20 6f 66 20 66 6f 6e 74 73 20 66 |umber of fonts f| 00003e70 6f 75 6e 64 0a 0a 20 54 68 69 73 20 77 69 6c 6c |ound.. This will| 00003e80 20 72 65 6c 65 61 73 65 20 61 20 65 78 69 73 74 | release a exist| 00003e90 69 6e 67 20 66 6f 6e 74 20 6d 65 6e 75 2c 20 61 |ing font menu, a| 00003ea0 6e 64 20 72 65 63 72 65 61 74 65 20 69 74 2e 0a |nd recreate it..| 00003eb0 0a 0a 0a 20 20 20 20 20 20 20 3d 3d 3d 3d 3d 3d |... ======| 00003ec0 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| * 00003ef0 3d 3d 3d 3d 3d 0a 0a 20 20 20 20 20 20 20 20 20 |=====.. | 00003f00 20 20 20 20 20 20 20 54 6f 20 63 6f 6e 74 61 63 | To contac| 00003f10 74 20 74 68 65 20 61 75 74 68 6f 72 20 6f 66 20 |t the author of | 00003f20 46 6f 6e 74 4d 65 6e 75 2c 20 70 6c 65 61 73 65 |FontMenu, please| 00003f30 20 77 72 69 74 65 20 74 6f 3a 0a 0a 20 20 20 20 | write to:.. | 00003f40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003f60 20 20 20 20 20 20 4a 6f 72 69 73 20 52 d6 6c 69 | Joris R.li| 00003f70 6e 67 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |ng. | 00003f80 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003f90 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 75 64 | Oud| 00003fa0 65 73 74 72 61 61 74 20 31 38 36 0a 20 20 20 20 |estraat 186. | 00003fb0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003fd0 20 20 20 20 20 20 38 32 36 31 20 43 57 20 4b 61 | 8261 CW Ka| 00003fe0 6d 70 65 6e 0a 20 20 20 20 20 20 20 20 20 20 20 |mpen. | 00003ff0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00004000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 | T| 00004010 68 65 20 4e 65 74 68 65 72 6c 61 6e 64 73 0a 0a |he Netherlands..| 00004020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00004040 20 20 20 20 20 20 20 20 20 20 54 65 6c 3a 30 35 | Tel:05| 00004050 32 30 32 2d 32 37 39 38 39 0a |202-27989.| 0000405a