@Database Zone_Editor.Guide @Author PaulHickman @Node Main "Zone Editor" @toc Easylife.guide/Main @index Easylife.gudie/SubjectIndex @{b}@{u}Zone Editor V3.01 - By Paul Hickman - (C) Oct 1994@{ub}@{uu} @{b}E-Mail: ph@doc.ic.ac.uk@{ub} @{"Distribution " link Distribution} @{"Concept " link Concept} @{"Drawing Zones " link Drawing} @{"Control Panel " link Controls} @{"Pull Down Menus" link Menus} @{"Preferences " link Preferences} @{"Bank Format " link Bank Format} @{"Easylife Documentation" link Easylife.guide/Main} @endnode @Node Distribution "Zone Editor / Distribution" @{b}@{u}Zone Editor V3.01 - By Paul Hickman - (C) Oct 1994@{uu}@{ub} Assembly code for fast zoom from the AMOS Pro Object Editor by Francois Lionet This program may be freely distributed, as long as no profit is made from doing so. Those wish to distribute for profit should contact the author. This includes making a profit from other material distributed on the same disk as the zone editor, and distribution on magazine coverdisks. The program may only be distributed in its original form, you may modify it, but modified versions may not be distributed, but should be sent back to the author if you have made improvements. If you do make any improvements, they will be creditted to you. @endnode @Node Concept "Zone Editor / Concept" @{b}@{u}The Concept@{ub}@{uu} The idea of the zone editor is that instead of calculating the positions of where your zones should be, or sitting in direct mode, and typing ?X Screen(X Mouse),Y Screen(Y Mouse) all the time, you can simply draw the zones over the screen on which you wish to set them. The zone editor allows you to do this, and stores the zones you draw in a zone bank. The bank is split into an arbitary number of groups. Each group should contain all the zones that are going to be active on the same screen at the same time. You can also load several background pictures to draw the zones over, aswell are drawing on those screens open when zone editor was run. NOTE: The zones are not connected to the picture they are drawn over - those drawn on one screen can be used on another. @{u}Main Improvements Since V2.1@{uu} - Nearly all code rewritten for AMOS Pro - Takes full advantage of AMOS Pro's accessory features - Zoom mode added - Menu interface - Vastly improvent bank grabing control - Multiple background pictures - Numeric Co-ordinate entry - Cut/Copy/Paste style zone editing @endnode @Node Running "Zone Editor / Running The Program" @{b}@{u}Running Zone Editor@{ub}@{uu} There are 4 ways to run the program: 1) Load it and run it as a normal AMOS program. This is not recomended as many of the menu options will not be available. 2) Run it from another program with the Prun command. All features will be active, except the ability to read/write Set Zone commands directly from the source of the previous program. NOTE: Zone editor will not restore your programs screen display afterwards, will turn all screens to autoback 1, and turn off all bobs. 3) Load it as an accessory, (or load it as a program and hide the window), then run it from the AMOS menu of the AMOSPro editor. All features will then be available. 4) Add it to your user menu. This is the best way, as it is easiest. To do this: - Copy the ZoneEditor.AMOS files to where you wish to permanently keep it.(AMOSPro_Accessories: is recommended if you have room). - Select 'Add Option' from AMOSPro's user menu. - Enter 'Edit Zones' into the requester, and press OK. - Select the new 'Edit Zones' option from the user menu. - Select the ZoneEditor.AMOS file in the file requester that appears. - Press OK in the next requester. No command line is required. The 'Run as hidden program' must be checkmarked - Not the 'Load in current window'. You may optionaly turn 'Keep after run' on, if you have the memory. (Although it isn't worth it from harddisk) - Select the new 'Edit Zones option again. - Press 'Shift RAmiga Z' (Or your own hotkey). - Select 'Save Default Config' from the 'Config' menu. You can now edit the zones of any AMOSPro program by loading it into the editor, and selecting 'Edit Zones' from the user menu. When you run zone editor by methods 2,3 or 4, the program it was run from, or the program in the active editor window when you run zone editor, becomes the previous program. You will them be able to grab zone & spacked picture banks from this program, and when run by methods 3 & 4, you can even grab / write Set Zone commands to its source code. I suggest you now run the program, and flip between it and this manual with Amiga-A. It will help you do understand the rest of the manual if you can see the program running, and try things as you go. @{u}Program Initialisation@{uu} When you run the zone editor, it first checks to see which screen if any is under the mouse. If there is a screen under the mouse, this will become the initial current picture when the editor. The current picture is the one on display above the control panel, on which you can draw the zones. Any other open screens are hidden, and become alternative pictures, which can be displayed from the picture menu (Show Next/Previous). Zone editor requires one screen for its control panel, so if all 7 screens are open, screen 7 is closed, unless the mouse was over it, in which case screen 6 is closed instead. NOTE: Hidden screens from your program also become pictures. NOTE: All hires screens are made lowres when displayed by the zone editor. NOTE: Zone editor can cope with double buffered screens, and HAM screens, but may not draw the zones correctly on the later. @endnode @node Drawing "Zone Editor / Drawing Zones" @{b}@{u}Drawing the zones@{ub}@{uu} To draw a zone, you must first select it as the current zone. To do this: - Click the 'ADD' button at the bottom of the control panel to create a new zone. It will flash green in the zone list to indicate it has become the current zone. - Other zones can be made the current zone by selecting them with the mouse on the list of zones on the right of the control panel. The co-ordinates of whichever zone is the current zone can be changed by: - Click the left mouse button over the picture. The top-left corner of the zones co-ordinates are set to the position where you release the mouse key. - Click the right mouse button over the picture. The bottom-right corner of the zone's co-ordinates are set to the position where you release the mouse key. - Press & Hold both buttons over the picture, to set one corner of the zone, then drag the mouse to a new location, and release the buttons to set the opposite corner. NOTE: When setting the Top-Left/Botton-Right co-ordiates individually, if you try to set the right co-ordinate to the left of the left co-ordinate, the left co-ordinate is moved to the same position as the right. etc. NOTE: If you reach the edge of the picture when holding down any mouse key, it is scrolled in the appropriate direction if there is a hidden part of the picture off that edge. NOTE: The pixels under the inverted box which indicates the zones position are part of the zone on all 4 edges. If you click the magnify button, you can then set zone co-ordinate in the same way in either the magnified, or unmagnified portion of the screen. @endnode @node Controls "Zone Editor / The Control Panel" @{b}@{u}The Control Panel@{ub}@{uu} This is divided into 6 areas: +-------------------------------------------------------------------+-+ | (1) | | +-------------------------------------------------------------------+-+ +--------------------+ +----------------------+ +-------------------+-+ | (2) | | (4) | | +-+ +--------------------+ | | | | | +--------------------+ +----------------------+ | (6) | | | (3) | +----------------------+ | | | | | | (5) | | +-+ +--------------------+ +----------------------+ +-------------------+-+ @{"1) The message bar " link MessageBar} @{"2) The zone co-ordinates" link Coords} @{"3) The group panel " link Group} @{"4) The scroll panel " link Scroll} @{"5) The Button panel " link Button} @{"6) The Selection panel " link Selection} @endnode @node MessageBar "Zone Editor / The Message Bar" @toc Controls @{b}@{u}The Message Bar@{ub}@{uu} The message bar suprisingly displays messages as you perform various actions. To it's right is the iconify button, which closes the zone editor to a small window on the workbench screen. Close the window, or press the right mouse button when it is selected to uniconify. When iconified, the zone buffer and pictures are not lost, and will reappear when you you de-iconify. @endnode @node Coords "Zone Editor / Zone Co-ordiantes" @toc Controls @{b}@{u}The Zone Co-ordinates@{ub}@{uu} When you have a zone selected as the current zone, its co-ordiantes appear in this panel. You may change any co-ordinate by clicking on it, and entering the new value. You may enter values that are so large they are off the current picture, but not negative values. If you enter a top co-ordiante below a bottom co-ordinate etc., the relevant pair are swapped, so that the left is always smaller than the right, and the top smaller than the bottom. @endnode @node Group "Zone Editor / The Group Panel" @toc Controls @{b}@{u}The group panel@{ub}@{uu} Each zone bank is contains several consecutively numbered groups of zones. Initially, the empty bank has just one group. To add another, click on the downward arrow in the group panel. The up and down arrows can then be used to select the group to edit. Extra groups can be added by clicking on the down arrow when editing the last group. The INS button will insert a new empty group before the current group, and select the new group for editing. The DEL button will delete the current group. Requesters appear to verify all add/delete group operations. You may also select a group to edit by clicking on the group number display, and entering the number of another existing group. @endnode @node Scroll "Zone Editor / The Scroll Panel" @toc Controls @{b}@{u}The scroll panel@{ub}@{uu} The four arrows can be used to scroll the current picture, if it is not all visible on the screen. They are also used to scroll the zoom window. The X & Y boxes display the current co-ordinates of the mouse on the current picture. @endnode @node Button "Zone Editor / The Buttons Panel" @toc Controls @{b}@{u}The buttons panel@{ub}@{uu} From left to right, the buttons are: @{u}Zoom@{uu} Press once to magnify the picture by a factor of 2. Press again to magnify by 4. Press again to cancel magnification. When zoomed, the left of the screen shows the original size picture, and the right the magnification. You may draw zones on either half. @{u}Top-Left@{uu} Press to centre the picture / zoom window on the top-left hand corner of the current zone (Flashing in green in the selection panel). @{u}Bottom-Right@{uu} Press to centre the picture/ zoom window on the bottom-right hand corner of the current zone. @{u}Undo@{uu} Undoes the last zone modification. There is only one step of undoing remembered, and no redo button. The following operations are undoable: - Changing a zones co-ordinates. - Adding / Inserting a zone. - Cut / Paste Over / Insert / Delete from the zone menu. - Any group menu operation which changes the zone bank buffer. @{u}Insert Zone@{uu} Inserts a new zone before the current zone (Flashing green) in the current group, and makes it the new current zone. If there is no current zone, the new zone is appended to the end of the group. @{u}Add Zone@{uu} Appends a new empty zone to the end of the current group, and selects it as the current zone. @endnode @node Selection "Zone Editor / The Selection Panel" @toc Controls @{b}@{u}The Selection Panel@{ub}@{uu} The selection panel lists the numbers & co-ordinates of the zones in the current group. The scroll bar / arrows may be used to display hidden parts of the list. When you click on the zone list, the zone you click on is highlighted, by its background becomming blue, and its foreground flashing green. If you them move the mouse over others zone descriptions whilst still holding the mouse key, their backgrounds will also turn blue, but they will not flash green. The green flashing zone is the 'Current Zone'. It is displayed over the picture, and it is the one that can be changed by clicking the mouse on the picture. It also specifies the point in the zone list where Paste Over/ Insert operations will occur. The zones with blue backgrounds are the 'Selected Zones', and they are ones affected by Cut/Copy/Delete operations from the zone menu. @endnode @node Menus "Zone Editor / Pull Down Menus" @{b}@{u}The Menus@{ub}@{uu} Menus are brought up by holding the right mouse button over the control panel. Some menu options only appear when the program is run from another program using the Prun command, or when it is run as an accessory from the AMOSPro editor. @{"Program Menu" link MN_Program} @{"Bank Menu " link MN_Bank} @{"Group " link MN_Group} @{"Picture " link MN_Picture} @{"Zones " link MN_Zones} @endnode @node MN_Program "Zone Editor / Program Menu" @{b}@{u}Program Menu@{ub}@{uu} The program menu is what is stupidly called the project menu in many applications, when it has nothing to do with the project being edited! It contains options which do not refer to the bank you are currently editing. @{u}Help@{uu} The menu option allows you to bring up this documentation file from within the program. You must set the MULTIVIEW$ command near the start of the program to the commandline to execute to display this guide. Normally this is: "SYS:Utilities/Multiview HELP:ZoneEditor.Guide" You can use either multiview, amigaguide or another guide browser. @{u}Reset@{uu} Asks for confirmation, then closes all pictures, erases the zone bank being edited, and opens a default picture. @{u}Quit@{uu} Quits back to the editor, or the next command of the previous program if zone editor was run via the Prun command. @endnode @node MN_Bank "Zone Editor / Bank Menu" @{b}@{u}Bank Menu@{ub}@{uu} The bank menu operations all affect the entire zone bank being edited. @{u}New@{uu} Asks for confirmation, then erases the bank being edited, and creates a new empty bank. @{u}Information@{uu} Displays some information about the properties, and origins of the current bank in the selection panel window. Press the left mouse key to continue afterwards. @{u}Open@{uu} If the bank currently being editted was grabbed, a requester appears offering to send it back to the previous program. If you decline, or the bank wasn't grabbed, but is unsaved, a requester appears offering to save this bank first. If you select 'Yes', the Save As function is inkoved. If latter abort the save, the open operation is cancelled. A file requester then appears from which you should select an AMOS .Abk file that contains a single zone bank. The format of the zone bank has not changed since previous versions of the editor, so old zone banks can be loaded with any conversion. The bank you select is the loaded into the edit buffer. @{u}Save@{uu} If the current bank was opened with the Open function, this menu option will saved the modifed version back over the original. Otherwise it reacts identically to save as. S@{u}ave As@{uu} A file requester appears, in which you should select / enter a filename to save the current zone bank to. If you select a file that already exists, a requester appears asking if you want to overwrite it. @{u}Revert@{uu} If the current bank was opened, revert will load it from disk again, undoing any changes you have made. If it was grabbed, it will be grabbed again. Otherwise, revert has no effect. @{b}The final two options on this menu only appear when the program is run as an accessory from the editor, or via the Prun command:@{ub} @{u}Grab Bank@{uu} This option copies a zone bank from your previous program into the buffer. When you select it, you are asked if you want to Send, or Save the current bank (Depending on where it originated), then a list of available banks appears in the right hand selection panel, from which you should select a zone bank to grab, or press the right mouse button to cancel. When you grab the bank, it is copied from your previous program into the zone editor buffer. It is not removed from the previous program with the Bgrab command. @{u}Send Bank@{uu} This option copies the zone editor buffer into a bank of your previous program. If the bank you are editting was grabbed from the program, a requester appears asking if you want to udpate the original from which you grabbed it. If you select 'Yes', the original is updated. If you select 'No', or if the current bank was not grabbed, a list of all possible bank numbers appears in the selection pannel, along with the type of bank next to those in use. Select the bank number you wish to send to. any existing bank will be overwritten by the zone bank. @endnode @node MN_Group "Zone Editor / Group Menu" @{b}@{u}Group Menu@{ub}@{uu} The group menu operations concern all zones in the group being edited, but do not affect the rest of the bank. @{u}Open AscII@{uu} This function reads all the Set Zone commands it can find in an AscII file, and inserts them into the current group. Only those existing zones with the same numbers as those in the file as overwritten - the other existing zones are unaffected. A file selector opens to select the file to read from. It must be pure AscII, not a .AMOS file. Only those Set Zone commands which contains decimal integer numbers for all 5 parameters will be read into the group. Those which use variables, or other number bases are ignored. @{u}Save AscII@{uu} This function saves the current group as a set of AscII Set Zone commands, and is headed by a line to reserve enough zones for the group. A file selector opens to select the file to save to. @{u}Grab Screen@{uu} This function attempts to replace the current group with the AMOS Screen zones that are currently defined on the current picture. There will only be zones to grab if this picture is from a screen that was already open when the zone editor was run. You cannot grab screen zones from an opened picture, or a picture grabbed from the previous programs banks. If the current group already contains some zones, you are asked to verify that you want to replace them. @{b}The final 2 options in this menu will only appear when the zone editor is run as an accessory from the AMOSPro editor (Methods 3 & 4 in the 'Running Zone Editor' section). They will not appear when run with a 'Prun' command.@{ub} @{u}Grab Source@{uu} This option allows you to read 'Set Zone' command from the source code of the previous program. When you select it, the AMOSPro editor screen appears, showing the previous program with all it's procedures unfolded. You should mark the start and end of the block you wish to read the set zone command from using the following controls: Control/Shift/Cursor Left: Search for previous 'Set Zone' command. Control/Shift/Cursor Right: Search for next 'Set Zone' command. Other Cursor Keys: Work as normally in editor, including when they are shifted / pressed with control / pressed with Control & Shift. Space Bar : Mark start / end of block. Escape : Abort operation, and return to zone editor. NOTE: Only Set Zone commands where all 5 parameters are decimal integer numbers are read. Those containing variables, expressions, or numbers in other bases are ignored. NOTE: Only those zones defined in the Set Zone commands are overwritten in the current group - the rest of the group is untouched. NOTE: Extra blank zones will be inserted into the group to fill the gaps between non-consecutive zone numbers, if there were no zones with those numbers defined previously. @{u}Send Source@{uu} This is the opposite of the grab source operation - it inserts the current group in the source code as Set Zone commands. Using the same controls as grab source, move to the point at which you wish to insert the new commands, and press space. NOTE: A Reserve zone command is placed before the set zone commands to reserve an appropriate number of zones. @endnode @node MN_Picture "Zone Editor / Picture Menu" @{b}@{u}Picture Menu@{ub}@{uu} The picture menu functions to not affect the zone bank, only the background picture on which the zones are drawn. @{u}Show Next@{uu} If you have several pictures open, this option will display the next one. Otherwise it has no effect. @{u}Show Previous@{uu} This is the same as Show Next, except it cycles through the open pictures in reverse order. @{u}Information@{uu} Displays various statistics of the current picture in the selection panel window. Press the left mouse button when done. @{u}Open@{uu} If there are not too many pictures open, a file selector appears from which you should select an IFF picture, or an AMOS Spacked bank file. You may open up to 6 pictures at a time (Except when zoom mode is on, when you may only open 5). NOTE: IFF files that are larger than 1024 pixels in either direction, or that require any AGA graphics mode cannot be opened. @{u}Close@{uu} This option closes the current picture, releasing the memory it uses. NOTE: You must have at least one picture open at all times, so you may not close the last picture. @{u}Paste Clip@{uu} Loads the picture from unit 0 of the clipboard, either as an IFF file, or an Spack .Abk file (Not that there is likely to be one of those on the clipboard, but you never know...) This can be used to read brushes Copied from Dpaint IV's brush menu, or even icons copied from iconian. @{u}Grab@{uu} If the program was run as an accessory, or via the prun command, you may use this menu option to open an spacked picture from the banks of the previous program. The selection panel on the right hand side of the control panel which from which you usually select zones lists the banks of the previous program. Select one which contains an Spacked picture to open it. NOTE: The AMOS BGrab command is not used - the bank is not removed from the previous program. @endnode @node Zones "Zone Editor / Zones Menu" @{b}@{u}Zone Menu@{ub}@{uu} The Zones menu operaions act upon a subset of the current group, often those zones highlighted in the selection panel. @{u}Select All@{uu} This selects all the zones in the current group, highlighting them in blue in the selection panel. @{u}Cut@{uu} This performs similarly to the cut operation in most word- processors / text editors. The selected zones are removed from the current group and stored in the cut buffer. NOTE: Only the zone co-ordinates are stored in the cut buffer - the zone numbers are not. They may be pasted/inserted back into this, or another group at any point. @{u}Copy@{uu} This copies the selected zones into the cut buffer, but does not remove them from the current group. @{u}Paste Over@{uu} This copies the cut buffer into the current group, begining at the current zone (Highlighted in flashing green). That zone, and those after it are overwriten by the zones from the cut buffer. NOTE: If the cut buffer is empty, or there is no current zone, Paste Over has no effect. @{u}Insert@{uu} This inserts the zones in the cut buffer into the current group, just before the current zone, without overwriting any of the existing zones. The zone numbers of those zones after the inserted zones are increased by the number of zones inserted. NOTE: If the cut buffer is empty, or these is no current zone, Insert has no effect. @endnode @node Preferences "Zone Editor / Preferences" A few variables at the start of the zone editor can be modified by the user. See the top of the source code for documentation. @endnode @node Easylife "Zone Editor / Zone Bank Support" @{b}@{u}Easylife Zone Bank Support@{ub}@{uu} The easylife extension has 3 commands to support zone banks: @{b}ElZb Add SCREEN,BANK,GROUP@{ub} This command installs a single group from a zone bank on the current screen, as normal AMOS zones, erasing any zones already set on that screen first. SCREEN in the screen number (0-7), BANK in the bank number of the zone bank, GROUP is the group number to install. NOTE: You DO NOT need a 'Reserve Zone' command before Elzb Add. @{b}ElZb Multi Add SCREEN,BANK,GROUP@{ub} This command is similar to the previous, except the zones are installed as easylife multi zones, instead of normal screen zones. The other difference is that the previous zones are not erased, unless their group & ID numbers clash with those in the group being added. NOTE: You DO need to use a 'Elmz Reserve ' first to reserve a sufficent number of multi zones for the group. @{b}Elzb Install SCREEN,BANK@{ub} This command installs all groups of the zone bank as easylife multi zones, erasing all existing multi zones first. NOTE: You DO NOT need to use a 'Elmz Reserve' command first. @{b}@{u}Other zone bank support@{ub}@{uu} The ZB_ADD procedure is equivilent to the Elzb Add command described above, but does not use the easylife extension. @endnode @node Format "Zone Editor / Internal Format Of A Zone Bank" @{b}@{u}Zone bank format@{ub}@{uu} If ST is the address Start(BANK_NO), Leek(ST) returns the number of groups, NG. The next NG longwords contain the offset of the start of each group from ST, in order of group number. The group definitions then follow, also in group number order. The format of each group is that the first word contains the number of zones in the group I.E. NZ=Deek(ST+Leek(ST+G*4)). Then follows the co-ordinates of each zone in the group, in ascending numeric order, with the individual co-ordinates taking 1 word each, and appearing in the order Left,Top,Right,Bottom So that bank format in assembler notation is: ST: dc.l NG dc.l Group1 - ST dc.l Group2 - ST dc.l Group3 - ST . . . dc.l GroupNG - ST Group1: dc.w Number zones in group 1 (NZ1) dc.w Group1,Zone1 Left Co-ordinate dc.w Group1,Zone1 Top Co-ordinate dc.w Group1,Zone1 Right Co-ordinate dc.w Group1,Zone1 Bottom Co-ordinate dc.w Group1,Zone2 Left Co-ordinate dc.w Group1,Zone2 Top Co-ordinate dc.w Group1,Zone2 Right Co-ordinate dc.w Group1,Zone2 Bottom Co-ordinate . . . dc.w Group1,ZoneNZ1 Left Co-ordinate dc.w Group1,ZoneNZ1 Top Co-ordinate dc.w Group1,ZoneNZ1 Right Co-ordinate dc.w Group1,ZoneNZ1 Bottom Co-ordinate Group2: dc.w Number of zones in group 2 (NZ2) dc.w Group2,Zone1 Left Co-ordinate dc.w Group2,Zone1 Top Co-ordinate dc.w Group2,Zone1 Right Co-ordinate dc.w Group2,Zone1 Bottom Co-ordinate . . . dc.w Group2,ZoneNZ2 Left Co-ordinate dc.w Group2,ZoneNZ2 Top Co-ordinate dc.w Group2,ZoneNZ2 Right Co-ordinate dc.w Group2,ZoneNZ2 Bottom Co-ordinate Group3: ....... . . . Group_NG ...... @endnode