LSDynamic 1.0a
give life to your LiteStep
LSDynamic is a module for LiteStep which moves windows in a fluid way by using scripts based on the timer.
Windows being referred by their classes and titles (or tooltips), so you can also move *Shortcut.
Displacements can be linear or circular, with an acceleration, and the whole based on intervals of time in ms.
Scripts are like a timeline under Premiere.
-=
Syl
=-
Table of contents
History
12/12/2001 - ver 1.0a
- Fixed window class initialization.
- Fixed "ShorcutClass" to "ShortcutClass" in examples.
- Fixed tables in the readme.
11/12/2001 - ver 1.0
started the 03/12/2001.
Installation
Copy LSDynamic.dll in your module directory and load the module:
LoadModule "c:\LiteStep\Modules\LSDynamic.dll"
if c:\LiteStep\Modules\ is your module directory of course...
Then, to run the examples, go to the examples section.
Usage
LSDynamic allow you to define, in your step.rc, movements and macros,
with timed movements inside, that you will call by using bangs command.
You will have to specify the window class and the window caption of the window
that you want to move. To help you, you can use Winspy, a freeware that gives
you these informations.
For shortcuts, the window class is "ShortcutClass" and the window caption is
the tooltip that you defined when you created the shortcut.
Syntax color:
Movement syntax
A movement define how your window will move. You can define a movement into a macro,
but it's easier to understand if you define it outside a macro definition.
When a movement is define, you can use it into many macros.
Here is a movement definition with all the possible options:
Definition
<move-type> :
There are two type of movements, linear and circular. A linear movement is a straight line from
the initial position to the destination. A circular movement make the window follow a circular
path.
The "move-name" is how you will reference
the movement in the macro.
Here are the definition for each type:
hwnd :
Specify the window class of the window you want to move. for example, the
<window-class> of a shortcut is ShortcutClass.
Tf you don't specify a hwnd for the movement,
the window class is the same that you define on a move line in a macro, or in the macro.
If you don't specify a hwnd for the macro,
the window class is the same that you have put in the bang command.
If you don't give a <window-class> ,
the default window class is ShortcutClass.
caption :
Specify the window caption of the window you want to move. for example, the
<window-caption> of a shortcut is his tooltip.
You can specify several caption at the same time like this:
*dyn caption
"caption1"
"caption2"
"caption3"
"..."
This syntax is also available where to have to specify captions.
If you don't specify a caption for the movement,
the window class is the same that you define on a
move line in a macro, or in the macro.
If you don't specify a caption for the macro,
the window class is the same that you have put in the bang command.
You must at least specify a window caption somewhere.
range :
The action is enable when the timer is between
<start-time> and
<end-time> . The range will
be added with the range in the macro on the
move line.
If you don't specify a range for the movement,
the range is the one you specify on the move line in the macro.
pos :
This keyword move the window to a position when the movement begin, where
<x-pos> and
<y-pos> are the co-ordinates.
Negative co-ordinate are relative to the opposite edge of the screen (like shortcut co-ordinates).
If you don't specify a pos ,
the default position is the window position.
dest :
Define the destination of the window.
If you should specify a destination to make the linear movement.
The <relative> flag allow
the position to be relative to the window.
If this flag isn't set, negative co-ordinate are relative to the opposite edge
of the screen (like shortcut co-ordinates).
If the flag is set (it acceptes value like "1", "true", "something"...), and if
there is a sign in the co-ordinates (+ or -), the co-ordinates are relative to
the initial position of the window (if there's no sign, the co-ordinates are
relative to the screen).
acc ,
r-acc ,
c-acc ,
a-acc ,
alpha-acc :
Define the acceleration to reach the destination. The default value is 100.
How does it work ?
acc < 100: o o o o oo ooo
acc = 100: o o o o o o o o o
acc > 100: ooo oo o o o o
The acceleration isn't restrainte between 0 and 200 because
you can make some very interesting effects according to the value of this one.
alpha :
Apply alpha blending to the window, from
<start-alpha> to
<end-alpha> .
These values are between 0 and 255.
center :
Specify the center of the circle. The window will move around the center
c-dest :
Specify the destination of the center of the circle.
r-dest :
Specify the final ray. The initial ray is computed with the
center of
the circle and the window position .
angle :
The window will move around the center
from the window inital position, where the angle is equal to zero, to the final
position on the circular path, obtained with the angle in degree.
Macro syntax
The macro is the way you will use the movements you defined.
Definition
macro :
You can execute the macro with the bang command which is the
"macro-name" .
flags :
The possible <flags> are:
L : the macro will Loop.
O : a command can only be executed One time.
move :
This command moves a window with the script
<move-name>
during the time
<start-time> and
<end-time> .
You can also specify a <window-class>
and <window-caption> . If you don't
want to specify the <window-class> ,
use the keyword caption
exec :
Execute a command during the time
<start-time> and
<end-time> .
pause :
Pause the <macro-name> when the time is between
<start-time> and
<end-time> .
resume :
Resume the paused <macro-name> when the time is between
<start-time> and
<end-time> .
win-stats :
This will show or hide the window during
<start-time> and
<end-time> .
The available <flags> are hide and show.
restore :
Restore the window with the caption <window-caption>
when the macro is finishing.
relay :
not yet implemented.
The macro, if it is stop, will give the relay to
<macro-name> by using
<relay-mode> .
Settings
DynTimerUpdate <delay-in-ms>
The macro will be updated every <delay-in-ms> .
The default value is 10 ms.
DynNoCircularRelativeToWindowCenter
By default, when you make a circular movement, the co-ordinates are the center of the window.
But you can force LSDynamic to take the top-left corner of the window to make the circular
movement.
DynNoHandleStorage
By default, the windows handle are stored in a list to speed up windows detection, but
if you want to move other windows than shortcut, and that windows can be closed, you
should this option.
DynStoreBadHandle
If you only use LSDynamic with shortcuts, you can use this option to speed up again
detection if a have specifie a bad window class or caption.
DynForceLayerRestoration
When you use restore ,
this restore only the position. If you want to remove the window alpha, use this option.
Bangs
!macro-name default
Run the macro.
!macro-name stop
not yet implemented.
!macro-name caption
<window-caption>
!macro-name
<window-class>
<window-caption>
Run the macro with the
<window-class> and
<window-caption>
!DynRunning
Show which macros are currently running.
!DynChangeMoveType
<move-name>
<move-type>
Change the type of the movement.
!DynPauseAll
!DynResumeAll
To pause and resume all macros.
Examples
To run examples, copy the images in your image directory and the rc files
in your LiteStep directory. Then include dyn.rc in your step.rc:
include "c:\litestep\dyn.rc"
You must load mzscript just to run the first bang !init_dyn with:
*mzscript start !init_dyn default
(this line is in the dyn.rc, if it doesn't work, try to put this line
in your default script rc file, or run it with a hotkey).
I try to show you with this example how LSDynamic works, so I just use mzscript
to initialise the example. I don't manage if a macro has been executed, so clic
just once on the big shortcut to initialise the second group, but don't clic on it a second time.
Tips
You should use Winspy to view <window-class>
and <window-caption> .
If you define a movement
in a macro , you can also use it in other macros.
You should pass <window-class>
and <window-caption> threw bang command
instead of define it in the movement or
in a macro .
LSDynamic doesn't mind in which group a shortcut is, so to have the shortcut working, you should
show it with the !ShortcutGroupShow bang and then toggle the stat with
win-stats . By this way, a shortcut can be
in a group and can be hidden while the others are shown, the group are not altered.
<start-time> and
<end-time> can overlap another movement,
you can make many movements at the same time.
Troubleshooting
If the shortcut always swap its stat between normal and mouse_over,
or if you can't get the window caption, use my modified shortcut2.dll.
There is a problem with alpha blending when you use it on a shorcut which isn't ontop.
You can't use alpha with child window (window create with the flag WS_CHILD). The modification
I made on the shortcut module was just to allow you to use LSDynamic with ontop shortcut
(the caption was disable if it was ontop).
Some strange things can happen if you use multiples macros on same windows at the same time...
If your shortcut is hidden when LiteStep is launch, he doesn't exist yet,
you should toggle its stat before using it.
A little slow down should happen when the shortcut tooltip appears.
A bug can happen when you want to execute a macro inside a macro (with the
exec key world). Email me
if this happen with your macros to see what I can do...
Greetings
I was inspired by Lain and mzscript.
Thanks to the LSDev Team for having made the best shell replacement.
Thanks to Nekoi, SeRIAL, NecroBorg, Terro, Kaze, Stafkiel, Krag,
Nox, Fredo, Jule, Vince, and every one who supported me =)
Contact
If you have a problem, want a new feature, want to report a bug, email me.
-=
Syl
=-
|