[Code Help - Beginner] Having an issue

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
shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

[Code Help - Beginner] Having an issue

Post by shawnblc » Mon Sep 02, 2013 10:22 pm

Let's see if I can explain this right.

I have a card and I'm trying to create a scrolling field that takes up nearly the whole card. In this scrolling field I'd like to add a few images, some text, input field, etc. Can't figure it out.

Any help is appreciated.

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

Re: [Code Help - Beginner] Having an issue

Post by Simon » Mon Sep 02, 2013 10:26 pm

Hi shawnblc,
A field is used for text what you want is a scrolling group.

So go ahead and put you text fileds and images onto a card and the "group" them all. Select the vertical scrollbar to allow you to scroll it manually.

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

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: [Code Help - Beginner] Having an issue

Post by shawnblc » Mon Sep 02, 2013 10:30 pm

Simon wrote:Hi shawnblc,
A field is used for text what you want is a scrolling group.

So go ahead and put you text fileds and images onto a card and the "group" them all. Select the vertical scrollbar to allow you to scroll it manually.

Simon
Simon that works, but what if I have several lines (pages of information) for this one card. You can only stretch the card so far according to your screen size.

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

Re: [Code Help - Beginner] Having an issue

Post by Simon » Mon Sep 02, 2013 10:49 pm

Hi shawnblc,
Is your question about how to make that group the first time when it could be really really long?

Let LC do it:
Lets say you have 10 fields and 10 images alternating and say 500 vertical px each (right off the screen)
put your 10 fields in a small size with small image (holder) both full width on your card. Then:

Code: Select all

on mouseUp
put myVeryLongText into fld 1-- myVeryLongText  is a variable that contains the first fields text
set the height of fld 1 to the formattedHeight of fld 1
set the top of fld 1 to the top of grp 1
--now you should have the field filled.  Now the first image
set the filename of img 1 to firstImage-- firstImage contains the path to the image (this is for external images)
set the height of img 1 to the formattedHeight of img 1
set the top of img 1 to the bottom of fld 1
etc.....
end mouseUp 
Do you see how that works?

Simon
Edit: Make sure you lock the group size and position!!
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: [Code Help - Beginner] Having an issue

Post by shawnblc » Mon Sep 02, 2013 11:24 pm

Thanks for the response.

Yes, I can create a group and have it scrolling. Just not on a big card with many lines of text and images. I'll see what I can do with what you provided and update this thread. Thank you.

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

Re: [Code Help - Beginner] Having an issue

Post by Simon » Mon Sep 02, 2013 11:42 pm

I just tried a manual approach which might be easier for you:
put a field with an image underneath it on the card and group them.
Select vertical scrollbar for the group
Re-size the group to the size of your card
Lock it's size and position
paste your text into the field

Now you will be going back and forth using the Select Group icon in the menubar.
Select just the image and drag it down off the card, you will see the scrollbar increasing in size.
Re-size the text fld going back and forth between dragging the image down Re-size text until all the text fits.

Remember to Edit the group when you add a new field or image.

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

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: [Code Help - Beginner] Having an issue

Post by shawnblc » Tue Sep 03, 2013 12:30 am

Excellent. I'll be trying it out now.

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: [Code Help - Beginner] Having an issue

Post by shawnblc » Tue Sep 03, 2013 12:40 am

That's what I was trying to do! Thank you Simon!

Post Reply