[lazarus] Problems with maskedit

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Sep 9 07:52:51 EDT 2003


On Mon, 08 Sep 2003 15:29:37 -0500
Tony Maro <tony at maro.net> wrote:

> It didn't used to do this until I updated Lazarus about a month ago.  I 
> didn't notice the problem right away.
> 
> Create a new project.
> Drop a maskedit on it.
> Set the mask to something like "00/00/0000"
> Set the visible property of the maskedit to false
> Drop a button on the form
> Add the following code to the onclick:
> 
>   MaskEdit1.Text := '05/06/2003';
>   MaskEdit1.Visible := True;
> 
> Run the app.
> When you click the button the maskedit appears, but does not have any 
> contents.
> Click the button again, and the contents appear.
> Any "text" property set before it's visible (and this includes when it's 
> to appear on a modal form) won't appear.  Once it's been created and 
> displayed once, you can hide, change and reshow to your hearts content 
> without problem.  It's that first time that it doesn't work right.

Just follow the Text property with find declaration and wou will see, that
maskedit uses SetTextBuf and this does not do anything, unless the Handle is
created. I fixed maskedit to use 'inherited Text' if no handle is allocated.

But if I remember right, you implemented maskedit. So maybe you can fix
another bug:
Doing the above steps resulted for me in MaskEdit1.Text='05-__-____'.


Mattias






More information about the Lazarus mailing list