Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » LineEdit, EditFields, DocEdit » What is the best way to create a mask in a editfield.
What is the best way to create a mask in a editfield. [message #12948] Fri, 30 November 2007 09:32 Go to next message
chico is currently offline  chico
Messages: 1
Registered: November 2007
Junior Member
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"
Re: What is the best way to create a mask in a editfield. [message #12949 is a reply to message #12948] Fri, 30 November 2007 10:13 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

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.
Re: What is the best way to create a mask in a editfield. [message #12994 is a reply to message #12949] Tue, 04 December 2007 10:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11835
Registered: November 2005
Ultimate Member
Perhaps we could also consider some "formatted edit field" special widget... Perhaps better defined than trying to bend Convert interface....
Re: What is the best way to create a mask in a editfield. [message #23766 is a reply to message #12994] Fri, 20 November 2009 10:36 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 307
Registered: July 2009
Senior Member
luzr wrote on Tue, 04 December 2007 10:50

Perhaps we could also consider some "formatted edit field" special widget...


Is this idea still alive or already dead?


Re: What is the best way to create a mask in a editfield. [message #23872 is a reply to message #23766] Sun, 29 November 2009 23:35 Go to previous message
mirek is currently offline  mirek
Messages: 11835
Registered: November 2005
Ultimate Member
Zbych wrote on Fri, 20 November 2009 04:36

luzr wrote on Tue, 04 December 2007 10:50

Perhaps we could also consider some "formatted edit field" special widget...


Is this idea still alive or already dead?



No progress so far. Perhaps this kind of EditField behaviour is not really needed.

Mirek
Previous Topic: EditString and QTF
Next Topic: How to trim leading and trailing spaces in EditString?
Goto Forum:
  


Current Time: Tue Apr 23 06:49:41 CEST 2019

Total time taken to generate the page: 0.01184 seconds