Vertical Field Scroller Dimensions

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
Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

Vertical Field Scroller Dimensions

Post by Gage » Fri Apr 19, 2013 4:41 pm

Hi All,

So I am wondering if there is a property of the "field" object type that designates the width of the scrollbar that pops up inherently. I want to place some headers above categories of information in the field itself, but keep it from looking like the header graphic overlaps the scrollbar.

I have been learning about data grids, and have an intuition that I should just be switching to that instead of a field.

That said, I am still wondering if there is a scrollbar property I can reference when sizing other objects.

Thanks!
Phil E.

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

Re: Vertical Field Scroller Dimensions

Post by dunbarx » Fri Apr 19, 2013 5:43 pm

Hi.

Well, I thought that the "scrollBarWidth" was just the ticket, and it is up to the default width. On a Mac, that is 16 pixels. You can make it narrower.

But to make it wider, and this may be a bug, you get all kinds of odd behavior. The scrollbar will shift with widths up to 38, will change into a small isolated gizmo a bit above that, and will change to a horizontal scrollbar in the 100's.

I don't suppose you only wanted it narrower?

Craig Newman

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

Re: Vertical Field Scroller Dimensions

Post by dunbarx » Fri Apr 19, 2013 5:52 pm

Well.

Make a field with a vertical scrollbar. Make a slider with a max value set to, say, 300. Put this in the slider script:

Code: Select all

on scrollbarDrag
   set the scrollbarwidth of fld 1 to the thumbposition of me
end scrollbarDrag
Well.

Craig Newman

Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

Re: Vertical Field Scroller Dimensions

Post by Gage » Fri Apr 19, 2013 9:48 pm

Hi Craig,

Mostly, I just want to know how to reference the thing, so I can code visually appealing object relations.

Wouldn't setting the scrollBarWidth to the thumbPosition be dynamic, and make the width larger as the thumb is dragged down the stack?

It looks like I can just set the scrollBarWidth property of a given field, right?

Phil E.

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

Re: Vertical Field Scroller Dimensions

Post by dunbarx » Fri Apr 19, 2013 11:42 pm

Sure.

I made that little gadget just to see how the scrollbar morphed with different values.

You, and everyone, seem to be limited to the default width or less, this value dependent on the platform. For Mac OSX, it is 16 pixels wide. So:

set the scrollbarWidth of fld yourField to yourValue -- like 10, or 16, the max

If I don't hear what I am missing, I will file a bug report, and make a note in the dictionary that the entry for this property has, er, issues.

Craig Newman

Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

Re: Vertical Field Scroller Dimensions

Post by Gage » Sat Apr 20, 2013 12:05 am

Sounds like a plan. Thank you for your help!

Phil E.

Post Reply