Hello Folks,
Just getting the feet wet with LiveCode, and it's becoming a great learning experience!
As part of the learning process, I'm trying to reconstruct a HandBase app. It's a basic shopping list app that allows the user to add items which can be viewed in a list with checkboxes. Once the item is checked, it is removed from the list and will appear on a “to buy” list. Once unchecked on the to buy list, it will appear once again on the item list. I'm thinking I must be missing something in that I'm not seeing any obvious way of doing this. The Data Grid looks to be an option for the checkbox functionality , but I was thinking that there was probably a simpler way of working this through. I've read some posts about an enhanced scroll list and also a post or two on the mailing list about using in image id to replace a character, but again, I'm thinking there is probably an obvious solution I'm missing.
Any thoughts and direction would be appreciated!
best,
Larry
CheckBox functionality in List
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 6
- Joined: Mon Dec 05, 2011 5:33 pm
Re: CheckBox functionality in List
Hi Larry,
Why checkboxes? You can make 2 list fields with the following script:
Kind regards,
Mark
Why checkboxes? You can make 2 list fields with the following script:
Code: Select all
//field 1
on mouseUp
if the clickText is not empty then
if fld 2 is not empty then put cr into myItem
put the selectedText after myItem
delete the selectedLine
put myItem after fld 2
filter me without empty
if last char of me is cr then
delete last char of me
end if
end if
end mouseUp
// field 2
on mouseUp
if the clickText is not empty then
if fld 1 is not empty then put cr into myItem
put the selectedText after myItem
delete the selectedLine
put myItem after fld 1
filter me without empty
if last char of me is cr then
delete last char of me
end if
end if
end mouseUp
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 6
- Joined: Mon Dec 05, 2011 5:33 pm
Re: CheckBox functionality in List
Hi Mark,
Many thanks for the response. I appreciate you taking the time for the code as it was very informative.
I'm not sure why I was fixated on the checkboxes themselves, probably because that's what was used in the original app, but your example definitely sent me down the right path. I'm finding that one of my hurdles to overcome with LiveCode is that I'm trying to over-complicate things when there are simpler and more elegant solutions available.
Thanks again for the help. Very instructive!
best to you,
Larry
Many thanks for the response. I appreciate you taking the time for the code as it was very informative.
I'm not sure why I was fixated on the checkboxes themselves, probably because that's what was used in the original app, but your example definitely sent me down the right path. I'm finding that one of my hurdles to overcome with LiveCode is that I'm trying to over-complicate things when there are simpler and more elegant solutions available.
Thanks again for the help. Very instructive!
best to you,
Larry