Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-03

To TDBEdit users: EditMask property about to being ignored

7 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luiz Americo Pereira Camara

Hi,

Back in time when TField did not have EditMask property, TDBEdit published and used it's own EditMask property

Now TField has EditMask since at least fpc 244 but is not used in TDBEdit

So, in order to be Delphi compatible and allow the mask being shared across db controls, i plan to use the TField.EditMask in DBEdit

This will make TDBEdit.EditMask to be ignored

Any thoughts?

Luiz

Reply by email

José Mejuto
to Luiz Americo Pereira Camara

Hello Lazarus-List,

Tuesday, March 6, 2012, 11:27:19 AM, you wrote:

LAPC> This will make TDBEdit.EditMask to be ignored LAPC> Any thoughts?

TDBEdit.EditMask should be ignored only if it has default value (nothing), if it has a value it should override field mask IMHO.

Best regards, Jos?

Reply by email

Juha Manninen
to José Mejuto

2012/3/6 Jos? Mejuto

Show quoted text 10 lines
Hello Lazarus-List, Tuesday, March 6, 2012, 11:27:19 AM, you wrote: LAPC> This will make TDBEdit.EditMask to be ignored LAPC> Any thoughts? TDBEdit.EditMask should be ignored only if it has default value (nothing), if it has a value it should override field mask IMHO.

Why should there be 2 EditMasks? To confuse people maybe? Just remove TDBEdit.EditMask if it is not used.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120306/8f27b535/attachment.html>

Reply by email

José Mejuto
to Juha Manninen

Hello Lazarus-List,

you wrote
> TDBEdit.EditMask should be ignored only if it has default value > (nothing), if it has a value it should override field mask IMHO.

JM> Why should there be 2 EditMasks? To confuse people maybe? JM> Just remove TDBEdit.EditMask if it is not used.

There are 2 possibilities. Same field could be editted in two different controls at the same time, like a TDBGrid and a TDBEdit, but in TDBGrid you can use a more compact mask for editing a date (in example) but a more verbose in a TDBEdit.

The second one is that if the user does not define a edit mask he/she can not use a TDBMaskEdit (it does not exists). The presence of a TDBMaskEdit in the component palette will invalidate this of course.

Anyway if TDBEditMask is removed I will not complaint.

Best regards, Jos?

Reply by email

Luiz Americo Pereira Camara
to José Mejuto
Jos? Mejuto wrote 19 lines
Hello Lazarus-List, Tuesday, March 6, 2012, 1:26:18 PM, you wrote: >> TDBEdit.EditMask should be ignored only if it has default value >> (nothing), if it has a value it should override field mask IMHO. JM> Why should there be 2 EditMasks? To confuse people maybe? JM> Just remove TDBEdit.EditMask if it is not used. There are 2 possibilities. Same field could be editted in two different controls at the same time, like a TDBGrid and a TDBEdit, but in TDBGrid you can use a more compact mask for editing a date (in example) but a more verbose in a TDBEdit. The second one is that if the user does not define a edit mask he/she can not use a TDBMaskEdit (it does not exists). The presence of a TDBMaskEdit in the component palette will invalidate this of course. Anyway if TDBEditMask is removed I will not complaint

Initially i think of not using TDBEdit.EditMask property at all since could lead to the confusion cited by Juha and to be Delphi compatible.

But given the below reasons:

- Keep compatibility with existing LCL code
- Provide a simpler way to define a Mask to datasets with fields created dynamically (not at design time)

I have the idea of adding a property OwnsMask that defaults to false. Seems a good compromise between Delphi compatibility (by default) and compatibility (just change a property)

More thoughts?

Luiz

Reply by email

Luiz Americo Pereira Camara
to José Mejuto: LAPC> This will make TDBEdit.EditMask to be ignored LAPC> Any thoughts? TDBEdit.EditMask…
Jos? Mejuto wrote 9 lines
Hello Lazarus-List, Tuesday, March 6, 2012, 11:27:19 AM, you wrote: LAPC> This will make TDBEdit.EditMask to be ignored LAPC> Any thoughts? TDBEdit.EditMask should be ignored only if it has default value (nothing), if it has a value it should override field mask IMHO.

Technically this is not possible given the way EditMask is set / used in TDBEdit

See the proposition of OwnsMask in other message

Luiz

Reply by email

José Mejuto
to Luiz Americo Pereira Camara: Initially i think of not using TDBEdit.EditMask property at all since could lead to the…

Hello Lazarus-List,

Tuesday, March 6, 2012, 4:57:45 PM, you wrote:

LAPC> I have the idea of adding a property OwnsMask that defaults to false. LAPC> Seems a good compromise between Delphi compatibility (by default) and LAPC> compatibility (just change a property)
LAPC> More thoughts?

OverrideEditMask ? UseCustomEditMask ? Maybe an options set (with just one option) that could be extended if necesary with some toggles ?

Best regards, Jos?

Reply by email