No subject

Bob Sneidar bobs at twft.com
Wed Sep 28 14:00:21 EDT 2011


The only place they could select the pointer tool is in the IDE. I am almost certain this is not possible in a standalone. Are the users co-developers? 

I tried this out myself and can confirm this. I tried using copy then paste in a handler I called in 0 seconds, but the copy clearly did not work because I got a graphic I had copied earlier. 

Here is what I did instead. Put this in your card script:
on deleteKey
   if word 1 of the selectedObject contains "field" then
      answer "You can't do that!" as sheet
      exit to top
   end if
   pass deleteKey
end deleteKey

on backspaceKey
   if word 1 of the selectedObject contains "field" then
      answer "You can't do that!" as sheet
      exit to top
   end if
   pass backspaceKey
end backspaceKey

Works like a charm. 

Bob


On Sep 28, 2011, at 10:38 AM, Art DiVito wrote:

> I need to prevent users from deleting a control by selecting it with the pointer tool and hitting the delete key.
> According to the LiveCode dictionary (under "deletefield"), an "undo" will work for fields. However, this appears to be true for buttons, but NOT for fields. Thus,
> On deletebutton
> Answer "Can't do that!"
> send "undo" to this card in 5 milliseconds
> end deletebutton
> works fine. However, 
> On deletefield
> 
> Answer "Can't do that!"
> 
> send "undo" to this card in 5 milliseconds
> 
> end deletefield
> does NOT work.
> I don't know whether it will work for images (I need to prevent them from being deleted too).
> What can I do?
> Thanks.
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list