Scrolling a Window

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Nonsanity
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 86
Joined: Thu May 17, 2007 9:15 pm
Contact:

Scrolling a Window

Post by Nonsanity » Sun Jul 06, 2008 2:28 am

I can't seem to find any way to make a window that is smaller than the card, with a scrollbar to move the contents around. It's not hard to simulate this, by grouping the contents of the page and moving the group with a scrollbar. But if the object is to print the whole contents of the card - which is longer than the screen - the window, or the printout at least, needs to be full-length.

Any way to make a window act like a typical large document window that will print its oversized contents?
~ Nonsanity
~ Chris Innanen

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Sun Jul 06, 2008 7:48 am

The simple solution is to separate the 'printout' look from the 'data aentry' look by having a separate (invisible) stack that you fill with the data from the entry stack, and then print that. Or use Quartam Reports :-)

Other than that, you could always alter your stack before printing - set the height/width of your group to its formattedHeight/Weight, hide the overlapping controls, turn off the group's scrollbars, and then print the rect of your group. After printing, revert everything to previous size/visibility.

Hope this gets you closer to a solution,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Nonsanity
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 86
Joined: Thu May 17, 2007 9:15 pm
Contact:

Post by Nonsanity » Tue Jul 08, 2008 8:37 pm

I missed that there was a response here. Thanks for answering. Turns out what I was missing was that groups could have scroll bars, and that they basically do what backgrounds did in Hypercard and early Supercard. How Revolution implemented them wasn't exactly intuitive, though it's perfectly functional.

So I've taken my original form PDF and converted it to an image with Photoshop, then added all the transparent text fields over the various fill-me-in spaces and grouped the lot. Added a scroll bar and sized it to the card. Now I can scroll the whole page in the smaller window and edit all the fields. Next step will be to resize the window to full and print, just as you also suggested, then restore it for further editing.


In case anyone is interested, the form in this case is the new 4th edition D&D character sheet. It's been decades, but my friends and I thought we'd give it a try again.

All the fields are uniquely named, and a save button creates a CSV text file of field name and contents. Load reverses this.

As an extra feature of this little app, many of the fields copy values from elsewhere on the form and total them up in different ways. I added a custom property to those fields with contents like "level / 2 + dexmod" and wrote a function that will parse out the words into operators, constants, and field names. A button in the controls palette repeatedly calls this until no more changes are made. Turns out most of the fields on the form are of this auto-calculating variety. Makes filling it all out so much easier. :)
~ Nonsanity
~ Chris Innanen

bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

Post by bjb007 » Wed Jul 09, 2008 1:56 am

Chris

That sounds interesting.

Care to share - in your "User Space" perhaps?
Life is just a bowl of cherries.

Post Reply