--------------------------------- LDos V1(3) for AMOS1.3 and above. LDos is (C) Niklas Sjöberg 1992 --------------------------------- PART FOUR - Filerequester ------------------------- Lfreq - Bring up the filerequester. A$=Lfreq("Title",FLAGS) where A$ will contain the full path and filename after the call. If the user clicked cancel, A$ will be empty. "Title" is the text you want as a headline in the requester fx. "Load an IFF-file". FLAGS decides how the requester will act. Every function is assigned to a bit, and here are their values (to choose many options, just add the values, fx. FLAGS=$2+$4+$1000) $1 - Show .info-files. Hidden otherwise $2 - Extended select. Not supported by Ldos. $4 - Dir cache. The latest used directory will be remembered so it won't have to be read again at the next call. *- $8 - Bring up font requester. Supported in V2 and above. *- Use Lfontsize Freq to get hold of the size of the *- font. A$ will contain the full path and name of the *- font and you may thus let the user select a font from *- any path and then load it using Ldisk Font. HINT, use *- Lget Freq Dir to mask out everything except the font- *- name if you intend to use Get Rom Fonts. See the inc- *- luded example Lfonts for more hints. $10 - Create a hide-'.info'-gadget $20 - Do not create any hide- and showgadgets $40 - Use absolute x,y for the requester. Otherwise it is placed directly under the mousepointer. (x and y are hard-coded to the upper left on the screen) *- Version 2 and higher allows re-position of the re- *- quester if $40-flag is used. $80 - Purge cache whenever the datestamp of the directory changes (in other words, re-read the directory whenever it is changed) $100 - Don't cache anything until the whole directory is read. $200 - Do not sort the files. $400 - Do not create a scrollbar. $800 - Used when choosing a file to save. Currently it have no function, but are reserved for future use. $1000 - Used when choosing a file to load. Currently it have no function, but are reserved for future use. $2000 - Let the user select directories only, does not display any files at all. You should ALWAYS set $800 or $1000 depending on if you are going to load or save a file. Lget Freq Dir - Get only the path which the user picked the last time the filerequester was used. A$=Lget Freq Dir where A$ will hold the LAST selected dir. A$ will NOT be empty even if the user clicked CANCEL and something has been selected through the filerequester before. Lget Freq File - Get only the filename which the user picked the last time the filerequester was active. A$=Lget Freq File where A$ will hold the LAST selected file. A$ will NOT empty even if the user clicked CANCEL, and something has been selected through the filerequester before. Lset Freq Dir - Set the default (current) directory for the filerequester. Lset Freq Dir "Path" where If you haven't set path, the filerequester will use your programs current directory. Whenever the user changes directory it will be remembered by Ldos. This path does not affect AMOS's (Dir$) path in any way. *- Lpos Freq - Change the hardcoded X and Y position of the requester. *- Lpos Freq X,Y *- where *- X and Y are specified in pixels. These positions will only be *- used if the $40-flag is specified, otherwise the requester pops *- up at the mousepointer. Default positions are 3,11. *- Lcust Freq - Change size of the requester's fields. *- Lcust Freq DEVWIDTH,FILEWIDTH,FILES *- where *- DEVWIDTH specifies how many characters wide the devicefield *- will be, FILEWIDTH does the same but affect the file-name/size *- window. FILES specifies how many files/dir that will be displayed *- (height). Default values are 12,30,14. *- Lfontsize Freq - Return the fontsize when the requester has been *- in font-mode. *- S=Lfontsize Freq *- where *- S contains the fontsize of the last chosen font. Note that *- you must set the filerequester to font-mode ($8-flag) in order to *- update this field. Currently the req.library doesn't support CG- *- fonts. Hopefully there will be a new version out soon (when/if *- CED V3 is coming?) CONTINUED IN NEXT ARTICLE.