From: <ah...@us...> - 2012-05-10 05:38:48
|
Revision: 13296 http://jvcl.svn.sourceforge.net/jvcl/?rev=13296&view=rev Author: ahuser Date: 2012-05-10 05:38:42 +0000 (Thu, 10 May 2012) Log Message: ----------- Fixed FormDesigner Guidelines AV Modified Paths: -------------- trunk/jvcl/run/JvDatePickerEdit.pas Modified: trunk/jvcl/run/JvDatePickerEdit.pas =================================================================== --- trunk/jvcl/run/JvDatePickerEdit.pas 2012-05-07 15:01:25 UTC (rev 13295) +++ trunk/jvcl/run/JvDatePickerEdit.pas 2012-05-10 05:38:42 UTC (rev 13296) @@ -1176,6 +1176,7 @@ procedure TJvCustomDatePickerEdit.SetEditMask(const AValue: string); var OldSep: Char; + Designing: Boolean; begin { if csDesigning in ComponentState then Exit;} @@ -1183,7 +1184,22 @@ OldSep := JclFormatSettings.DateSeparator; JclFormatSettings.DateSeparator := Self.DateSeparator; try - inherited EditMask := AValue; + Designing := False; + if csDesigning in ComponentState then + begin + // If SetEditMask is called from CreateWnd via SetDateFormat, the TMaskEdit.SetCursor emulates + // a Shift+Left/Right key press. The form designer catches the key press and the + // IDE's Designer Guidelines code throws an access violation. + // With this we disable the form designer until "inherted EditMask" was executed. + Designing := True; + SetDesigning(False, False); + end; + try + inherited EditMask := AValue; + finally + if Designing then + SetDesigning(True, False); + end; finally JclFormatSettings.DateSeparator := OldSep; end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |