Shortcut for resizing a selected object ?

Richard Gaskin ambassador at fourthworld.com
Wed Dec 16 12:10:35 EST 2009


Nicely done.  Limiting the resizing to the left and bottom removes the 
ambiguity I was wondering about in terms of which sides gets adjusted.

I think I'll add this to my copy of the MC IDE, and have cc'd the MC 
discussion list here in hopes that the crew agrees it would be useful to 
add to the master version.

It's a nice compliment to the Shift key modifier, which moves the 
objects by 10-pixel increments.  With Option added for resizing, it 
really rounds out the arrow key use quite well.

Thanks for the script - useful stuff.

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv

zryip wrote:

>
> 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