continuous card

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
Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm

continuous card

Post by Samuele » Mon Jan 31, 2022 1:07 pm

Hi, how can i make a card that's "scrollable" for example in my case, i put all the content from a database in a field, but i don't want only the field to be "scrollable" but all the card, because of the design
Immagine 2022-01-31 130252.png
as you can see in this image, the text in black comes from the database and the yellow and white bars are part of the design of the background image.
while we're on the subject in the same image you can see that the text is not perfectly aligned to the yellow/white bars, does anyone have any idea how to make it become aligned?
Thanks!
Samuele.

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: continuous card

Post by Klaus » Mon Jan 31, 2022 2:46 pm

Samuele wrote:
Mon Jan 31, 2022 1:07 pm
Hi, how can i make a card that's "scrollable" for example in my case, i put all the content from a database in a field, but i don't want only the field to be "scrollable" but all the card, because of the design.
In short: you can't! :shock:
But you can fake it. :D
Group all the controls of your card, set the rect of the group to the rect of your card and turn on the scrollbars for that group.
Samuele wrote:
Mon Jan 31, 2022 1:07 pm
as you can see in this image, the text in black comes from the database and the yellow and white bars are part of the design of the background image.
while we're on the subject in the same image you can see that the text is not perfectly aligned to the yellow/white bars, does anyone have any idea how to make it become aligned?
Since you have an image in your background, you will need to play with the textsize and textheight of your field.
No success guarantedd, so I would use a DATAGRID here, which has alternating row-colors that fit exactly!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: continuous card

Post by richmond62 » Mon Jan 31, 2022 3:16 pm

so I would use a DATAGRID here, which has alternating row-colors that fit exactly!
You can also do this with a listField or a tabbed field:
-
SShot 2022-01-31 at 16.16.13.png

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: continuous card

Post by dunbarx » Mon Jan 31, 2022 3:19 pm

What Klaus said.

You only have to "fake" it to the extent that only you know that the card is not scrolling, rather only the gadgetry of that card.

You can use a table field, which is much simpler than a dataGrid. But you will have to control the vertical placement of the small circles when you scroll, so that they track particular lines. Fortunately , this can easily be done. If you need help with that write back.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: continuous card

Post by richmond62 » Mon Jan 31, 2022 3:22 pm

SShot 2022-01-31 at 16.20.28.png
Attachments
STRIPEY.livecode.zip
Stack.
(183.53 KiB) Downloaded 116 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: continuous card

Post by dunbarx » Mon Jan 31, 2022 4:15 pm

Richmond.

The OP wants other controls to scroll in sync with the "field", however that is constructed.

@Samulele. A "form" style of dataGrid can be constructed to do what you want, but there is a significant learning curve for that object.

A table field is ready to go out of the box. You can set the backColor of alternating lines to any color you want.

Here is a crude example stack. It needs work to make it more robust, for example, changing the size or loc of the table field.
ScrollTest.livecode.zip
(1.78 KiB) Downloaded 113 times
Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: continuous card

Post by richmond62 » Mon Jan 31, 2022 4:19 pm

The OP wants other controls to scroll in sync with the "field", however that is constructed.
Aha: but doesn't that mean that some things will get "lost" off the top of the card
when things are scrolled?

Well, unless you have lots of fiddly scripts to keep things in place, or, of course, they are not inwith the group.
-
Groupies.jpeg

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: continuous card

Post by dunbarx » Mon Jan 31, 2022 4:26 pm

Aha: but doesn't that mean that some things will get "lost" off the top of the card
when things are scrolled?
Yes, which is why a kludge has to anticipate all that sort of stuff. In the very crude example stack I just posted, for example, the circle graphic simply disappears if it "scrolls" too high. There are likely several places where various other stuff has to be dealt with.

Craig

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm

Re: continuous card

Post by Samuele » Mon Jan 31, 2022 6:02 pm

Thank You, I will try to put into practice all the knowledge just revealed to me!
Samuele.

Post Reply