Board index » cppbuilder » No drop cursor in drag & drop

No drop cursor in drag & drop

I have this piece of code in my DragOver event to not allow
a node to be dropped onto itself, it displays the no drop
cursor.

        if( TargetNode == SourceNode )
        {
            // do not allow dragging over itself
            Accept = false;
        }
        else
        {
            Accept = true;
        }

I would also like to display the no drop cursor if the level of the
tree
is one (1) meaning a child node.  Can someone give me an example
of what i need to put in there so i can display the no drop cursor
when
the cursor is over a child node.

I tried the TargetNode->Level in the DragOver event, but somehow
that did not work. The level always remained the same.

Thanks in advance.

 

Re:No drop cursor in drag & drop


snip....
Quote

>         if( TargetNode == SourceNode )
>         {
>             // do not allow dragging over itself
>             Accept = false;
>         }
>         else
>         {
>             Accept = true;
>         }

> I would also like to display the no drop cursor if the level of the
> tree
> is one (1) meaning a child node.  Can someone give me an example
> of what i need to put in there so i can display the no drop cursor
> when
> the cursor is over a child node.

            Accept = (SourceNode->Level ==0);

HTH Pete

Re:No drop cursor in drag & drop


Thanks Pete.

Other Threads