Adding a new file to !Info is easy. As I have said earlier, !Info will load sprite files, Drawfiles and ASCII text files. These can be easily created with !Paint, !Draw and !Edit which are found on application disc #1
In addition to these applications, many others provide output as text, sprites or drawfiles, a few examples of these are shown below:
Presenter 2: Creates graphs, pie charts etc. Output is in the form of a drawfile. Thus it is easy to add graphs or charts to an !Info structure.
Translator (PD) turn foreign sprite and image formats into archimedes sprite files that can be used by !Info. Thus images from other computer systems can be used in !Info after conversion.
Snapshot saves screen dumps on a hot key being pressed, it saves the images as sprites, thus screen dumps can be used in !Info
Word Processors/DTP packages, eg. !EasiWriter, !1stWord+, !Pipedream, !Impression, etc can all output text in ASCII format which can be used in !Info
The backbone of !Info data structures is a hierarchical directory tree as found in all RISC OS filing systems. The directory can be on any filing system as long as it is not in the root directory of the disc (there is no way to drag the root directory in desktop).
An example data structure can be found in the file 'exstruct'. (it's a drawfile)
Simply, an !Info data structure is tree of directories and subdirectories containing the files you want displaying.
Sprite Handeling in !Info:
In !Info, there is a great deal of control over which sprite is used for an icon. !Info could be seen as an extended filer display which just displays files instead of using the relevant applications, but it is poosible with a bit of effort to change the sprite used in then diplays so that they are context sensitive instead of just being the normal filetype icons (as they are here).
!Info used two files to control sprite use. These files are 'CONFIG' and 'SPRITES'. Both of the files are expected to be in the first directory of the structure and if they are here will not be displayed.
SPRITES is a sprite file (surprise, surprise) contains all of the extra sprites that are needed for the display.
CONFIG is a file that maps the items in a display window to a certain sprites. With a simple structure, this file may not be needed.
This how the sprite to use is determined
1) First, if the item has an entry in a config file (and if it exists) this sprite is checked for and used if it exists in a sprite file.
2) Secondly, !Info attempts to match the items leaf name (ie. last part of the filename) with a sprite in the sprite file. If a match is found it is used.
3) Thirdly, the items filetype is checked, if a filetype icon is found, it is used.
4) Fourthly, this is the last resort used only if no sprites are present for the item and it does not have a filetype icon the ASCII text icon is used.
A sprite file may exist without a CONFIG file, but not the other way round.
CONFIG file format:
The file is an ASCII text file (created in edit). The file contains the item's pathname (starting from the first directory of the structure - not the filing system name, disc name and root directory etc). The filename is followed by an equals sign '=' and then by a sprite name. There should be no spaces inbetween the = and the other part of the line.
Each statement (filename=spritename) should be followed by a ASCII control character (0-31).
Syntax: <Filename>=<Spritename>
There should always be a return character at the end of the file.
The format of !Info file for display:
Sprites
These Sprite files should contain only one item (as the others aren't displayed). The sprite can be in any mode that the system (and your monitor) can handle. !Info tries to map colours that don't exist to the closest alternative and will attempt to scale the sprite so that it appears at the correct aspect ratio.
Drawfiles
Any legal drawfile can be loaded. !Draw+ drawfiles are a newer format and may not even load. If they do no guarantee can be made about how much of you drawing will be displayed: Save it as a standard drawfile (see Draw+ documentation for details).
Almost all of a normal drawfile will be displayed. The only thing that won't is a columned text area - created by dragging a text file into draw.
Unlike in Draw and Draw+, the image is correct and all of it is contained in the drawfile area - none of your drawfile will be lost as it might be when loaded into Draw
ASCII Text
I have spent a lot of time on the routines that display ASCII text files.
The file will automatically be justified, word-wrapped and displayed in the chosen Anti-Aliased font at 12 points.
A few control codes have been used to select underline, center and tab.
All of the control codes can be entered in !Edit as show.
NB. Tab charcters don't always work as you expected. Often in full lines of text, if a tab character is used, the justification spacing between each word will be close to zero or negative (ie words printed on top of each other). Tabs therefore can only really be used when the file of text is not full of text. Multiple tabs can be used.
ASCII Code Keystroke in !Edit Purpose
01 Ctrl-A Turn underlining on
02 Ctrl-B Turn underlining off (don't forget)
05 Ctrl-E Center this line of text
09 Ctrl-I Tab out line.
When you type text in using edit the display is not particularly good as ther isn't word wrap and the control characters are not used. DON'T WORRY, it will normally look OK when used in !Info