Re: [Lazarus] MaskEdit: question on how it should behave
> Ok, I tested it -- D7 does the same. Actually, ValidateEdit only fires > if the text was modified. (Or always at the design time). Thanks for testing it for me. I'll implement it that way then. Bart ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] MaskEdit: question on how it should behave
On Sun, Dec 28, 2008 at 09:43, Bart wrote: >> I am not sure how modern Delphi behaves, but I'd say that Lazarus >> way is correct here -- this is clearly a programmes's error. >> OTOH, I think it would be useful to provide a separate function >> like 'TrySetText' which whould return false instead if saising an exception. > > In D3, D4 and Kylix1 ValidateEdit is only called if either the user > presses Enter in the control, or the control looses focus. > > I still would like someone to test this in D7 or higher. Ok, I tested it -- D7 does the same. Actually, ValidateEdit only fires if the text was modified. (Or always at the design time). -- Alexander S. Klenin ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] MaskEdit: question on how it should behave
> I am not sure how modern Delphi behaves, but I'd say that Lazarus > way is correct here -- this is clearly a programmes's error. > OTOH, I think it would be useful to provide a separate function > like 'TrySetText' which whould return false instead if saising an exception. In D3, D4 and Kylix1 ValidateEdit is only called if either the user presses Enter in the control, or the control looses focus. I still would like someone to test this in D7 or higher. > > > > Question 3: > > In the EditMask you can specify if the mask will be saved as pasrt of > > the data (again: what data?). For instance, if your EditMask is > > '000;0;_' then maskdata is not saved (the first 0 after the colon ( ; > > ) sets this value). > > I cannot really figure out what it does. I see noe effect n Text or > > EditText at all. > > > If you mask includes non-special characters, those are displayed in > the editor as-is, > e.g. if mask is "000-00-00" and the user enters "1234567", the editor > would contain > "123-45-67". Depending on the value of the flag, the actual Text property > will contain either "1234567" or "123-45-67". Yeah, that should not be so hard to implement. Thanks, Bart ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] MaskEdit: question on how it should behave
On Sat, Dec 27, 2008 at 10:07, Bart wrote: > Question 1: > > If I set the text of a MaskEdit to some value that does not match the > mask (e.g. EditMask = '' and then MaskEdit.Text := 'ABCD'), in D3 > no exception is raised and the text in the control is set. Is this > still the case in current Delphi's? > (In Lazarus ATM an Exception is raised if you try to do that) I am not sure how modern Delphi behaves, but I'd say that Lazarus way is correct here -- this is clearly a programmes's error. OTOH, I think it would be useful to provide a separate function like 'TrySetText' which whould return false instead if saising an exception. > Question 3: > In the EditMask you can specify if the mask will be saved as pasrt of > the data (again: what data?). For instance, if your EditMask is > '000;0;_' then maskdata is not saved (the first 0 after the colon ( ; > ) sets this value). > I cannot really figure out what it does. I see noe effect n Text or > EditText at all. If you mask includes non-special characters, those are displayed in the editor as-is, e.g. if mask is "000-00-00" and the user enters "1234567", the editor would contain "123-45-67". Depending on the value of the flag, the actual Text property will contain either "1234567" or "123-45-67". -- Alexander S. Klenin ___ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus