Drag to resize list fields
Scott Morrow
scott at elementarysoftware.com
Wed Nov 21 00:17:56 EST 2007
Hello Russell,
Eric Chatonet of So Smart Software has a fine example on how to do
this as part of his "Managing Resizing" tutorial.
http://www.sosmartsoftware.com/?r=revolution_didacticiels&l=en
In the example stack look under the "Tips and Tricks" tab and click
the "Two Fields Together" button. The script is in the divider bar.
-Scott Morrow
Elementary Software
(Now with 20% less chalk dust !)
web http://elementarysoftware.com/
email scott at elementarysoftware.com
-----------------------------------------------------------------
On Nov 20, 2007, at 6:07 PM, Russell Martin wrote:
> Hi. I'm attempting to create an interface where I have two list
> fields side by side. I would like the user to be able to click in
> the space between the two lists and then drag left or right to and
> have the lists widths to be resized.
>
> What I've attempted to do, is to put a tall narrow rectangle in the
> space between the two fields and then have it respond to the
> mouseDown and dragMove messages.
>
> They look like this:
>
> on mouseDown
> -- I set the dragdata, because the documentation led me to believe
> -- it was necessary to get the rectangle to respond to dragMove
> messages
> set the dragdata["text"] to "text being dragged"
> -- the rectangle's width is 10 and so this immediately moves the
> rectangle
> -- to be centered to the pointer, if the pointer escapes the
> rectangle, the drag
> -- operation fails
> set the left of me to the mouseH - 5
> end mouseDown
>
>
> on dragMove
> -- again, this centers the rectangle to the pointer
> set the left of me to the mouseH - 5
> -- this resizes the left hand field to be one pixel away from the
> rectangle
> set the width of field LeftSideField to the mouseH - 6
> -- this gets the left hand field positioned properly again
> against the left
> -- edge of the window
> set the left of field LeftSideField to 0
> -- then, I set the width of the right hand field and fix it's
> position
> set the width of field RightSideField to width of this stack -
> the mouseH - 6
> set the left of field RightSideField to width the mouseH - 6
> end dragMove
>
>
> Now, this mostly works, but not as well as I'd like. If you move
> the pointer too quickly (which is not hard to do), it will escape
> from the rectangle and your drag operation will stop and the
> dragMove messages will start making their way up the message path.
> Also, even if you drag slowly enough to avoid this, when the window
> is resized and the fields resize based on their geometry settings,
> they are no longer within one pixel of the rectangle.
>
> I'm thinking that there has two be a better way to accomplish what
> I'm trying to do in Revolution. I'm hoping that someone out there
> will be able to set me straight. Thanks in advance. :-)
>
>
>
>
>
> ______________________________________________________________________
> ______________
> Never miss a thing. Make Yahoo your home page.
> http://www.yahoo.com/r/hs
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list