[Lazarus] I've installed Lazarus 0.9.26 on M$ Windowz XP OS -- cannot find app file to run Lazarus!!!

Peter Williams pewtas at gmail.com
Mon Dec 29 20:15:57 CET 2008


Hi,

In the MaskEdit unit I'm working on, I' ve overriden the DoExit
procedure, because this is where the ValidateEdit occurs.


...
    procedure DoExit; override;
...



procedure TCustomMaskEdit.DoExit;
begin
  //First give OnExit a change to prevent a EDBEditError
  inherited DoExit;
    ValidateEdit;
end;


Now there is a problem.
If you drop a TMaskEdit on a form, set the mask and set the text to
something that will not validate (e.g leave text empty), then an
exception is raised as soon as you start the program en the program is
killed, you never get to see the form.
If you set the mask at runtime and then set an invalid text, no
exception is raised until the user (enters and) leaves the control
(this is as it should be).

>From the backtrace I can see that DoExit is called.
This happens after the form's OnFromCreate, OnFormShow and OnActivate event.
It seems that the control somehow looses focus in the create -->
"actually show on the screen" process

This (raising the exception at this stage) is unwanted behaviour, and
i'm not sure how to prevent it.
I tried checking for csLoading in ComponentState
( if not (csLoading in ComponentState) then ) , but it is not.

What check should I perform in oreder to not call ValidateEdit in this case?
I'm kind of stuck here.

Thanks,

Bart



More information about the Lazarus mailing list