TDateEdit: DefaultToday doesn't work properly if DirectInput property is False
Original Reporter info from Mantis: Black Doomer
-
Reporter name: Dmitry D. Chernov
Original Reporter info from Mantis: Black Doomer
- Reporter name: Dmitry D. Chernov
Description:
TDateEdit.DefaultToday sets current date only if Text property is empty, but it's impossible to set it empty at design-time if DirectInput option was set to False AFTER DefaultToday was set to True. This caused by auto-setting Text property to the current date if DirectInput was changed with DefaultToday set to True. When DirectInput is False, Text property become read-only - it always restore current date value.
It's possible to remove Text property value directly from the form file, but this will work only before next saving of the form, when Text value will be re-assigned to the date of saving.
Steps to reproduce:
- Create default LCL project.
- Put TDateEdit onto the form.
- Set DefaultToday to True.
- Set DirectInput to False.
- You will notice that Text value was changed and it's impossible to clear it now.
- Build the project.
- Change system date to another one.
- Run the program. You will notice that TDateEdit value isn't equal to the current system date.