[lazarus] I got tired of waiting for a TMaskedEdit
Mattias Gaertner
nc-gaertnma at netcologne.de
Wed Apr 16 03:11:26 EDT 2003
On Wed, 16 Apr 2003 09:25:19 +0200
Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:
> On 16 Apr 2003 02:17:32 -0500
> Tony Maro <tony at maro.net> wrote:
>
> > On Wed, 2003-04-16 at 01:57, Mattias Gaertner wrote:
> > > On 16 Apr 2003 01:41:44 -0500
> > > Tony Maro <tony at maro.net> wrote:
> > >
> > > > I've noticed that the csDesigning check doesn't seem to work
> > > > anymore. Is there a bug in Lazarus or the LCL that breaks this? I
> > > > can't get the designing check to work in anything I do...
> > >
> > > It works for me. When/Where do you check csDesigning?
> > >
> >
> > Well, the mask.pp is pretty complex in that and may have a bug, however
> > the help system component I'm working on is simple.
> >
> > constructor THelpSystem.create(AOwner: TComponent);
> > begin
> > // squeeze myself into the form's OnKeyUp event
> > // without ignoring anything already set there...
> > FForm := nil;
> > FOldKeyUp := nil;
> > FItems := TStringList.Create;
> >
> > if not(csDesigning in componentstate) then begin
> > if AOwner is TForm then begin
> > FForm := AOwner as TForm;
> > if assigned(FForm.OnKeyUp) then begin
> > FOldKeyUP := FForm.OnKeyUp;
> > end;
> > FForm.OnKeyUP := @FormKEYUP;
> > FForm.KeyPreview := True;
> > end;
> > end;
> >
> > inherited create(AOwner);
> > end;
>
> csDesigning is copied from its owner in the constructor of TComponent.
> Before the 'inherited Create' you can use this:
>
> if (Owner<>nil) and not (csDesigning in Owner.componentstate) then begin
Sorry, I ment AOwner.
Mattias
More information about the Lazarus
mailing list