Home » Archimedes archive » Acorn Computing » 1994 08 subscription disc.adf » 9408s » Shareware/Event/Documents/!EShellDoc/StrongHlp/FontMenu/HelpData
Shareware/Event/Documents/!EShellDoc/StrongHlp/FontMenu/HelpData
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/Documents/!EShellDoc/StrongHlp/FontMenu/HelpData |
Read OK: | ✔ |
File size: | 3FD4 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
Documentation for the FontMenu module v.1.16 � J.R�ling 1990 WARNING The SWI I use is NOT officially 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 interested, and I understand 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 outline 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 incapable 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 hassle to create one, and without claiming extra space. What does FontMenu do ? The FontMenu module is able to create 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 released 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 alphabetically (even when more than one font directory is 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 exists, 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 of 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 sent 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 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 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 recreate the whole menu tree automatically. So a litle trick has to assure that it will work correctly. 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 44 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 6f |Documentation fo| 00000010 72 20 74 68 65 20 46 6f 6e 74 4d 65 6e 75 20 6d |r the FontMenu m| 00000020 6f 64 75 6c 65 20 76 2e 31 2e 31 36 0a 0a 20 20 |odule v.1.16.. | 00000030 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000040 20 20 20 20 20 20 20 20 20 20 20 a9 20 4a 2e 52 | . J.R| 00000050 d6 6c 69 6e 67 20 31 39 39 30 0a 20 20 20 20 20 |.ling 1990. | 00000060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000070 20 20 20 0a 0a 20 20 20 20 20 20 20 20 20 20 20 | .. | 00000080 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000090 20 20 20 20 20 20 57 41 52 4e 49 4e 47 0a 0a 20 | WARNING.. | 000000a0 54 68 65 20 53 57 49 20 49 20 75 73 65 20 69 73 |The SWI I use is| 000000b0 20 4e 4f 54 20 6f 66 66 69 63 69 61 6c 6c 79 20 | NOT officially | 000000c0 61 6c 6c 6f 63 61 74 65 64 20 62 79 20 41 43 4f |allocated by ACO| 000000d0 52 4e 2e 20 49 20 64 69 64 20 74 72 79 20 74 6f |RN. I did try to| 000000e0 20 67 65 74 20 6f 6e 65 2c 20 62 75 74 0a 74 68 | get one, but.th| 000000f0 65 79 20 72 65 66 75 73 65 64 2e 20 20 57 68 79 |ey refused. Why| 00000100 2c 20 49 20 64 6f 6e 27 74 20 6b 6e 6f 77 2e 20 |, I don't know. | 00000110 50 72 6f 62 61 62 6c 79 20 62 65 63 61 75 73 65 |Probably because| 00000120 20 49 20 68 61 76 65 20 6e 6f 20 49 53 56 20 73 | I have no ISV s| 00000130 74 61 74 75 73 2c 20 61 6e 64 0a 49 20 64 69 64 |tatus, and.I did| 00000140 20 74 68 65 20 77 6f 72 6b 20 6f 6e 20 46 6f 6e | the work on Fon| 00000150 74 4d 65 6e 75 20 6e 6f 74 20 6f 6e 20 62 65 68 |tMenu not on beh| 00000160 61 6c 66 20 6f 66 20 6f 6e 65 20 63 6f 6d 70 61 |alf of one compa| 00000170 6e 79 20 69 6e 20 70 61 72 74 69 63 75 6c 61 72 |ny in particular| 00000180 2e 20 49 20 64 69 64 0a 64 69 73 63 6f 76 65 72 |. I did.discover| 00000190 20 74 68 6f 75 67 68 20 74 68 61 74 20 74 68 65 | though that the| 000001a0 72 65 20 61 72 65 20 61 20 6c 6f 74 20 6f 66 20 |re are a lot of | 000001b0 70 65 6f 70 6c 65 20 69 6e 74 65 72 65 73 74 65 |people intereste| 000001c0 64 2c 20 61 6e 64 20 49 20 75 6e 64 65 72 73 74 |d, and I underst| 000001d0 61 6e 64 0a 74 68 61 74 20 73 6f 6d 65 20 6f 66 |and.that some of| 000001e0 20 74 68 65 6d 20 61 72 65 20 61 63 74 75 61 6c | them are actual| 000001f0 6c 79 20 69 6d 70 6c 65 6d 65 6e 74 69 6e 67 20 |ly implementing | 00000200 69 74 20 69 6e 20 74 68 65 69 72 20 63 6f 64 65 |it in their code| 00000210 2e 20 53 6f 20 69 66 20 61 6e 79 6f 6e 65 0a 61 |. So if anyone.a| 00000220 74 20 41 43 4f 52 4e 20 69 73 20 72 65 61 64 69 |t ACORN is readi| 00000230 6e 67 20 74 68 69 73 2c 20 70 6c 65 61 73 65 20 |ng this, please | 00000240 72 65 63 6f 6e 73 69 64 65 72 20 6d 79 20 72 65 |reconsider my re| 00000250 71 75 65 73 74 2e 0a 0a 2d 2d 2d 2d 2d 2d 2d 2d |quest...--------| 00000260 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000002a0 2d 2d 2d 2d 0a 0a 20 20 20 20 20 20 20 20 20 20 |----.. | 000002b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000002c0 20 20 20 20 20 49 6e 74 72 6f 64 75 63 74 69 6f | Introductio| 000002d0 6e 0a 0a 20 41 73 20 6d 6f 72 65 20 61 6e 64 20 |n.. As more and | 000002e0 6d 6f 72 65 20 6f 75 74 6c 69 6e 65 20 66 6f 6e |more outline fon| 000002f0 74 73 20 66 6f 72 20 74 68 65 20 41 72 63 68 69 |ts for the Archi| 00000300 6d 65 64 65 73 20 61 72 65 20 62 65 63 6f 6d 69 |medes are becomi| 00000310 6e 67 20 61 76 61 69 6c 61 62 6c 65 2c 0a 61 20 |ng available,.a | 00000320 70 72 6f 62 6c 65 6d 20 61 72 69 73 65 73 20 66 |problem arises f| 00000330 6f 72 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 |or applications | 00000340 61 63 63 65 73 73 69 6e 67 20 74 68 65 73 65 20 |accessing these | 00000350 66 6f 6e 74 73 2e 20 54 68 65 20 6e 75 6d 62 65 |fonts. The numbe| 00000360 72 20 6f 66 0a 66 6f 6e 74 73 20 69 73 20 6e 6f |r of.fonts is no| 00000370 74 20 6b 6e 6f 77 6e 20 69 6e 20 61 64 76 61 6e |t known in advan| 00000380 63 65 2c 20 73 6f 20 74 6f 20 63 72 65 61 74 65 |ce, so to create| 00000390 20 61 20 66 6f 6e 74 20 6d 65 6e 75 20 74 68 65 | a font menu the| 000003a0 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 68 61 73 | application has| 000003b0 0a 74 6f 20 66 69 67 75 72 65 20 6f 75 74 20 74 |.to figure out t| 000003c0 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 66 6f 6e |he number of fon| 000003d0 74 73 2c 20 63 6c 61 69 6d 20 65 6e 6f 75 67 68 |ts, claim enough| 000003e0 20 73 70 61 63 65 20 74 6f 20 68 6f 6c 64 20 61 | space to hold a| 000003f0 20 66 6f 6e 74 20 6d 65 6e 75 2c 0a 61 6e 64 20 | font menu,.and | 00000400 63 72 65 61 74 65 20 69 74 2e 20 54 68 69 73 20 |create it. This | 00000410 63 61 6e 20 62 65 20 64 6f 6e 65 20 69 6e 20 74 |can be done in t| 00000420 68 65 20 64 75 6c 6c 20 73 69 6e 67 6c 65 20 6c |he dull single l| 00000430 65 76 65 6c 20 28 73 74 72 61 69 67 68 74 20 66 |evel (straight f| 00000440 6f 72 77 61 72 64 29 0a 77 61 79 2e 20 54 68 69 |orward).way. Thi| 00000450 73 20 73 61 76 65 73 20 73 6f 6d 65 20 73 70 61 |s saves some spa| 00000460 63 65 2c 20 61 6e 64 20 63 6f 64 65 20 63 6f 6d |ce, and code com| 00000470 70 6c 65 78 69 74 79 2c 20 62 75 74 20 69 74 20 |plexity, but it | 00000480 69 73 20 6e 6f 74 20 70 72 65 66 65 72 72 65 64 |is not preferred| 00000490 2c 20 61 73 0a 74 68 65 20 75 73 65 72 20 77 69 |, as.the user wi| 000004a0 6c 6c 20 62 65 20 70 72 65 73 65 6e 74 65 64 20 |ll be presented | 000004b0 62 79 20 61 20 73 6f 6d 65 74 69 6d 65 73 20 76 |by a sometimes v| 000004c0 65 72 79 20 6c 6f 6e 67 20 6d 65 6e 75 20 63 6f |ery long menu co| 000004d0 6e 74 61 69 6e 69 6e 67 20 69 74 65 6d 73 0a 77 |ntaining items.w| 000004e0 69 74 68 20 74 68 65 20 73 61 6d 65 20 70 72 65 |ith the same pre| 000004f0 66 69 78 2c 20 65 2e 67 2e 20 0a 0a 20 20 20 20 |fix, e.g. .. | 00000500 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000510 20 20 20 20 20 20 20 20 20 54 72 69 6e 69 74 79 | Trinity| 00000520 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00000530 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 72 | Tr| 00000540 69 6e 69 74 79 2e 42 6f 6c 64 0a 20 20 20 20 20 |inity.Bold. | 00000550 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000560 20 20 20 20 20 20 20 20 54 72 69 6e 69 74 79 2e | Trinity.| 00000570 42 6f 6c 64 2e 49 74 61 6c 69 63 0a 20 20 20 20 |Bold.Italic. | 00000580 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000590 20 20 20 20 20 20 20 20 20 54 72 69 6e 69 74 79 | Trinity| 000005a0 2e 4d 65 64 69 75 6d 0a 20 20 20 20 20 20 20 20 |.Medium. | 000005b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000005c0 20 20 20 20 20 54 72 69 6e 69 74 79 2e 4d 65 64 | Trinity.Med| 000005d0 69 75 6d 2e 49 74 61 6c 69 63 0a 20 20 20 20 20 |ium.Italic. | 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 65 74 63 2e 0a 0a 20 54 | etc... T| 00000600 68 65 20 6d 6f 72 65 20 66 6f 6e 74 73 20 62 65 |he more fonts be| 00000610 63 6f 6d 65 20 61 76 61 69 6c 61 62 6c 65 2c 20 |come available, | 00000620 74 68 65 20 6c 6f 6e 67 65 72 20 74 68 69 73 20 |the longer this | 00000630 6d 65 6e 75 20 62 65 63 6f 6d 65 73 2c 20 74 68 |menu becomes, th| 00000640 65 20 6d 6f 72 65 0a 69 72 72 69 74 61 74 69 6e |e more.irritatin| 00000650 67 20 69 74 20 69 73 2e 20 0a 0a 20 4d 61 6e 79 |g it is. .. Many| 00000660 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 6e 6f | applications no| 00000670 77 20 61 72 65 20 65 76 65 6e 20 69 6e 63 61 70 |w are even incap| 00000680 61 62 6c 65 20 6f 66 20 63 72 65 61 74 69 6e 67 |able of creating| 00000690 20 6d 65 6e 75 73 20 6c 6f 6e 67 65 72 20 74 68 | menus longer th| 000006a0 65 6e 20 61 0a 63 65 72 74 61 69 6e 20 61 6d 6f |en a.certain amo| 000006b0 75 6e 74 2e 20 45 78 61 6d 70 6c 65 73 20 6f 66 |unt. Examples of| 000006c0 20 74 68 65 73 65 20 61 72 65 20 21 45 64 69 74 | these are !Edit| 000006d0 20 28 34 38 20 65 6e 74 72 69 65 73 29 2c 20 21 | (48 entries), !| 000006e0 44 72 61 77 20 28 36 34 0a 65 6e 74 72 69 65 73 |Draw (64.entries| 000006f0 29 2c 20 61 6e 64 20 65 76 65 6e 20 21 49 6d 70 |), and even !Imp| 00000700 72 65 73 73 69 6f 6e 20 72 65 61 63 74 73 20 73 |ression reacts s| 00000710 69 63 6b 2e 0a 0a 20 57 68 65 6e 20 72 75 6e 6e |ick... When runn| 00000720 69 6e 67 20 6d 6f 72 65 20 74 68 65 6e 20 6f 6e |ing more then on| 00000730 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 77 69 |e application wi| 00000740 74 68 20 61 20 66 6f 6e 74 20 6d 65 6e 75 2c 20 |th a font menu, | 00000750 74 68 65 72 65 20 69 73 20 61 72 69 73 65 73 0a |there is arises.| 00000760 61 6e 6f 74 68 65 72 20 64 69 73 61 64 76 61 6e |another disadvan| 00000770 74 61 67 65 20 6f 66 20 74 68 69 73 20 6d 65 74 |tage of this met| 00000780 68 6f 64 2e 20 53 65 76 65 72 61 6c 20 61 70 70 |hod. Several app| 00000790 6c 69 63 61 74 69 6f 6e 73 20 75 73 69 6e 67 20 |lications using | 000007a0 61 20 69 64 65 6e 74 69 63 61 6c 0a 6d 65 6e 75 |a identical.menu| 000007b0 20 73 74 72 75 63 74 75 72 65 20 62 75 74 20 6e | structure but n| 000007c0 6f 74 20 73 68 61 72 69 6e 67 20 74 68 65 20 72 |ot sharing the r| 000007d0 65 73 6f 75 72 63 65 2c 20 69 73 20 6e 6f 74 20 |esource, is not | 000007e0 74 68 65 20 70 6f 6c 69 63 79 20 6f 66 20 41 63 |the policy of Ac| 000007f0 6f 72 6e 20 6f 6e 0a 6f 74 68 65 72 20 73 75 62 |orn on.other sub| 00000800 6a 65 63 74 73 2e 20 0a 0a 20 53 6f 20 68 65 72 |jects. .. So her| 00000810 65 20 69 73 20 61 20 6e 65 61 74 20 73 6f 6c 75 |e is a neat solu| 00000820 74 69 6f 6e 20 66 6f 72 20 65 76 65 72 79 6f 6e |tion for everyon| 00000830 65 20 77 68 6f 20 77 61 6e 74 73 20 61 20 70 72 |e who wants a pr| 00000840 6f 70 65 72 20 66 6f 6e 74 20 6d 65 6e 75 2c 0a |oper font menu,.| 00000850 77 69 74 68 6f 75 74 20 74 68 65 20 68 61 73 73 |without the hass| 00000860 6c 65 20 74 6f 20 63 72 65 61 74 65 20 6f 6e 65 |le to create one| 00000870 2c 20 61 6e 64 20 77 69 74 68 6f 75 74 20 63 6c |, and without cl| 00000880 61 69 6d 69 6e 67 20 65 78 74 72 61 20 73 70 61 |aiming extra spa| 00000890 63 65 2e 0a 0a 0a 20 20 20 20 20 20 20 20 20 20 |ce.... | 000008a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000008b0 57 68 61 74 20 64 6f 65 73 20 46 6f 6e 74 4d 65 |What does FontMe| 000008c0 6e 75 20 64 6f 20 3f 0a 0a 20 54 68 65 20 46 6f |nu do ?.. The Fo| 000008d0 6e 74 4d 65 6e 75 20 6d 6f 64 75 6c 65 20 69 73 |ntMenu module is| 000008e0 20 61 62 6c 65 20 74 6f 20 63 72 65 61 74 65 20 | able to create | 000008f0 61 20 6d 75 6c 74 69 2d 6c 65 76 65 6c 20 66 6f |a multi-level fo| 00000900 6e 74 20 6d 65 6e 75 2c 20 61 6e 64 20 6c 65 74 |nt menu, and let| 00000910 73 0a 65 76 65 72 79 20 61 70 70 6c 69 63 61 74 |s.every applicat| 00000920 69 6f 6e 20 73 68 61 72 65 20 74 68 65 20 6a 6f |ion share the jo| 00000930 79 2e 20 49 74 20 63 6f 6e 74 61 69 6e 73 20 73 |y. It contains s| 00000940 65 76 65 72 61 6c 20 53 57 49 27 73 20 74 6f 20 |everal SWI's to | 00000950 63 72 65 61 74 65 2c 20 61 6e 64 0a 61 63 63 65 |create, and.acce| 00000960 73 73 20 74 68 69 73 20 72 65 73 6f 75 72 63 65 |ss this resource| 00000970 2e 20 49 66 20 6e 6f 20 61 70 70 6c 69 63 61 74 |. If no applicat| 00000980 69 6f 6e 20 69 73 20 75 73 69 6e 67 20 74 68 65 |ion is using the| 00000990 20 73 74 72 75 63 74 75 72 65 20 61 6e 79 6d 6f | structure anymo| 000009a0 72 65 0a 28 62 65 63 61 75 73 65 20 74 68 65 79 |re.(because they| 000009b0 20 77 65 72 65 20 61 6c 6c 20 71 75 69 74 65 64 | were all quited| 000009c0 20 66 6f 72 20 65 78 61 6d 70 6c 65 29 20 74 68 | for example) th| 000009d0 65 20 6d 65 6d 6f 72 79 20 66 6f 72 20 74 68 65 |e memory for the| 000009e0 20 6d 65 6e 75 20 73 74 72 75 63 74 75 72 65 0a | menu structure.| 000009f0 77 69 6c 6c 20 62 65 20 72 65 6c 65 61 73 65 64 |will be released| 00000a00 20 62 79 20 46 6f 6e 74 4d 65 6e 75 2c 20 73 6f | by FontMenu, so| 00000a10 20 6e 6f 20 75 6e 6e 65 63 65 73 73 61 72 79 20 | no unnecessary | 00000a20 6d 65 6d 6f 72 79 20 69 73 20 69 6e 20 75 73 65 |memory is in use| 00000a30 2e 20 49 74 20 68 61 73 20 6e 6f 0a 70 72 6f 62 |. It has no.prob| 00000a40 6c 65 6d 73 20 69 66 20 6d 6f 72 65 20 74 68 61 |lems if more tha| 00000a50 6e 20 6f 6e 65 20 66 6f 6e 74 20 64 69 72 65 63 |n one font direc| 00000a60 74 6f 72 79 20 69 73 20 69 6e 20 75 73 65 2e 20 |tory is in use. | 00000a70 54 68 65 20 6d 65 6e 75 20 69 73 20 73 6f 72 74 |The menu is sort| 00000a80 65 64 0a 61 6c 70 68 61 62 65 74 69 63 61 6c 6c |ed.alphabeticall| 00000a90 79 20 28 65 76 65 6e 20 77 68 65 6e 20 6d 6f 72 |y (even when mor| 00000aa0 65 20 74 68 61 6e 20 6f 6e 65 20 66 6f 6e 74 20 |e than one font | 00000ab0 64 69 72 65 63 74 6f 72 79 20 69 73 20 75 73 65 |directory is use| 00000ac0 64 29 2c 20 73 6f 20 74 68 65 20 75 73 65 72 0a |d), so the user.| 00000ad0 69 73 20 61 62 6c 65 20 74 6f 20 66 69 6e 64 20 |is able to find | 00000ae0 74 68 65 20 72 65 71 75 69 72 65 64 20 66 6f 6e |the required fon| 00000af0 74 20 61 74 20 61 6e 20 69 6e 73 74 61 6e 63 65 |t at an instance| 00000b00 2e 20 49 74 20 72 65 71 75 69 72 65 73 20 61 20 |. It requires a | 00000b10 6d 69 6e 69 6d 75 6d 20 6f 66 0a 64 69 73 63 20 |minimum of.disc | 00000b20 61 63 63 65 73 73 20 77 68 65 6e 20 61 20 6e 65 |access when a ne| 00000b30 77 20 6d 65 6e 75 20 69 73 20 63 72 65 61 74 65 |w menu is create| 00000b40 64 2e 20 4e 65 77 20 6d 65 6e 75 73 20 61 72 65 |d. New menus are| 00000b50 20 6f 6e 6c 79 20 63 72 65 61 74 65 64 20 69 66 | only created if| 00000b60 20 6f 6e 65 20 69 73 0a 72 65 71 75 69 72 65 64 | one is.required| 00000b70 2c 20 61 6e 64 20 74 68 65 72 65 20 69 73 6e 27 |, and there isn'| 00000b80 74 20 61 6c 72 65 61 64 79 20 61 20 76 61 6c 69 |t already a vali| 00000b90 64 20 6f 6e 65 2e 20 57 68 65 6e 20 61 20 66 6f |d one. When a fo| 00000ba0 6e 74 20 6d 65 6e 75 20 65 78 69 73 74 73 2c 20 |nt menu exists, | 00000bb0 61 6e 64 0a 74 68 65 20 75 73 65 72 20 68 61 73 |and.the user has| 00000bc0 20 73 65 6c 65 63 74 65 64 20 61 20 6e 65 77 20 | selected a new | 00000bd0 66 6f 6e 74 20 64 69 72 65 63 74 6f 72 79 2c 20 |font directory, | 00000be0 74 68 65 20 66 6f 6e 74 20 6d 65 6e 75 20 77 69 |the font menu wi| 00000bf0 6c 6c 20 62 65 20 72 65 62 75 69 6c 64 20 61 73 |ll be rebuild as| 00000c00 0a 73 6f 6f 6e 20 61 73 20 74 68 65 20 61 70 70 |.soon as the app| 00000c10 6c 69 63 61 74 69 6f 6e 20 61 63 63 65 73 73 65 |lication accesse| 00000c20 73 20 74 68 69 73 20 66 6f 6e 74 20 6d 65 6e 75 |s this font menu| 00000c30 2e 20 0a 0a 20 46 6f 6e 74 4d 65 6e 75 20 63 72 |. .. FontMenu cr| 00000c40 65 61 74 65 73 20 61 6e 20 6d 75 6c 74 69 2d 6c |eates an multi-l| 00000c50 65 76 65 6c 65 64 20 66 6f 6e 74 20 6d 65 6e 75 |eveled font menu| 00000c60 2e 20 49 6e 20 74 68 65 20 65 78 61 6d 70 6c 65 |. In the example| 00000c70 20 61 62 6f 76 65 20 74 68 69 73 20 69 73 20 61 | above this is a| 00000c80 0a 6d 65 6e 75 20 77 68 65 72 65 20 27 54 72 69 |.menu where 'Tri| 00000c90 6e 69 74 79 27 20 6f 63 63 75 72 73 20 6f 6e 6c |nity' occurs onl| 00000ca0 79 20 6f 6e 63 65 2c 20 62 75 74 20 69 74 20 77 |y once, but it w| 00000cb0 69 6c 6c 20 68 61 76 65 20 61 20 73 75 62 6d 65 |ill have a subme| 00000cc0 6e 75 20 63 6f 6e 74 61 69 6e 69 6e 67 0a 74 77 |nu containing.tw| 00000cd0 6f 20 69 74 65 6d 73 3a 20 27 42 6f 6c 64 27 20 |o items: 'Bold' | 00000ce0 61 6e 64 20 27 4d 65 64 69 75 6d 27 2e 20 42 65 |and 'Medium'. Be| 00000cf0 63 61 75 73 65 20 74 68 65 72 65 20 61 72 65 20 |cause there are | 00000d00 74 77 6f 20 74 79 70 65 73 20 6f 66 0a 27 54 72 |two types of.'Tr| 00000d10 69 6e 69 74 79 2e 42 6f 6c 64 27 20 28 27 54 72 |inity.Bold' ('Tr| 00000d20 69 6e 69 74 79 2e 42 6f 6c 64 27 20 61 6e 64 20 |inity.Bold' and | 00000d30 27 54 72 69 6e 69 74 79 2e 42 6f 6c 64 2e 49 74 |'Trinity.Bold.It| 00000d40 61 6c 69 63 27 29 20 27 42 6f 6c 64 27 20 77 69 |alic') 'Bold' wi| 00000d50 6c 6c 20 68 61 76 65 0a 61 6e 6f 74 68 65 72 20 |ll have.another | 00000d60 73 75 62 6d 65 6e 75 2e 20 49 6e 20 74 68 69 73 |submenu. In this| 00000d70 20 73 75 62 6d 65 6e 75 20 74 68 65 20 66 69 72 | submenu the fir| 00000d80 73 74 20 69 74 65 6d 20 77 69 6c 6c 20 62 65 20 |st item will be | 00000d90 27 50 6c 61 69 6e 27 2e 20 54 68 69 73 20 6e 61 |'Plain'. This na| 00000da0 6d 65 0a 69 73 20 6d 61 64 65 20 75 70 2c 20 62 |me.is made up, b| 00000db0 75 74 20 69 74 20 69 73 20 6d 6f 72 65 20 63 6c |ut it is more cl| 00000dc0 65 61 72 20 74 68 65 6e 20 61 20 65 6d 70 74 79 |ear then a empty| 00000dd0 20 6d 65 6e 75 20 65 6e 74 72 79 2e 20 54 68 65 | menu entry. The| 00000de0 20 73 65 63 6f 6e 64 20 65 6e 74 72 79 0a 77 69 | second entry.wi| 00000df0 6c 6c 20 6f 66 20 63 6f 75 72 73 65 20 62 65 20 |ll of course be | 00000e00 27 49 74 61 6c 69 63 27 2e 0a 0a 0a 0a 20 20 20 |'Italic'..... | 00000e10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000e20 20 20 20 20 20 20 20 48 6f 77 20 64 6f 65 73 20 | How does | 00000e30 46 6f 6e 74 4d 65 6e 75 20 77 6f 72 6b 20 3f 0a |FontMenu work ?.| 00000e40 0a 20 54 6f 20 75 73 65 20 46 6f 6e 74 4d 65 6e |. To use FontMen| 00000e50 75 20 69 74 20 69 73 20 6e 65 63 65 73 73 61 72 |u it is necessar| 00000e60 79 20 74 6f 20 75 6e 64 65 72 73 74 61 6e 64 20 |y to understand | 00000e70 68 6f 77 20 74 68 65 20 57 69 6d 70 20 77 6f 72 |how the Wimp wor| 00000e80 6b 73 2c 20 61 6e 64 20 68 6f 77 0a 74 6f 20 63 |ks, and how.to c| 00000e90 72 65 61 74 65 20 61 20 61 70 70 6c 69 63 61 74 |reate a applicat| 00000ea0 69 6f 6e 20 6f 6e 20 74 68 65 20 41 72 63 68 69 |ion on the Archi| 00000eb0 6d 65 64 65 73 20 65 6e 76 69 72 6f 6e 6d 65 6e |medes environmen| 00000ec0 74 2e 20 49 74 20 69 73 20 61 73 73 75 6d 65 64 |t. It is assumed| 00000ed0 20 74 68 61 74 0a 74 68 65 20 72 65 61 64 65 72 | that.the reader| 00000ee0 20 75 6e 64 65 72 73 74 61 6e 64 73 20 74 68 65 | understands the| 00000ef0 20 61 62 6f 76 65 20 66 6f 72 20 74 68 65 20 72 | above for the r| 00000f00 65 73 74 20 6f 66 20 74 68 69 73 20 64 6f 63 75 |est of this docu| 00000f10 6d 65 6e 74 2e 0a 0a 20 57 68 65 6e 20 61 20 61 |ment... When a a| 00000f20 70 70 6c 69 63 61 74 69 6f 6e 20 77 61 6e 74 73 |pplication wants| 00000f30 20 74 6f 20 61 63 63 65 73 73 20 74 68 65 20 46 | to access the F| 00000f40 6f 6e 74 4d 65 6e 75 20 6d 65 6e 75 20 73 74 72 |ontMenu menu str| 00000f50 75 63 74 75 72 65 2c 20 69 74 20 68 61 73 20 74 |ucture, it has t| 00000f60 6f 0a 63 61 6c 6c 20 53 57 49 20 22 46 6f 6e 74 |o.call SWI "Font| 00000f70 4d 65 6e 75 5f 43 72 65 61 74 65 22 20 62 65 66 |Menu_Create" bef| 00000f80 6f 72 65 20 61 6e 79 20 6f 74 68 65 72 20 46 6f |ore any other Fo| 00000f90 6e 74 4d 65 6e 75 20 53 57 49 27 73 20 61 72 65 |ntMenu SWI's are| 00000fa0 20 63 61 6c 6c 65 64 2e 20 54 68 69 73 0a 77 69 | called. This.wi| 00000fb0 6c 6c 20 61 73 73 75 72 65 20 74 68 61 74 20 61 |ll assure that a| 00000fc0 20 70 72 6f 70 65 72 20 66 6f 6e 74 20 6d 65 6e | proper font men| 00000fd0 75 20 73 74 72 75 63 74 75 72 65 20 77 69 6c 6c |u structure will| 00000fe0 20 62 65 20 61 76 61 69 6c 61 62 6c 65 2e 20 54 | be available. T| 00000ff0 68 69 73 20 63 61 6e 20 62 65 0a 64 6f 6e 65 20 |his can be.done | 00001000 6f 6e 20 69 6e 69 74 69 61 6c 69 73 61 74 69 6f |on initialisatio| 00001010 6e 20 6f 66 20 74 68 65 20 61 70 70 6c 69 63 61 |n of the applica| 00001020 74 69 6f 6e 2c 20 62 75 74 20 69 73 20 6e 6f 74 |tion, but is not| 00001030 20 61 62 73 6f 6c 75 74 65 6c 79 20 6e 65 63 65 | absolutely nece| 00001040 73 73 61 72 79 2e 0a 57 68 65 6e 20 65 78 69 74 |ssary..When exit| 00001050 69 6e 67 20 74 68 65 20 61 70 70 6c 69 63 61 74 |ing the applicat| 00001060 69 6f 6e 2c 20 53 57 49 20 22 46 6f 6e 74 4d 65 |ion, SWI "FontMe| 00001070 6e 75 5f 52 65 6c 65 61 73 65 22 20 68 61 73 20 |nu_Release" has | 00001080 74 6f 20 62 65 20 63 61 6c 6c 65 64 2c 20 73 6f |to be called, so| 00001090 20 69 66 0a 74 68 69 73 20 77 61 73 20 74 68 65 | if.this was the| 000010a0 20 6f 6e 6c 79 20 61 70 70 6c 69 63 61 74 69 6f | only applicatio| 000010b0 6e 20 75 73 69 6e 67 20 74 68 65 20 66 6f 6e 74 |n using the font| 000010c0 20 6d 65 6e 75 2c 20 46 6f 6e 74 4d 65 6e 75 20 | menu, FontMenu | 000010d0 63 61 6e 20 72 65 6c 65 61 73 65 20 74 68 65 0a |can release the.| 000010e0 6d 65 6d 6f 72 79 20 66 6f 72 20 69 74 2e 20 45 |memory for it. E| 000010f0 76 65 72 79 20 74 69 6d 65 20 53 57 49 20 22 46 |very time SWI "F| 00001100 6f 6e 74 4d 65 6e 75 5f 43 72 65 61 74 65 22 20 |ontMenu_Create" | 00001110 69 73 20 63 61 6c 6c 65 64 2c 20 61 20 63 6f 75 |is called, a cou| 00001120 6e 74 65 72 20 69 73 0a 69 6e 63 72 65 6d 65 6e |nter is.incremen| 00001130 74 65 64 2c 20 61 6e 64 20 69 66 20 69 74 20 77 |ted, and if it w| 00001140 61 73 20 7a 65 72 6f 20 28 74 68 69 73 20 69 73 |as zero (this is| 00001150 20 74 68 65 20 69 6e 69 74 69 61 6c 20 76 61 6c | the initial val| 00001160 75 65 29 2c 20 69 74 20 77 69 6c 6c 20 63 72 65 |ue), it will cre| 00001170 61 74 65 0a 61 20 6e 65 77 20 66 6f 6e 74 20 6d |ate.a new font m| 00001180 65 6e 75 2e 20 57 68 65 6e 20 63 61 6c 6c 69 6e |enu. When callin| 00001190 67 20 53 57 49 20 22 46 6f 6e 74 4d 65 6e 75 5f |g SWI "FontMenu_| 000011a0 52 65 6c 65 61 73 65 22 2c 20 74 68 65 20 63 6f |Release", the co| 000011b0 75 6e 74 65 72 20 69 73 0a 64 65 63 72 65 6d 65 |unter is.decreme| 000011c0 6e 74 65 64 2c 20 61 6e 64 20 69 66 20 69 74 20 |nted, and if it | 000011d0 72 65 61 63 68 65 64 20 7a 65 72 6f 20 46 6f 6e |reached zero Fon| 000011e0 74 4d 65 6e 75 20 77 69 6c 6c 20 72 65 6c 65 61 |tMenu will relea| 000011f0 73 65 20 74 68 65 20 6d 65 6e 75 20 6d 65 6d 6f |se the menu memo| 00001200 72 79 2c 0a 61 73 20 6e 6f 20 61 70 70 6c 69 63 |ry,.as no applic| 00001210 61 74 69 6f 6e 20 69 73 20 75 73 69 6e 67 20 74 |ation is using t| 00001220 68 65 20 6d 65 6e 75 20 73 74 72 75 63 74 75 72 |he menu structur| 00001230 65 20 61 6e 79 6d 6f 72 65 2e 0a 0a 0a 20 46 72 |e anymore.... Fr| 00001240 6f 6d 20 68 65 72 65 20 6f 6e 20 74 68 65 72 65 |om here on there| 00001250 20 61 72 65 20 74 77 6f 20 77 61 79 73 20 6f 66 | are two ways of| 00001260 20 70 72 6f 67 72 61 6d 6d 69 6e 67 20 77 68 65 | programming whe| 00001270 6e 20 75 73 69 6e 67 20 46 6f 6e 74 4d 65 6e 75 |n using FontMenu| 00001280 2e 20 54 68 65 0a 66 69 72 73 74 20 69 73 20 74 |. The.first is t| 00001290 68 65 20 73 69 6d 70 6c 65 20 6f 6e 65 2c 20 74 |he simple one, t| 000012a0 68 65 20 73 65 63 6f 6e 64 20 61 20 6c 69 74 74 |he second a litt| 000012b0 6c 65 20 62 69 74 20 6d 6f 72 65 20 63 6f 6d 70 |le bit more comp| 000012c0 6c 69 63 61 74 65 64 2c 20 61 73 20 69 74 0a 69 |licated, as it.i| 000012d0 6e 76 6f 6c 76 65 73 20 74 68 65 20 75 73 65 20 |nvolves the use | 000012e0 74 68 65 20 57 69 6d 70 20 6d 65 73 73 61 67 65 |the Wimp message| 000012f0 20 73 79 73 74 65 6d 2e 0a 0a 20 54 68 65 20 65 | system... The e| 00001300 61 73 79 20 77 61 79 0a 20 2d 2d 2d 2d 2d 2d 2d |asy way. -------| 00001310 2d 2d 2d 2d 2d 0a 20 57 68 65 6e 65 76 65 72 20 |-----. Whenever | 00001320 74 68 65 20 75 73 65 72 20 6f 70 65 6e 73 20 74 |the user opens t| 00001330 68 65 20 6d 65 6e 75 20 73 74 72 75 63 74 75 72 |he menu structur| 00001340 65 20 6f 66 20 74 68 65 20 61 70 70 6c 69 63 61 |e of the applica| 00001350 74 69 6f 6e 20 62 79 20 70 72 65 73 73 69 6e 67 |tion by pressing| 00001360 0a 74 68 65 20 4d 45 4e 55 20 62 75 74 74 6f 6e |.the MENU button| 00001370 2c 20 61 20 63 61 6c 6c 20 68 61 73 20 74 6f 20 |, a call has to | 00001380 62 65 20 6d 61 64 65 20 74 6f 20 46 6f 6e 74 4d |be made to FontM| 00001390 65 6e 75 5f 53 65 6c 65 63 74 20 77 69 74 68 20 |enu_Select with | 000013a0 52 30 20 70 6f 69 6e 74 69 6e 67 0a 74 6f 20 61 |R0 pointing.to a| 000013b0 20 70 6f 69 6e 74 20 73 65 70 65 61 72 74 65 64 | point sepearted| 000013c0 20 28 7a 65 72 6f 20 74 65 72 6d 69 6e 61 74 65 | (zero terminate| 000013d0 64 29 20 66 6f 6e 74 20 73 74 72 69 6e 67 2c 20 |d) font string, | 000013e0 61 6e 64 20 69 6e 20 52 31 20 74 68 65 20 76 61 |and in R1 the va| 000013f0 6c 75 65 20 30 20 6f 72 0a 31 20 74 6f 20 74 65 |lue 0 or.1 to te| 00001400 6c 6c 20 46 6f 6e 74 4d 65 6e 75 20 69 66 20 69 |ll FontMenu if i| 00001410 74 20 61 6c 6c 6f 77 73 20 74 68 65 20 75 73 65 |t allows the use| 00001420 72 20 74 6f 20 73 65 6c 65 63 74 20 74 68 65 20 |r to select the | 00001430 53 79 73 74 65 6d 46 6f 6e 74 2e 20 54 68 65 20 |SystemFont. The | 00001440 63 61 6c 6c 0a 77 69 6c 6c 20 72 65 74 75 72 6e |call.will return| 00001450 20 77 69 74 68 20 61 20 70 6f 69 6e 74 65 72 20 | with a pointer | 00001460 74 6f 20 74 68 65 20 66 6f 6e 74 20 6d 65 6e 75 |to the font menu| 00001470 20 73 74 72 75 63 74 75 72 65 20 69 6e 20 52 31 | structure in R1| 00001480 2e 20 4e 6f 77 20 69 74 20 69 73 20 75 70 20 74 |. Now it is up t| 00001490 6f 0a 74 68 65 20 70 72 6f 67 72 61 6d 6d 65 72 |o.the programmer| 000014a0 20 77 68 61 74 20 74 6f 20 64 6f 20 77 69 74 68 | what to do with| 000014b0 20 74 68 69 73 20 70 6f 69 6e 74 65 72 2e 20 57 | this pointer. W| 000014c0 68 65 6e 20 70 61 73 73 65 64 20 69 6e 20 52 31 |hen passed in R1| 000014d0 20 77 68 65 6e 20 63 61 6c 6c 69 6e 67 0a 57 69 | when calling.Wi| 000014e0 6d 70 5f 43 72 65 61 74 65 4d 65 6e 75 2c 20 74 |mp_CreateMenu, t| 000014f0 68 65 20 6d 65 6e 75 20 74 72 65 65 20 77 69 6c |he menu tree wil| 00001500 6c 20 63 6f 6e 73 69 73 74 20 65 6e 74 69 72 65 |l consist entire| 00001510 6c 79 20 6f 66 20 46 6f 6e 74 4d 65 6e 75 20 73 |ly of FontMenu s| 00001520 74 72 75 63 74 75 72 65 73 2e 0a 49 66 20 74 68 |tructures..If th| 00001530 65 20 66 6f 6e 74 20 6d 65 6e 75 20 73 68 6f 75 |e font menu shou| 00001540 6c 64 20 62 65 20 61 20 73 75 62 6d 65 6e 75 20 |ld be a submenu | 00001550 6f 66 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 |of the applicati| 00001560 6f 6e 73 20 6f 77 6e 20 6d 65 6e 75 20 73 74 72 |ons own menu str| 00001570 75 63 74 75 72 65 2c 0a 74 68 65 20 70 6f 69 6e |ucture,.the poin| 00001580 74 65 72 20 73 68 6f 75 6c 64 20 62 65 20 70 75 |ter should be pu| 00001590 74 20 69 6e 20 74 68 65 20 73 75 62 6d 65 6e 75 |t in the submenu| 000015a0 2d 77 6f 72 64 20 6f 66 20 74 68 65 20 70 61 72 |-word of the par| 000015b0 65 6e 74 20 6d 65 6e 75 20 65 6e 74 72 79 2c 20 |ent menu entry, | 000015c0 61 6e 64 0a 57 69 6d 70 5f 43 72 65 61 74 65 4d |and.Wimp_CreateM| 000015d0 65 6e 75 20 73 68 6f 75 6c 64 20 62 65 20 63 61 |enu should be ca| 000015e0 6c 6c 65 64 20 77 69 74 68 20 61 20 70 6f 69 6e |lled with a poin| 000015f0 74 65 72 20 74 6f 20 74 68 65 20 61 70 70 6c 69 |ter to the appli| 00001600 63 61 74 69 6f 6e 73 20 6f 77 6e 20 6d 65 6e 75 |cations own menu| 00001610 0a 73 74 72 75 63 74 75 72 65 2e 0a 0a 20 57 68 |.structure... Wh| 00001620 65 6e 20 61 20 6d 65 6e 75 20 73 65 6c 65 63 74 |en a menu select| 00001630 69 6f 6e 20 77 61 73 20 64 6f 6e 65 2c 20 74 68 |ion was done, th| 00001640 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 73 68 |e application sh| 00001650 6f 75 6c 64 20 64 65 74 65 72 6d 69 6e 65 20 62 |ould determine b| 00001660 79 20 74 68 65 0a 72 65 74 75 72 6e 65 64 20 27 |y the.returned '| 00001670 6d 65 6e 75 20 74 72 65 65 20 73 6f 20 66 61 72 |menu tree so far| 00001680 27 20 76 61 6c 75 65 73 20 69 66 20 74 68 65 20 |' values if the | 00001690 75 73 65 72 20 73 65 6c 65 63 74 65 64 20 61 20 |user selected a | 000016a0 65 6e 74 72 79 20 69 6e 20 74 68 65 20 66 6f 6e |entry in the fon| 000016b0 74 0a 6d 65 6e 75 2e 20 49 66 20 73 6f 2c 20 69 |t.menu. If so, i| 000016c0 74 20 73 68 6f 75 6c 64 20 73 65 74 20 61 6e 20 |t should set an | 000016d0 69 6e 74 65 72 6e 61 6c 20 66 6c 61 67 20 28 73 |internal flag (s| 000016e0 61 79 20 27 46 6f 6e 74 4d 65 6e 75 53 65 6c 65 |ay 'FontMenuSele| 000016f0 63 74 65 64 27 29 20 74 6f 0a 54 52 55 45 2c 20 |cted') to.TRUE, | 00001700 65 6c 73 65 20 69 74 20 73 68 6f 75 6c 64 20 73 |else it should s| 00001710 65 74 20 69 74 20 74 6f 20 46 41 4c 53 45 2c 20 |et it to FALSE, | 00001720 73 6f 20 6c 61 74 65 72 20 6f 6e 20 69 74 20 69 |so later on it i| 00001730 73 20 73 74 69 6c 6c 20 6b 6e 6f 77 6e 20 69 66 |s still known if| 00001740 20 74 68 65 0a 75 73 65 72 20 6d 61 79 20 68 61 | the.user may ha| 00001750 76 65 20 73 65 6c 65 63 74 65 64 20 61 20 6e 65 |ve selected a ne| 00001760 77 20 66 6f 6e 74 2e 20 41 66 74 65 72 20 74 68 |w font. After th| 00001770 61 74 20 69 74 20 73 68 6f 75 6c 64 20 63 61 6c |at it should cal| 00001780 6c 20 53 57 49 0a 22 46 6f 6e 74 4d 65 6e 75 5f |l SWI."FontMenu_| 00001790 44 65 63 6f 64 65 46 6f 6e 74 4d 65 6e 75 22 20 |DecodeFontMenu" | 000017a0 77 69 74 68 20 52 30 20 70 6f 69 6e 74 69 6e 67 |with R0 pointing| 000017b0 20 74 6f 20 74 68 65 20 66 69 72 73 74 20 6d 65 | to the first me| 000017c0 6e 75 20 73 65 6c 65 63 74 69 6f 6e 20 69 6e 0a |nu selection in.| 000017d0 74 68 65 20 27 6d 65 6e 75 20 74 72 65 65 20 73 |the 'menu tree s| 000017e0 6f 20 66 61 72 27 20 62 6c 6f 63 6b 20 77 68 69 |o far' block whi| 000017f0 63 68 20 64 65 74 65 72 6d 69 6e 65 73 20 74 68 |ch determines th| 00001800 65 20 73 65 6c 65 63 74 65 64 20 66 6f 6e 74 2e |e selected font.| 00001810 20 52 31 20 73 68 6f 75 6c 64 0a 70 6f 69 6e 74 | R1 should.point| 00001820 20 74 6f 20 61 20 62 75 66 66 65 72 20 74 6f 20 | to a buffer to | 00001830 63 6f 6e 74 61 69 6e 20 74 68 65 20 61 6e 73 77 |contain the answ| 00001840 65 72 2e 20 54 68 69 73 20 62 75 66 66 65 72 20 |er. This buffer | 00001850 6d 75 73 74 20 62 65 20 61 74 20 6c 65 61 73 74 |must be at least| 00001860 20 34 38 0a 62 79 74 65 73 2e 20 49 66 20 6f 6e | 48.bytes. If on| 00001870 20 72 65 74 75 72 6e 20 6f 66 20 74 68 69 73 20 | return of this | 00001880 63 61 6c 6c 20 52 30 20 3e 20 30 2c 20 74 68 65 |call R0 > 0, the| 00001890 20 75 73 65 72 20 73 65 6c 65 63 74 65 64 20 61 | user selected a| 000018a0 20 6e 65 77 20 66 6f 6e 74 2e 20 54 68 65 0a 62 | new font. The.b| 000018b0 75 66 66 65 72 20 70 61 73 73 65 64 20 69 6e 20 |uffer passed in | 000018c0 52 31 20 77 69 6c 6c 20 63 6f 6e 74 61 69 6e 20 |R1 will contain | 000018d0 74 68 65 20 66 6f 6e 74 20 6e 61 6d 65 20 28 61 |the font name (a| 000018e0 20 70 6f 69 6e 74 20 73 65 70 65 72 61 74 65 64 | point seperated| 000018f0 2c 20 7a 65 72 6f 0a 74 65 72 6d 69 6e 61 74 65 |, zero.terminate| 00001900 64 20 66 6f 6e 74 20 73 74 72 69 6e 67 29 2e 0a |d font string)..| 00001910 0a 20 41 66 74 65 72 20 61 20 6d 65 6e 75 20 73 |. After a menu s| 00001920 65 6c 65 63 74 69 6f 6e 2c 20 61 6e 64 20 74 61 |election, and ta| 00001930 6b 69 6e 67 20 61 70 70 72 6f 70 72 69 61 74 65 |king appropriate| 00001940 20 61 63 74 69 6f 6e 73 2c 20 74 68 65 20 61 70 | actions, the ap| 00001950 70 6c 69 63 61 74 69 6f 6e 0a 73 68 6f 75 6c 64 |plication.should| 00001960 20 63 68 65 63 6b 20 74 68 65 20 6d 6f 75 73 65 | check the mouse| 00001970 20 62 75 74 74 6f 6e 20 73 74 61 74 65 20 74 6f | button state to| 00001980 20 73 65 65 20 69 66 20 69 74 20 68 61 73 20 74 | see if it has t| 00001990 6f 20 63 61 6c 6c 20 53 57 49 0a 22 57 69 6d 70 |o call SWI."Wimp| 000019a0 5f 43 72 65 61 74 65 4d 65 6e 75 22 20 61 67 61 |_CreateMenu" aga| 000019b0 69 6e 2e 20 49 66 20 61 64 6a 75 73 74 20 77 61 |in. If adjust wa| 000019c0 73 20 75 73 65 64 20 74 6f 20 6d 61 6b 65 20 74 |s used to make t| 000019d0 68 65 20 73 65 6c 65 63 74 69 6f 6e 2c 20 69 74 |he selection, it| 000019e0 20 68 61 73 20 74 6f 0a 63 68 65 63 6b 20 20 74 | has to.check t| 000019f0 68 65 20 27 46 6f 6e 74 4d 65 6e 75 53 65 6c 65 |he 'FontMenuSele| 00001a00 63 74 65 64 27 20 66 6c 61 67 20 74 6f 20 64 65 |cted' flag to de| 00001a10 74 65 72 6d 69 6e 65 20 69 66 20 74 68 65 20 75 |termine if the u| 00001a20 73 65 72 20 73 65 6c 65 63 74 65 64 20 61 20 66 |ser selected a f| 00001a30 6f 6e 74 0a 6d 65 6e 75 20 65 6e 74 72 79 2e 20 |ont.menu entry. | 00001a40 49 66 20 73 6f 2c 20 69 74 20 73 68 6f 75 6c 64 |If so, it should| 00001a50 20 63 61 6c 6c 20 46 6f 6e 74 4d 65 6e 75 5f 53 | call FontMenu_S| 00001a60 65 6c 65 63 74 20 61 73 20 64 65 73 63 72 69 62 |elect as describ| 00001a70 65 64 20 61 62 6f 76 65 2e 20 54 68 69 73 0a 73 |ed above. This.s| 00001a80 68 6f 75 6c 64 20 62 65 20 64 6f 6e 65 20 77 69 |hould be done wi| 00001a90 74 68 20 52 30 20 70 6f 69 6e 74 69 6e 67 20 74 |th R0 pointing t| 00001aa0 6f 20 74 68 65 20 73 74 72 69 6e 67 20 46 6f 6e |o the string Fon| 00001ab0 74 4d 65 6e 75 5f 44 65 63 6f 64 65 46 6f 6e 74 |tMenu_DecodeFont| 00001ac0 4d 65 6e 75 0a 72 65 74 75 72 6e 65 64 2e 20 54 |Menu.returned. T| 00001ad0 68 65 20 6d 65 6e 75 20 70 6f 69 6e 74 65 72 20 |he menu pointer | 00001ae0 72 65 74 75 72 6e 65 64 20 62 79 20 46 6f 6e 74 |returned by Font| 00001af0 4d 65 6e 75 5f 53 65 6c 65 63 74 20 68 61 73 20 |Menu_Select has | 00001b00 74 6f 20 62 65 20 70 75 74 20 69 6e 20 74 68 65 |to be put in the| 00001b10 0a 27 73 75 62 2d 6d 65 6e 75 20 70 6f 69 6e 74 |.'sub-menu point| 00001b20 65 72 27 20 77 6f 72 64 20 6f 66 20 74 68 65 20 |er' word of the | 00001b30 27 46 6f 6e 74 73 27 20 65 6e 74 72 79 2e 20 4e |'Fonts' entry. N| 00001b40 6f 77 20 74 68 65 20 63 61 6c 6c 20 74 6f 0a 57 |ow the call to.W| 00001b50 69 6d 70 5f 43 72 65 61 74 65 4d 65 6e 75 20 63 |imp_CreateMenu c| 00001b60 61 6e 20 62 65 20 64 6f 6e 65 2e 20 49 6e 20 74 |an be done. In t| 00001b70 68 69 73 20 77 61 79 20 69 74 20 69 73 20 70 6f |his way it is po| 00001b80 73 73 69 62 6c 65 20 66 6f 72 20 74 68 65 20 75 |ssible for the u| 00001b90 73 65 72 20 74 6f 0a 63 6c 69 63 6b 20 77 69 74 |ser to.click wit| 00001ba0 68 20 61 64 6a 75 73 74 20 69 6e 20 74 68 65 20 |h adjust in the | 00001bb0 66 6f 6e 74 20 6d 65 6e 75 2c 20 61 6e 64 20 6b |font menu, and k| 00001bc0 65 65 70 69 6e 67 20 74 68 65 20 6d 65 6e 75 20 |eeping the menu | 00001bd0 6f 6e 20 73 63 72 65 65 6e 20 61 66 74 65 72 20 |on screen after | 00001be0 74 68 65 0a 73 65 6c 65 63 74 69 6f 6e 2e 0a 0a |the.selection...| 00001bf0 20 54 68 65 72 65 20 69 73 20 6f 6e 65 20 6c 69 | There is one li| 00001c00 74 74 6c 65 20 64 72 61 77 62 61 63 6b 20 6f 66 |ttle drawback of| 00001c10 20 74 68 69 73 20 6d 65 74 68 6f 64 2e 20 49 66 | this method. If| 00001c20 20 74 68 65 20 75 73 65 72 20 73 65 6c 65 63 74 | the user select| 00001c30 65 64 20 61 20 6e 65 77 0a 21 46 6f 6e 74 73 20 |ed a new.!Fonts | 00001c40 64 69 72 65 63 74 6f 72 79 2c 20 69 74 20 77 69 |directory, it wi| 00001c50 6c 6c 20 62 65 20 6e 6f 74 65 64 20 62 65 20 74 |ll be noted be t| 00001c60 68 65 20 46 6f 6e 74 4d 65 6e 75 5f 53 65 6c 65 |he FontMenu_Sele| 00001c70 63 74 20 63 6f 64 65 2c 20 61 6e 64 20 61 20 6e |ct code, and a n| 00001c80 65 77 0a 66 6f 6e 74 20 6d 65 6e 75 20 73 74 72 |ew.font menu str| 00001c90 75 63 74 75 72 65 20 77 69 6c 6c 20 62 65 20 67 |ucture will be g| 00001ca0 65 6e 65 72 61 74 65 64 2e 20 54 68 69 73 20 69 |enerated. This i| 00001cb0 73 20 61 6c 77 61 79 73 20 74 68 65 20 63 61 73 |s always the cas| 00001cc0 65 2c 20 61 6c 73 6f 20 77 69 74 68 0a 74 68 65 |e, also with.the| 00001cd0 20 6d 65 74 68 6f 64 20 64 65 73 63 72 69 62 65 | method describe| 00001ce0 64 20 62 65 6c 6f 77 2e 20 42 75 74 20 69 74 20 |d below. But it | 00001cf0 63 6f 75 6c 64 20 62 65 20 70 6f 73 73 69 62 6c |could be possibl| 00001d00 65 20 74 68 61 74 20 74 68 65 20 75 73 65 72 20 |e that the user | 00001d10 77 61 73 20 67 6f 69 6e 67 0a 74 6f 20 64 6f 20 |was going.to do | 00001d20 73 6f 6d 65 74 68 69 6e 67 20 65 6c 73 65 20 69 |something else i| 00001d30 6e 20 74 68 65 20 6d 65 6e 75 2c 20 6e 6f 74 20 |n the menu, not | 00001d40 73 65 6c 65 63 74 69 6e 67 20 61 20 66 6f 6e 74 |selecting a font| 00001d50 20 61 74 20 61 6c 6c 2e 20 48 65 20 63 6f 75 6c | at all. He coul| 00001d60 64 20 66 6f 72 0a 69 6e 73 74 61 6e 63 65 20 77 |d for.instance w| 00001d70 61 6e 74 20 74 6f 20 71 75 69 74 2e 20 4e 6f 77 |ant to quit. Now| 00001d80 20 68 65 20 28 73 68 65 29 20 68 61 73 20 74 6f | he (she) has to| 00001d90 20 77 61 69 74 20 66 6f 72 20 74 68 65 20 46 6f | wait for the Fo| 00001da0 6e 74 4d 65 6e 75 20 6d 6f 64 75 6c 65 20 74 6f |ntMenu module to| 00001db0 0a 63 72 65 61 74 65 20 74 68 65 20 6e 65 77 20 |.create the new | 00001dc0 6d 65 6e 75 20 73 74 72 75 63 74 75 72 65 2c 20 |menu structure, | 00001dd0 62 65 66 6f 72 65 20 68 65 20 28 73 68 65 29 20 |before he (she) | 00001de0 69 73 20 61 62 6c 65 20 74 6f 20 61 63 63 65 73 |is able to acces| 00001df0 73 20 74 68 65 20 27 51 75 69 74 27 0a 65 6e 74 |s the 'Quit'.ent| 00001e00 72 79 2e 20 53 6f 20 74 68 65 20 6e 65 78 74 20 |ry. So the next | 00001e10 73 6f 6c 75 74 69 6f 6e 20 69 73 20 74 6f 20 77 |solution is to w| 00001e20 61 69 74 20 77 69 74 68 20 63 61 6c 6c 69 6e 67 |ait with calling| 00001e30 20 46 6f 6e 74 4d 65 6e 75 5f 53 65 6c 65 63 74 | FontMenu_Select| 00001e40 2c 20 75 6e 74 69 6c 0a 74 68 65 20 75 73 65 72 |, until.the user| 00001e50 20 77 61 6e 74 73 20 74 6f 20 73 65 6c 65 63 74 | wants to select| 00001e60 20 61 20 6e 65 77 20 66 6f 6e 74 2e 20 54 68 69 | a new font. Thi| 00001e70 73 20 63 61 6e 20 6f 6e 6c 79 20 62 65 20 64 6f |s can only be do| 00001e80 6e 65 20 62 79 20 6d 61 6b 69 6e 67 20 75 73 65 |ne by making use| 00001e90 20 6f 66 0a 74 68 65 20 57 69 6d 70 20 6d 65 73 | of.the Wimp mes| 00001ea0 73 61 67 65 20 73 79 73 74 65 6d 2e 20 54 68 65 |sage system. The| 00001eb0 20 64 69 66 66 69 63 75 6c 74 20 74 68 69 6e 67 | difficult thing| 00001ec0 20 6f 66 20 74 68 69 73 20 6d 65 74 68 6f 64 20 | of this method | 00001ed0 28 61 73 20 64 65 73 63 72 69 62 65 64 0a 6c 61 |(as described.la| 00001ee0 74 65 72 29 20 69 73 20 74 68 61 74 20 74 68 65 |ter) is that the| 00001ef0 20 57 69 6d 70 20 69 73 20 75 6e 61 62 6c 65 20 | Wimp is unable | 00001f00 74 6f 20 72 65 2d 6f 70 65 6e 20 74 68 65 20 6d |to re-open the m| 00001f10 65 6e 75 20 73 74 72 75 63 74 75 72 65 20 65 6e |enu structure en| 00001f20 74 69 72 65 6c 79 0a 61 66 74 65 72 20 61 20 6d |tirely.after a m| 00001f30 65 6e 75 20 73 65 6c 65 63 74 69 6f 6e 20 75 73 |enu selection us| 00001f40 69 6e 67 20 74 68 65 20 41 44 4a 55 53 54 20 62 |ing the ADJUST b| 00001f50 75 74 74 6f 6e 2e 20 53 6f 20 61 20 6c 69 74 74 |utton. So a litt| 00001f60 6c 65 20 74 72 69 63 6b 20 68 61 73 20 74 6f 0a |le trick has to.| 00001f70 73 6f 6c 76 65 20 74 68 69 73 20 70 72 6f 62 6c |solve this probl| 00001f80 65 6d 2e 0a 0a 20 54 68 65 20 68 61 72 64 20 77 |em... The hard w| 00001f90 61 79 0a 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |ay. ------------| 00001fa0 0a 20 49 6e 20 74 68 65 20 61 70 70 6c 69 63 61 |. In the applica| 00001fb0 74 69 6f 6e 73 20 6f 77 6e 20 6d 65 6e 75 20 73 |tions own menu s| 00001fc0 74 72 75 63 74 75 72 65 2c 20 74 68 65 72 65 20 |tructure, there | 00001fd0 73 68 6f 75 6c 64 20 62 65 20 61 20 6d 65 6e 75 |should be a menu| 00001fe0 20 65 6e 74 72 79 20 28 65 2e 67 2e 0a 27 46 6f | entry (e.g..'Fo| 00001ff0 6e 74 73 27 29 20 77 69 74 68 20 62 69 74 20 33 |nts') with bit 3| 00002000 20 6f 66 20 69 74 73 20 6d 65 6e 75 20 66 6c 61 | of its menu fla| 00002010 67 73 20 73 65 74 2e 20 54 68 65 20 61 70 70 6c |gs set. The appl| 00002020 69 63 61 74 69 6f 6e 20 68 61 73 20 74 6f 20 61 |ication has to a| 00002030 73 73 75 72 65 0a 74 68 61 74 20 74 68 69 73 20 |ssure.that this | 00002040 62 69 74 20 69 73 20 73 65 74 20 77 68 65 6e 65 |bit is set whene| 00002050 76 65 72 20 69 74 20 63 61 6c 6c 73 20 53 57 49 |ver it calls SWI| 00002060 20 22 57 69 6d 70 5f 43 72 65 61 74 65 4d 65 6e | "Wimp_CreateMen| 00002070 75 22 20 61 73 20 69 74 20 6d 61 79 20 62 65 0a |u" as it may be.| 00002080 63 6f 72 72 75 70 74 65 64 20 28 73 65 65 20 62 |corrupted (see b| 00002090 65 6c 6f 77 29 2e 20 53 6f 20 77 68 65 6e 65 76 |elow). So whenev| 000020a0 65 72 20 74 68 65 20 75 73 65 72 20 70 75 74 73 |er the user puts| 000020b0 20 74 68 65 20 70 6f 69 6e 74 65 72 20 61 62 6f | the pointer abo| 000020c0 76 65 20 74 68 65 20 61 72 72 6f 77 0a 6f 6e 20 |ve the arrow.on | 000020d0 74 68 65 20 72 69 67 68 74 20 6f 66 20 74 68 69 |the right of thi| 000020e0 73 20 65 6e 74 72 79 2c 20 61 20 77 61 72 6e 69 |s entry, a warni| 000020f0 6e 67 20 6d 65 73 73 61 67 65 20 28 26 34 30 30 |ng message (&400| 00002100 43 30 29 20 77 69 6c 6c 20 62 65 20 73 65 6e 74 |C0) will be sent| 00002110 20 62 79 20 74 68 65 0a 57 69 6d 70 2e 20 4f 6e | by the.Wimp. On| 00002120 20 72 65 63 65 69 76 69 6e 67 20 6f 66 20 74 68 | receiving of th| 00002130 69 73 20 6d 65 73 73 61 67 65 2c 20 74 68 65 20 |is message, the | 00002140 61 70 70 6c 69 63 61 74 69 6f 6e 20 73 68 6f 75 |application shou| 00002150 6c 64 20 72 65 73 70 6f 6e 64 20 62 79 20 63 61 |ld respond by ca| 00002160 6c 6c 69 6e 67 0a 53 57 49 20 22 46 6f 6e 74 4d |lling.SWI "FontM| 00002170 65 6e 75 5f 53 65 6c 65 63 74 22 20 77 69 74 68 |enu_Select" with| 00002180 20 52 30 20 70 6f 69 6e 74 69 6e 67 20 74 6f 20 | R0 pointing to | 00002190 61 20 70 6f 69 6e 74 20 73 65 70 65 72 61 74 65 |a point seperate| 000021a0 64 20 28 7a 65 72 6f 0a 74 65 72 6d 69 6e 61 74 |d (zero.terminat| 000021b0 65 64 29 20 66 6f 6e 74 20 73 74 72 69 6e 67 2c |ed) font string,| 000021c0 20 61 6e 64 20 69 6e 20 52 31 20 74 68 65 20 76 | and in R1 the v| 000021d0 61 6c 75 65 20 30 20 6f 72 20 31 20 74 6f 20 74 |alue 0 or 1 to t| 000021e0 65 6c 6c 20 46 6f 6e 74 4d 65 6e 75 20 69 66 20 |ell FontMenu if | 000021f0 69 74 0a 61 6c 6c 6f 77 73 20 74 68 65 20 75 73 |it.allows the us| 00002200 65 72 20 74 6f 20 73 65 6c 65 63 74 20 74 68 65 |er to select the| 00002210 20 53 79 73 74 65 6d 46 6f 6e 74 2e 20 54 68 65 | SystemFont. The| 00002220 20 66 6f 6e 74 20 73 74 72 69 6e 67 20 6d 61 79 | font string may| 00002230 20 62 65 20 61 20 7a 65 72 6f 0a 6c 65 6e 67 74 | be a zero.lengt| 00002240 68 20 73 74 72 69 6e 67 2c 20 77 69 63 68 20 6d |h string, wich m| 00002250 65 61 6e 73 20 74 68 61 74 20 6e 6f 20 63 75 72 |eans that no cur| 00002260 72 65 6e 74 20 66 6f 6e 74 20 69 73 20 73 65 6c |rent font is sel| 00002270 65 63 74 65 64 2e 20 46 6f 6e 74 4d 65 6e 75 20 |ected. FontMenu | 00002280 77 69 6c 6c 0a 73 65 6c 65 63 74 20 74 68 65 20 |will.select the | 00002290 66 6f 6e 74 20 69 6e 20 69 74 73 20 6d 65 6e 75 |font in its menu| 000022a0 20 73 74 72 75 63 74 75 72 65 2e 20 49 66 20 31 | structure. If 1| 000022b0 20 77 61 73 20 70 61 73 73 65 64 20 69 6e 20 52 | was passed in R| 000022c0 31 2c 20 74 68 65 20 66 69 72 73 74 20 69 74 65 |1, the first ite| 000022d0 6d 0a 69 6e 20 74 68 65 20 6d 65 6e 75 20 73 74 |m.in the menu st| 000022e0 72 75 63 74 75 72 65 20 77 69 6c 6c 20 62 65 20 |ructure will be | 000022f0 27 53 79 73 74 65 6d 46 6f 6e 74 73 27 2e 20 49 |'SystemFonts'. I| 00002300 6e 20 63 61 73 65 20 52 31 20 3d 20 30 2c 20 74 |n case R1 = 0, t| 00002310 68 69 73 20 65 6e 74 72 79 20 77 69 6c 6c 0a 6e |his entry will.n| 00002320 6f 74 20 62 65 20 74 68 65 72 65 2e 20 54 68 69 |ot be there. Thi| 00002330 73 20 63 61 6c 6c 20 77 69 6c 6c 20 72 65 74 75 |s call will retu| 00002340 72 6e 20 77 69 74 68 20 61 20 70 6f 69 6e 74 65 |rn with a pointe| 00002350 72 20 74 6f 20 74 68 65 20 6d 65 6e 75 20 73 74 |r to the menu st| 00002360 72 75 63 74 75 72 65 20 69 6e 0a 52 31 2e 20 54 |ructure in.R1. T| 00002370 68 69 73 20 70 6f 69 6e 74 65 72 20 73 68 6f 75 |his pointer shou| 00002380 6c 64 20 62 65 20 70 61 73 73 65 64 20 74 6f 20 |ld be passed to | 00002390 53 57 49 20 22 57 69 6d 70 5f 43 72 65 61 74 65 |SWI "Wimp_Create| 000023a0 53 75 62 4d 65 6e 75 22 2e 0a 0a 20 57 68 65 6e |SubMenu"... When| 000023b0 20 61 20 6d 65 6e 75 20 73 65 6c 65 63 74 69 6f | a menu selectio| 000023c0 6e 20 77 61 73 20 64 6f 6e 65 2c 20 74 68 65 20 |n was done, the | 000023d0 61 70 70 6c 69 63 61 74 69 6f 6e 20 73 68 6f 75 |application shou| 000023e0 6c 64 20 64 65 74 65 72 6d 69 6e 65 20 62 79 20 |ld determine by | 000023f0 74 68 65 0a 72 65 74 75 72 6e 65 64 20 27 6d 65 |the.returned 'me| 00002400 6e 75 20 74 72 65 65 20 73 6f 20 66 61 72 27 20 |nu tree so far' | 00002410 76 61 6c 75 65 73 20 69 66 20 74 68 65 20 75 73 |values if the us| 00002420 65 72 20 73 65 6c 65 63 74 65 64 20 61 20 65 6e |er selected a en| 00002430 74 72 79 20 69 6e 20 74 68 65 20 66 6f 6e 74 0a |try in the font.| 00002440 6d 65 6e 75 2e 20 49 66 20 73 6f 2c 20 69 74 20 |menu. If so, it | 00002450 73 68 6f 75 6c 64 20 73 65 74 20 61 6e 20 69 6e |should set an in| 00002460 74 65 72 6e 61 6c 20 66 6c 61 67 20 28 73 61 79 |ternal flag (say| 00002470 20 27 46 6f 6e 74 4d 65 6e 75 53 65 6c 65 63 74 | 'FontMenuSelect| 00002480 65 64 27 29 20 74 6f 0a 54 52 55 45 2c 20 65 6c |ed') to.TRUE, el| 00002490 73 65 20 69 74 20 73 68 6f 75 6c 64 20 73 65 74 |se it should set| 000024a0 20 69 74 20 74 6f 20 46 41 4c 53 45 2c 20 73 6f | it to FALSE, so| 000024b0 20 6c 61 74 65 72 20 6f 6e 20 69 74 20 69 73 20 | later on it is | 000024c0 73 74 69 6c 6c 20 6b 6e 6f 77 6e 20 69 66 20 74 |still known if t| 000024d0 68 65 0a 75 73 65 72 20 6d 61 79 20 68 61 76 65 |he.user may have| 000024e0 20 73 65 6c 65 63 74 65 64 20 61 20 6e 65 77 20 | selected a new | 000024f0 66 6f 6e 74 2e 20 41 66 74 65 72 20 74 68 61 74 |font. After that| 00002500 20 69 74 20 73 68 6f 75 6c 64 20 63 61 6c 6c 20 | it should call | 00002510 53 57 49 0a 22 46 6f 6e 74 4d 65 6e 75 5f 44 65 |SWI."FontMenu_De| 00002520 63 6f 64 65 46 6f 6e 74 4d 65 6e 75 22 20 77 69 |codeFontMenu" wi| 00002530 74 68 20 52 30 20 70 6f 69 6e 74 69 6e 67 20 74 |th R0 pointing t| 00002540 6f 20 74 68 65 20 66 69 72 73 74 20 6d 65 6e 75 |o the first menu| 00002550 20 73 65 6c 65 63 74 69 6f 6e 20 69 6e 0a 74 68 | selection in.th| 00002560 65 20 27 6d 65 6e 75 20 74 72 65 65 20 73 6f 20 |e 'menu tree so | 00002570 66 61 72 27 20 62 6c 6f 63 6b 20 77 68 69 63 68 |far' block which| 00002580 20 64 65 74 65 72 6d 69 6e 65 73 20 74 68 65 20 | determines the | 00002590 73 65 6c 65 63 74 65 64 20 66 6f 6e 74 2e 20 52 |selected font. R| 000025a0 31 20 73 68 6f 75 6c 64 0a 70 6f 69 6e 74 20 74 |1 should.point t| 000025b0 6f 20 61 20 62 75 66 66 65 72 20 74 6f 20 63 6f |o a buffer to co| 000025c0 6e 74 61 69 6e 20 74 68 65 20 61 6e 73 77 65 72 |ntain the answer| 000025d0 2e 20 54 68 69 73 20 62 75 66 66 65 72 20 6d 75 |. This buffer mu| 000025e0 73 74 20 62 65 20 61 74 20 6c 65 61 73 74 20 34 |st be at least 4| 000025f0 38 0a 62 79 74 65 73 2e 20 49 66 20 6f 6e 20 72 |8.bytes. If on r| 00002600 65 74 75 72 6e 20 6f 66 20 74 68 69 73 20 63 61 |eturn of this ca| 00002610 6c 6c 20 52 30 20 3e 20 30 2c 20 74 68 65 20 75 |ll R0 > 0, the u| 00002620 73 65 72 20 73 65 6c 65 63 74 65 64 20 61 20 6e |ser selected a n| 00002630 65 77 20 66 6f 6e 74 2e 20 54 68 65 0a 62 75 66 |ew font. The.buf| 00002640 66 65 72 20 70 61 73 73 65 64 20 69 6e 20 52 31 |fer passed in R1| 00002650 20 77 69 6c 6c 20 63 6f 6e 74 61 69 6e 20 74 68 | will contain th| 00002660 65 20 66 6f 6e 74 20 6e 61 6d 65 20 28 61 20 70 |e font name (a p| 00002670 6f 69 6e 74 20 73 65 70 65 72 61 74 65 64 2c 20 |oint seperated, | 00002680 7a 65 72 6f 0a 74 65 72 6d 69 6e 61 74 65 64 20 |zero.terminated | 00002690 66 6f 6e 74 20 73 74 72 69 6e 67 29 2e 0a 0a 20 |font string)... | 000026a0 41 66 74 65 72 20 61 20 6d 65 6e 75 20 73 65 6c |After a menu sel| 000026b0 65 63 74 69 6f 6e 2c 20 61 6e 64 20 74 61 6b 69 |ection, and taki| 000026c0 6e 67 20 61 70 70 72 6f 70 72 69 61 74 65 20 61 |ng appropriate a| 000026d0 63 74 69 6f 6e 73 2c 20 74 68 65 20 61 70 70 6c |ctions, the appl| 000026e0 69 63 61 74 69 6f 6e 0a 73 68 6f 75 6c 64 20 63 |ication.should c| 000026f0 68 65 63 6b 20 74 68 65 20 6d 6f 75 73 65 20 62 |heck the mouse b| 00002700 75 74 74 6f 6e 20 73 74 61 74 65 20 74 6f 20 73 |utton state to s| 00002710 65 65 20 69 66 20 69 74 20 68 61 73 20 74 6f 20 |ee if it has to | 00002720 63 61 6c 6c 20 53 57 49 0a 22 57 69 6d 70 5f 43 |call SWI."Wimp_C| 00002730 72 65 61 74 65 4d 65 6e 75 22 20 61 67 61 69 6e |reateMenu" again| 00002740 2e 20 49 66 20 61 64 6a 75 73 74 20 77 61 73 20 |. If adjust was | 00002750 75 73 65 64 20 74 6f 20 6d 61 6b 65 20 74 68 65 |used to make the| 00002760 20 73 65 6c 65 63 74 69 6f 6e 2c 20 69 74 20 68 | selection, it h| 00002770 61 73 20 74 6f 0a 63 68 65 63 6b 20 20 74 68 65 |as to.check the| 00002780 20 27 46 6f 6e 74 4d 65 6e 75 53 65 6c 65 63 74 | 'FontMenuSelect| 00002790 65 64 27 20 66 6c 61 67 20 74 6f 20 64 65 74 65 |ed' flag to dete| 000027a0 72 6d 69 6e 65 20 69 66 20 74 68 65 20 75 73 65 |rmine if the use| 000027b0 72 20 73 65 6c 65 63 74 65 64 20 61 20 66 6f 6e |r selected a fon| 000027c0 74 0a 6d 65 6e 75 20 65 6e 74 72 79 2e 20 49 66 |t.menu entry. If| 000027d0 20 73 6f 2c 20 69 74 20 73 68 6f 75 6c 64 20 63 | so, it should c| 000027e0 61 6c 6c 20 53 57 49 20 22 46 6f 6e 74 4d 65 6e |all SWI "FontMen| 000027f0 75 5f 53 65 6c 65 63 74 22 20 61 73 20 64 65 73 |u_Select" as des| 00002800 63 72 69 62 65 64 20 61 62 6f 76 65 2e 0a 54 68 |cribed above..Th| 00002810 69 73 20 73 68 6f 75 6c 64 20 62 65 20 64 6f 6e |is should be don| 00002820 65 20 77 69 74 68 20 52 30 20 70 6f 69 6e 74 69 |e with R0 pointi| 00002830 6e 67 20 74 6f 20 74 68 65 20 73 74 72 69 6e 67 |ng to the string| 00002840 20 53 57 49 0a 22 46 6f 6e 74 4d 65 6e 75 5f 44 | SWI."FontMenu_D| 00002850 65 63 6f 64 65 46 6f 6e 74 4d 65 6e 75 22 20 72 |ecodeFontMenu" r| 00002860 65 74 75 72 6e 65 64 2e 20 20 41 73 20 74 68 65 |eturned. As the| 00002870 20 4d 65 6e 75 57 61 72 6e 69 6e 67 46 6c 61 67 | MenuWarningFlag| 00002880 20 69 6e 20 74 68 65 20 6d 65 6e 75 0a 66 6c 61 | in the menu.fla| 00002890 67 73 20 6f 66 20 74 68 65 20 6d 65 6e 75 20 65 |gs of the menu e| 000028a0 6e 74 72 79 20 28 65 2e 67 2e 20 27 46 6f 6e 74 |ntry (e.g. 'Font| 000028b0 73 27 29 20 70 72 65 63 65 64 69 6e 67 20 74 68 |s') preceding th| 000028c0 65 20 66 6f 6e 74 20 6d 65 6e 75 20 77 61 73 20 |e font menu was | 000028d0 73 65 74 0a 28 70 68 68 68 21 29 2c 20 74 68 65 |set.(phhh!), the| 000028e0 20 57 69 6d 70 20 69 73 20 75 6e 61 62 6c 65 20 | Wimp is unable | 000028f0 74 6f 20 72 65 63 72 65 61 74 65 20 74 68 65 20 |to recreate the | 00002900 77 68 6f 6c 65 20 6d 65 6e 75 20 74 72 65 65 20 |whole menu tree | 00002910 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 2e 0a 53 |automatically..S| 00002920 6f 20 61 20 6c 69 74 6c 65 20 74 72 69 63 6b 20 |o a litle trick | 00002930 68 61 73 20 74 6f 20 61 73 73 75 72 65 20 74 68 |has to assure th| 00002940 61 74 20 69 74 20 77 69 6c 6c 20 77 6f 72 6b 20 |at it will work | 00002950 63 6f 72 72 65 63 74 6c 79 2e 20 54 68 65 20 6d |correctly. The m| 00002960 65 6e 75 20 70 6f 69 6e 74 65 72 0a 72 65 74 75 |enu pointer.retu| 00002970 72 6e 65 64 20 62 79 20 53 57 49 20 22 46 6f 6e |rned by SWI "Fon| 00002980 74 4d 65 6e 75 5f 53 65 6c 65 63 74 22 20 68 61 |tMenu_Select" ha| 00002990 73 20 74 6f 20 62 65 20 70 75 74 20 69 6e 20 74 |s to be put in t| 000029a0 68 65 20 27 73 75 62 2d 6d 65 6e 75 20 70 6f 69 |he 'sub-menu poi| 000029b0 6e 74 65 72 27 0a 77 6f 72 64 20 6f 66 20 74 68 |nter'.word of th| 000029c0 65 20 27 46 6f 6e 74 73 27 20 65 6e 74 72 79 2c |e 'Fonts' entry,| 000029d0 20 61 6e 64 20 74 68 65 20 4d 65 6e 75 57 61 72 | and the MenuWar| 000029e0 6e 69 6e 67 46 6c 61 67 20 28 62 69 74 20 33 29 |ningFlag (bit 3)| 000029f0 20 6f 66 20 74 68 65 20 6d 65 6e 75 20 66 6c 61 | of the menu fla| 00002a00 67 73 0a 77 6f 72 64 20 6f 66 20 74 68 69 73 20 |gs.word of this | 00002a10 65 6e 74 72 79 20 73 68 6f 75 6c 64 20 62 65 20 |entry should be | 00002a20 63 6c 65 61 72 65 64 2e 20 4e 6f 77 20 74 68 65 |cleared. Now the| 00002a30 20 63 61 6c 6c 20 74 6f 20 53 57 49 20 22 57 69 | call to SWI "Wi| 00002a40 6d 70 5f 43 72 65 61 74 65 4d 65 6e 75 22 0a 63 |mp_CreateMenu".c| 00002a50 61 6e 20 62 65 20 64 6f 6e 65 2e 20 49 6e 20 74 |an be done. In t| 00002a60 68 69 73 20 77 61 79 20 69 74 20 69 73 20 70 6f |his way it is po| 00002a70 73 73 69 62 6c 65 20 66 6f 72 20 74 68 65 20 75 |ssible for the u| 00002a80 73 65 72 20 74 6f 20 63 6c 69 63 6b 20 77 69 74 |ser to click wit| 00002a90 68 20 61 64 6a 75 73 74 20 69 6e 0a 74 68 65 20 |h adjust in.the | 00002aa0 66 6f 6e 74 20 6d 65 6e 75 2c 20 61 6e 64 20 6b |font menu, and k| 00002ab0 65 65 70 69 6e 67 20 74 68 65 20 6d 65 6e 75 20 |eeping the menu | 00002ac0 6f 6e 20 73 63 72 65 65 6e 20 61 66 74 65 72 20 |on screen after | 00002ad0 74 68 65 20 73 65 6c 65 63 74 69 6f 6e 2e 20 54 |the selection. T| 00002ae0 68 65 20 6e 65 78 74 0a 74 69 6d 65 20 74 68 65 |he next.time the| 00002af0 20 75 73 65 72 20 6f 70 65 6e 73 20 74 68 65 20 | user opens the | 00002b00 61 70 70 6c 69 63 61 74 69 6f 6e 20 6d 65 6e 75 |application menu| 00002b10 2c 20 74 68 65 20 4d 65 6e 75 57 61 72 6e 69 6e |, the MenuWarnin| 00002b20 67 46 6c 61 67 20 28 62 69 74 20 33 29 20 73 68 |gFlag (bit 3) sh| 00002b30 6f 75 6c 64 0a 62 65 20 73 65 74 20 61 67 61 69 |ould.be set agai| 00002b40 6e 2c 20 61 73 20 6f 74 68 65 72 20 61 70 70 6c |n, as other appl| 00002b50 69 63 61 74 69 6f 6e 73 20 6d 61 79 20 68 61 76 |ications may hav| 00002b60 65 20 75 73 65 64 20 74 68 65 20 66 6f 6e 74 20 |e used the font | 00002b70 6d 65 6e 75 20 69 6e 20 74 68 65 0a 6d 65 61 6e |menu in the.mean| 00002b80 77 68 69 6c 65 2c 20 61 6e 64 20 69 74 20 69 73 |while, and it is| 00002b90 20 6e 65 63 65 73 73 61 72 79 20 74 68 61 74 20 | necessary that | 00002ba0 53 57 49 20 22 46 6f 6e 74 4d 65 6e 75 5f 53 65 |SWI "FontMenu_Se| 00002bb0 6c 65 63 74 22 20 69 73 20 63 61 6c 6c 65 64 20 |lect" is called | 00002bc0 6a 75 73 74 0a 62 65 66 6f 72 65 20 74 68 65 20 |just.before the | 00002bd0 66 6f 6e 74 20 6d 65 6e 75 20 6f 70 65 6e 73 2e |font menu opens.| 00002be0 0a 0a 20 42 65 63 61 75 73 65 20 73 6f 6d 65 20 |.. Because some | 00002bf0 46 6f 6e 74 4d 65 6e 75 20 53 57 49 27 73 20 6d |FontMenu SWI's m| 00002c00 61 79 20 74 61 6b 65 20 73 6f 6d 65 20 74 69 6d |ay take some tim| 00002c10 65 20 62 65 66 6f 72 65 20 74 68 65 79 20 72 65 |e before they re| 00002c20 74 75 72 6e 0a 28 74 68 69 73 20 69 73 20 64 75 |turn.(this is du| 00002c30 65 20 74 6f 20 46 6f 6e 74 5f 4c 69 73 74 46 6f |e to Font_ListFo| 00002c40 6e 74 73 29 2c 20 74 68 65 20 48 6f 75 72 67 6c |nts), the Hourgl| 00002c50 61 73 73 20 4f 6e 20 26 20 4f 66 66 20 53 57 49 |ass On & Off SWI| 00002c60 27 73 20 61 72 65 20 75 73 65 64 0a 6f 6e 20 65 |'s are used.on e| 00002c70 6e 74 72 79 20 61 6e 64 20 65 78 69 74 20 72 65 |ntry and exit re| 00002c80 73 70 65 63 74 69 76 65 6c 79 2e 20 53 6f 20 69 |spectively. So i| 00002c90 6e 20 74 68 65 6f 72 79 20 69 74 20 69 73 20 70 |n theory it is p| 00002ca0 6f 73 73 69 62 6c 65 20 74 68 61 74 0a 77 68 65 |ossible that.whe| 00002cb0 6e 65 76 65 72 20 6f 6e 65 20 6f 66 20 74 68 65 |never one of the| 00002cc0 20 46 6f 6e 74 4d 65 6e 75 20 53 57 49 27 73 20 | FontMenu SWI's | 00002cd0 74 61 6b 65 20 6c 6f 6e 67 65 72 20 74 68 61 6e |take longer than| 00002ce0 20 31 2f 33 20 6f 66 20 61 20 73 65 63 6f 6e 64 | 1/3 of a second| 00002cf0 2c 20 61 0a 68 6f 75 72 67 6c 61 73 73 20 61 70 |, a.hourglass ap| 00002d00 70 65 61 72 73 2e 20 49 6e 20 70 72 61 63 74 69 |pears. In practi| 00002d10 63 65 20 74 68 69 73 20 6f 6e 6c 79 20 6f 63 63 |ce this only occ| 00002d20 75 72 73 20 77 68 65 6e 20 46 6f 6e 74 4d 65 6e |urs when FontMen| 00002d30 75 5f 43 72 65 61 74 65 0a 6f 72 20 46 6f 6e 74 |u_Create.or Font| 00002d40 4d 65 6e 75 5f 53 65 6c 65 63 74 20 69 73 20 63 |Menu_Select is c| 00002d50 61 6c 6c 65 64 20 61 6e 64 20 74 68 65 79 20 68 |alled and they h| 00002d60 61 76 65 20 74 6f 20 61 63 74 75 61 6c 6c 79 20 |ave to actually | 00002d70 63 72 65 61 74 65 20 61 20 6e 65 77 0a 6d 65 6e |create a new.men| 00002d80 75 20 73 74 72 75 63 74 75 72 65 20 28 42 65 63 |u structure (Bec| 00002d90 61 75 73 65 20 6f 66 20 61 20 66 69 72 73 74 20 |ause of a first | 00002da0 63 61 6c 6c 2c 20 6f 72 20 61 20 63 68 61 6e 67 |call, or a chang| 00002db0 65 64 20 46 6f 6e 74 24 50 61 74 68 29 2e 0a 0a |ed Font$Path)...| 00002dc0 0a 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 00002dd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4e | N| 00002de0 6f 74 65 73 20 66 72 6f 6d 20 74 68 65 20 61 75 |otes from the au| 00002df0 74 68 6f 72 0a 0a 20 54 68 65 20 72 65 61 73 6f |thor.. The reaso| 00002e00 6e 20 77 68 79 20 49 20 77 72 6f 74 65 20 74 68 |n why I wrote th| 00002e10 69 73 20 6d 6f 64 75 6c 65 2c 20 69 73 20 62 65 |is module, is be| 00002e20 63 61 75 73 65 20 49 27 6d 20 6e 6f 74 20 6f 6e |cause I'm not on| 00002e30 6c 79 20 61 20 70 72 6f 67 72 61 6d 6d 65 72 2c |ly a programmer,| 00002e40 0a 62 75 74 20 61 6c 73 6f 20 61 20 75 73 65 72 |.but also a user| 00002e50 20 77 68 6f 20 6c 69 6b 65 73 20 74 6f 20 77 6f | who likes to wo| 00002e60 72 6b 20 77 69 74 68 20 74 68 65 20 41 72 63 68 |rk with the Arch| 00002e70 69 6d 65 64 65 73 2e 20 54 68 69 73 20 69 73 20 |imedes. This is | 00002e80 62 65 63 61 75 73 65 20 69 74 27 73 0a 61 20 66 |because it's.a f| 00002e90 61 73 74 20 6d 61 63 68 69 6e 65 20 61 6e 64 20 |ast machine and | 00002ea0 62 65 63 61 75 73 65 20 6d 6f 73 74 20 70 61 72 |because most par| 00002eb0 74 73 20 6f 66 20 52 69 73 63 2d 4f 53 20 61 6c |ts of Risc-OS al| 00002ec0 6c 6f 77 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 |low applications| 00002ed0 20 74 6f 20 62 65 0a 76 65 72 79 20 69 6e 74 75 | to be.very intu| 00002ee0 69 74 69 76 65 2e 20 49 20 64 69 64 6e 27 74 20 |itive. I didn't | 00002ef0 6c 69 6b 65 20 74 68 65 20 77 61 79 20 74 68 65 |like the way the| 00002f00 20 61 76 61 69 6c 61 62 6c 65 20 66 6f 6e 74 73 | available fonts| 00002f10 20 77 65 72 65 20 70 72 65 73 65 6e 74 65 64 20 | were presented | 00002f20 69 6e 0a 6d 6f 73 74 20 61 70 70 6c 69 63 61 74 |in.most applicat| 00002f30 69 6f 6e 73 2c 20 73 6f 20 49 20 73 74 61 72 74 |ions, so I start| 00002f40 65 64 20 74 6f 20 66 69 67 75 72 65 20 6f 75 74 |ed to figure out| 00002f50 20 61 20 70 72 6f 70 65 72 20 73 6f 6c 75 74 69 | a proper soluti| 00002f60 6f 6e 3a 20 46 6f 6e 74 4d 65 6e 75 2e 0a 0a 20 |on: FontMenu... | 00002f70 49 20 68 6f 70 65 20 74 68 61 74 20 66 75 74 75 |I hope that futu| 00002f80 72 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 |re applications | 00002f90 61 64 6f 70 74 20 74 6f 20 74 68 69 73 20 6d 65 |adopt to this me| 00002fa0 74 68 6f 64 2c 20 73 6f 20 70 6c 65 61 73 65 20 |thod, so please | 00002fb0 70 61 73 73 20 69 74 20 6f 6e 2e 0a 45 76 65 72 |pass it on..Ever| 00002fc0 79 62 6f 64 79 20 69 73 20 66 72 65 65 20 74 6f |ybody is free to| 00002fd0 20 75 73 65 20 69 74 2c 20 65 76 65 6e 20 69 6e | use it, even in| 00002fe0 20 63 6f 6d 6d 65 72 63 69 61 6c 20 63 6f 64 65 | commercial code| 00002ff0 2e 20 54 68 65 20 6f 6e 6c 79 20 72 65 73 74 72 |. The only restr| 00003000 69 63 74 69 6f 6e 0a 69 73 20 74 68 61 74 20 74 |iction.is that t| 00003010 68 69 73 20 64 6f 63 75 6d 65 6e 74 20 73 68 6f |his document sho| 00003020 75 6c 64 20 6e 6f 74 20 62 65 20 73 65 70 65 72 |uld not be seper| 00003030 61 74 65 64 20 66 72 6f 6d 20 74 68 65 20 46 6f |ated from the Fo| 00003040 6e 74 4d 65 6e 75 20 6d 6f 64 75 6c 65 2c 20 61 |ntMenu module, a| 00003050 6e 64 0a 74 68 61 74 20 62 6f 74 68 20 74 68 65 |nd.that both the| 00003060 20 6d 6f 64 75 6c 65 20 61 6e 64 20 74 68 69 73 | module and this| 00003070 20 64 6f 63 75 6d 65 6e 74 20 72 65 6d 61 69 6e | document remain| 00003080 20 75 6e 63 68 61 6e 67 65 64 2e 20 49 6e 20 63 | unchanged. In c| 00003090 61 73 65 20 6f 66 0a 63 6f 6d 6d 65 72 63 69 61 |ase of.commercia| 000030a0 6c 20 75 73 65 20 49 20 77 6f 75 6c 64 20 6c 69 |l use I would li| 000030b0 6b 65 20 74 6f 20 6b 6e 6f 77 20 74 68 69 73 20 |ke to know this | 000030c0 69 6e 20 61 64 76 61 6e 63 65 20 28 49 20 63 6f |in advance (I co| 000030d0 75 6c 64 20 74 68 61 6e 20 70 72 6f 76 69 64 65 |uld than provide| 000030e0 0a 79 6f 75 20 77 69 74 68 20 69 74 73 20 6c 61 |.you with its la| 000030f0 74 65 73 74 20 72 65 6c 65 61 73 65 29 2e 20 4d |test release). M| 00003100 79 20 61 64 64 72 65 73 73 20 69 73 20 61 74 20 |y address is at | 00003110 74 68 65 20 65 6e 64 20 6f 66 20 74 68 69 73 20 |the end of this | 00003120 64 6f 63 75 6d 65 6e 74 2e 20 59 6f 75 0a 63 61 |document. You.ca| 00003130 6e 20 61 6c 77 61 79 73 20 63 6f 6e 74 61 63 74 |n always contact| 00003140 20 6d 65 20 69 66 20 79 6f 75 20 66 6f 75 6e 64 | me if you found| 00003150 20 73 6f 6d 65 20 62 75 67 2c 20 6f 72 20 77 68 | some bug, or wh| 00003160 65 6e 20 68 61 76 69 6e 67 20 6f 74 68 65 72 0a |en having other.| 00003170 73 75 67 67 65 73 74 69 6f 6e 73 2e 0a 0a 0a 2d |suggestions....-| 00003180 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| * 000031c0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 20 20 |------------.. | 000031d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000031e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46 6f | Fo| 000031f0 6e 74 4d 65 6e 75 20 53 57 49 27 73 0a 0a 20 20 |ntMenu SWI's.. | 00003200 20 20 20 20 20 20 20 20 20 42 65 6c 6f 77 20 61 | Below a| 00003210 72 65 20 74 68 65 20 73 68 6f 72 74 20 64 69 73 |re the short dis| 00003220 63 72 69 70 74 69 6f 6e 73 20 6f 66 20 74 68 65 |criptions of the| 00003230 20 46 6f 6e 74 4d 65 6e 75 20 53 57 49 27 73 2e | FontMenu SWI's.| 00003240 0a 20 20 20 20 20 20 20 20 20 20 20 0a 0a 46 6f |. ..Fo| 00003250 6e 74 4d 65 6e 75 5f 43 72 65 61 74 65 20 26 38 |ntMenu_Create &8| 00003260 44 30 38 30 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |D080.-----------| 00003270 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 4f 6e 20 65 |-----------.On e| 00003280 6e 74 72 79 3a 20 2d 2d 0a 4f 6e 20 65 78 69 74 |ntry: --.On exit| 00003290 20 3a 20 52 30 20 3d 20 4e 75 6d 62 65 72 20 6f | : R0 = Number o| 000032a0 66 20 66 6f 6e 74 73 20 66 6f 75 6e 64 0a 0a 20 |f fonts found.. | 000032b0 54 68 69 73 20 77 69 6c 6c 20 63 72 65 61 74 65 |This will create| 000032c0 20 61 20 66 6f 6e 74 20 6d 65 6e 75 20 73 74 72 | a font menu str| 000032d0 75 63 74 75 72 65 20 69 6e 20 52 4d 41 2c 20 69 |ucture in RMA, i| 000032e0 66 20 6e 6f 74 20 61 6c 72 65 61 64 79 20 64 6f |f not already do| 000032f0 6e 65 20 73 6f 2e 20 41 6e 0a 65 72 72 6f 72 20 |ne so. An.error | 00003300 6f 63 63 75 72 73 20 69 66 20 74 68 65 72 65 20 |occurs if there | 00003310 69 73 20 6e 6f 74 20 65 6e 6f 75 67 68 20 72 6f |is not enough ro| 00003320 6f 6d 20 69 6e 20 52 4d 41 20 74 6f 20 63 72 65 |om in RMA to cre| 00003330 61 74 65 20 74 68 65 20 6d 65 6e 75 2e 0a 0a 0a |ate the menu....| 00003340 0a 46 6f 6e 74 4d 65 6e 75 5f 52 65 6c 65 61 73 |.FontMenu_Releas| 00003350 65 20 26 38 44 30 38 31 0a 2d 2d 2d 2d 2d 2d 2d |e &8D081.-------| 00003360 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00003370 0a 4f 6e 20 65 6e 74 72 79 3a 20 2d 2d 0a 4f 6e |.On entry: --.On| 00003380 20 65 78 69 74 20 3a 20 2d 2d 0a 0a 20 54 68 69 | exit : --.. Thi| 00003390 73 20 77 69 6c 6c 20 72 65 6c 65 61 73 65 20 74 |s will release t| 000033a0 68 65 20 6d 65 6d 6f 72 79 20 74 61 6b 65 6e 20 |he memory taken | 000033b0 62 79 20 74 68 65 20 66 6f 6e 74 20 6d 65 6e 75 |by the font menu| 000033c0 20 69 66 20 6e 6f 20 74 61 73 6b 73 20 61 72 65 | if no tasks are| 000033d0 20 75 73 69 6e 67 0a 69 74 20 61 6e 79 6d 6f 72 | using.it anymor| 000033e0 65 2e 0a 0a 0a 0a 46 6f 6e 74 4d 65 6e 75 5f 53 |e.....FontMenu_S| 000033f0 65 6c 65 63 74 20 26 38 44 30 38 32 0a 2d 2d 2d |elect &8D082.---| 00003400 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00003410 2d 2d 2d 0a 4f 6e 20 65 6e 74 72 79 3a 20 52 30 |---.On entry: R0| 00003420 20 3d 20 70 6f 69 6e 74 65 72 20 74 6f 20 70 6f | = pointer to po| 00003430 69 6e 74 20 73 65 70 65 72 61 74 65 64 2c 20 63 |int seperated, c| 00003440 74 72 6c 20 74 65 72 6d 69 6e 61 74 65 64 20 66 |trl terminated f| 00003450 6f 6e 74 20 73 74 72 69 6e 67 20 0a 20 20 20 20 |ont string . | 00003460 20 20 20 20 20 20 52 31 20 3d 20 53 79 73 74 65 | R1 = Syste| 00003470 6d 46 6f 6e 74 20 66 6c 61 67 20 20 20 20 20 20 |mFont flag | 00003480 20 20 20 20 20 20 0a 0a 4f 6e 20 65 78 69 74 20 | ..On exit | 00003490 3a 20 52 30 20 3d 20 53 74 61 74 65 20 66 6c 61 |: R0 = State fla| 000034a0 67 0a 20 20 20 20 20 20 20 20 20 20 52 31 20 3d |g. R1 =| 000034b0 20 70 6f 69 6e 74 65 72 20 74 6f 20 66 6f 6e 74 | pointer to font| 000034c0 20 6d 65 6e 75 20 73 74 72 75 63 74 75 72 65 0a | menu structure.| 000034d0 0a 20 54 68 69 73 20 77 69 6c 6c 20 74 69 63 6b |. This will tick| 000034e0 20 74 68 65 20 66 6f 6e 74 20 70 61 73 73 65 64 | the font passed| 000034f0 20 69 6e 20 52 30 20 6f 6e 20 65 6e 74 72 79 2e | in R0 on entry.| 00003500 20 52 31 20 64 65 74 65 72 6d 69 6e 65 73 20 69 | R1 determines i| 00003510 66 0a 27 53 79 73 74 65 6d 46 6f 6e 74 27 20 73 |f.'SystemFont' s| 00003520 68 6f 75 6c 64 20 6f 63 63 75 72 20 69 6e 20 74 |hould occur in t| 00003530 68 65 20 6d 65 6e 75 20 61 73 20 66 6f 6c 6c 6f |he menu as follo| 00003540 77 73 3a 0a 0a 20 20 56 61 6c 75 65 20 4d 65 61 |ws:.. Value Mea| 00003550 6e 69 6e 67 0a 20 20 20 20 30 20 20 20 27 53 79 |ning. 0 'Sy| 00003560 73 74 65 6d 46 6f 6e 74 27 20 64 6f 65 73 20 6e |stemFont' does n| 00003570 6f 74 20 6f 63 63 75 72 20 69 6e 20 74 68 65 20 |ot occur in the | 00003580 6d 65 6e 75 0a 20 20 20 20 31 20 20 20 27 53 79 |menu. 1 'Sy| 00003590 73 74 65 6d 46 6f 6e 74 27 20 64 6f 65 73 20 6f |stemFont' does o| 000035a0 63 63 75 72 20 69 6e 20 74 68 65 20 6d 65 6e 75 |ccur in the menu| 000035b0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000035c0 20 20 20 20 20 20 20 20 20 20 0a 20 4f 6e 20 65 | . On e| 000035d0 78 69 74 20 52 30 20 73 68 6f 77 73 20 74 68 65 |xit R0 shows the| 000035e0 20 73 65 6c 65 63 74 69 6f 6e 20 73 74 61 74 65 | selection state| 000035f0 20 61 73 20 66 6f 6c 6c 6f 77 73 3a 0a 0a 20 20 | as follows:.. | 00003600 56 61 6c 75 65 20 4d 65 61 6e 69 6e 67 0a 20 20 |Value Meaning. | 00003610 20 20 30 20 20 20 54 6f 20 62 65 20 73 65 6c 65 | 0 To be sele| 00003620 63 74 65 64 20 66 6f 6e 74 20 6e 6f 74 20 66 6f |cted font not fo| 00003630 75 6e 64 2c 20 6e 6f 20 74 69 63 6b 73 0a 20 20 |und, no ticks. | 00003640 20 20 31 20 20 20 54 6f 20 62 65 20 73 65 6c 65 | 1 To be sele| 00003650 63 74 65 64 20 66 6f 6e 74 20 66 6f 75 6e 64 2c |cted font found,| 00003660 20 61 6e 64 20 74 69 63 6b 65 64 20 20 0a 20 20 | and ticked . | 00003670 20 20 32 20 20 20 4e 6f 20 66 6f 6e 74 20 65 6e | 2 No font en| 00003680 74 72 69 65 73 20 66 6f 75 6e 64 2c 20 6d 65 6e |tries found, men| 00003690 75 20 63 6f 6e 73 69 73 74 73 20 6f 6e 65 20 69 |u consists one i| 000036a0 74 65 6d 3b 20 27 53 79 73 74 65 6d 46 6f 6e 74 |tem; 'SystemFont| 000036b0 27 2c 0a 20 20 20 20 20 20 20 20 61 6e 64 20 69 |',. and i| 000036c0 73 20 74 69 63 6b 65 64 0a 20 20 20 20 20 20 20 |s ticked. | 000036d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003710 20 20 20 20 20 20 20 20 20 20 20 0a 20 52 31 20 | . R1 | 00003720 77 69 6c 6c 20 70 6f 69 6e 74 20 74 6f 20 74 68 |will point to th| 00003730 65 20 66 6f 6e 74 20 6d 65 6e 75 20 6f 6e 20 65 |e font menu on e| 00003740 78 69 74 2e 20 41 6e 20 65 72 72 6f 72 20 6f 63 |xit. An error oc| 00003750 63 75 72 73 20 69 66 20 6e 6f 20 66 6f 6e 74 20 |curs if no font | 00003760 6d 65 6e 75 20 65 78 69 73 74 73 2e 20 0a 0a 0a |menu exists. ...| 00003770 0a 46 6f 6e 74 4d 65 6e 75 5f 44 65 73 65 6c 65 |.FontMenu_Desele| 00003780 63 74 20 26 38 44 30 38 33 0a 2d 2d 2d 2d 2d 2d |ct &8D083.------| 00003790 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 000037a0 2d 2d 0a 4f 6e 20 65 6e 74 72 79 3a 20 2d 2d 2d |--.On entry: ---| 000037b0 0a 4f 6e 20 65 78 69 74 20 3a 20 2d 2d 0a 0a 20 |.On exit : --.. | 000037c0 54 68 69 73 20 77 69 6c 6c 20 63 6c 65 61 72 20 |This will clear | 000037d0 61 6c 6c 20 74 69 63 6b 73 20 61 6e 64 20 6d 61 |all ticks and ma| 000037e0 72 6b 73 20 6f 66 20 74 68 65 20 66 6f 6e 74 20 |rks of the font | 000037f0 6d 65 6e 75 2e 20 49 74 20 69 73 20 6e 6f 74 20 |menu. It is not | 00003800 6e 65 63 65 73 73 61 72 79 0a 74 6f 20 63 61 6c |necessary.to cal| 00003810 6c 20 74 68 69 73 20 53 57 49 20 62 65 66 6f 72 |l this SWI befor| 00003820 65 20 61 20 46 6f 6e 74 4d 65 6e 75 5f 53 65 6c |e a FontMenu_Sel| 00003830 65 63 74 20 63 61 6c 6c 2c 20 61 73 20 46 6f 6e |ect call, as Fon| 00003840 74 4d 65 6e 75 5f 53 65 6c 65 63 74 20 77 69 6c |tMenu_Select wil| 00003850 6c 20 74 61 6b 65 0a 63 61 72 65 20 6f 66 20 63 |l take.care of c| 00003860 6c 65 61 6e 69 6e 67 20 75 70 20 6f 6c 64 20 73 |leaning up old s| 00003870 65 6c 65 63 74 69 6f 6e 2e 20 41 6e 20 65 72 72 |election. An err| 00003880 6f 72 20 6f 63 63 75 72 73 20 69 66 20 6e 6f 20 |or occurs if no | 00003890 66 6f 6e 74 20 6d 65 6e 75 20 65 78 69 73 74 73 |font menu exists| 000038a0 2e 20 0a 20 20 0a 20 20 20 20 20 20 20 20 20 20 |. . . | 000038b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000038c0 20 20 20 20 0a 0a 46 6f 6e 74 4d 65 6e 75 5f 44 | ..FontMenu_D| 000038d0 65 63 6f 64 65 46 6f 6e 74 4d 65 6e 75 20 26 38 |ecodeFontMenu &8| 000038e0 44 30 38 34 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |D084.-----------| 000038f0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00003900 2d 2d 2d 0a 4f 6e 20 65 6e 74 72 79 3a 20 52 30 |---.On entry: R0| 00003910 20 3d 20 70 6f 69 6e 74 65 72 20 74 6f 20 61 20 | = pointer to a | 00003920 6c 69 73 74 20 6f 66 20 66 6f 6e 74 20 6d 65 6e |list of font men| 00003930 75 20 73 65 6c 65 63 74 69 6f 6e 73 0a 20 20 20 |u selections. | 00003940 20 20 20 20 20 20 20 52 31 20 3d 20 70 6f 69 6e | R1 = poin| 00003950 74 65 72 20 74 6f 20 61 20 62 75 66 66 65 72 20 |ter to a buffer | 00003960 74 6f 20 63 6f 6e 74 61 69 6e 20 74 68 65 20 61 |to contain the a| 00003970 6e 73 77 65 72 20 0a 20 20 20 20 20 20 20 20 20 |nswer . | 00003980 20 20 20 20 20 20 28 61 74 20 6c 65 61 73 74 20 | (at least | 00003990 34 38 20 62 79 74 65 73 20 6c 6f 6e 67 29 0a 4f |48 bytes long).O| 000039a0 6e 20 65 78 69 74 20 3a 20 52 30 20 3d 20 46 6c |n exit : R0 = Fl| 000039b0 61 67 20 28 30 20 3d 20 6e 6f 6e 2d 73 65 6e 73 |ag (0 = non-sens| 000039c0 69 62 6c 65 2f 20 31 3d 20 73 65 6e 73 69 62 6c |ible/ 1= sensibl| 000039d0 65 20 73 65 6c 65 63 74 69 6f 6e 29 0a 0a 20 54 |e selection).. T| 000039e0 68 69 73 20 77 69 6c 6c 20 64 65 63 6f 64 65 20 |his will decode | 000039f0 74 68 65 20 66 6f 6e 74 20 6d 65 6e 75 20 73 65 |the font menu se| 00003a00 6c 65 63 74 69 6f 6e 20 69 6e 74 6f 20 61 20 66 |lection into a f| 00003a10 6f 6e 74 20 73 74 72 69 6e 67 20 66 6f 72 20 74 |ont string for t| 00003a20 68 65 0a 46 6f 6e 74 4d 61 6e 61 67 65 72 2e 20 |he.FontManager. | 00003a30 54 68 69 73 20 73 74 72 69 6e 67 20 63 61 6e 20 |This string can | 00003a40 62 65 20 70 61 73 73 65 64 20 62 61 63 6b 20 74 |be passed back t| 00003a50 6f 20 46 6f 6e 74 4d 65 6e 75 5f 53 65 6c 65 63 |o FontMenu_Selec| 00003a60 74 20 74 6f 20 74 69 63 6b 20 74 68 65 0a 61 70 |t to tick the.ap| 00003a70 70 72 6f 70 72 69 61 74 65 20 65 6e 74 72 69 65 |propriate entrie| 00003a80 73 2e 20 41 6e 20 65 72 72 6f 72 20 6f 63 63 75 |s. An error occu| 00003a90 72 73 20 69 66 20 6e 6f 20 66 6f 6e 74 20 6d 65 |rs if no font me| 00003aa0 6e 75 20 65 78 69 73 74 73 2e 20 54 68 69 73 20 |nu exists. This | 00003ab0 63 61 6c 6c 20 6d 61 6b 65 73 0a 75 73 65 20 6f |call makes.use o| 00003ac0 66 20 57 69 6d 70 5f 44 65 63 6f 64 65 4d 65 6e |f Wimp_DecodeMen| 00003ad0 75 2c 20 62 75 74 20 61 73 20 69 74 20 69 73 20 |u, but as it is | 00003ae0 70 6f 73 73 69 62 6c 65 20 74 68 61 74 20 74 68 |possible that th| 00003af0 65 20 72 65 74 75 72 6e 65 64 20 73 74 72 69 6e |e returned strin| 00003b00 67 20 65 6e 64 73 0a 77 69 74 68 20 27 50 6c 61 |g ends.with 'Pla| 00003b10 69 6e 27 20 28 61 20 6d 61 64 65 20 75 70 20 6e |in' (a made up n| 00003b20 61 6d 65 20 74 6f 20 64 69 73 74 69 6e 67 75 69 |ame to distingui| 00003b30 73 65 20 61 6e 20 65 6d 70 74 79 20 73 75 62 2d |se an empty sub-| 00003b40 6e 61 6d 65 20 66 72 6f 6d 20 74 68 65 20 72 65 |name from the re| 00003b50 73 74 0a 6f 66 20 74 68 65 20 73 75 62 2d 6e 61 |st.of the sub-na| 00003b60 6d 65 73 29 2c 20 69 74 20 68 61 73 20 74 6f 20 |mes), it has to | 00003b70 63 68 65 63 6b 20 66 6f 72 20 74 68 69 73 2c 20 |check for this, | 00003b80 61 6e 64 20 74 68 72 6f 77 20 61 77 61 79 20 74 |and throw away t| 00003b90 68 69 73 20 6c 61 73 74 0a 73 75 62 2d 6e 61 6d |his last.sub-nam| 00003ba0 65 20 73 6f 20 74 68 65 20 46 6f 6e 74 4d 61 6e |e so the FontMan| 00003bb0 61 67 65 72 20 63 61 6e 20 72 65 63 6f 67 6e 69 |ager can recogni| 00003bc0 73 65 20 74 68 65 20 72 65 71 75 69 72 65 64 20 |se the required | 00003bd0 66 6f 6e 74 2e 20 0a 20 20 4f 6e 20 65 78 69 74 |font. . On exit| 00003be0 20 52 30 20 63 6f 6e 61 74 61 69 6e 73 20 61 20 | R0 conatains a | 00003bf0 66 6c 61 67 20 74 65 6c 6c 69 6e 67 20 79 6f 75 |flag telling you| 00003c00 20 69 66 20 74 68 65 20 73 65 6c 65 63 74 69 6f | if the selectio| 00003c10 6e 20 74 68 65 20 75 73 65 72 20 6d 61 64 65 20 |n the user made | 00003c20 77 61 73 0a 61 20 73 65 6e 73 69 62 6c 65 20 6f |was.a sensible o| 00003c30 6e 65 2e 20 49 66 2c 20 66 6f 72 20 65 78 61 6d |ne. If, for exam| 00003c40 70 6c 65 2c 20 74 68 65 20 75 73 65 72 20 73 65 |ple, the user se| 00003c50 6c 65 63 74 65 64 20 6e 6f 6e 2d 6c 65 61 66 20 |lected non-leaf | 00003c60 6d 65 6e 75 20 65 6e 74 72 79 20 28 65 2e 67 2e |menu entry (e.g.| 00003c70 0a 27 54 72 69 6e 69 74 79 2e 4d 65 64 69 75 6d |.'Trinity.Medium| 00003c80 27 29 20 74 68 65 6e 20 74 68 69 73 20 66 6c 61 |') then this fla| 00003c90 67 20 77 69 6c 6c 20 62 65 20 30 2e 20 49 66 20 |g will be 0. If | 00003ca0 74 68 65 20 66 6c 61 67 20 69 73 20 30 2c 20 79 |the flag is 0, y| 00003cb0 6f 75 20 61 72 65 0a 61 64 76 69 73 65 64 20 6e |ou are.advised n| 00003cc0 6f 74 20 74 6f 20 64 6f 20 61 6e 79 74 68 69 6e |ot to do anythin| 00003cd0 67 2e 0a 0a 0a 0a 46 6f 6e 74 4d 65 6e 75 5f 53 |g.....FontMenu_S| 00003ce0 6d 61 73 68 20 26 38 44 30 38 35 0a 2d 2d 2d 2d |mash &8D085.----| 00003cf0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00003d00 2d 0a 4f 6e 20 65 6e 74 72 79 3a 20 2d 2d 0a 4f |-.On entry: --.O| 00003d10 6e 20 65 78 69 74 20 3a 20 2d 2d 0a 0a 20 54 68 |n exit : --.. Th| 00003d20 69 73 20 77 69 6c 6c 20 72 65 6c 65 61 73 65 20 |is will release | 00003d30 74 68 65 20 66 6f 6e 74 20 6d 65 6e 75 20 6d 65 |the font menu me| 00003d40 6d 6f 72 79 20 77 69 74 68 6f 75 74 20 6c 6f 6f |mory without loo| 00003d50 6b 69 6e 67 20 61 74 20 74 68 65 20 61 6d 6f 75 |king at the amou| 00003d60 6e 74 20 6f 66 0a 74 69 6d 65 73 20 46 6f 6e 74 |nt of.times Font| 00003d70 4d 65 6e 75 5f 43 72 65 61 74 65 20 77 61 73 20 |Menu_Create was | 00003d80 63 61 6c 6c 65 64 2e 0a 0a 0a 0a 46 6f 6e 74 4d |called.....FontM| 00003d90 65 6e 75 5f 52 65 43 72 65 61 74 65 20 26 38 44 |enu_ReCreate &8D| 00003da0 30 38 36 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |086.------------| 00003db0 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 4f 6e 20 |------------.On | 00003dc0 65 6e 74 72 79 3a 20 2d 2d 0a 4f 6e 20 65 78 69 |entry: --.On exi| 00003dd0 74 20 3a 20 52 30 20 3d 20 4e 75 6d 62 65 72 20 |t : R0 = Number | 00003de0 6f 66 20 66 6f 6e 74 73 20 66 6f 75 6e 64 0a 0a |of fonts found..| 00003df0 20 54 68 69 73 20 77 69 6c 6c 20 72 65 6c 65 61 | This will relea| 00003e00 73 65 20 61 20 65 78 69 73 74 69 6e 67 20 66 6f |se a existing fo| 00003e10 6e 74 20 6d 65 6e 75 2c 20 61 6e 64 20 72 65 63 |nt menu, and rec| 00003e20 72 65 61 74 65 20 69 74 2e 0a 0a 0a 0a 20 20 20 |reate it..... | 00003e30 20 20 20 20 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d | ============| 00003e40 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| * 00003e60 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a |===============.| 00003e70 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 00003e80 20 54 6f 20 63 6f 6e 74 61 63 74 20 74 68 65 20 | To contact the | 00003e90 61 75 74 68 6f 72 20 6f 66 20 46 6f 6e 74 4d 65 |author of FontMe| 00003ea0 6e 75 2c 20 70 6c 65 61 73 65 20 77 72 69 74 65 |nu, please write| 00003eb0 20 74 6f 3a 0a 0a 20 20 20 20 20 20 20 20 20 20 | to:.. | 00003ec0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003ee0 4a 6f 72 69 73 20 52 d6 6c 69 6e 67 0a 20 20 20 |Joris R.ling. | 00003ef0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003f10 20 20 20 20 20 20 20 4f 75 64 65 73 74 72 61 61 | Oudestraa| 00003f20 74 20 31 38 36 0a 20 20 20 20 20 20 20 20 20 20 |t 186. | 00003f30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003f50 38 32 36 31 20 43 57 20 4b 61 6d 70 65 6e 0a 20 |8261 CW Kampen. | 00003f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003f80 20 20 20 20 20 20 20 20 20 54 68 65 20 4e 65 74 | The Net| 00003f90 68 65 72 6c 61 6e 64 73 0a 0a 20 20 20 20 20 20 |herlands.. | 00003fa0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003fc0 20 20 20 20 54 65 6c 3a 30 35 32 30 32 2d 32 37 | Tel:05202-27| 00003fd0 39 38 39 0a |989.| 00003fd4