Lazarus

Programming => LCL => Topic started by: talorigomat on April 25, 2017, 12:55:54 pm

Title: Entering symbols in a TDateEdit component
Post by: talorigomat on April 25, 2017, 12:55:54 pm
In a previous version of my program compiled in January this year with Lazarus 1.6.2 I was able to enter symbols such as  <, <=, : in the TDateEdit component.  I've recompiled the program with 1.6.4 but it seems to no longer allows the entry of these symbols.  Is there a property setting I can set to allow it to accept these characters again?
Title: Re: Entering symbols in a TDateEdit component
Post by: ASerge on April 25, 2017, 06:13:23 pm
Lazarus 1.6.4. Windows 7. Put a TDateEdit in a new project on the form. Launched. Accepts any characters, including <, =, :
Title: Re: Entering symbols in a TDateEdit component
Post by: Bart on April 25, 2017, 06:19:51 pm
If DateOrder <> doNone then the control is masked.
IIRC when the control looses focus, illegal input will be erased.

Bart
Title: Re: Entering symbols in a TDateEdit component
Post by: talorigomat on April 25, 2017, 06:40:57 pm
I'm now getting the behaviour that Bart describes.  Before I had the behaviour that ASerge describes.  I created a new project and still am not able to enter the symbols.  I'm using Lazarus 1.6.4 with Windows 7 on one machine and Windows 10 on another. 
Title: Re: Entering symbols in a TDateEdit component
Post by: Bart on April 25, 2017, 06:55:21 pm
Why do you want to (be able to) enter invalid characters in a TDateEdit anyway?
It makes no sense to me whatsoever.

If you want to be able to enter anything, just use a TEdit and a TSpeedButton to open a TCalendarDialog instead.

Bart
Title: Re: Entering symbols in a TDateEdit component
Post by: talorigomat on April 26, 2017, 12:11:34 pm
Quote
Why do you want to (be able to) enter invalid characters in a TDateEdit anyway?

I've created a form for users to enter search criteria which has a routine to check whether these characters or entered.  The user can use the control to add a date and/or include these characters.
Title: Re: Entering symbols in a TDateEdit component
Post by: Bart on April 26, 2017, 05:03:52 pm
Well, TDateEdit wasn't designed for that.

Bart
Title: Re: Entering symbols in a TDateEdit component
Post by: Remy Lebeau on April 26, 2017, 10:54:53 pm
I've created a form for users to enter search criteria which has a routine to check whether these characters or entered.  The user can use the control to add a date and/or include these characters.

I would use a separate TEdit or TComboBox for entering the desired search operator, and then use a TDateEdit for just the date value by itself.
TinyPortal © 2005-2018