Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-09

Problems with maskedit

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to Tony Maro: It didn't used to do this until I updated Lazarus about a month ago. I didn't notice the…
Show quoted text 21 lines
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

Reply by email

Tony Maro

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.

Tony Maro Systems Consultant The Maro Group (256) 337-5759 http://www.maro.net/

Reply by email