I am trying to create a mask in a EditField to format fields while typing.
The format would be "(XX) XXXX - XXXX" for a phone number
I have used WhenAction() "<<=", but when press backspace, delete or arrows (left and right), the cursor's position goes away.
Then I tried to override the Ctrl's Key and filter that keys but they seem to not accept K_BACKSPACE or K_DELETE.
Would be great a function like SetFilter(). "SetMask()"?!
It would be usefull for EditDate too. "XX/XX/XXXX"
unodgs Messages: 1363 Registered: November 2005 Location: Poland
This is not possible yet. We were thinking about extending Convert interface (each edit uses it) that would allow to do that. I don't know when it'll be done as this change would cause backward compatibility problems.
From the other side upp prefers allowing the user to input any string - (keyboard filtered is acceptable) and to display immediate error (edit changes color of the background to red) when edit's data is not correct (you just pass ErrorValue to edit in your callback) and display detailed error message when dialog OK button is pressed. Just override bool Accept() of your control to display your own messages.