Page 1 of 1

Field drop shadow

Posted: Wed Jan 18, 2012 9:46 am
by kevin11
Hi,

I'm having an odd problem with a field's drop shadow. In the code I am just doing :

set the shadow of field whatever to true

This seems to give an offset, flat grey shadow that lies within the field boundaries.
The property inspector shows shadow is off. Using the property inspector to switch on a drop shadow then gives a drop shadow, black, blended, outside the field boundaries where it should be. There is nothing I can do in the property inspector to turn off this "inner" drop shadow.

In code, using "set the shadow of field whatever to false" does of course remove the inner effect.

So the question is, what is the code line generating on that field, if not a drop shadow ?

Kevin

Re: Field drop shadow

Posted: Wed Jan 18, 2012 10:03 am
by kevin11
and the answer is....

use "set the dropshadow"
not "set the shadow"

dictionary was a bit confusing there !

Re: Field drop shadow

Posted: Wed Jan 18, 2012 1:46 pm
by Klaus
Hi Kevin,
kevin11 wrote:...
In code, using "set the shadow of field whatever to false" does of course remove the inner effect.
So the question is, what is the code line generating on that field, if not a drop shadow?
that line will create a custom property named "shadow" for your field! :)


Best

Klaus

Re: Field drop shadow

Posted: Wed Jan 18, 2012 5:21 pm
by jmburnod
Hi Kewin,

The dropshadow is an array property
You can set dropshadow of an object or not like that

set dropShadow["size"] of fld "myField" to 8 -- or an integer between 0 and 255
set dropShadow["size"] of fld "myField" to 0 -- dropshadow is not visible
( i write under the Klaus's control) :D


Best regards

Jean-Marc

Re: Field drop shadow

Posted: Wed Jan 18, 2012 5:27 pm
by Klaus
You are a good boy, Jean-Marc! :D

Re: Field drop shadow

Posted: Mon Jan 23, 2012 3:06 am
by Randy Hengst
Hi Kevin,

This may be overkill for you, but I've coded drop shadows before.... here's an example that I've put in a handler associated with a mouseDown in a graphic. It would also work for a field.

set the dropShadow["color"] of target to "0,0,0"
set the dropShadow["blendMode"] of target to "normal"
set the dropShadow["opacity"] of target to "200"
set the dropShadow["filter"] of target to "gaussian" -- highest "box2pass" is medium quality
set the dropShadow["spread"] of target to "0"
set the dropShadow["size"] of target to "6"
set the dropShadow["distance"] of target to "6"
set the dropShadow["angle"] of target to "45"

You can then clear all of the dropShadow settings by

set the dropShadow of target to "false"

I've use the set to false in the mouseUp handler of the same graphics.

be well,
randy