[Mono-osx] [MonoMac] DatePicker sample and patch
kjpou
kjpou at pt.lu
Fri Dec 31 05:55:37 EST 2010
Hello all
Here is a new sample for DatePicker.
I think there is a problem though with the ValidateProposedDateValue method.
[Export("datePickerCell:validateProposedDateValue:timeInterval:")]
void ValidateProposedDateValue (NSDatePickerCell
aDatePickerCell, ref NSDate proposedDateValue, double proposedTimeInterval)
{
TestWindowController controller =
(TestWindowController)aDatePickerCell.WeakDelegate;
if (controller != null && controller == this &&
aDatePickerCell == datePickerControl.Cell) {
// override code goes here. You should
ensure that the new values are within the appropriate range.
if
(overrideDateCheck.SelectedCell.State == NSCellStateValue.On)
// override the date using the
user specified date
proposedDateValue =
overrideDate.DateValue;
// NOTE: I think there is a problem
setting the proposed Date value as it is a ref
}
}
When overriding the proposedDateValue the value is not being set. The
code gets executed but the control is not affected by the override.
Could this be a result of the proposedDateValue being a ref pointer?
Attached is the sample solution as well as the diff patch that was
discussed on the #monomac irc list on the 18th of Dec.
Kenneth
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DatePicker.zip
Type: application/zip
Size: 46431 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20101231/acfe7d42/attachment-0001.zip
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: NSDatePicker.diff
Url: http://lists.ximian.com/pipermail/mono-osx/attachments/20101231/acfe7d42/attachment-0001.pl
More information about the Mono-osx
mailing list