Recent

Author Topic: Entering symbols in a TDateEdit component  (Read 4043 times)

talorigomat

  • Jr. Member
  • **
  • Posts: 96
Entering symbols in a TDateEdit component
« 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?
Lazarus 1.8.0Rc4, Windows 10

ASerge

  • Hero Member
  • *****
  • Posts: 2223
Re: Entering symbols in a TDateEdit component
« Reply #1 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 <, =, :

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Entering symbols in a TDateEdit component
« Reply #2 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

talorigomat

  • Jr. Member
  • **
  • Posts: 96
Re: Entering symbols in a TDateEdit component
« Reply #3 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. 
Lazarus 1.8.0Rc4, Windows 10

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Entering symbols in a TDateEdit component
« Reply #4 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

talorigomat

  • Jr. Member
  • **
  • Posts: 96
Re: Entering symbols in a TDateEdit component
« Reply #5 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.
Lazarus 1.8.0Rc4, Windows 10

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Entering symbols in a TDateEdit component
« Reply #6 on: April 26, 2017, 05:03:52 pm »
Well, TDateEdit wasn't designed for that.

Bart

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1312
    • Lebeau Software
Re: Entering symbols in a TDateEdit component
« Reply #7 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.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

 

TinyPortal © 2005-2018