Error when using Scroll Bars

Geoff Canyon gcanyon at inspiredlogic.com
Wed Dec 5 17:58:01 EST 2001


At 2:42 PM -0700 12/5/01, David Burgun wrote:
>What exactly is being moved here? Is it the actual Pixel Values from the PixMap?

No, it's just changing the width and height of the object so that it is the same size, but oriented a certain way. Here's the script again, with some comments. Bear in mind that I didn't write this, so mistakes in commenting are possible.


-- This is the script from the Horizontal/Vertical popup in the
-- properties palette. You see it when you show properties
-- on a scrollbar.

on menuPick pWhich
-- prevent screen updates
  lock screen
-- get a list of the objects the user has selected
  put revPaletteObjects() into tObjects
-- are we going to make them all horizontal, or vertical?
-- if horizontal
  if pWhich is "Horizontal" then  
-- do this for each of the objects the user has selected 
    repeat for each line l in tObjects
-- get the larger dimension of the object
      put max(the height of l,the width of l) into tWidth
-- get the smaller dimension of the object
      put min(the width of l, the height of l) into tHeight
-- get the current location of the object
      put the loc of l into tLoc
-- set the width of the object to the larger dimension
      set the width of l to tWidth
-- set the height of the object to the smaller dimension
      set the height of l to tHeight
-- make sure the object remains at the same location
      set the loc of l to tLoc
    end repeat
  else
    --make orientation vertical
-- imagine the same comments here, in reverse :-)
    repeat for each line l in tObjects
      put max(the height of l,the width of l) into tHeight
      put min(the width of l, the height of l) into tWidth
      put the loc of l into tLoc
      set the width of l to tWidth
      set the height of l to tHeight
      set the loc of l to tLoc
    end repeat
  end if
  unlock screen
end menuPick




More information about the use-livecode mailing list