Alternative to scrolling field

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
carel
Posts: 58
Joined: Mon Jul 29, 2013 2:49 pm

Alternative to scrolling field

Post by carel » Fri Jan 24, 2014 10:04 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9663
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Alternative to scrolling field

Post by dunbarx » Fri Jan 24, 2014 10:17 pm

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

LC4iOS
Posts: 88
Joined: Tue Dec 03, 2013 8:15 pm

Re: Alternative to scrolling field

Post by LC4iOS » Fri Jan 24, 2014 10:34 pm

Use mouse down and drag.
Otherwise semi transparent buttons on the work pallette itself.
Hidden after a few seconds of non use, etc.
Thanks to RunRev.
Thanks to LiveCode forum members.

LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member

carel
Posts: 58
Joined: Mon Jul 29, 2013 2:49 pm

Re: Alternative to scrolling field

Post by carel » Sat Jan 25, 2014 12:42 pm

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
Attachments
Screenshot1.jpg

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Alternative to scrolling field

Post by Klaus » Sat Jan 25, 2014 4:44 pm

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 :D


Best

Klaus

LC4iOS
Posts: 88
Joined: Tue Dec 03, 2013 8:15 pm

Re: Alternative to scrolling field

Post by LC4iOS » Sat Jan 25, 2014 10:01 pm

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. ;)
Thanks to RunRev.
Thanks to LiveCode forum members.

LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Alternative to scrolling field

Post by jacque » Sat Jan 25, 2014 10:59 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

carel
Posts: 58
Joined: Mon Jul 29, 2013 2:49 pm

Re: Alternative to scrolling field

Post by carel » Mon Jan 27, 2014 9:15 am

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9663
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Alternative to scrolling field

Post by dunbarx » Mon Jan 27, 2014 8:48 pm

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Alternative to scrolling field

Post by jacque » Tue Jan 28, 2014 4:51 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

carel
Posts: 58
Joined: Mon Jul 29, 2013 2:49 pm

Re: Alternative to scrolling field

Post by carel » Wed Jan 29, 2014 6:53 pm

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
Attachments
test.livecode.rename.zip
(9.08 KiB) Downloaded 208 times

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Alternative to scrolling field

Post by Simon » Wed Jan 29, 2014 9:52 pm

Hi Carel,
First quick reply...
add lock screen and unlock screen to your up/down btns.
way better looking.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

carel
Posts: 58
Joined: Mon Jul 29, 2013 2:49 pm

Re: Alternative to scrolling field

Post by carel » Thu Jan 30, 2014 6:09 pm

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

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Alternative to scrolling field

Post by Klaus » Thu Jan 30, 2014 6:47 pm

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! :D
...
set the scroll of fld x to N
## where N is an integer, of course 8)
...

Best

Klaus

carel
Posts: 58
Joined: Mon Jul 29, 2013 2:49 pm

Re: Alternative to scrolling field

Post by carel » Fri Jan 31, 2014 10:05 pm

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”