I would be happy to help with this, if I can. Send me code to test, or send
me what you've got and assign me a function or two.
Regards,
Jeff Childers
···
-----Original Message-----
From: Jason Hihn [mailto:jhihn@paytimepayroll.com]
Sent: Wednesday, January 29, 2003 1:34 PM
To: wxPython-users@lists.wxwindows.org
Subject: RE: [wxPython-users] Masked edits?
def SetFormatByRegExp(self, format): # r'\(\d\d\d\)\d\d\d-\d\d\d'
def SetFormatByString(self, format): # (###)###-####
def SetFormatAsCurrency(self, format): # ###,###.##;-;[red]###,###.##
def SetCurrencyDecimal(self, ch): ch='.' or ','; only valid when
SetFormatAsCurrency has been called.
def SetFormatByPrintf(self, format): # (%03d)%03d-%04d
-----Original Message-----
From: Magnus Lycka [mailto:magnus@thinkware.se]
Sent: Wednesday, January 29, 2003 1:15 PM
To: wxPython-users@lists.wxwindows.org
Subject: RE: [wxPython-users] Masked edits?
At 16:21 2003-01-29 +0100, Magnus Lycka wrote:
At 10:10 2003-01-28 -0800, Donnal Walter wrote:
What else would we need besides # for digit?
I think it's a good idea to avoid reinventing the wheel.
Actually, considering what I just said, I feel that there
are two natural forms of syntax for edit masks. One is
string formatting, and the other is regular expressions.
Why should programmers have to learn a third way of saying
more or less the same thing?
Rather than: Format='(###)###-####' I would suggest that we
either write Format='(%3i)%3i-%4i' or
Format=r'\(\d\d\d\)\d\d\d-\d\d\d'
I realize that RE and format strings are different from edit
masks, but at least we won't have to invent so much, and
programmers won't have yet another syntax to learn. One could
actually imagine reusing the strptime syntax as well, it fits
with string syntax.
I guess the regular expression syntax is the most versitile
of these though. We have \d for digit and \w for alphanumeric.
If we want to be able to enter floats, we can type
Format = r'-?\d+\.\d*' only letters Format=r'[A-Za-z]*' and
so on.
One thing to consider though: Don't forget that not all people
use US ASCII letters, or decimal points. (Some countries actually
follow the ISO standard...)
--
Magnus Lycka, Thinkware AB
Alvans vag 99, SE-907 50 UMEA, SWEDEN
phone: int+46 70 582 80 65, fax: int+46 70 612 80 65
http://www.thinkware.se/ mailto:magnus@thinkware.se
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org