check marks in a list
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
check marks in a list
Hi, I have a list field where you can select items and then do things (on a separate card). I am looking for ideas on how I might be able to put a "check mark" beside an item in the list, like this:
item 1 ✓
item 2 ✓
item 3
item 4
item 5 ✓
Any suggestions?
Thanks
-- Mark
PS application is destined for iOS so I guess if I use a font that might be an issue?
item 1 ✓
item 2 ✓
item 3
item 4
item 5 ✓
Any suggestions?
Thanks
-- Mark
PS application is destined for iOS so I guess if I use a font that might be an issue?
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
Re: check marks in a list
Hi Mark,
For this, I use a field with small icons. I set the imageSource of a character to the id of an image and if the user presses on it, I change the id. You might want to check the clickText.
Alternatively, you could use the datagrid.
Kind regards,
Mark
For this, I use a field with small icons. I set the imageSource of a character to the id of an image and if the user presses on it, I change the id. You might want to check the clickText.
Alternatively, you could use the datagrid.
Kind regards,
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
Re: check marks in a list
Couldn't you just append the checkmark itself (ASCII 195)?
Craig Newman
Craig Newman
Re: check marks in a list
I actually do that a lot in my own stuff, it's handy, but really that's a square root symbol so in production work I'd use an image.dunbarx wrote:Couldn't you just append the checkmark itself (ASCII 195)?
Craig Newman
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: check marks in a list
Thanks Mark, Craig and Jacque. For the quick demo I was pulling together I was actually concerned about using the imagesource idea having never tried it before so I went the route of just overlaying some checkbox buttons on the list (I was surprised that worked. Really surprised, but it did and was simple to script the status of each check). Now that I have some time to explore I'll look further into imagesource and clicktext.jacque wrote:I actually do that a lot in my own stuff, it's handy, but really that's a square root symbol so in production work I'd use an image.dunbarx wrote:Couldn't you just append the checkmark itself (ASCII 195)?
Craig Newman
I have a related question. I also wanted to "sum" the number of items checked, for example in my original post the sum would be 3. I put together the following loop that works fine but wondered if there is wasn't an easier (single statement) way to do the same thing...
Code: Select all
put 0 into s
repeat with x = 1 to 6
put "check" into temp
put x after temp
if the hilite of btn temp is true then
add 1 to s
end if
end repeat
Code: Select all
put sum(btn "check1", btn "check2") into s -- assuming TRUE = 1, FALSE = 0
Thanks
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
Re: check marks in a list
Mark,
Since you're using checkboxes, you need to use a repeat loop. If you were using radiobuttons, then you might have been able to use the selectedButton or hilitedButton. The selectedButton does work with checkboxes, but it always returns only one object reference.
Kind regards,
Mark
Since you're using checkboxes, you need to use a repeat loop. If you were using radiobuttons, then you might have been able to use the selectedButton or hilitedButton. The selectedButton does work with checkboxes, but it always returns only one object reference.
Kind regards,
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