Donate Share

DotNetFireball

Tracker: Bugs

5 DragDrop event does not fire for CodeEditor control. - ID: 1749216
Last Update: Comment added ( scorredoira )

The primary issue is the CodeEditor control's DragDrop event is not being
raised when something (a WinForms TreeView node for example) is dragged and
dropped on it. The DragDrop event is raised when using the same code with
a WinForms TextBox control. See attached VB.Net project for a small
example of the issue.

Another less important bug is the cursor and 'drag effect' handling of the
CodeEditor control. Note that in the example project the cursor does not
behave as expected when dragging over the CodeEditor (before dropping)
compared to the TextBox control. It displays a generic cursor instead of
the specific "DragDropEffects.Copy" effect that is specified in the code.
The cursor effect does not work at all on the CodeEditor if
"DragDropEffects.All" is not specified in the DoDragDrop function. These
issues prevent the correct effects from being displayed in situations were
different actions might be taken by the code. Also, these issues prevent
the program from limiting the types of DragDrop events that are allowed
between certain controls.


Nobody/Anonymous ( nobody ) - 2007-07-06 16:09

5

Open

None

DotNetFireball

Fireball.CodeEditor

None

Public


Comments ( 2 )




Date: 2007-11-12 15:39
Sender: scorredoira


Hi,

I had the same issue and found the problem. In the file
EditViewControl.cs, line 3.475, in the method:

protected override void OnDragDrop(DragEventArgs drgevent)

the line:

string s = drgevent.Data.GetData(typeof(string)).ToString();

assumes that the data dragged can be converted to a string, so if you drag
a file for example, an exception is thrown and the event is not fired.

To solve the problem you need to check the data present, for example to
avoid the exception when a file is droped:

if (!drgevent.Data.GetDataPresent(DataFormats.FileDrop))
{
}

or better, check if any data convertible to string is present.


Date: 2007-09-13 03:30
Sender: nobody

Logged In: NO

I too have experienced this problem.


Log in to comment.

Attached File ( 1 )

Filename Description Download
FireBallDragDropTest.zip Simple example of the issues (VB.Net project) Download

Change ( 1 )

Field Old Value Date By
File Added 235964: FireBallDragDropTest.zip 2007-07-06 16:09 nobody