[Mono-dev] [Patch] DateTimePicker changes

Carlos Alberto Cortez calberto.cortez at gmail.com
Sun Jul 20 13:27:46 EDT 2008


Hey,

While working on #, I found some small bits not matching .net. So
basically the attached patch:

* Doesn't change the DateTimePicker.Value property immediately when
editing -this means, when a user types a single digit-, but when the max
number of digits is reached *or* the selection moves to a different date
time section, or the checked state changes, or focus moves out of the
control, like .net does.

* Don't set at all the date entered by the user if is invalid. Just
ignore it and fallback to the current value.

* When painting, print the current editing text *if* we are actually
editing at the moment, or print the related Value otherwise.

* Use an enum to identify different date time parts (hour, minutes,
etc). This was done to avoid adding a new switch block when trying to
set the Value from a different part than KeyPress handler.

* Finally, infer the year when the user enters a two digit number, like
'99' or '34'. The behaviour I implemented is the one I observed in .Net,
but could not find something related to it in the docs.

Carlos.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dt-value-changes.patch
Type: text/x-patch
Size: 15716 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080720/2aef7342/attachment-0001.bin 


More information about the Mono-devel-list mailing list