Shortcut for resizing a selected object ?

zryip theSlug zryip.theslug at gmail.com
Wed Dec 16 04:42:33 EST 2009


Hi Richard,

How ?
Try this 8) :

on rawkeyDown theKey
   if (the altKey is down) and (theKey >= 65361) and (theKey <= 65364)
then -- only if alt key is pressed when using arrow key
      put the selectedObjects into objectsList -- keep in memory the
list of objects to resize
      get number of lines of objectsList
      if it > 0 then
         repeat with x = 1 to it -- a loop to resize all the objects in the list
            resizeObject line x of the selectedObjects,theKey
         end repeat
      end if
   else
      pass rawkeyDown
   end if
end rawkeyDown

on resizeObject theObject,theKey
   do "get rect of" && theObject
   put numKey2Const(theKey) into direction
   put getStep(direction,the shiftKey is down) into myStep -- step = 1
pixel or 5 pixels when the shift key is down
   add myStep to item numKey2rectItem(direction) of it
   do "set rect of" && (theObject) && "to it"
end resizeObject

function numKey2Const valueKey
   -- Not necessary but usefull to not keep in mind 65361 when I
search my left. 8)
      switch valueKey
      case 65361
         return "left"
      case 65362
         return "up"
      case 65363
         return "right"
      case 65364
         return "down"
      default
         return ""
   end switch
end numKey2Const

function numKey2rectItem direction
   if (direction is in "left,right") then
      return 3
   else
      return 4
   end if
end numKey2rectItem

function getStep direction,shiftFlag
   if (direction is in "left,up") then
      put -1 into myStep -- reduce the size of the object
   else
      put 1 into myStep -- grow up the size of the object
   end if
   if shiftFlag then put (myStep * 5) into myStep
   return myStep
end getStep

-Zryip TheSlug- wish you the best ! 8)

2009/12/16 Richard Gaskin <ambassador at fourthworld.com>

    I use this feature in Fireworks and other tools that let you
select a single bounds handle, but how would this work in Rev (or HC
for that matter, since it used the "marching ants" marquee to indicate
selection)?



More information about the Use-livecode mailing list