Page 1 of 1
set the tool of a stack
Posted: Thu Apr 30, 2009 6:00 pm
by jmburnod
Hi All,
I want set the tool of a main stack by a click to a btn of a substack and keep the browse tool for the substack
This script work well but you have maeby others ways more elegants
on mousemove --•• in the stack script of the main stack
global gLaCurTool
put "TestJLS 1.03" into LeMainStack
put "UnePalette" into LeSubStack
put the mousestack into LeCurStack
put the tool of this stack into bufTool
if LeCurStack = LeMainStack and bufTool <> gLaCurTool then
set the tool of this stack to gLaCurTool
end if
if LeCurStack = LeSubStack and bufTool <> "browse" then
set the tool of this stack to "browse"
end if
end mousemove
Thank for your help
Posted: Thu Apr 30, 2009 6:37 pm
by Klaus
Bon soir jmburnod,
I'm not sure if I understand what you are looking for but maybe this helps:
If a stack is opened as a "palette" (looks like your substack "UnePalette"
IS in fact a palette window, right?) then the "tool" of this stack will ALWAYS
be the browse tool!
(As you can see with the REV tools palette!)
So in this palette stack your button to change the "tool" could use this simple script:
Code: Select all
on mouseup
choose pointer tool
end mouseup
And the rest will happen automatically

(IF I understand you correctly!)
Anyway, that's the way you should implement a "tools" palette at all.
Au revoir d'allemagne
Klaus
set the tool of a stack
Posted: Thu Apr 30, 2009 8:34 pm
by jmburnod
Guten Abend Klaus,
Und danke für deine hilfe.
Yes, you have understand perfectly my need.
I tested "choose pointer tool " but the tool of the substack change also to pointer (with revolution 2.9)
It work for you ?
Mit freudlischen grüssen von Genf
Jean-Marc
Posted: Fri May 01, 2009 1:06 pm
by Klaus
Ah, ein Schwyzer
Bonjour Jean-Marc,
you need to open your substack as palette like:
...
go stack "UnePalette" as palette
...
to make it work.
Try this and come back if it does not work.
Remember to keep the GUI (Graphical User Interface) standards where a "tools" stack should be a palette window (like the REV tools palette).
Au revoir
Klaus
set the tool of a stack
Posted: Sat May 02, 2009 2:12 pm
by jmburnod
Vielen dank noch einmal Klaus,
I try with "as palette" and i can set the tool for browse,image,select
but
the others change only after a selection of the tool on the revtool
Is there an "initPaintTool" or something like that ?
Jean-Marc
Posted: Sun May 03, 2009 11:52 am
by Klaus
Hi Jean-Marc,
sorry, don't understand what you are trying to do?
set the tool of a stack
Posted: Sun May 03, 2009 5:45 pm
by jmburnod
Hi Klaus
Sorry for my poor english
I trying to do a toolpalette for paint an image on the main stack
The tool palette is open as palette and there is a fld with a list of tools
One clic on a line change the tool of the main stack
It work for some tools immediately (browse,image and pointer) but not for
brush, bucket, eraser and spray :
For exemple, the tool of the stack return "brush tool" but the cursor dont change and the brush dont work.
Jean-Marc
Posted: Sun May 03, 2009 6:31 pm
by bn
Jean-Marc,
try
Code: Select all
on mouseUp
choose brush tool
set the brush to 8
--set the brushcolor to black
end mouseUp
or
Code: Select all
on mouseUp
choose eraser
set the eraser to 12
end mouseUp
for the cursor to change you have to set a brush etc on top of choosing the brush tool
regards
Bernd
Posted: Sun May 03, 2009 8:28 pm
by Klaus
YO!

Posted: Sun May 03, 2009 9:00 pm
by bn
THANK YO!

set the tool of a stack
Posted: Mon May 04, 2009 7:27 am
by jmburnod
YES,
bucket, brush, eraser and spray work fine now
many thanks
Jean-Marc