On May 23, 2016, at 11:03 AM, Kay C Lan wrote:

> On Mon, May 23, 2016 at 9:13 PM, Paul Dupuis <p...@researchware.com> wrote:
> 
>> In some dictionary entries, like for rawKeyDown, it talks about the need
>> to pass the message (unless you want to trap all key presses).
> 
> The Dictionary entry for 'pass' also mentions the need to pass
> 'setprop' if you have custom properties that are set via setprop
> handlers.

Although, there is the well-known technique of deliberately not passing a 
get/setprop message, turning the property into a "virtual property" -- so 
actions are taken but no custom property of any object is actually set. For 
instance:

getprop writable
   ----  a virtual field property  ----
   -- writable = true if locktext = false, traversalon = true, autohilite = true
   --     ie, user can enter text
   
   if not (the target begins with "field") then return empty
   put the locktext of the target into L
   put the traversalon of the target into T
   put the autohilite of the target into A
   if T and A and not L then return true
   return false
end writable

setprop writable tf
   ----  a virtual field property  ----
   -- writable = true: set locktext = false, traversalon = true, autohilite = 
true
   --     ie, user can enter text
   -- writable = false: set locktext = true, traversalon = false, autohilite = 
false
   
   if not (the target begins with "field") then exit writable
   set the locktext of the target to not tf
   set the traversalon of the target to tf
   set the autohilite of the target to tf
end writable

-- Peter

Peter M. Brigham
pmb...@gmail.com


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to