1. Drag and Drop

Inside Win32lib, function fDoMouse, I noticed these lines:

if length(vDragData) > 0 then
                -- I'm draging something. --
                -- First, tell the destination control.
                VOID = invokeHandler(id,          w32HDragAndDrop, vDragData)
                -- Secondly, tell the source control
                VOID = invokeHandler(vDragData[1], w32HDragAndDrop, vDragData)
                -- Reset the cursor shape.
IndicateDragging( vDragData[1], w32False ) -- Reset drag cursor
                shape.
            end if


This means, I think, that when I'm dragging something from a treeview to the
same treeview, the routine that handles the drag and drop action for that
treeview is called 2 times, but is not able to understand whics is the first call
and which is the second.
If this correct? 
If it is, have I to modify my copy of win32lib to solve this issue or there's a
smarter way?

Thanks,

papinic

new topic     » topic index » view message » categorize

2. Re: Drag and Drop

Papinic wrote:
> 
> Inside Win32lib, function fDoMouse, I noticed these lines:
> 
> }}}
<eucode>
>             if length(vDragData) > 0 then
>                 -- I'm draging something. --
>                 -- First, tell the destination control.
>                 VOID = invokeHandler(id,          w32HDragAndDrop, vDragData)
>                 -- Secondly, tell the source control
>                 VOID = invokeHandler(vDragData[1], w32HDragAndDrop, vDragData)
>                 -- Reset the cursor shape.
>                 IndicateDragging( vDragData[1], w32False ) -- Reset drag
>                 cursor shape.
>             end if
> </eucode>
{{{

> 
> This means, I think, that when I'm dragging something from a treeview to the
> same treeview,
> the routine that handles the drag and drop action for that treeview is called
> 2 times,
> but is not able to understand whics is the first call and which is the second.
> If this correct? 
> If it is, have I to modify my copy of win32lib to solve this issue or there's
> a smarter
> way?

You are correct. I have wondered why it was written like this. I suggest
you change the code like this ...

  -- First, tell the destination control.
  VOID = invokeHandler(id,          w32HDragAndDrop, {1, vDragData} )
  -- Secondly, tell the source control
  VOID = invokeHandler(vDragData[1], w32HDragAndDrop, {0, vDragData})

Or even better, if you want more control...

create a two new event names, say w32HSourceDD , and w32HTargetDD then

  -- First, tell the destination control.
  VOID = invokeHandler(id,          w32HTargetDD, vDragData )
  -- Secondly, tell the source control
  VOID = invokeHandler(vDragData[1], w32HSourceDD, vDragData)

I will do some fix for this soon (as I can find time)
-- 
Derek Parnell
Melbourne, Australia
irc://irc.sorcery.net:9000/euphoria

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu