home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 3
/
Merciful_Release_3.bin
/
software
/
d
/
data_division_docs
/
datadivisiondocs02.dms
/
datadivisiondocs02.adf
/
13
< prev
next >
Wrap
Text File
|
1996-11-23
|
10KB
|
223 lines
Chapter Twelve
Filetypes .......................................139
Predefined Filetypes ............................139
Filetype Manager ................................140
Editing Filetypes ...............................141
Events ......................................141
Mouse Events ................................142
Command Events - User 1-4 ...................143
Icon and Filetype Menus .........................143
Default Icon and Select Icon ................143
Edit Class ..................................144
Definition of a Filetype ....................144
Editing the Filetype Definition .............145
Edit Commands ...............................146
Testing Directives ..........................146
Movement Directives .........................149
Extra Examples ..............................151
The Automatic Filetype Creator ..................152
Filetypes
A file is simply stored data. Files can contain executable programs,
text files, pictures or various types, icons for Workbench, or a multitude
of other kinds of data. Most, but not all files, have an identifiable
structure. Directory Opus 5's Filetypes system is designed to examine a
file's internal structure and identify the type of data it contains. You
can configure Directory Opus 5 to understand an unlimited number of
Filetypes.
Filetypes are a powerful feature of Directory Opus 5. By using
Filetypes, you can configure Opus 5 to play animations when they are
double-clicked, to load and use Multiview when you double-click on an
AmigaGuide help file, or to uncompress an archived file when you drag and
drop it to a new directory or even to feed the archive to an external
handler such as ArcDir.
This is the essence of the Filetypes; when you do something to a file,
Opus 5 can figure out what kind of file it is, and take the appropriate
action for that type of data.
Predefined Filetypes
Opus 5 comes with some fully defined Filetypes. These are stored in the
DOpus5:Filetypes directory and have both the Filetype structure fully
defined, plus have default commands attached to the various actions
available. The loading of Filetypes is dynamic. Opus 5 will look to see
what Filetypes you have defined in this directory and load them
automatically.
Directory Opus 5 139
For convenience, we have also provided a set of default Filetypes
definitions in the DOpus5:Storage/filetypes directory. With these, we
have done most of the hard work and have set out the details needed by
Opus 5 to recognise files of the specific types. To use one of these pre-
defined Filetypes, you should use the Automatic Filetype Creator to
identify and install the matching Filetypes or you can manually drag the
required one into the DOpus5:Filetypes drawer and Opus 5 will recognise
and load it automatically. Then, edit the new Filetype and set out the
specific actions you wish to attach to the new definition. By doing this,
you don't have to be an expert or know anything about the internal
structure of the various files. All you need to do is attach the actions
which Opus 5 should take when it recognises a file of this type.
Filetype Manager
The Filetypes requester is accessed from the Settings menu and displays
the list of Filetypes that Directory Opus 5 recognises. For starters, we
have included several definitions. These may include AmigaGuide, LHA
archive, Workbench icons, and Script files.
Your currently defined and available Filetypes will be shown in the list
in alphabetical order. For example,
*** See Fig 12-01 ***
Add: Allows you to create a new Filetype entry based on a predefined
File Class. When you select this button, two requesters appear
where you may define the actions and definitions of the new
Filetype.
Duplicate: Allows you to quickly duplicate a current entry. Highlight
the desired entry, select 'Duplicate' and a new entry will be
cloned from the current one and presented for editing.
140 Directory Opus 5
Edit: Displays the Filetype events and allows you to edit the Filetype
definition and command actions.
Remove: Removes a Filetype definition from the list and deletes the
entry from the DOpus5:Filetypes drawer.
Store: Removes a Filetype definition from the list and moves the entry
from the DOpus5:Filetypes drawer to the DOpus5:Storage/Filetypes
draw.
Editing Filetypes
The Filetype Editor consists of a number of parts; one showing the actual
Filetype definition or class, one showing the possible events or user
actions, and one detailing the corresponding commands each action will
perform.
Double-clicking on a particular Filetype, or selecting the Edit button,
displays the list of events or user actions which can be defined for each
Filetype, a special set of menus which you may attach to the sticky menus
for icons of this type, and the default icon image you wish to use for
this type of file.
*** See Fig 11-02 ***
Events
Each of the actions is associated with either a mouse event or a limited
set of Opus 5 commands, namely User1 - User4.
A tick on the left of an entry indicates that it already has an Function
Command List defined for it. Clicking on an entry in the list displays
the Function Editor, allowing you to edit the commands associated with
this event.
Directory Opus 5 141
*** See Fig 11-03 ***
To compare the definitions for multiple events, or edit multiple
definitions simultaneously, double-click on multiple events in turn.
While each of these event types can be defined to do something different,
usually only a few are actually defined. It is certainly not necessary to
define all events for a particular Filetype.
When one of these actions or events occurs, Opus 5 does the following:-
* It first searches the Filetypes list, starting with the Filetype
of highest priority, and checks whether it matches the entry's
Filetype definition.
* If it matches, it checks if the corresponding event has been
defined as a notifiable action. If it is defined, it performs the
attached function.
* If there is no match for the Filetype definition, or if there is a
match but no associated function, it continues to search the
Filetypes list. Note that it is possible for it to match a
subsequent entry that has a function defined.
Mouse Events
Mouse events occur when you either double-click on a file or when you
drag and drop it into a new directory.
Double-click: This occurs when you double click on a file. A popular
use of this action is to examine a file and, for example,
to show it if it is a picture, or play it if it is a
sound. The actual double-click speed is defined by your
Amiga OS preferences.
142 Directory Opus 5
Drag and drop: This event occurs when a file is clicked on, dragged to
another window and released. One popular use of this
event is for extracting an archive.
Command Events - User 1-4
Command events are called when a file is acted upon by a limited set of
Directory Opus 5 commands. Only the User event commands are available.
The terms User 1, User 2, User 3, and User 4 may seem cryptic, but they
are here to give you flexibility. Each of the normal Opus 5 commands has
an implied usage, but you may have an application which doesn't really
mean any of these. In that case, you can decide that one of these User
events means "Perform this special operation".
Icon and Filetype Menus
As from Opus 5.5, each icon, and Name mode Listers if activated, has a
special set of Filetype pop-up menus, accessed by pressing the RMB over
the icon, or an entry in a Name mode Lister. Opus provides a limited set
of common commands for these menus according to the type of icon or file.
You can add your own favourite commands specific to icons and files of
defined types.
When an icon is displayed for a file for which you have previously
defined a Filetype, the Filetype menus are added to the pop-up menus for
icons of this type. Select Add to define the Menu label and functions for
your own custom menus.
Default Icon and Select Icon
The Select Icon button allows you to provide an icon image which Opus 5
will use when displaying this specific Filetype in either an Icon or Icon
Action mode Lister, or when left-out on the Opus 5 Main Window. To add
your own special image, either select the icon image required through the
file requester, or drag and drop a suitable icon into the display area
above this button. (We provide a special DOpus5:Icons directory to store
such special icons.)
+---------------------------------------------------------------------+
| If an icon image is supplied, Opus 5 will use this defined icon for |
| the internal AddIcon command instead of the system default. |
+---------------------------------------------------------------------+
Directory Opus 5 143
Edit Class
Underneath the event list is a button which lets you modify the class or
definition for this Filetype as discussed below.
Definition of a Filetype
Selecting Edit Class from the Event Requester brings up the File Class
editor. Here, you specify the elements which Opus 5 will look for to
recognise a specific Filetype.
*** See Fig 11-04 ***
Name: This is for the name of the Filetype.
ID: The ID will appear beside the Filetype in the Filetype manager
screen. It is a shorthand way for Opus 5 to display the name for
the Filetype