Newbie: Scrolling question

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm

Newbie: Scrolling question

Post by kpeters » Tue Jun 12, 2007 8:42 pm

I nocticed that window moving & scrolling on Macs is quite different from Windows and again quite different comparing RR to the design tools/languages I use on Windows.

Having a stack window wider & higher than the screen on some machines my app will need to run on:

How do I make it scrollable, both on the x and y axis?

As always, thanks in advance for any help/pointers.

Kai

xApple
Posts: 113
Joined: Wed Nov 29, 2006 10:21 pm

Post by xApple » Tue Jun 12, 2007 9:21 pm

I made a card scrollable vertically once simply by grouping all the controls it had in one big group called "allTheStuff" and adding a scroll bar on it's side (the only object not contained in the big group). Finally, put this script in the scrollbar:

Code: Select all

on mouseUp
  global scrollMax, myStartPosition
  put scrollMax*((the thumbPosition of me)/(the endValue of me)) into myNewPosition
  set the top of group "allTheStuff" of cd "debugInfo" to myStartPosition-myNewPosition
end mouseUp
Set the global variables when the stack opens:

Code: Select all

on openStack
  global scrollMax,  myStartPosition
  put 1000 into scrollMax
  put 5 into myStartPosition
  set the top of group "allTheStuff" of cd "debugInfo" to myStartPosition
  set the thumbPosition of control "myScrollBar" of cd "debugInfo" to 0
end openStack
I'm sure you'll manage to generalize it for vertical and horizontal scrolling ;)

But in general if your interface requires more space than the real estate the screen provides; it's your interface that has a problem not the screen.

kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm

Post by kpeters » Tue Jun 12, 2007 10:35 pm

Thanks, xApple ~

that sounds like a solution I could work with. Just tried it in a simple demo but it does not work as expected - too much of a newbie?

Would you mind sending me a minimalistic demo stack off list to
platysternon@hotmail.com?

TIA,
Kai

xApple
Posts: 113
Joined: Wed Nov 29, 2006 10:21 pm

Post by xApple » Wed Jun 13, 2007 3:25 pm

Ok I made an exemple.
But again you never should need to scroll a card.
Just type this in your message box and hit enter:

Code: Select all

go URL "http://homepage.mac.com/xapple/give/scrollingstack.rev"

Post Reply