[lazarus] I got tired of waiting for a TMaskedEdit

Tony Maro tony at maro.net
Wed Apr 16 02:59:20 EDT 2003


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;

Despite the fact that the section that assigns the OnKeyUp event is
supposed to be checking to see if we're csDesigning, as soon as you drop
this component on a form, it affects the OnKeyUp event of the form,
changing it to "<unpublished>".

Now, I don't plan on using this code later, because of the changes
discussed, but it illustrates the problem I'm having.

This is a fresh CVS download of Lazarus from a few hours ago.

-Tony






More information about the Lazarus mailing list