Scrolling variable set of checkboxes
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Scrolling variable set of checkboxes
Hi all.
As you can see, I am new to this board and new to LiveCode too. I've already had a great deal of help from existing posts, so thanks everyone!
I am investigating one part of an IOS (iPad) app having a scroller which contains a list of items the user can tick off. The list will contain a varying set of values, rather like a shopping list, so the set of options needs to be defined via script. The sort of look I was after is the iOS Reminders app. I'd also like to know (e.g. onCloseCode) which items were ticked off.
Could anyone point me to a way of doing this, either in LiveCode directly, or via an add-on?
Cheers,
Adrian
As you can see, I am new to this board and new to LiveCode too. I've already had a great deal of help from existing posts, so thanks everyone!
I am investigating one part of an IOS (iPad) app having a scroller which contains a list of items the user can tick off. The list will contain a varying set of values, rather like a shopping list, so the set of options needs to be defined via script. The sort of look I was after is the iOS Reminders app. I'd also like to know (e.g. onCloseCode) which items were ticked off.
Could anyone point me to a way of doing this, either in LiveCode directly, or via an add-on?
Cheers,
Adrian
Re: Scrolling variable set of checkboxes
In theory the Datagrid in it's "form" style can do that. However, it's most often more efficient to code your own:
To check the hilite state of the checkmark buttons you have to loop trough them:
After you got this working, you might investigate more complex stuff like adding/removing the checkmark buttons on the fly, or what to do when the user adds too many buttons.
See also this lessons on group scrolling: http://lessons.runrev.com/s/lessons/m/4 ... the-window
There's also a basic intro to groups in the scripting conferences: http://www.runrev.com/developers/lesson ... nferences/
And maybe later on, this lesson on dynamical object positioning: http://lessons.runrev.com/s/lessons/m/4 ... is-resized
- Make a bunch of checkmarks, arrange them on top of each other
- Group them (button in the Toolbar under the menus that says "group")
- Name the group something responsible, and set the vertical scrollbar of it to true (basic inspector tab, "Scrollbar:" "V")
- Set the group to the desired rectangle
- Important: go to the Size & Position part of the Inspector and check "Lock Size and Position" (LockLoc = true)
To check the hilite state of the checkmark buttons you have to loop trough them:
Code: Select all
on mouseUp
repeat with x = the number of buttons in group "myGroup" down to 1
put the short name of button x of group "myGroup" && the hilite of button x of group "myGroup" & return after theList
end repeat
put theList
end mouseUp
See also this lessons on group scrolling: http://lessons.runrev.com/s/lessons/m/4 ... the-window
There's also a basic intro to groups in the scripting conferences: http://www.runrev.com/developers/lesson ... nferences/
And maybe later on, this lesson on dynamical object positioning: http://lessons.runrev.com/s/lessons/m/4 ... is-resized
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Scrolling variable set of checkboxes
Thanks Bjoernke for the detailed reply. I'm sure I've had a play with checkboxes and they look pretty rough on iOS, but I'll have another go. Also, I presume I would need to use an iOS scroller holding the grouped checkboxes to get proper srolling, rather than a scroll bar on iOS?
I have scrollers elsewhere in my projct and I think I have got the basic hang of them. The thing I wasn't sure how to do was in script to be able to set up a bunch of checkboxes within a scroller and have it all look like native iOS. The items in the "tick list" will come from a sql database, so need to be created on the fly, as the card is opened.
Cheers,
Adrian.
I have scrollers elsewhere in my projct and I think I have got the basic hang of them. The thing I wasn't sure how to do was in script to be able to set up a bunch of checkboxes within a scroller and have it all look like native iOS. The items in the "tick list" will come from a sql database, so need to be created on the fly, as the card is opened.
Cheers,
Adrian.
Re: Scrolling variable set of checkboxes
for native looks there's several commercial add-ons, mobgui, tmControls, economy-x-talk ios gui elements, etc.
you could fake it yourself by setting the icon, hiliteIcon, armedIcon, etc. look at the icons and border property palette
you could fake it yourself by setting the icon, hiliteIcon, armedIcon, etc. look at the icons and border property palette

Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Scrolling variable set of checkboxes
OK, I'll do some more experimenting. I'm using MobGUI, but that doesn't inclide checkboxes.
Thanks again for our help.
Thanks again for our help.
Re: Scrolling variable set of checkboxes
That's because iOS doesn't do checkmarks. It does switch buttons:
http://mobgui.com/doc.php?docId=7
http://mobgui.com/doc.php?docId=7
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Scrolling variable set of checkboxes
Thanks. Yes, I realised that, but wanted to emulate the Reminders app, ticking things off the list. I've pretty much achieved that using a MobGUI scroller and using script to add in checkboxes, using custom icons - thanks for the pointer.
In case anyone else comes across this post and wants more detail, I used a hidden button to contain the relevant script and used the behaviours property of th checkboxes to get them to inherit the script. The script essentially adds the selected checkbox name to a hidden field and removes it (using the nifty "filter") when de-selected. It all works really quite simply. Hurrah!
In case anyone else comes across this post and wants more detail, I used a hidden button to contain the relevant script and used the behaviours property of th checkboxes to get them to inherit the script. The script essentially adds the selected checkbox name to a hidden field and removes it (using the nifty "filter") when de-selected. It all works really quite simply. Hurrah!