realbasic-nug
[Top] [All Lists]

Re: DragReorderRows in hierarchical listbox

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: DragReorderRows in hierarchical listbox
From: Walter Purvis <wpurvis7 at bellsouth dot net>
Date: Thu, 31 Jul 2003 07:59:38 -0400
MouseMove fires for me. In the DragRow event of a hierarchical listbox, I put 
this code

  me.cell(0,0) = "x = " + str(me.MouseX) + "; y = " + str(me.mouseY) 
  me.Refresh

and the cell value updates to reflect the xy point where the DragRow started. 
Then in the MouseMove event I put this code:

  me.cell(1,0) = "x = " + str(me.MouseX) + "; y = " + str(me.mouseY) 
  me.Refresh

And the cell value updates continuously as I move the mouse around.

I did have to turn off AllowDragReorder in order to get these events to fire. 

It seems like you should be able to make it work if you can track the mouse 
position like that, though you will have to do some fairly hairy calculations 
based on row heights and whatnot, and drawing the appropriate visual cues won't 
be fun. But then I don't know exactly what you're trying to accomplish, so 
maybe not.

HTH,
Walter


At 8:37 PM -0700 7/30/03, Bryan Lund wrote:
>On Wednesday, July 30, 2003, at 06:02 PM, Walter Purvis wrote:
>
>> At 4:24 PM -0700 7/30/03, Bryan Lund wrote:
>>> So, basically, what I need either:
>>> b) The ability to have events fire during a drag so that I can create this 
>>> functionality myself.
>>
>> What events do you need to have fire? If you know the xy of the mouse, can't 
>> you make the appropriate visual updates to the rows you're dragging over? 
>> And can't you tell the xy position at mouseup and thus figure out what row 
>> was dropped where? What else do you need to create the functionality?
>
>Well, when a drag is in process NO events fire.  At all.  If just one single 
>event would fire (like mouse move or mouse drag) I could get this 
>functionality to work quite easily.
>
>Theoretically I could make this work if I didn't use the RB drag functionality 
>at all and created my own drag class.  But, well, that's not exactly an 
>elegant or optimal solution.  And I like elegant and optimal solutions. :-)

---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
.


<Prev in Thread] Current Thread [Next in Thread>