Icons & Borders

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Icons & Borders

Post by francof » Sun Apr 27, 2014 11:12 am

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Icons & Borders

Post by jmburnod » Sun Apr 27, 2014 12:08 pm

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
https://alternatic.ch

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: Icons & Borders

Post by francof » Sun Apr 27, 2014 2:42 pm

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.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Icons & Borders

Post by jmburnod » Sun Apr 27, 2014 3:34 pm

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
Last edited by jmburnod on Sun Apr 27, 2014 5:08 pm, edited 1 time in total.
https://alternatic.ch

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: Icons & Borders

Post by francof » Sun Apr 27, 2014 4:21 pm

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

Post Reply