Mask corruption in DBEdit
Original Reporter info from Mantis: luizamerico
-
Reporter name: Luiz Americo
Original Reporter info from Mantis: luizamerico
- Reporter name: Luiz Americo
Description:
In a DBEdit with a mask set to 99/99 the mask is corrupted after the following steps (See the attached demo):
1) The dataset is closed.
* The Masked DBEdit shows (__/__)
2) The dataset is open and an empty record is added
* The Masked DBEdit shows (_____)
* This occurs because TDBEdit.DataChange set EditText with an empty string ("")
3) Set the focus to the Masked DBEdit
* The Masked DBEdit shows (__/__)
* This occurs because Clear is called through WMSetFocus -> Reset -> SetText
3) Set the focus to the Normal DBEdit and add some random value. Set focus again to Masked DBEdit
* The Masked DBEdit shows (_____)
* Is not possible to add values in the third position (where should be /) but after loosing focus an exception will occur: "The current text does not match the mask"
* This occurs because WMSetFocus calls Reset only when not Editing
The attached patch fixes the issue. Although i'm not sure if is correct or if there's another bug somewhere else.
Mantis conversion info:
- Mantis ID: 14832
- OS: Windows
- OS Build: XP
- Platform: i386
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 22323 (#377d707a)
- Target version: 1.0.0
- LazTarget: 1.0