home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 3
/
CDPDIII.bin
/
pd
/
commodities
/
toback&front
/
toback&front.doc
< prev
next >
Wrap
Text File
|
1992-10-07
|
11KB
|
279 lines
toBack&Front
(Commodity)
by
Stefan Sticht
This program (binary), sourcecode, documentation is
PUBLIC DOMAIN.
You may do anything with it!
Description
toBack& Front is a commodity, with which you can easily switch the
window under the mouse pointer in front of all others or behind all
others. If the mousepointer is over an backdrop window or the titlebar
of a screen or no window, the screen is switched to front or back. For
example you may install toBack&Front to bring any window to front if
you double-click in it. Or if you make three fast clicks, so that this
doesn't interfere with double-clicking an icon. You may install it
that double-clicking into a window while holding the left alt key
pressed switches the window to back. Which action switches a window or
screen to back or front is changeable. Most inputevents (e.g. keyboard
or mouse events) can be such an action.
Requirements
This commodity requires AmigaOS 2.0, at least Kickstart 37.175. This
version is also known as AmigaOS 2.04. Please check this out using the
About menu item from the Workbench's menu.
Starting toBack&Front
Just make a double-click on its icon. Starting toBack&Front twice
removes it. You can quit it with Exchange's Kill gadget, too. If you
want to start it with every boot, just copy the icon in the drawer
WBStartup of your Workbench.
You can start toBack&Front from the Shell with
<path>toBack&Front
Please replace <path> with your path to toBack&Front, e.g.
SYS:Tools/Commodities/. If you start toBack&Front with
Run >NIL: <path>toBack&Front
you are able to close the shell or do anything else with it. You may
quit it by starting it twice or using the DOS commands Status and
Break: Execute Status and look for number of toBack&Front's process in
the second column. Using Break <number> C removes toBack&Front.
Exchange
Exchange is the commodities controller program. With Exchange you can
control all commodities: you can kill, disable, enable, show and hide
commodities.
Start the Exchange program, which usually is in the Utilities
drawer of your Workbench disk, by double clicking its icon. Now you
see a list of the available commodities. Select the commodity you want
to control. The commodities title, description and status is shown now
below the listview gadget.
You can kill the commodity using the Kill gadget... If the
commodity has a window to open, in which you usually change some
parameters, you can open this window using Show. Hide closes this
window. toBack&Front has no window to open.
Options
If you start toBack&Front from the Workbench, you specify options
using tool types. Select toBack&Front's icon and call the menu item
Information from the Workbench's menu. In the window, which has
opened, you can change the tool types of toBack&Front. Please read
your Workbench documentation for further information.
In the Shell you specify options after the program name, e.g.
toBack&Front back_clicks=3
If an option requires a string, which contains blanks, you must quote
the string:
toBack&Front back_action="lalt f1"
Here the template:
CX_PRI0RITY/K/N,BACK_ACTI0N/K,BACK_CLICKS/K/N,BACK_REM0VE/S,
BACK_LEFTBUTT0NUP/S, FR0NT_ACTI0N/K,FR0NT_CLICKS/K/N,FR0NT_REM0VE/S,
FR0NT_LEFTBUTT0NUP/S
The description of the options:
CX_Priority
You can specify the priority of the commodity within the commodities
queue using CX_PRIORITY=<number>, where <number> is the decimal value
for the priority. Default priority is 0.
Front_Action
FRONT_ACTION=<string> specifies which action switches the window or
screen to front. <string> is an input description string as described
below. Default action is "FRONT_ACTION=rawmouse leftbutton
lbuttoncode" (left mousebutton).
Front_Clicks
FRONT_CLICKS=<number> specifies how many actions have to occur to
switch something to front. Two actions must always occur within the
doubleclick-timeout, which you can specify in the Input preferences.
For example if you want a window to be switched to front when
double-clicking in it, you must set Front_Action to trap the left
mousebutton and set Front_clicks=2. If you want triple-clicking, set
Front_clicks=3 etc. Default is front_clicks=2.
Front_Remove
The keyword FRONT_REMOVE specifies that the inputevent for the front
action shall be removed and not being sent further to other programs.
For example setting front action to trap a double click and setting
front_remove isn't useful, because any double-click will be eaten by
toBack&Front. Then you can't start any longer a program by
double-clicking its icon. On the other hand it might be usefull to
remove the inputevent, for example if specify the action to be
pressing left alt and f once: if you don't specify front_remove, then
pressing left alt and a while the mouse pointer is over an shell
window may write something in the window (depends on your keymap) and
switches it to front. If you set front_remove, only the front action
takes place without writing something in any window.
Front_Leftbuttonup
Specifying Front_Leftbuttonup simulates a release of the left mouse
button when the front_action happens. Please see Back_Leftbuttonup for
a detailed description.
Back_Action
BACK_ACTION=<string> specifies which action switches the window or
screen to back, analogous to Front_Action. Default is "rawmouse
leftbutton rbutton rbuttoncode" (holding left mousebutton pressed and
pressing right mousebutton).
Back_Clicks
Like Front_Clicks BACK_CLICKS=<number> specifies how many actions have
to occur to switch something to back. Default is 1.
Back_Remove
The keyword BACK_REMOVE specifies that the inputevent for the back
action shall be removed. Please specify this keyword, if you use the
default action for back_action. It isn't automatically set.
Back_Leftbuttonup
When you use the default action for back_action you will notice, that
a screen or window doesn't go to back until you release the left
mousebutton, if the mouse pointer was over a screen's or window's
titlebar. If you specify this option, a release of the left mouse
button is simulated, if the back_action contains the keyword
leftbutton and not lbuttoncode and if the mouse pointer is over a
titlebar of window or screen.
Input description strings
With input description strings you can specify almost any input
action, for example the action lshift f1, which means that pressing
the left shift and the f1 key together is the action. In this
commodity you can specify the action to open the commodity's window,
as described above.
Input description strings have the following template:
[class] (([-]qual)|syn)* [[-]upstroke] [highmap|ANSIcode]
(* = zero or more occurances of the of the expression in brackets)
class is one of the following strings:
rawkey, rawmouse, event, pointerpos, timer, newprefs,
diskremoved, diskinserted.
If not specified, the class is taken to be "rawkey".
qual is one of the strings:
lshift, rshift, capslock, control, lalt, ralt, lcommand,
rcommand, numericpad, repeat, midbutton, rbutton, leftbutton,
relativemouse
A preceding '-' means that the value of the corresponding
qualifier is to be considered irrelevant.
syn (synonym) is one of the strings: shift, caps, alt
shift means "left or right shift"
caps means "shift or capslock"
alt means "either alt key"
upstroke (literally "upstroke")
if this token is absent, only downstrokes are considered
for rawmouse (mousebuttons) and rawkey events. If it is
present alone, only upstrokes count. If it preceded by
'-' it means that both up and down strokes are included.
highmap one of the strings:
comma, space, backspace, tab, enter, return, esc, del, up,
down, right, left, help, f1, f2, f3, f4, f5, f6, f7, f8, f9,
f10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, (, ), /, *, -, +
lbuttoncode¹, mbuttoncode¹, rbuttoncode¹
ansicode a single character token is interpreted as a character code,
which is looked up in the system default keymap.
¹ these keywords are only recognized by toBack&Front
Examples
To front with left mousebutton double-click, to back with left
mousebutton and right mousebutton. The actions are the default ones
and haven't to be specified, but back_remove should be specified when
using the default action for to back:
toBack&Front back_remove back_leftbuttonup
To front when pressing left alt and f1, no back_action:
toback&Front front_action="lalt f1" front_clicks=1 front_remove
back_action=""
To front when double-clicking with left mouse button, to back when
clicking with the middle mouse button (requires three button mouse!):
toback&Front back_action="rawmouse midbutton mbuttoncode" back_remove
To front when double-clicking with the left mouse button while
pressing left alt key, to back when double-clicking with left mouse
button while pressing left amiga key:
toback&Front front_action="rawmouse lalt leftbutton lbuttoncode"
back_action="rawmouse lcommand leftbutton lbuttoncode"
front_remove back_remove back_clicks=2
A funny example:
To front when inserting a disk in any disk drive, to back when
removing a disk from any drive:
toback&Front front_action=diskinserted front_clicks=1
back_action=diskremoved back_clicks=1
Version history
V1.09 Parsing of options changed. Program got smaller, but doesn't
self detach from shell anymore. Default for back_action
changed. New options (back|front)_leftbuttonup.
V1.08 bug fix: a lock up still happend using left and right
mousebutton
Older versions are described in toBack&Front.c.
Send bug-reports, enhancement-requests, questions, gifts to:
Stefan Sticht
Bibereckerweg 40a
D-8390 Passau 18
FRG
or (better) EMail to:
sticht@edith.deg.sub.org
Fido-Net: Stefan Sticht (2:246/200.4)
Please include the version number in a bug report.