How to tell when a datagrid column has been resized
Pete
pete at mollysrevenge.com
Thu Dec 22 20:36:22 EST 2011
There's a mouseUp handler in the default header behavior script for a
datagrid that looks like this:
*on* mouseUp pMouseBtnNum
*if* pMouseBtnNum is 1 and not the dgHeaderColumnIsBeingResized of
thedgHeader
of me *then*
*## Change the sort of the column*
*## _HeaderToggleSortOfColumn is a helper that resizes in the parent
group script.*
*## It toggles the sort of the column based on current state of
column.*
_HeaderToggleSortOfColumn the dgColumn of me
*end* *if*
*pass* mouseUp
*end* mouseUp
You might be able to figure something out from that. For example , set the
default header behavior script to your own copy of it and then if
the dgHeaderColumnIsBeingResized property is true, do whatever it is you
need to do.
Pete
On Thu, Dec 22, 2011 at 5:11 PM, Bob Sneidar <bobs at twft.com> wrote:
> > Hi all. I have read up on all the lessons that might help, as well as
> searched the datagrid library, and I cannot find anyplace where a message
> gets sent when a column has been resized. I would like to trap that message
> so the next time around I can set up the datagrid the way it was last. Any
> ideas?
> >
> > Bob
> >
> >
> Never mind. I figured out a way. I just put a handler for getprop
> dgColumnWidth [pColumn] in the script of the datagrid and then pass it when
> through. I think I was hoping for some kind of message to get sent when the
> resize was FINISHED. This gets sent when a column resize is in progress,
> even if the column is not changing in size at the time. As long as the
> mouse is down on the column divider, it keeps triggering. It feels dirty
> somehow, like I ought to be trying to be more efficient, and can't be.
>
> Oh well. I have CPU cycles to spare I guess...
>
> Bob
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
--
Pete
Molly's Revenge <http://www.mollysrevenge.com>
More information about the use-livecode
mailing list