Page 1 of 1

Icons & Borders

Posted: Sun Apr 27, 2014 11:12 am
by francof
Ciao to all,
for an image loaded as an object, there is the property "Icons & Borders" as, for example, an object button (Hover Icon, etc)?
I would like to change the image when the mouse is over it.
at the time I tried to add a drop shadow so:

Code: Select all

on mouseEnter -- visualizza l'ombra finchè il mouse è sopra l'oggetto
   set the dropShadow of image "PeperoneVerde" to tDropshadowPropertiesArray
   set the dropShadow ["color"] of me to "0,0,0"
   set the dropShadow ["opacity"] of me to "255"
end mouseEnter

on mouseLeave  -- se il testo non è visibile azzera l'ombra quando il mouse 
                        -- esce dall'oggetto
   if visible of field "fieldVerde" = false then      
     set the dropShadow of image "PeperoneVerde" to tDropshadowPropertiesArray
     set the dropShadowdropShadow [opacity] of me to "0"
   end if
end mouseLeave
thanks for your attention.
franco

Re: Icons & Borders

Posted: Sun Apr 27, 2014 12:08 pm
by jmburnod
Ciao Franco,

If your object is a btn you can set the hoverIcon of it to the short id of an image.
but you can also use graphic effect to set the appearance of all controls
Something like that:

Code: Select all

on mouseEnter -- visualizza l'ombra finchè il mouse è sopra l'oggetto
   --   set the dropShadow of image "PeperoneVerde" to tDropshadowPropertiesArray -- what is in tDropshadowPropertiesArray ?
   set the dropShadow ["size"] of me to 3
   set the dropShadow ["distance"] of me to 3
   set the dropShadow ["color"] of me to "0,0,0"
   set the dropShadow ["opacity"] of me to 100
end mouseEnter

on mouseLeave  -- se il testo non è visibile azzera l'ombra quando il mouse 
                           -- esce dall'oggetto
   if visible of field "fieldVerde" = false then      
      set the dropShadow ["size"] of me to 0
      set the dropShadow ["distance"] of me to 0
      set the dropShadow ["color"] of me to "255,255,255"
      set the dropShadow ["opacity"] of me to 0
         --  set the dropShadow of image "PeperoneVerde" to tDropshadowPropertiesArray
   end if
end mouseLeave
Best regards
Jean-Marc

Re: Icons & Borders

Posted: Sun Apr 27, 2014 2:42 pm
by francof
Jean-Marc, thanks for your replay.
jmburnod wrote: .......but you can also use graphic effect to set the appearance of all controls.....
yes you are correct, I was only looking for a more quickly way to set it.
in the case of a button it is done automatically, without lines of code (you imagine the case of tens of controls) ....you should use an array of controls, I think ....

straight from the Dictionary:

"dropShadow

Type: property

Syntax:
set the dropShadow of object to propertiesArray
set the dropShadow[propertyName] of object to propertyValue.....

....
Examples:
set the dropShadow of button "Ok" to tDropshadowPropertiesArray
set the dropShadow["color"] of me to "255,0,0"
...."

anyway, I removed the line and it works the same. I don't know why it was indicated that statement. :oops:
I will test your code :wink:
ciao
franco

p.s.:
due to my English I hope I explained myself.

Re: Icons & Borders

Posted: Sun Apr 27, 2014 3:34 pm
by jmburnod
Ciao Franco,

Code: Select all

set the dropShadow of button "Ok" to tDropshadowPropertiesArray
tDropshadowPropertiesArray is an array of all DropshadowProperties of a control
in your exemple tDropshadowPropertiesArray is empty
try

Code: Select all

set the dropShadow of btn 2 to  the dropShadow of btn 1
or

Code: Select all

put  the dropShadow of btn 1 into tDropshadowPropertiesArray
set the dropShadow of btn 2 to tDropshadowPropertiesArray
Best regards
Jean-Marc

Re: Icons & Borders

Posted: Sun Apr 27, 2014 4:21 pm
by francof
ciao Jean-Marc,
yes I imagined tDropshadowPropertiesArray was an array of all the properties of an object. and I understood it should be declared.
I will try your lines.

bye
franco