Scrollbar without group

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
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Scrollbar without group

Post by jalz » Mon Sep 01, 2014 10:17 pm

Hello all,

Is it possible to add a scrollbar to a card which is 800px high and allow the user to scroll up and down that page without having to group items on the card? I know how to group items and apply a scrollbar, but I really would like to add a native scrollbar from the palette and not a scrollbar via the group.

Thanks
Jalz

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

Re: Scrollbar without group

Post by Klaus » Tue Sep 02, 2014 12:55 pm

Hi Jalz,

if that "native" scrollbar is scripted correctly, there should be no problem :D


Best

Klaus

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: Scrollbar without group

Post by jalz » Tue Sep 02, 2014 6:04 pm

Hi Klaus,

Thanks for that. Any resources you can point me towards on how to do this? Tried the usual google and forum searches, but the grouped scrollbar method turns up.

Best
Jalz

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

Re: Scrollbar without group

Post by Klaus » Tue Sep 02, 2014 6:11 pm

Are we talking about MOBILE?
If yes, please always note this first, thanks! 8)

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

Re: Scrollbar without group

Post by Klaus » Tue Sep 02, 2014 6:16 pm

If we ARE talking about mobile, please make a search for "native scroller" in the mobile section!
This has come up about 100000000000 times before :D

There is even a Livecode tutorial about this that you can modify to your needs:
http://lessons.runrev.com/m/4069/l/9441 ... ll-a-field

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: Scrollbar without group

Post by jalz » Tue Sep 02, 2014 6:20 pm

Hi Klaus,

No we're talking about normal desktop. I'll check out the link you've given to me.

Cheers
Jalz

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

Re: Scrollbar without group

Post by Klaus » Tue Sep 02, 2014 6:48 pm

jalz wrote:No we're talking about normal desktop. I'll check out the link you've given to me.
AHA! :D

OK, we cannot have a "native mobile scroller" on the desktop, so the lesson will not be of much use for you in this respect.

AND on the desktop a "custom" scrollbar will not look any different than the groups scrollbar,
so adding a scrollbar to the group is the way to go on desktop systems!

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: Scrollbar without group

Post by jalz » Tue Sep 02, 2014 7:49 pm

Yeah, I figured that, no way around it so I've gone for the grouped scrollbar.

Another question, how do I script the group object enlarging/reducing when I change the size of the window. I kind of want the script equivalent of the geometry when you can fix the right and bottom position.

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: Scrollbar without group

Post by jalz » Tue Sep 02, 2014 10:07 pm

I've almost got it to behave like I want. I decided to use on on resizestack after a bit of research and can stretch the grouped object keeping the scrollbars on the edge of the card. However its all a little 'messy'. The grouped object seems to move slightly when I move when I resize the card and scrollbars on occasion go off screen. Anyone help me make it behave like a traditional window with scrollbars?
Attachments
grp.livecode.zip
(1.01 KiB) Downloaded 197 times

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

Re: Scrollbar without group

Post by Klaus » Tue Sep 02, 2014 10:15 pm

Hi Jalz,

either add a "lock screen" or simply do:

Code: Select all

on resizeStack cardWidth, cardHeight
   set the rect of group "grp" to the rect of this cd
end resizeStack
No flickering! :D


Best

Klaus

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: Scrollbar without group

Post by jalz » Tue Sep 02, 2014 10:27 pm

Thank you :D

Post Reply