Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinForms: DataObject malfunction #1927

Closed
cyanfish opened this issue Apr 15, 2021 · 5 comments · Fixed by #2045
Closed

WinForms: DataObject malfunction #1927

cyanfish opened this issue Apr 15, 2021 · 5 comments · Fixed by #2045
Labels
Milestone

Comments

@cyanfish
Copy link
Contributor

Setting data on an Eto DataObject has no apparent effect - subsequent gets return null. This applies to all methods (SetString, SetObject, SetData, etc.).

var x = new Eto.Forms.DataObject();
x.SetString("data", "type");
Console.WriteLine(x.GetString("type")); // null

This seems related to 1b32e67 which creates a custom internal data object in the default constructor.

Creating with a normal data object works as expected:

var x = new DataObject(new DataObjectHandler(new System.Windows.Forms.DataObject()));
x.SetString("data", "type");
Console.WriteLine(x.GetString("type")); // "data"

Specifications

  • Version: 2.5.10
  • Platform(s): WinForms
  • Operating System(s): Win10
@cyanfish
Copy link
Contributor Author

Also, is the "shell drag and drop" documented anywhere? I'm not sure the point of it, it seems like I also need to set WindowsControl.UseShellDropManager to false in order for drag-and-drop to work.

@cwensley
Copy link
Member

The shell drag and drop is used so you can have drag images and have a tooltip like how the File Explorer drag/drop works.

Thanks for reporting the issue! What control(s) are you dragging/dropping with where it doesn't work?

@cyanfish
Copy link
Contributor Author

I had drag implemented on items in a embedded control (System.Windows.Forms.ListView). I guess that might not be supported with the shell drag and drop?

@cyanfish
Copy link
Contributor Author

But in any case, there still seems to be the issue with the data object (I wanted to use the Eto version for unified Clipboard/drag-and-drop handling). Though I can work around that with creating the handler manually if needed.

@cwensley
Copy link
Member

Hm, yeah that might not be working.. but it should be compatible with standard drag/drop so it's probably a bug.

As for the original issue that can certainly be fixed.

@cwensley cwensley added this to the 2.5.x milestone Apr 15, 2021
cwensley added a commit to cwensley/Eto that referenced this issue Oct 23, 2021
@cwensley cwensley added the bug label Oct 23, 2021
@cwensley cwensley modified the milestones: 2.6.x, 2.6.0 Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants