Page 1 of 1
Alternative to scrolling field
Posted: Fri Jan 24, 2014 10:04 pm
by carel
At the moment I'm putting items into a scrolling field for a user to select an item, but I want it to look a bit better, with nice graphical up and down arrows etc.
Should I use buttons, text fields? (for the items in the scrolling field) - I'm sure both of these I'll manage to do but I'm just wondering if there is a better way?
Any examples would help as well.
Thanks,
Carel
Re: Alternative to scrolling field
Posted: Fri Jan 24, 2014 10:17 pm
by dunbarx
Hi.
If you want graphic gadgets that scroll with the "field", why not use a datagrid. These take a little practice, but are very powerful.
http://lessons.runrev.com/m/datagrid
Craig Newman
Re: Alternative to scrolling field
Posted: Fri Jan 24, 2014 10:34 pm
by LC4iOS
Use mouse down and drag.
Otherwise semi transparent buttons on the work pallette itself.
Hidden after a few seconds of non use, etc.
Re: Alternative to scrolling field
Posted: Sat Jan 25, 2014 12:42 pm
by carel
Thanks for the replies.
I took a screenshot of what I want to achieve - the buttons on the left as opposed to the scrolling text field on the right.
The blue button is what the "user selected" - although I've just changed the color for the example.
Using the text field is easy - I just put myText into field "textfield" whereas with the buttons I'm going to have to create all of them with code and "remove" the top button as soon as the user starts scrolling downwards past the last visible button (if there is more buttons down the list)
If I can use any other control to achieve this easier I would do that, but I don't mind doing what I explained here if that is my only option.
It is a Windows app btw.
I just had a thought - I could have a finite amount of buttons - say 10, and just change the contents as the user scrolls, and just hide buttons if there is less than 10 items in the list.
Thanks,
Carel
Re: Alternative to scrolling field
Posted: Sat Jan 25, 2014 4:44 pm
by Klaus
HUi Carel,
still not sure what you are after, but I would also recommend to use a datagrid
of type FORM with only ONE button in its template.
This way you do need need to create all the neccessary buttons yourself
Best
Klaus
Re: Alternative to scrolling field
Posted: Sat Jan 25, 2014 10:01 pm
by LC4iOS
Yes, Dunbar and Klaus are correct.
Using a datagrid is definitely the go.
Datagrids are NOT intuitive to use.
Pretty much in any scripting language.
You must read thru and follow the data grid lessons.
The hyperlink Dunbar posted above is a general reference to datagrid lessons.
You will find if you follow these lessons you'll be able to accomplish tasks much faster than trying to figure it out yourself.
I would suggest starting here:
26382-how-do-i-work-with-checkboxes-in-a-data-grid
http://lessons.runrev.com/s/lessons/m/d ... -data-grid
and perhaps change the checkboxes to a button.
Then here:
http://forums.runrev.com/viewtopic.php?f=8&t=8532
http://ftp.runrev.com/forums/viewtopic. ... 77&p=61376
Be sure to post your queries here if you get stuck and before you get frustrated.

Re: Alternative to scrolling field
Posted: Sat Jan 25, 2014 10:59 pm
by jacque
I think you can do it pretty simply without the overhead of a datagrid. Create and align the buttons. Group them. Then set the scroll of the group in your up and down arrow buttons.
If the number of buttons changes, you can add or remove them directly in the existing group, you don't need to re-create the entire thing each time.
Re: Alternative to scrolling field
Posted: Mon Jan 27, 2014 9:15 am
by carel
I think I'll just do it with the text field, and the way I imagine it in my head.
Can I upload 'n sample stack somewhere to get comments from you guys?
Thanks,
Carel
Re: Alternative to scrolling field
Posted: Mon Jan 27, 2014 8:48 pm
by dunbarx
Jacque may be right. I reread the original post, and maybe I was off base with the idea that objects attached to each visible line tracked the scrolling list. Do upload the test stack. This might be easy...
Craig
Re: Alternative to scrolling field
Posted: Tue Jan 28, 2014 4:51 pm
by jacque
Image sources in fields will scroll with the field, but in this case I think it would be more work than just scrolling a group.
Re: Alternative to scrolling field
Posted: Wed Jan 29, 2014 6:53 pm
by carel
OK, here is the test stack.
BTW it is not a compressed file, just remove the ".rename.zip"
The whole exercise is not for functionality - the standard scroll field on the right works perfectly. The whole idea is to make it look better for example, but nice icons on the up and down buttons.
Any feedback, or an easier way to achieve the same would be appreciated.
Thanks,
Carel
Re: Alternative to scrolling field
Posted: Wed Jan 29, 2014 9:52 pm
by Simon
Hi Carel,
First quick reply...
add lock screen and unlock screen to your up/down btns.
way better looking.
Simon
Re: Alternative to scrolling field
Posted: Thu Jan 30, 2014 6:09 pm
by carel
Thanks Simon,
Never knew about it - looked it up in the dictionary.
I had a thought today - could one scroll a field with external (custom) buttons?
Carel
Re: Alternative to scrolling field
Posted: Thu Jan 30, 2014 6:47 pm
by Klaus
Hi Carel,
carel wrote:I had a thought today - could one scroll a field with external (custom) buttons?
sure, you can set EVERY property of objects in Livecode by script!
...
set the scroll of fld x to N
## where N is an integer, of course
...
Best
Klaus
Re: Alternative to scrolling field
Posted: Fri Jan 31, 2014 10:05 pm
by carel
Thanks Klaus,
Then this whole exercise was (not entirely) pointless. I'll explore some more...
At least I got some more experience and learned new things while doing this which is always a good thing.
Thanks,
Carel