[Mono-dev] Patches for mono-winforms

Steven Boswell II ulatekh at yahoo.com
Tue Jun 5 00:39:25 UTC 2012


Thank you!

Is there any chance of getting my previous two bug fixes pushed into the 2.10 release branch?
I figure that's the fastest way to get them into the versions found in yum repositories.

And what differences did you notice?  I'll at least put them on my list of things to consider.

I just tried to run your DgwTest project, both with latest mono, and with my patched 2.10.5 installation, under Fedora Core 16.  I compiled it with 2.10.5, and it ran fine with both versions of mono.  I then compiled it with latest mono, and it ran fine with latest mono.  So I don't know what to tell you.


BTW, enclosed is an updated version of patch 2.  I noticed the problem while debugging my own application today.  DataGridView.EndEdit(DataGridViewDataErrorContexts context) calls Focus(); there are no source-code comments to explain why, but my best guess is that it's to force the current editing-control to unfocus, since there is no explicit method to unfocus a control in WinForms.  Unfortunately, that's not the sort of thing you want to happen while processing a Leave event.  In addition, DataGridView.EndEdit(DataGridViewDataErrorContexts context) doesn't yet do anything with the passed-in DataGridViewDataErrorContexts parameter.  So my new patch keeps the call to EndEdit() that I added to DataGridView.OnLeave(), but with a parameter of DataGridViewDataErrorContexts.LeaveControl, and in EndEdit(), I guard the call to Focus() with "if (context != DataGridViewDataErrorContexts.LeaveControl)".  That seems a lot more sensible, and the problem I
 was having with my application went away. It's still not suitable for check-in, what with missing a unit test and all, but I wanted to keep all interested parties up to date on my progress.

Finally, in case anyone is interested, here are two more mono-winforms bugs I noticed today, that I'll probably try to fix at some point:

1) Modifying DataGridViewComboBoxColumn.Items doesn't propagate the changes to its cells, like it does in .NET.  Mono will propagate changes made to DataGridViewComboBoxCell.Items to its owning column, though.
2) The value of the Control.Focused property isn't consistent during an OnLeave event.  Under .NET, it appears to always be false.  Under Mono, I've seen both true and false.

Thanks to all for putting up with me. :-)

Steven Boswell


________________________________
 From: Stifu <stifu at free.fr>
To: mono-devel-list at lists.ximian.com 
Sent: Monday, June 4, 2012 2:57 PM
Subject: Re: [Mono-dev] Patches for mono-winforms
 
I've just pushed patch 3
(https://github.com/mono/mono/commit/bcb49c60cdb9e9797fa91473955fe71828805643).
Thanks.

By the way, I have noticed a few remaining subtle differences with .NET, but
I guess we have enough on our hands as is...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120604/3e7ab7ac/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mwf-02-DataGridView-Leave.patch
Type: application/octet-stream
Size: 994 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120604/3e7ab7ac/attachment-0001.obj>


More information about the Mono-devel-list mailing list