"the effective visibility"

Eric Chatonet eric.chatonet at sosmartsoftware.com
Sat Aug 9 04:14:24 EDT 2008


Bonjour Chipp,

Le 8 août 08 à 22:49, Chipp Walters a écrit :

> If anyone already has an "isEffectiveVisible" function, let me know.

IsVisible returns any control effective visibility:

function IsVisible pObj
   if not the visible of pObj then return false
   repeat until "Card" is word 1 of the long owner of pObj
     put the long owner of pObj into pObj
     if not the visible of pObj then return false
   end repeat
   return true
end IsVisible

ObjOwners lists the owners of an object:

function ObjOwners pObj
   -- return the owners of any object until the card (not included)
   local tOwner,tOwners
   -----
   put pObj into tOwner
   repeat until "Card" is word 1 of the long owner of tOwner
     put the long owner of tOwner & cr after tOwners
     put the long owner of tOwner into tOwner
   end repeat
   if tOwners = empty then return pObj
   return pObj & cr & line 1 to -1 of tOwners
end ObjOwners

OutOfCardWindow returns is an object is out of the card window:

function OutOfCardWindow pObj,pCard
   if the left of pObj > the right of pCard then return true
   if the right of pObj < 0 then return true
   if the bottom of pObj < 0 then return true
   if the top of pObj > the bottom of pCard then return true
   return false
end OutOfCardWindow

IsHiddenByAnotherControl checks if a control can be hidden by another  
one:

function IsHiddenByAnotherControl pObj,pCard
   repeat with i = (the layer of pObj + 1) to the number of controls  
of pCard
     if the topLeft of pObj is within the rect of control i of pCard  
and the botright of pObj is within the rect of control i of pCard and  
the opaque of control i of pCard then return true
   end repeat
   return false
end IsHiddenByAnotherControl

Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list