home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
workbench
/
groupinfo
/
groupinfo.doc
< prev
next >
Wrap
Text File
|
1995-02-27
|
17KB
|
446 lines
GroupInfo version 1.04, copyright 1992 Nicolas Dade.
All rights reserved. Permission is hereby granted for non-commercial
duplication and distribution, and for distribution by BBSs which do
not change for downloads, and for distribution in disk collections
which charge a nominal fee per disk.
Description:
GroupInfo is to a group of files what the C= supplied Information
(in the workbench Icons menu) is to one. It allows the manipulation
of a set of files and their .info files in one operation. It
requires at least WB 2.04.
Use:
You can select some files and/or dirs to manipulate, and then
double-click on GroupInfo. Or you can just start it going by itself,
and select the files and dirs to manipulate once GroupInfo is going
(by pressing the [Add...] Objects button).
You can also start GroupInfo from a shell, but if it is started from
a shell it cannot read it's tooltypes, save its preferences, and
cannot be passed a list of objects.
But the most logical way I've found is to put it in the workbench's
Tools menu using any of the Tools menu manipulation programs
available (ToolMenu, ToolManager, ToolsDaemon come to mind). Then
you access it just like you access Information: select the files and
dirs, and then chose GroupInfo from the menus.
If you pass it just one file or dir, then GroupInfo imports that
file's or dir's tooltypes, stack, comment, default tool and
protection bits, just like Information.
The Window & it's Gadgets:
Once the window opens, you see something which vaguely resembles the
Information window, but with a few modifications:**
** There are actually two different layouts of the gadgets possible.
Here I describe what is know internally as the standard layout,
which is the one GroupInfo tries first to use. However if you are
running GroupInfo on a small workbench screen, and/or with a very
large font, it might fall back to the alternate layout, which
contains all the gadgets which the standard layout contains, but not
in the same places. Since it's not all that hard to figure out what
is what, I'll speak no more of this.
Instead of a single file's or dir's icon, you are shown a list of
all the objects you selected. The gadgets [Add...],[Del] and [Del
All] below this list let you add and remove from the list. The file
requester shown in response to [Add...] allows multiple file
selection (shift-click on the names, instead of just clicking) in
order to add a lot of files or dirs at once. You can also add
objects by picking up their icons (from a workbench window) and
dropping them on the object list. The text box below the list shows
the selected object, which would be deleted if the [Del] button
where pressed.
Below the object list is the tooltype list. The tooltypes list area
includes 3 gadgets not found in the Information window, along with
the expected [New] and [Del].
[Import...] lets you add to the list the tooltypes of a file or dir
(it pops a file requester). You can also import tooltypes from files
by dropping their icons on the tooltype list.
[Del All], similarly to that found with the object list, deletes all
the tooltypes from the list.
The cycle gadget above the tooltypes list cycles through the action
to be performed to the tooltypes of the objects listed in the object
list.
[ - ] does nothing.
[Add or Replace] adds the tooltypes in the list to those already
belonging to the objects, replacing those which match with the value
from the tooltype list, leaving unchanged any which do not match any
in the tooltype list, and finally, adding those which appear in the
tooltype list and not in the object.
For example, if the tooltype list contained
CX_POPUP=NO
STARTUPPRI=0
and the object contained
CX_POPUP=YES
DONOTWAIT
after GroupInfo got done with things (after you'd pressed [Execute]
or [Execute & Exit]), the object would contain
CX_POPUP=NO
STARTUPPRI=0
DONOTWAIT
The CX_POPUP=YES tooltype was replaced by the one from the list
since the list already contained a CX_POPUP=<something> tooltype.
The STARTUPPRI=0 tooltype was added since there was no
STARTUPPRI=<something> tooltype in the object. The DONOTWAIT
tooltype passed through unchanged since the list did not contain any
DONOTWAIT<something> tooltypes.
The thing to understand is that tooltypes are matched by the
argument name, and not by its value. In other words, tooltypes are
matched by the text to the left of the `=', or the whole line if
there is no `='.
[ Uncomment ] uncomments tooltypes which match those in the list.
(commenting out tooltypes is the prefered way to render them
inactive, rather than deleting them outright, since when you want to
add them back on you don't have to look them up again. It is done
manually by enclosing the tooltype line in parenthesis.) I.e. If the
list contained
DONOTWAIT
CX_POPUP
and the object contained
(DONOTWAIT)
CX_POPUP=YES
CX_POPKEY=LAmiga RAmiga Control X
after GroupInfo finished the object would contain
(DONOTWAIT)
(CX_POPUP=YES)
CX_POPKEY=LAmiga RAmiga Control X
The DONOTWAIT line was already commented out, so there was no point
in commenting it out a second time. The CX_POPUP line was commented
out since it matched the CX_POPUP line in the list. And the
CX_POPKEY line pass through since it matched no lines in the list.
[ Comment Out ] does, as you would expect, exactly the opposite of
[Uncomment]. Any tooltypes which match those in the list are
commented out. The rest are left unchanged.
[ Replace All ] replaces the object's tooltypes with those in the
list, without keeping any which do not match (in other words, it
completely replaces the object's tooltypes---the previous tooltypes
are ignored and deleted).
Also the interactions between [New], [Del], the text entry box and
the list are more fluid than those in Information. The string starts
out in New mode, and stays that way while you enter many
tooltypes---no need to click on [New] all the time. And after
deleting a tooltype, the next on in the list is shown in the text
entry box, and pressing [Del] another time deletes that one---no
need to click on an item in the list and then on [Del] all the time.
In the right hand column, starting at the top, there are two
information boxes, Files' Size, which shows the total size of all
the files in the object list, and Total Size, which if not zero,
shows the total size of all the files contained inside any
directories and/or devices in the object list. Since this can take
time to compute, this is not done automatically. Rather the button
just below, [Compute Total Size], begins that computation.
Below are cycle gadgets which define what manupulation should be
performed to the object's protection bits. Unlike the C= Information
window, which only has two states for these bits, I have three, and
so could not use a `checked or unchecked' to show their state.
Instead [ - ], like with the tooltypes, means do not change that
bit. [ Set ] sets that bit (equivalent to checking that item in
Information), and [Clear] clears that bit (equivalent to unchecking
that item in Information). You can set these to a file's protection
bits by dropping the file's icon on these.
Below are three text entry gadgets, and three corresponding action
cycle gadgets. Stack lets you set the object's stack size, Comment
lets you set the object's comment, and Default Tool lets you set the
object's default tool. Again [ - ] means `do not change', and [Set]
means `do change'. You can import a file's stack, comment or default
tool by dropping it's icon on the corresponding area of the window.
Across the bottom of the window are four buttons. The two on the
left have GroupInfo go off and actually perform the changes you've
selected above. [Execute & Exit] performs the changes and then quits
GroupInfo, just like [Save] in Information. [Execute] simply
performs the changes. On the right [Clear Actions] resets all the
action gadgets to `do nothing'. [Cancel] quits GroupInfo without
doing anything, just like [Cancel] in Information.
As in Information, the close button on the window is equivalent to
[Cancel].
ToolTypes:
GroupInfo understands several tooltypes, though none are required.
LEFTEDGE=<pixel position of left edge of unzipped window>
TOPEDGE=<pixel position of top edge of unzipper window>
ZLEFTEDGE=<pixel position of left edge of zipped window>
ZTOPEDGE=<pixel position of top edge of zipper window>
these four allow you to specify where the upzipped and zipped
windows should appear. The easiest way to set these is to start
GroupInfo going, put the window where you want it, and chose `Save
Window Position' from the menu, but if you like to type in pixel
numbers by hand, feel free to do so.
LAYOUT=<standard or alternate>
this lets you specify which layout you prefer.
FONT=<name.font/height>
and this lets you select the font you prefer.
These last two can be set by selecting `Save Font & Layout' from
GroupInfo's menu, but if you want a font which GroupInfo is not
using at that time, you'l have to type it in yourself.
REFRESH=<smart or simple>
this lets you chose the manner in which the GroupInfo window will be
refreshed (redrawn). Smart refresh is fast, but chip ram is required
to save the obscured portions of the window. Simple refresh requires
no chip ram, but GroupInfo has to redraw newly uncovered regions of
the window, which takes time. The refresh mode does not effect
GroupInfo's operation, so choose the one you prefer. (these are the
same modes as are selected with /SIMPLE and /SMART when opening a
CON: window, if that means anything to you). The default is smart
refresh.
So the tooltypes could look like
LEFTEDGE=30
TOPEDGE=32
ZLEFTEDGE=10000
LAYOUT=standard
FONT=times.font/13
REFRESH=smart
and they would give me an unzipped window at (30,32), and a zipped
window at the top right edge of my screen (10000 is larger than the
width of my screen, so the zipped window will go as far as it can).
GroupInfo will first try the standard layout with times.font size 13
(it will fall back to other fonts and layouts if my screen is too
small, or if it can't find the times.font size 13). And the window
will use smart refresh.
The Menus:
The `Project' menu contains only `About', which shows name, version
and copyright information.
The `Preferences' menu contains two items to save various parts of
the current settings to GroupInfo's tooltypes.
`Save Window Position' saves the current window position in the
LEFTEDGE and TOPEDGE tooltypes if the window is unzipped, and in the
ZLEFTEDGE and ZTOPEDGE tooltypes if the windiw is zipped.
`Save Font & Layout' saves the current font and layout in the FONT
and LAYOUT tooltypes.
The reason it in interresting to save these is the following: when
GroupInfo has to fall back to smaller fonts and alternate layouts,
it takes time for it to try and reject each layout. By using this
menu item to save the layout and font that GroupInfo finaly used you
save time, since the next time you start GroupInfo it will try this
configuration first (and hopefully it will still work---it if
doesn't then GroupInfo will go through the long fallback routine and
you haven't save any time, but the hope is that this will not be the
case). Of course you can also edit these two tooltypes to specify a
layout and a font which are not the current ones (in order to try
something new, for instance), but to do that you'd type the values
in yourself---this menu item will only save out the current font and
layout.
Details:
1) Tooltypes are matched by the argument's name, in a locale
sensative, case independent, manner (utiltity.library/Stricmp()).
The argument's value (if even present) is disregarded. Therefor when
[Comment Out]ing or [Uncomment]ing tooltypes, any argument values
present in the listed tooltypes are ignored.
2) Tooltypes are considered commented out if they begin with a `(',
and not if they do not.
3) When [Uncomment]ing tooltypes, GroupInfo does not flag tooltypes
in the objects which contain brackets. Thus a tooltype like
(PASTEKEY=<key>)
will be uncommented to
PASTEKEY=<key>
which is not correct, since the ``<key>'' should be replaced by the
actually key desired when the tooltype is uncommented. For the
moment you, the user, have to watch out for this.
4) The file requesters have as default pattern ~(#?.info), which
causes them to not show any icon files. However I do allow the user
to edit this, and then to select icon files. (Sometimes you want to
mess with icons' protection bits, for example).
6) The GroupInfo window is completely font sensative. (Unlike the
Information window, which, like many of C='s programs, insists on
using topaz 8, even when the default font is also 8x8. Forcing topaz
8 is NOT font sensative programing by any stretch of anyone's
imagination, except C='s, and it IS definitely user insensative
programing). GroupInfo will lay itself out in Times 15 if you ask
for it (give GroupInfo a tooltype FONT=times.font/15) However it can
happen that, while in the process of laying out the contents of the
window, GroupInfo discovers that it couldn't open a window large
enough to hold everything. It deals with this with two strategies:
it can use an alternate, smaller, less pleasing (to me at least)
layout, and it can fall back to the workbench screen's font, the
system's default font, and then to topaz 8. You _will_ see this
behavior if you try to run GroupInfo on a 640 by 200 workbench
(standard non-interlaced wb): the normal window layout is too tall,
given an 8 x 8 fixed width font. GroupInfo will probably fall back
all the way to topaz 8 with the alternate layout. (And you will note
that the alternate layout, given an 8x8 font, a screen font no more
than 9 pixels high, and the standard border thicknesses, just barely
fits on an 640x200 screen. That is not by accident. :) If nothing
fits, GroupInfo gives up with an error message saying "the window
will not fit in the screen". The only way to get GroupInfo to work
is to either make the screen larger, or make the screen's font
smaller (changing GroupInfo's font at this point makes no
difference, since it has already fallen all the way back to topaz 8
before giving up)(unless you can stand a font smaller then 8, in
which case changing to that font could help).
Changes:
new in 1.04:
1) error messages all over the place.
new in 1.03:
1) If started with only one argument, it imports everything from
that argument, which makes it like Information.
2) fix: the tooltype list is now correctly scrolled to the bottom
when a new tooltype string is added to it.
3) bug fix: after adding to the tooltype list, the object list was
unselectable until something was added to it. (Actually the bug was
much much more serious---the own_tooltypelist routine actually asked
gadtools for the object listview's list, instead of the tooltype
listview's list! A fine recipe for a non-reproducible crash if the
wrong things happen at the wrong time.)
4) fix: It seems that GetDiskInfo(), when passed a null string for
the name, and when the CurrentDir is the root dir of a filesystem,
fails, instead of looking for a file called `disk.info'---it just
does the `normal' thing of looking in the ParentDir for a file with
the name `<name of CurrentDir lock>.info. Grrrr. So I wrapped
GetDiskInfo with some code to handle this situation (PutDiskInfo in
execute too). Now you can drop disks on the default tool area and
import the disk's default tool, and you can modify a disk's icon.
(You may have though you could before, but that was only because
there was no error msg from GroupInfo. If you looked at the disk
icon later you'd see that nothing had been changed.)
5) played with a lot of little things involving the flow of the
user interface. the most visible change is that the long operations
(execute and compute total size) now disable all gadgets that should
not be used when they are running (i.e. you can't change the object
list while computing the total size, since the total size routine
uses the object list). All not-ghosted gadgets may be played with
while the operation is in progress, and while I was at it, menu
items too, and window refreshing also still takes place. And,
finally, pressing [Cancel] or the close window button cancels the
long operation in progress.
new in 1.02:
1) fix: [Clear Actions] no longer clears the Stack, Comment and
Default Tool strings.
2) bug fix: during the exit code I was removing the lists from the
listview gadgets after I had closed the window! If GroupInfo was
crashing upon exit, and/or drawing in the workbench screen itself,
and other strange things upon exit, this bug could have been causing
it.
3) Some tooltypes for GroupInfo to store away some preferences
items, and menu items to write the preferences to the icon
automatically.
4) Added a tooltype to choose between simple and smart refresh
modes. Smart is still the default.
5) Made the window an AppWindow. You can drop icons on various area
and the appropriate action takes place.
new in 1.01:
1) Big bug fix: try passing a drawer or a disk to version 1.00 at
startup. Boom! (Especially with the disk, it happens even faster ---
there were two seperate bugs). All this is fixed, and while I was at
it I changed the code so that it correctly appends a `:' to disks
which are passed in from workbench, and appends a `/' to dirs.