Problems with "undo" (button) for user actions.

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
sinep
Posts: 12
Joined: Sat Jun 13, 2015 5:19 am

Problems with "undo" (button) for user actions.

Post by sinep » Tue Jun 30, 2015 9:45 am

I've been trying to make an "undo" button for some time now and only have it partially working.

I have it so that a user can clone a button (or multiple buttons) and click the "undo" button if they want to delete the last cloned button. It does delete each button in sequence of when it was created except that it CONTINUES to delete buttons that should not be deleted such as the "main page" button that returns users to the main page.

How do I make it so that it only deletes user-created buttons?

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Problems with "undo" (button) for user actions.

Post by Klaus » Tue Jun 30, 2015 1:05 pm

Hi sinep,

we need to take a look at your "delete" script! 8)


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Problems with "undo" (button) for user actions.

Post by dunbarx » Tue Jun 30, 2015 2:58 pm

Hi.

If your button does something like:

delete the last button

then how would it know when to stop? The 'last" button will be the one with the highest layer property. Period.

If you have a core set of controls, the trick is to somehow identify the cloned buttons apart from that core. You do this by setting a property unique to the cloned buttons, that is not shared by the core controls. Do you see? Can you handle this on your own? Write back if you need a clue.

Craig Newman

sinep
Posts: 12
Joined: Sat Jun 13, 2015 5:19 am

Re: Problems with "undo" (button) for user actions.

Post by sinep » Wed Jul 01, 2015 3:42 am

Thank you!

I think I'm headed in the right direction now.

Post Reply