-# 11/23/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o Updated for wx namespace
-#
-# 11/26/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o the three libraries below all have not been hit by the
-# wx renamer.
-#
-# 12/09/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o A few changes to correct my own mistakes earlier :-).
-#
-# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o wxMaskedTextCtrl -> MaskedTextCtrl
-# o wxMaskedComboBox -> MaskedComboBox
-# o wxIpAddrCtrl -> IpAddrCtrl
-# o wxMaskedNumCtrl -> MaskedNumCtrl
-# o wxTimeCtrl -> TimeCtrl
-# o wxScrolledPanel -> ScrolledPanel
-#
import string
import sys
label = wx.StaticText( self, -1, """\
All these controls have been created by passing a single parameter, the autoformat code,
-and use the factory class wxMaskedCtrl with its default controlType.
+and use the factory class MaskedCtrl with its default controlType.
The maskededit module contains an internal dictionary of types and formats (autoformats).
Many of these already do complicated validation; To see some examples, try
29 Feb 2002 vs. 2004 for the date formats, or email address validation.
for autoformat, desc in med.autoformats:
grid.Add( wx.StaticText( self, -1, desc), 0, wx.ALIGN_LEFT )
grid.Add( wx.StaticText( self, -1, autoformat), 0, wx.ALIGN_LEFT )
- grid.Add( mctl.wxMaskedCtrl( self, -1, "",
+ grid.Add( mctl.MaskedCtrl( self, -1, "",
autoformat = autoformat,
demo = True,
name = autoformat),
with auto-select:""")
# Create this one using factory function:
- statename = mctl.wxMaskedCtrl( self, -1, med.state_names[0],
+ statename = mctl.MaskedCtrl( self, -1, med.state_names[0],
controlType = mctl.controlTypes.MASKEDCOMBO,
choices = med.state_names,
autoformat="USSTATENAME",
Choices for each side of the fraction can
be selected with PageUp/Down:""")
- fraction = mctl.wxMaskedCtrl( self, -1, "",
+ fraction = mctl.MaskedCtrl( self, -1, "",
controlType = mctl.MASKEDCOMBO,
choices = choices,
choiceRequired = True,
Programmatically set
choice sets:""")
self.list_selector = wx.ComboBox(self, -1, '', choices = ['list1', 'list2', 'list3'])
- self.dynamicbox = mctl.wxMaskedCtrl( self, -1, ' ',
+ self.dynamicbox = mctl.MaskedCtrl( self, -1, ' ',
controlType = mctl.controlTypes.MASKEDCOMBO,
mask = 'XXXX',
formatcodes = 'F_',
label_ipaddr3 = wx.StaticText( self, -1, """\
A control with restricted legal values:
10. (1|2) . (129..255) . (0..255)""")
- ipaddr3 = mctl.wxMaskedCtrl( self, -1,
+ ipaddr3 = mctl.MaskedCtrl( self, -1,
controlType = mctl.controlTypes.IPADDR,
mask=" 10. #.###.###")
ipaddr3.SetFieldParameters(0, validRegex="1|2",validRequired=False ) # requires entry to match or not allowed
if __name__ == "__main__":
import sys,os
import run
- run.main(['', os.path.basename(sys.argv[0])])
+ run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])