Hello All,
I'm new to Revolution, and am attempting to create a paned interface.
Specifically, I have two text fields, with a little grabber icon between them. The effect I'm trying to accomplish is that, as I drag the little grabber button between the two fields, the two fields on either side are to automatically resize in width.
I'm experimenting with just the left text field and grabber icon at this time. My current challenge is that when I drag the grabber left and right, the text field on the left does resize in width-- however, it resizes from its centerpoint outwards. Ideally, I would want the text field's XY coordinates to remain locked, while only the _right_ side of the text field grows outward or inward.
Is there a property for Rev objects that can configure objects to resize from one specific side?
Thank you,
Ron Toledo
Resizing a Text Field Dynamically, While Locking XY Position
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Hi ron,
you could try something like this:
in your grabber thingy:
This is out of the top of my head, so there may be typos, but you get the idea.
Hope that helps,
malte
you could try something like this:
in your grabber thingy:
Code: Select all
on mouseDown
set the uAllowDrag of me to true
end mouseDown
on mouseUp
set the uAllowDrag of me to false
end mouseUp
on mouseRelease
set the uAllowDrag of me to false
end mouseRelease
on mouseMove x,y
if not the uAllowDrag of me then exit mouseMove
set the loc of me to x,item 2 of the loc of me
set the rect of fld "leftField" to the topLeft of fld "leftField",the left of me,the bottom of fld "leftField"
set the rect of fld "rightField" to the right of me,the top of fld "rightField,the botRight of fld "rightField"
end mouseMove
Hope that helps,
malte
Malte,
Thank you much for this; I'm going to give a whirl shortly. It's ironic that you would reply-- I've been experimenting with AnimationEngine's excellent constraintLinear and constraintLinearCallback functions to achieve the left/right slider effect for the grabber!
Everything has been working swimmingly, save for the text field resize, which you've pointed me in the right direction for.
Will let you know how it goes.
Thank you again,
Ron
Thank you much for this; I'm going to give a whirl shortly. It's ironic that you would reply-- I've been experimenting with AnimationEngine's excellent constraintLinear and constraintLinearCallback functions to achieve the left/right slider effect for the grabber!
Everything has been working swimmingly, save for the text field resize, which you've pointed me in the right direction for.
Will let you know how it goes.
Thank you again,
Ron
Hello again,
Just gave it a try, and it worked perfectly!
As I'm using AnimationEngine for the grabber (so that it constrains to moving along the X axis only (with an invisible line graphic as the grabber's guide/contraint), I only modified the grabber's handler as follows:
Amazing how elegant Revolution is; imagine attempting to purely code the same functionality in, say, Adobe Flex. Yikes.
Btw, when I think of Adobe Air, and the amount of code it takes to build Flash-based desktop applications, and compare it to accomplishing the same thing in Revolution, I'm amazed by the potential amount of time saved by leveraging the latter.
Thank you much,
Ron
Just gave it a try, and it worked perfectly!
As I'm using AnimationEngine for the grabber (so that it constrains to moving along the X axis only (with an invisible line graphic as the grabber's guide/contraint), I only modified the grabber's handler as follows:
Code: Select all
on ConstrainLinearCallback
set the rectangle of field "leftField" to the topLeft of field "leftField", the left of me, the bottom of field "leftField"
set the rectangle of field "rightField" to the right of me, the top of field "rightField", the botRight of field "rightField"
end ConstrainLinearCallback
Btw, when I think of Adobe Air, and the amount of code it takes to build Flash-based desktop applications, and compare it to accomplishing the same thing in Revolution, I'm amazed by the potential amount of time saved by leveraging the latter.
Thank you much,
Ron