DateTimePicker: add option dtpoResetSelection

git-svn-id: trunk@60614 -
This commit is contained in:
zoran 2019-03-07 11:31:22 +00:00
parent 8518262eef
commit 66f30ba367

View File

@ -119,8 +119,8 @@ type
dtaDefault means it is determined by BiDiMode }
TDTCalAlignment = (dtaLeft, dtaRight, dtaDefault);
TDateTimePickerOption = (
dtpoDoChangeOnSetDateTime, dtpoEnabledIfUnchecked, dtpoAutoCheck, dtpoFlatButton);
TDateTimePickerOption = (dtpoDoChangeOnSetDateTime, dtpoEnabledIfUnchecked,
dtpoAutoCheck, dtpoFlatButton, dtpoResetSelection);
TDateTimePickerOptions = set of TDateTimePickerOption;
{ TCustomDateTimePicker }
@ -2717,6 +2717,11 @@ end;
procedure TCustomDateTimePicker.DoEnter;
begin
if dtpoResetSelection in Options then begin
FSelectedTextPart := High(TTextPart);
MoveSelectionLR(False);
end;
inherited DoEnter;
Invalidate;
end;