From d4b73b1b8e585418459362c9bf9173aa21da8c41 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 22 Dec 2003 19:09:54 +0000 Subject: [PATCH] More lib and demo patches to drop the wx prefix (Jeff has been busy!) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24965 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/demo/MaskedEditControls.py | 65 ++-- wxPython/demo/infoframe.py | 12 +- wxPython/demo/wxEditor.py | 16 +- wxPython/demo/wxIntCtrl.py | 24 +- wxPython/demo/wxKeyEvents.py | 8 +- wxPython/demo/wxListCtrl.py | 19 +- wxPython/demo/wxMVCTree.py | 14 +- wxPython/demo/wxMaskedNumCtrl.py | 20 +- wxPython/demo/wxMultiSash.py | 10 +- wxPython/demo/wxPopupControl.py | 14 +- wxPython/demo/wxPyColourChooser.py | 15 +- wxPython/demo/wxRightTextCtrl.py | 15 +- wxPython/demo/wxScrolledPanel.py | 18 +- wxPython/demo/wxTimeCtrl.py | 21 +- wxPython/wx/lib/colourchooser/__init__.py | 13 +- wxPython/wx/lib/colourchooser/canvas.py | 11 +- wxPython/wx/lib/colourchooser/intl.py | 10 +- wxPython/wx/lib/colourchooser/pycolourbox.py | 11 +- .../wx/lib/colourchooser/pycolourchooser.py | 23 +- .../wx/lib/colourchooser/pycolourslider.py | 11 +- wxPython/wx/lib/colourchooser/pypalette.py | 20 +- wxPython/wx/lib/editor/__init__.py | 6 +- wxPython/wx/lib/editor/editor.py | 8 +- wxPython/wx/lib/grids.py | 46 ++- wxPython/wx/lib/imagebrowser.py | 2 +- wxPython/wx/lib/infoframe.py | 14 +- wxPython/wx/lib/intctrl.py | 40 ++- wxPython/wx/lib/maskedctrl.py | 46 +-- wxPython/wx/lib/maskededit.py | 327 +++++++++--------- wxPython/wx/lib/maskednumctrl.py | 113 +++--- wxPython/wx/lib/mixins/grid.py | 8 +- wxPython/wx/lib/mixins/listctrl.py | 9 +- wxPython/wx/lib/multisash.py | 40 ++- wxPython/wx/lib/mvctree.py | 69 ++-- wxPython/wx/lib/popupctl.py | 13 +- wxPython/wx/lib/rightalign.py | 6 +- wxPython/wx/lib/scrolledpanel.py | 12 +- wxPython/wx/lib/timectrl.py | 101 +++--- wxPython/wx/tools/dbg.py | 18 +- wxPython/wx/tools/img2img.py | 22 +- wxPython/wx/tools/img2png.py | 17 +- wxPython/wx/tools/img2py.py | 39 ++- wxPython/wx/tools/img2xpm.py | 17 +- .../lib/colourchooser/pycolourchooser.py | 2 +- wxPython/wxPython/lib/editor/__init__.py | 2 +- wxPython/wxPython/lib/editor/editor.py | 2 +- wxPython/wxPython/lib/grids.py | 4 +- wxPython/wxPython/lib/infoframe.py | 4 +- wxPython/wxPython/lib/intctrl.py | 6 +- wxPython/wxPython/lib/maskedctrl.py | 2 +- wxPython/wxPython/lib/maskededit.py | 10 +- wxPython/wxPython/lib/maskednumctrl.py | 4 +- wxPython/wxPython/lib/mixins/grid.py | 2 +- wxPython/wxPython/lib/mixins/listctrl.py | 4 +- wxPython/wxPython/lib/multisash.py | 6 +- wxPython/wxPython/lib/mvctree.py | 8 +- wxPython/wxPython/lib/plot.py | 22 ++ wxPython/wxPython/lib/popupctl.py | 5 +- wxPython/wxPython/lib/rightalign.py | 2 +- wxPython/wxPython/lib/scrolledpanel.py | 2 +- wxPython/wxPython/lib/timectrl.py | 2 +- wxPython/wxPython/lib/wxPlotCanvas.py | 13 + 62 files changed, 865 insertions(+), 580 deletions(-) create mode 100644 wxPython/wxPython/lib/plot.py create mode 100644 wxPython/wxPython/lib/wxPlotCanvas.py diff --git a/wxPython/demo/MaskedEditControls.py b/wxPython/demo/MaskedEditControls.py index 9ccce09c3e..a642ca5b6e 100644 --- a/wxPython/demo/MaskedEditControls.py +++ b/wxPython/demo/MaskedEditControls.py @@ -11,6 +11,15 @@ # # 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 @@ -31,7 +40,7 @@ class demoMixin: mask = wx.StaticText( self, -1, "Mask Value" ) formatcode = wx.StaticText( self, -1, "Format" ) regex = wx.StaticText( self, -1, "Regexp Validator(opt.)" ) - ctrl = wx.StaticText( self, -1, "wxMaskedTextCtrl" ) + ctrl = wx.StaticText( self, -1, "MaskedTextCtrl" ) description.SetFont( wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD)) mask.SetFont( wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD)) @@ -54,7 +63,7 @@ class demoMixin: sizer.Add( wx.StaticText( self, -1, control[4]) ) if control in controls: - newControl = med.wxMaskedTextCtrl( self, -1, "", + newControl = med.MaskedTextCtrl( self, -1, "", mask = control[1], excludeChars = control[2], formatcodes = control[3], @@ -85,9 +94,9 @@ class demoMixin: #---------------------------------------------------------------------------- -class demoPage1(scroll.wxScrolledPanel, demoMixin): +class demoPage1(scroll.ScrolledPanel, demoMixin): def __init__(self, parent, log): - scroll.wxScrolledPanel.__init__(self, parent, -1) + scroll.ScrolledPanel.__init__(self, parent, -1) self.sizer = wx.BoxSizer( wx.VERTICAL ) self.editList = [] @@ -157,10 +166,10 @@ Smith, Jones, Williams). Signs on numbers can be toggled with the minus key. self.changeControlParams( event, "fillChar", '?', ' ' ) -class demoPage2(scroll.wxScrolledPanel, demoMixin): +class demoPage2(scroll.ScrolledPanel, demoMixin): def __init__( self, parent, log ): self.log = log - scroll.wxScrolledPanel.__init__( self, parent, -1 ) + scroll.ScrolledPanel.__init__( self, parent, -1 ) self.sizer = wx.BoxSizer( wx.VERTICAL ) label = wx.StaticText( self, -1, """\ @@ -202,15 +211,15 @@ Many of these already do complicated validation; To see some examples, try self.SetupScrolling() -class demoPage3(scroll.wxScrolledPanel, demoMixin): +class demoPage3(scroll.ScrolledPanel, demoMixin): def __init__(self, parent, log): self.log = log - scroll.wxScrolledPanel.__init__(self, parent, -1) + scroll.ScrolledPanel.__init__(self, parent, -1) self.sizer = wx.BoxSizer( wx.VERTICAL ) self.editList = [] label = wx.StaticText( self, -1, """\ -Here wxMaskedTextCtrls that have default values. The states +Here MaskedTextCtrls that have default values. The states control has a list of valid values, and the unsigned integer has a legal range specified. """) @@ -248,10 +257,10 @@ has a legal range specified. self.changeControlParams( event, "validRequired", True, False ) -class demoPage4(scroll.wxScrolledPanel, demoMixin): +class demoPage4(scroll.ScrolledPanel, demoMixin): def __init__( self, parent, log ): self.log = log - scroll.wxScrolledPanel.__init__( self, parent, -1 ) + scroll.ScrolledPanel.__init__( self, parent, -1 ) self.sizer = wx.BoxSizer( wx.VERTICAL ) label = wx.StaticText( self, -1, """\ @@ -269,7 +278,7 @@ Page Up and Shift-Up arrow will similarly cycle backwards through the list. description = wx.StaticText( self, -1, "Description" ) autofmt = wx.StaticText( self, -1, "AutoFormat Code" ) fields = wx.StaticText( self, -1, "Field Objects" ) - ctrl = wx.StaticText( self, -1, "wxMaskedTextCtrl" ) + ctrl = wx.StaticText( self, -1, "MaskedTextCtrl" ) description.SetFont( wx.Font( 9, wx.SWISS, wx.NORMAL, wx.BOLD ) ) autofmt.SetFont( wx.Font( 9, wx.SWISS, wx.NORMAL, wx.BOLD ) ) @@ -292,7 +301,7 @@ Page Up and Shift-Up arrow will similarly cycle backwards through the list. grid.Add( wx.StaticText( self, -1, "Restricted Area Code"), 0, wx.ALIGN_LEFT ) grid.Add( wx.StaticText( self, -1, autoformat), 0, wx.ALIGN_LEFT ) grid.Add( wx.StaticText( self, -1, fieldsLabel), 0, wx.ALIGN_LEFT ) - grid.Add( med.wxMaskedTextCtrl( self, -1, "", + grid.Add( med.MaskedTextCtrl( self, -1, "", autoformat = autoformat, fields = fieldsDict, demo = True, @@ -305,7 +314,7 @@ Page Up and Shift-Up arrow will similarly cycle backwards through the list. {1: Field(choices=[ "03", "04", "05"], choiceRequired=True)}""" - exp = med.wxMaskedTextCtrl( self, -1, "", + exp = med.MaskedTextCtrl( self, -1, "", autoformat = autoformat, fields = fieldsDict, demo = True, @@ -324,7 +333,7 @@ Page Up and Shift-Up arrow will similarly cycle backwards through the list. 1: Field(choices=["1234", "5678"], choiceRequired=False)}""" autoformat = "USZIPPLUS4" - zip = med.wxMaskedTextCtrl( self, -1, "", + zip = med.MaskedTextCtrl( self, -1, "", autoformat = autoformat, fields = fieldsDict, demo = True, @@ -341,15 +350,15 @@ Page Up and Shift-Up arrow will similarly cycle backwards through the list. self.SetupScrolling() -class demoPage5(scroll.wxScrolledPanel, demoMixin): +class demoPage5(scroll.ScrolledPanel, demoMixin): def __init__( self, parent, log ): self.log = log - scroll.wxScrolledPanel.__init__( self, parent, -1 ) + scroll.ScrolledPanel.__init__( self, parent, -1 ) self.sizer = wx.BoxSizer( wx.VERTICAL ) labelMaskedCombos = wx.StaticText( self, -1, """\ -These are some examples of wxMaskedComboBox:""") +These are some examples of MaskedComboBox:""") labelMaskedCombos.SetForegroundColour( "Blue" ) @@ -357,7 +366,7 @@ These are some examples of wxMaskedComboBox:""") A state selector; only "legal" values can be entered:""") - statecode = med.wxMaskedComboBox( self, -1, med.states[0], + statecode = med.MaskedComboBox( self, -1, med.states[0], choices = med.states, autoformat="USSTATE") @@ -405,7 +414,7 @@ A masked ComboBox to validate text from a list of numeric codes:""") choices = ["91", "136", "305", "4579"] - code = med.wxMaskedComboBox( self, -1, choices[0], + code = med.MaskedComboBox( self, -1, choices[0], choices = choices, choiceRequired = True, formatcodes = "F_r", @@ -428,16 +437,16 @@ choice sets:""") labelIpAddrs = wx.StaticText( self, -1, """\ -Here are some examples of wxIpAddrCtrl, a control derived from wxMaskedTextCtrl:""") +Here are some examples of IpAddrCtrl, a control derived from MaskedTextCtrl:""") labelIpAddrs.SetForegroundColour( "Blue" ) label_ipaddr1 = wx.StaticText( self, -1, "An empty control:") - ipaddr1 = med.wxIpAddrCtrl( self, -1, style = wx.TE_PROCESS_TAB ) + ipaddr1 = med.IpAddrCtrl( self, -1, style = wx.TE_PROCESS_TAB ) label_ipaddr2 = wx.StaticText( self, -1, "A restricted mask:") - ipaddr2 = med.wxIpAddrCtrl( self, -1, mask=" 10. 1.109.###" ) + ipaddr2 = med.IpAddrCtrl( self, -1, mask=" 10. 1.109.###" ) label_ipaddr3 = wx.StaticText( self, -1, """\ @@ -454,22 +463,22 @@ A control with restricted legal values: labelNumerics = wx.StaticText( self, -1, """\ -Here are some useful configurations of a wxMaskedTextCtrl for integer and floating point input that still treat -the control as a text control. (For a true numeric control, check out the wxMaskedNumCtrl class!)""") +Here are some useful configurations of a MaskedTextCtrl for integer and floating point input that still treat +the control as a text control. (For a true numeric control, check out the MaskedNumCtrl class!)""") labelNumerics.SetForegroundColour( "Blue" ) label_intctrl1 = wx.StaticText( self, -1, """\ An integer entry control with shifting insert enabled:""") - self.intctrl1 = med.wxMaskedTextCtrl(self, -1, name='intctrl', mask="#{9}", formatcodes = '_-,F>') + self.intctrl1 = med.MaskedTextCtrl(self, -1, name='intctrl', mask="#{9}", formatcodes = '_-,F>') label_intctrl2 = wx.StaticText( self, -1, """\ Right-insert integer entry:""") - self.intctrl2 = med.wxMaskedTextCtrl(self, -1, name='intctrl', mask="#{9}", formatcodes = '_-,Fr') + self.intctrl2 = med.MaskedTextCtrl(self, -1, name='intctrl', mask="#{9}", formatcodes = '_-,Fr') label_floatctrl = wx.StaticText( self, -1, """\ A floating point entry control with right-insert for ordinal:""") - self.floatctrl = med.wxMaskedTextCtrl(self, -1, name='floatctrl', mask="#{9}.#{2}", formatcodes="F,_-R", useParensForNegatives=False) + self.floatctrl = med.MaskedTextCtrl(self, -1, name='floatctrl', mask="#{9}.#{2}", formatcodes="F,_-R", useParensForNegatives=False) self.floatctrl.SetFieldParameters(0, formatcodes='r<', validRequired=True) # right-insert, require explicit cursor movement to change fields self.floatctrl.SetFieldParameters(1, defaultValue='00') # don't allow blank fraction diff --git a/wxPython/demo/infoframe.py b/wxPython/demo/infoframe.py index aeea24411f..3d4312e82f 100644 --- a/wxPython/demo/infoframe.py +++ b/wxPython/demo/infoframe.py @@ -12,7 +12,7 @@ import sys import wx -import wx.lib.infoframe as infoframe +import wx.lib.infoframe #---------------------------------------------------------------------- @@ -82,14 +82,14 @@ class MyFrame(wx.Frame): #---------------------------------------------------------------------- -overview = infoframe.__doc__ +overview = wx.lib.infoframe.__doc__ def runTest(frame, nb, log): """ This method is used by the wxPython Demo Framework for integrating this demo with the rest. """ - win = MyFrame(infoframe.wxPyInformationalMessagesFrame()) + win = MyFrame(wx.lib.infoframe.PyInformationalMessagesFrame()) frame.otherWin = win win.Show(1) @@ -113,7 +113,7 @@ if __name__ == "__main__": ## output.SetOtherMenuBar(menubar,menuname="Output") ## def OnClose(self,event): -## if isinstance(sys.stdout,wxPyInformationalMessagesFrame): +## if isinstance(sys.stdout,wx.lib.infoframe.PyInformationalMessagesFrame): ## sys.stdout.close() ## self.Destroy() @@ -121,7 +121,7 @@ if __name__ == "__main__": # Override the default output window and point it to the # custom class. - outputWindowClass = infoframe.wxPyInformationalMessagesFrame + outputWindowClass = wx.lib.infoframe.PyInformationalMessagesFrame def OnInit(self): @@ -142,7 +142,7 @@ if __name__ == "__main__": self.SetTopWindow(frame) # Associate the frame with stdout. - if isinstance(sys.stdout, infoframe.wxPyInformationalMessagesFrame): + if isinstance(sys.stdout, wx.lib.infoframe.PyInformationalMessagesFrame): sys.stdout.SetParent(frame) print "Starting.\n", diff --git a/wxPython/demo/wxEditor.py b/wxPython/demo/wxEditor.py index 96e827afcb..904dc3f144 100644 --- a/wxPython/demo/wxEditor.py +++ b/wxPython/demo/wxEditor.py @@ -6,6 +6,10 @@ # # o editor lib hasn't been hit by the renamer yet. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxEditor -> Editor +# import wx import wx.lib.editor as editor @@ -14,7 +18,7 @@ import wx.lib.editor as editor def runTest(frame, nb, log): win = wx.Panel(nb, -1) - ed = editor.wxEditor(win, -1, style=wx.SUNKEN_BORDER) + ed = editor.Editor(win, -1, style=wx.SUNKEN_BORDER) box = wx.BoxSizer(wx.VERTICAL) box.Add(ed, 1, wx.ALL|wx.GROW, 1) win.SetSizer(box) @@ -22,7 +26,7 @@ def runTest(frame, nb, log): ed.SetText(["", "This is a simple text editor, the class name is", - "wxEditor. Type a few lines and try it out.", + "Editor. Type a few lines and try it out.", "", "It uses Windows-style key commands that can be overridden by subclassing.", "Mouse select works. Here are the key commands:", @@ -44,19 +48,19 @@ def runTest(frame, nb, log): overview = """ -The wxEditor class implements a simple text editor using wxPython. You -can create a custom editor by subclassing wxEditor. Even though much of +The Editor class implements a simple text editor using wxPython. You +can create a custom editor by subclassing Editor. Even though much of the editor is implemented in Python, it runs surprisingly smoothly on normal hardware with small files. How to use it ------------- -The demo code (demo/wxEditor.py) shows how to use wxEditor as a simple text +The demo code (demo/Editor.py) shows how to use Editor as a simple text box. Use the SetText() and GetText() methods to set or get text from the component; these both use a list of strings. The samples/FrogEdit directory has an example of a simple text editor -application that uses the wxEditor component. +application that uses the Editor component. Subclassing ----------- diff --git a/wxPython/demo/wxIntCtrl.py b/wxPython/demo/wxIntCtrl.py index 5a18b78583..27b968c5a2 100644 --- a/wxPython/demo/wxIntCtrl.py +++ b/wxPython/demo/wxIntCtrl.py @@ -11,9 +11,13 @@ # # o All issues corrected # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxIntCtrl -> IntCtrl +# import wx -import wx.lib.intctrl as intctrl +import wx.lib.intctrl #---------------------------------------------------------------------- @@ -25,11 +29,11 @@ class TestPanel( wx.Panel ): panel = wx.Panel( self, -1 ) self.set_min = wx.CheckBox( panel, -1, "Set minimum value:" ) - self.min = intctrl.wxIntCtrl( panel, size=( 50, -1 ) ) + self.min = wx.lib.intctrl.IntCtrl( panel, size=( 50, -1 ) ) self.min.Enable( False ) self.set_max = wx.CheckBox( panel, -1, "Set maximum value:" ) - self.max = intctrl.wxIntCtrl( panel, size=( 50, -1 ) ) + self.max = wx.lib.intctrl.IntCtrl( panel, size=( 50, -1 ) ) self.max.Enable( False ) self.limit_target = wx.CheckBox( panel, -1, "Limit control" ) @@ -37,7 +41,7 @@ class TestPanel( wx.Panel ): self.allow_long = wx.CheckBox( panel, -1, "Allow long integers" ) label = wx.StaticText( panel, -1, "Resulting integer control:" ) - self.target_ctl = intctrl.wxIntCtrl( panel ) + self.target_ctl = wx.lib.intctrl.IntCtrl( panel ) grid = wx.FlexGridSizer( 0, 2, 0, 0 ) grid.Add( self.set_min, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) @@ -74,9 +78,9 @@ class TestPanel( wx.Panel ): self.Bind(wx.EVT_CHECKBOX, self.OnSetAllowNone, self.allow_none) self.Bind(wx.EVT_CHECKBOX, self.OnSetAllowLong, self.allow_long) - self.Bind(intctrl.EVT_INT, self.SetTargetMinMax, self.min) - self.Bind(intctrl.EVT_INT, self.SetTargetMinMax, self.max) - self.Bind(intctrl.EVT_INT, self.OnTargetChange, self.target_ctl) + self.Bind(wx.lib.intctrl.EVT_INT, self.SetTargetMinMax, self.min) + self.Bind(wx.lib.intctrl.EVT_INT, self.SetTargetMinMax, self.max) + self.Bind(wx.lib.intctrl.EVT_INT, self.OnTargetChange, self.target_ctl) def OnSetMin( self, event ): @@ -146,13 +150,13 @@ def runTest( frame, nb, log ): overview = """

-wxIntCtrl provides a control that takes and returns integers as +IntCtrl provides a control that takes and returns integers as value, and provides bounds support and optional value limiting.

-Here's the API for wxIntCtrl: +Here's the API for IntCtrl:

-    wxIntCtrl(
+    IntCtrl(
          parent, id = -1,
          value = 0,
          min = None,
diff --git a/wxPython/demo/wxKeyEvents.py b/wxPython/demo/wxKeyEvents.py
index ee2259c061..c992865219 100644
--- a/wxPython/demo/wxKeyEvents.py
+++ b/wxPython/demo/wxKeyEvents.py
@@ -6,6 +6,10 @@
 #
 # o lib.mixins.listctrl needs wx renamer applied.
 # 
+# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxListCtrlAutoWidthMixin -> ListCtrlAutoWidthMixin 
+#
 
 import  wx
 import  wx.lib.mixins.listctrl  as  listmix
@@ -204,12 +208,12 @@ class KeySink(wx.Window):
 
 #----------------------------------------------------------------------
 
-class KeyLog(wx.ListCtrl, listmix.wxListCtrlAutoWidthMixin):
+class KeyLog(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
 
     def __init__(self, parent):
         wx.ListCtrl.__init__(self, parent, -1,
                             style = wx.LC_REPORT|wx.LC_VRULES|wx.LC_HRULES)
-        listmix.wxListCtrlAutoWidthMixin.__init__(self)
+        listmix.ListCtrlAutoWidthMixin.__init__(self)
 
         self.InsertColumn(0, "Event Type")
         self.InsertColumn(1, "Key Name")
diff --git a/wxPython/demo/wxListCtrl.py b/wxPython/demo/wxListCtrl.py
index 75412e7dd7..879bc1baa0 100644
--- a/wxPython/demo/wxListCtrl.py
+++ b/wxPython/demo/wxListCtrl.py
@@ -24,6 +24,11 @@
 # o ColumnSorterMixin implementation was broke - added event.Skip()
 #   to column click event to allow event to fall through to mixin.
 #
+# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxColumnSorterMixin -> ColumnSorterMixin
+# o wxListCtrlAutoWidthMixin -> ListCtrlAutoWidthMixin 
+#
 
 import  wx
 import  wx.lib.mixins.listctrl  as  listmix
@@ -91,14 +96,14 @@ musicdata = {
 
 #---------------------------------------------------------------------------
 
-class TestListCtrl(wx.ListCtrl, listmix.wxListCtrlAutoWidthMixin):
+class TestListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
     def __init__(self, parent, ID, pos=wx.DefaultPosition,
                  size=wx.DefaultSize, style=0):
         wx.ListCtrl.__init__(self, parent, ID, pos, size, style)
-        listmix.wxListCtrlAutoWidthMixin.__init__(self)
+        listmix.ListCtrlAutoWidthMixin.__init__(self)
 
 
-class TestListCtrlPanel(wx.Panel, listmix.wxColumnSorterMixin):
+class TestListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin):
     def __init__(self, parent, log):
         wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS)
 
@@ -126,7 +131,7 @@ class TestListCtrlPanel(wx.Panel, listmix.wxColumnSorterMixin):
         # Now that the list exists we can init the other base class,
         # see wxPython/lib/mixins/listctrl.py
         self.itemDataMap = musicdata
-        listmix.wxColumnSorterMixin.__init__(self, 3)
+        listmix.ColumnSorterMixin.__init__(self, 3)
         #self.SortListItems(0, True)
 
         self.Bind(wx.EVT_SIZE, self.OnSize)
@@ -201,11 +206,11 @@ class TestListCtrlPanel(wx.Panel, listmix.wxColumnSorterMixin):
         self.currentItem = 0
 
 
-    # Used by the wxColumnSorterMixin, see wxPython/lib/mixins/listctrl.py
+    # Used by the ColumnSorterMixin, see wxPython/lib/mixins/listctrl.py
     def GetListCtrl(self):
         return self.list
 
-    # Used by the wxColumnSorterMixin, see wxPython/lib/mixins/listctrl.py
+    # Used by the ColumnSorterMixin, see wxPython/lib/mixins/listctrl.py
     def GetSortImages(self):
         return (self.sm_dn, self.sm_up)
 
@@ -441,7 +446,7 @@ item data values.
 
 

ListCtrlAutoWidthMixin

-wxListCtrlAutoWidthMixin() +ListCtrlAutoWidthMixin()

A mix-in class that automatically resizes the last column to take up the remaining width of the ListCtrl. diff --git a/wxPython/demo/wxMVCTree.py b/wxPython/demo/wxMVCTree.py index 80301ef360..79ad083a85 100644 --- a/wxPython/demo/wxMVCTree.py +++ b/wxPython/demo/wxMVCTree.py @@ -6,6 +6,10 @@ # # o Library must be updated for this to run. # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxMVCTree -> MVCTree +# import os import sys @@ -32,12 +36,12 @@ def delitem(evt): logger.write("Delete\n") def runTest(frame, nb, log): - #f = wx.Frame(frame, -1, "wxMVCTree", (0,0), (200,500)) + #f = wx.Frame(frame, -1, "MVCTree", (0,0), (200,500)) global logger logger = log - p = tree.wxMVCTree(nb, -1) - #f = wx.Frame(frame, -1, "wxMVCTree") - #p = tree.wxMVCTree(f, -1) + p = tree.MVCTree(nb, -1) + #f = wx.Frame(frame, -1, "MVCTree") + #p = tree.MVCTree(f, -1) p.SetAssumeChildren(True) p.SetModel(tree.LateFSTreeModel(os.path.normpath(os.getcwd() + os.sep +'..'))) @@ -61,7 +65,7 @@ def runTest(frame, nb, log): overview = """\ -wxMVCTree is a control which handles hierarchical data. It is +MVCTree is a control which handles hierarchical data. It is constructed in model-view-controller architecture, so the display of that data, and the content of the data can be changed greatly without affecting the other parts. diff --git a/wxPython/demo/wxMaskedNumCtrl.py b/wxPython/demo/wxMaskedNumCtrl.py index 3b0c8cc8dd..855726b100 100644 --- a/wxPython/demo/wxMaskedNumCtrl.py +++ b/wxPython/demo/wxMaskedNumCtrl.py @@ -10,6 +10,10 @@ # # o Issues with lib corrected. # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxMaskedNumCtrl -> MaskedNumCtrl +# import string import sys @@ -27,40 +31,40 @@ class TestPanel( wx.Panel ): panel = wx.Panel( self, -1 ) header = wx.StaticText(panel, -1, """\ -This shows the various options for wxMaskedNumCtrl. +This shows the various options for MaskedNumCtrl. The controls at the top reconfigure the resulting control at the bottom. """) header.SetForegroundColour( "Blue" ) intlabel = wx.StaticText( panel, -1, "Integer width:" ) - self.integerwidth = mnum.wxMaskedNumCtrl( + self.integerwidth = mnum.MaskedNumCtrl( panel, value=10, integerWidth=2, allowNegative=False ) fraclabel = wx.StaticText( panel, -1, "Fraction width:" ) - self.fractionwidth = mnum.wxMaskedNumCtrl( + self.fractionwidth = mnum.MaskedNumCtrl( panel, value=0, integerWidth=2, allowNegative=False ) groupcharlabel = wx.StaticText( panel,-1, "Grouping char:" ) - self.groupchar = mnum.wxMaskedTextCtrl( + self.groupchar = mnum.MaskedTextCtrl( panel, -1, value=',', mask='&', excludeChars = '-()', formatcodes='F', emptyInvalid=True, validRequired=True ) decimalcharlabel = wx.StaticText( panel,-1, "Decimal char:" ) - self.decimalchar = mnum.wxMaskedTextCtrl( + self.decimalchar = mnum.MaskedTextCtrl( panel, -1, value='.', mask='&', excludeChars = '-()', formatcodes='F', emptyInvalid=True, validRequired=True ) self.set_min = wx.CheckBox( panel, -1, "Set minimum value:" ) # Create this MaskedNumCtrl using factory, to show how: - self.min = mnum.wxMaskedNumCtrl( panel, integerWidth=5, fractionWidth=2 ) + self.min = mnum.MaskedNumCtrl( panel, integerWidth=5, fractionWidth=2 ) self.min.Enable( False ) self.set_max = wx.CheckBox( panel, -1, "Set maximum value:" ) - self.max = mnum.wxMaskedNumCtrl( panel, integerWidth=5, fractionWidth=2 ) + self.max = mnum.MaskedNumCtrl( panel, integerWidth=5, fractionWidth=2 ) self.max.Enable( False ) @@ -79,7 +83,7 @@ The controls at the top reconfigure the resulting control at the bottom. font.SetWeight(wx.BOLD) label.SetFont(font) - self.target_ctl = mnum.wxMaskedNumCtrl( panel, -1, name="target control" ) + self.target_ctl = mnum.MaskedNumCtrl( panel, -1, name="target control" ) label_numselect = wx.StaticText( panel, -1, """\ Programmatically set the above diff --git a/wxPython/demo/wxMultiSash.py b/wxPython/demo/wxMultiSash.py index 7de9259c38..ce95868047 100644 --- a/wxPython/demo/wxMultiSash.py +++ b/wxPython/demo/wxMultiSash.py @@ -12,6 +12,10 @@ # # o renamer issue shelved. # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxMultiSash -> MultiSash +# import wx import wx.lib.multisash as sash @@ -76,7 +80,7 @@ class TestWindow(stc.StyledTextCtrl): def runTest(frame, nb, log): - multi = sash.wxMultiSash(nb, -1, pos = (0,0), size = (640,480)) + multi = sash.MultiSash(nb, -1, pos = (0,0), size = (640,480)) # Use this method to set the default class that will be created when # a new sash is created. The class's constructor needs 1 parameter @@ -90,9 +94,9 @@ def runTest(frame, nb, log): overview = """ -

wxMultiSash

+

MultiSash

-wxMultiSash allows the user to split a window any number of times +MultiSash allows the user to split a window any number of times either horizontally or vertically, and to close the split off windows when desired. diff --git a/wxPython/demo/wxPopupControl.py b/wxPython/demo/wxPopupControl.py index e9e369926d..d312a9319c 100644 --- a/wxPython/demo/wxPopupControl.py +++ b/wxPython/demo/wxPopupControl.py @@ -6,14 +6,18 @@ # # o Is it just me or are the graphics for the control not lining up right? # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxPopupControl -> PopupControl +# import wx import wx.lib.popupctl as pop import wx.calendar as cal -class TestDateControl(pop.wxPopupControl): +class TestDateControl(pop.PopupControl): def __init__(self,*_args,**_kwargs): - apply(pop.wxPopupControl.__init__,(self,) + _args,_kwargs) + apply(pop.PopupControl.__init__,(self,) + _args,_kwargs) self.win = wx.Window(self,-1,pos = (0,0),style = 0) self.cal = cal.CalendarCtrl(self.win,-1,pos = (0,0)) @@ -39,7 +43,7 @@ class TestDateControl(pop.wxPopupControl): date.GetYear())) evt.Skip() - # Method overridden from wxPopupControl + # Method overridden from PopupControl # This method is called just before the popup is displayed # Use this method to format any controls in the popup def FormatContent(self): @@ -82,9 +86,9 @@ def runTest(frame, nb, log): #---------------------------------------------------------------------- overview = """ -

wxPopupControl

+

PopupControl

-wxPopupControl is a class that can display a value and has a button +PopupControl is a class that can display a value and has a button that will popup another window similar to how a wxComboBox works. The popup window can contain whatever is needed to edit the value. This example uses a wxCalendarCtrl. diff --git a/wxPython/demo/wxPyColourChooser.py b/wxPython/demo/wxPyColourChooser.py index dc58529e8a..b31fe51326 100644 --- a/wxPython/demo/wxPyColourChooser.py +++ b/wxPython/demo/wxPyColourChooser.py @@ -6,6 +6,11 @@ # # o Updated URL for SF link in overview. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxPyColorChooser -> PyColorChooser +# o wxPyColourChooser -> PyColourChooser +# import wx import wx.lib.colourchooser as cc @@ -17,7 +22,7 @@ class TestColourChooser(wx.Panel): wx.Panel.__init__(self, parent, -1) self.log = log - chooser = cc.wxPyColourChooser(self, -1) + chooser = cc.PyColourChooser(self, -1) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(chooser, 0, wx.ALL, 25) @@ -33,7 +38,7 @@ def runTest(frame, nb, log): #--------------------------------------------------------------- overview = """ -The wxPyColourChooser component creates a colour chooser window +The PyColourChooser component creates a colour chooser window that is similar to the Microsoft Windows colour chooser dialog. This dialog component is drawn in a panel, and thus can be embedded inside any widget (although it cannot be resized). @@ -43,17 +48,17 @@ chooser on any platform that might have an ugly one :) How to use it ------------------------------ -The demo (demo/wxPyColourChooser.py code shows how to display +The demo (demo/PyColourChooser.py code shows how to display a colour chooser and retrieve its options. Contact and Author Info ------------------------------ -wxPyColourChooser was written and is maintained by: +PyColourChooser was written and is maintained by: Michael Gilfix -You can find the latest wxPyColourChooser code at +You can find the latest PyColourChooser code at http://sourceforge.net/projects/wxcolourchooser/. If you have any suggestions or want to submit a patch, please send it my way at: mgilfix@eecs.tufts.edu diff --git a/wxPython/demo/wxRightTextCtrl.py b/wxPython/demo/wxRightTextCtrl.py index 8fcc2bc5cf..9d28c46c79 100644 --- a/wxPython/demo/wxRightTextCtrl.py +++ b/wxPython/demo/wxRightTextCtrl.py @@ -10,7 +10,10 @@ # # o All issues resolved. # - +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxRightTextCtrl -> RightTextCtrl +# ############################################################################\ # Note: this demo has been converted, but the control is deprecated because | @@ -37,19 +40,19 @@ class TestPanel(wx.Panel): ) fgs.Add(txt) - fgs.Add(right.wxRightTextCtrl(self, -1, "", size=(75, -1))) + fgs.Add(right.RightTextCtrl(self, -1, "", size=(75, -1))) fgs.Add((10,10)) - fgs.Add(right.wxRightTextCtrl(self, -1, "123.45", size=(75, -1))) + fgs.Add(right.RightTextCtrl(self, -1, "123.45", size=(75, -1))) fgs.Add((10,10)) - fgs.Add(right.wxRightTextCtrl(self, -1, "234.56", size=(75, -1))) + fgs.Add(right.RightTextCtrl(self, -1, "234.56", size=(75, -1))) fgs.Add((10,10)) - fgs.Add(right.wxRightTextCtrl(self, -1, "345.67", size=(75, -1))) + fgs.Add(right.RightTextCtrl(self, -1, "345.67", size=(75, -1))) fgs.Add((10,10)) - fgs.Add(right.wxRightTextCtrl(self, -1, "456.78", size=(75, -1))) + fgs.Add(right.RightTextCtrl(self, -1, "456.78", size=(75, -1))) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(fgs, 0, wx.ALL, 25) diff --git a/wxPython/demo/wxScrolledPanel.py b/wxPython/demo/wxScrolledPanel.py index 7526b3caee..c9fa69e05d 100644 --- a/wxPython/demo/wxScrolledPanel.py +++ b/wxPython/demo/wxScrolledPanel.py @@ -10,6 +10,10 @@ # # o lib updated, all is well. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxScrolledPanel -> ScrolledPanel +# import wx import wx.lib.scrolledpanel as scrolled @@ -19,14 +23,14 @@ import wx.lib.scrolledpanel as scrolled text = "one two buckle my shoe three four shut the door five six pick up sticks seven eight lay them straight nine ten big fat hen" -class TestPanel(scrolled.wxScrolledPanel): +class TestPanel(scrolled.ScrolledPanel): def __init__(self, parent, log): self.log = log - scrolled.wxScrolledPanel.__init__(self, parent, -1) + scrolled.ScrolledPanel.__init__(self, parent, -1) vbox = wx.BoxSizer(wx.VERTICAL) desc = wx.StaticText(self, -1, - "wxScrolledPanel extends wxScrolledWindow, adding all " + "ScrolledPanel extends wxScrolledWindow, adding all " "the necessary bits to set up scroll handling for you.\n\n" "Here are three fixed size examples of its use. The " "demo panel for this sample is also using it -- the \nwxStaticLine" @@ -40,7 +44,7 @@ class TestPanel(scrolled.wxScrolledPanel): words = text.split() - panel1 = scrolled.wxScrolledPanel(self, -1, size=(120,300), + panel1 = scrolled.ScrolledPanel(self, -1, size=(120,300), style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER ) fgs1 = wx.FlexGridSizer(cols=2, vgap=4, hgap=4) @@ -54,9 +58,9 @@ class TestPanel(scrolled.wxScrolledPanel): panel1.SetAutoLayout(1) panel1.SetupScrolling( scroll_x=False ) - panel2 = scrolled.wxScrolledPanel(self, -1, size=(350, 40), + panel2 = scrolled.ScrolledPanel(self, -1, size=(350, 40), style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER) - panel3 = scrolled.wxScrolledPanel(self, -1, size=(200,100), + panel3 = scrolled.ScrolledPanel(self, -1, size=(200,100), style = wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER) fgs2 = wx.FlexGridSizer(cols=25, vgap=4, hgap=4) @@ -114,7 +118,7 @@ def runTest(frame, nb, log): overview = """ -wxScrolledPanel fills a "hole" in the implementation of wxScrolledWindow, +ScrolledPanel fills a "hole" in the implementation of wxScrolledWindow, providing automatic scrollbar and scrolling behavior and the tab traversal mangement that wxScrolledWindow lacks. diff --git a/wxPython/demo/wxTimeCtrl.py b/wxPython/demo/wxTimeCtrl.py index ea6a7ec727..aa5cf52762 100644 --- a/wxPython/demo/wxTimeCtrl.py +++ b/wxPython/demo/wxTimeCtrl.py @@ -11,6 +11,11 @@ # # o New binders applied. Issues still exist. # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxTimeCtrl -> TimeCtrl +# o wxScrolledPanel -> ScrolledPanel +# import wx import wx.lib.timectrl as timectl @@ -18,27 +23,27 @@ import wx.lib.scrolledpanel as scrolled #---------------------------------------------------------------------- -class TestPanel( scrolled.wxScrolledPanel ): +class TestPanel( scrolled.ScrolledPanel ): def __init__( self, parent, log ): - scrolled.wxScrolledPanel.__init__( self, parent, -1 ) + scrolled.ScrolledPanel.__init__( self, parent, -1 ) self.log = log text1 = wx.StaticText( self, -1, "12-hour format:") - self.time12 = timectl.wxTimeCtrl( self, -1, name="12 hour control" ) + self.time12 = timectl.TimeCtrl( self, -1, name="12 hour control" ) spin1 = wx.SpinButton( self, -1, wx.DefaultPosition, (-1,20), 0 ) self.time12.BindSpinButton( spin1 ) text2 = wx.StaticText( self, -1, "24-hour format:") spin2 = wx.SpinButton( self, -1, wx.DefaultPosition, (-1,20), 0 ) - self.time24 = timectl.wxTimeCtrl( + self.time24 = timectl.TimeCtrl( self, -1, name="24 hour control", fmt24hr=True, spinButton = spin2 ) text3 = wx.StaticText( self, -1, "No seconds\nor spin button:") - self.spinless_ctrl = timectl.wxTimeCtrl( + self.spinless_ctrl = timectl.TimeCtrl( self, -1, name="spinless control", display_seconds = False ) @@ -94,17 +99,17 @@ class TestPanel( scrolled.wxScrolledPanel ): self.set_bounds = wx.CheckBox( self, -1, "Set time bounds:" ) minlabel = wx.StaticText( self, -1, "minimum time:" ) - self.min = timectl.wxTimeCtrl( self, -1, name="min", display_seconds = False ) + self.min = timectl.TimeCtrl( self, -1, name="min", display_seconds = False ) self.min.Enable( False ) maxlabel = wx.StaticText( self, -1, "maximum time:" ) - self.max = timectl.wxTimeCtrl( self, -1, name="max", display_seconds = False ) + self.max = timectl.TimeCtrl( self, -1, name="max", display_seconds = False ) self.max.Enable( False ) self.limit_check = wx.CheckBox( self, -1, "Limit control" ) label = wx.StaticText( self, -1, "Resulting time control:" ) - self.target_ctrl = timectl.wxTimeCtrl( self, -1, name="new" ) + self.target_ctrl = timectl.TimeCtrl( self, -1, name="new" ) grid2 = wx.FlexGridSizer( 0, 2, 0, 0 ) grid2.Add( (20, 0), 0, wx.ALIGN_LEFT|wx.ALL, 5 ) diff --git a/wxPython/wx/lib/colourchooser/__init__.py b/wxPython/wx/lib/colourchooser/__init__.py index d9f7a146a8..ccce2e3c4c 100644 --- a/wxPython/wx/lib/colourchooser/__init__.py +++ b/wxPython/wx/lib/colourchooser/__init__.py @@ -1,10 +1,10 @@ """ -wxPyColourChooser +PyColourChooser Copyright (C) 2002 Michael Gilfix -This file is part of wxPyColourChooser. +This file is part of PyColourChooser. -This version of wxPyColourChooser is open source; you can redistribute it +This version of PyColourChooser is open source; you can redistribute it and/or modify it under the licensed terms. This program is distributed in the hope that it will be useful, @@ -16,11 +16,16 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # o 2.5 compatability update. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxPyColorChooser -> PyColorChooser +# o wxPyColourChooser -> PyColourChooser +# from pycolourchooser import * # For the American in you -wxPyColorChooser = wxPyColourChooser +PyColorChooser = PyColourChooser __all__ = [ 'canvas', diff --git a/wxPython/wx/lib/colourchooser/canvas.py b/wxPython/wx/lib/colourchooser/canvas.py index a541d8b40f..d4162f1ca8 100644 --- a/wxPython/wx/lib/colourchooser/canvas.py +++ b/wxPython/wx/lib/colourchooser/canvas.py @@ -1,10 +1,10 @@ """ -wxPyColourChooser +PyColourChooser Copyright (C) 2002 Michael Gilfix -This file is part of wxPyColourChooser. +This file is part of PyColourChooser. -This version of wxPyColourChooser is open source; you can redistribute it +This version of PyColourChooser is open source; you can redistribute it and/or modify it under the licensed terms. This program is distributed in the hope that it will be useful, @@ -16,6 +16,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # o 2.5 compatability update. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxPyColorChooser -> PyColorChooser +# o wxPyColourChooser -> PyColourChooser +# import wx diff --git a/wxPython/wx/lib/colourchooser/intl.py b/wxPython/wx/lib/colourchooser/intl.py index cfc84f1359..b10d291a34 100644 --- a/wxPython/wx/lib/colourchooser/intl.py +++ b/wxPython/wx/lib/colourchooser/intl.py @@ -1,10 +1,10 @@ """ -wxPyColourChooser +PyColourChooser Copyright (C) 2002 Michael Gilfix -This file is part of wxPyColourChooser. +This file is part of PyColourChooser. -This version of wxPyColourChooser is open source; you can redistribute it +This version of PyColourChooser is open source; you can redistribute it and/or modify it under the licensed terms. This program is distributed in the hope that it will be useful, @@ -15,8 +15,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. try: import gettext - gettext.bindtextdomain('wxpycolourchooser') - gettext.textdomain('wxpycolourchooser') + gettext.bindtextdomain('pycolourchooser') + gettext.textdomain('pycolourchooser') _ = gettext.gettext except Exception, strerror: print "Warning: Couldn't import translation function: %(str)s" %{ 'str' : strerror } diff --git a/wxPython/wx/lib/colourchooser/pycolourbox.py b/wxPython/wx/lib/colourchooser/pycolourbox.py index 0e9bf155f8..9cc9b5f3b2 100644 --- a/wxPython/wx/lib/colourchooser/pycolourbox.py +++ b/wxPython/wx/lib/colourchooser/pycolourbox.py @@ -1,10 +1,10 @@ """ -wxPyColourChooser +PyColourChooser Copyright (C) 2002 Michael Gilfix -This file is part of wxPyColourChooser. +This file is part of PyColourChooser. -This version of wxPyColourChooser is open source; you can redistribute it +This version of PyColourChooser is open source; you can redistribute it and/or modify it under the licensed terms. This program is distributed in the hope that it will be useful, @@ -15,6 +15,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # o 2.5 compatability update. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxPyColorChooser -> PyColorChooser +# o wxPyColourChooser -> PyColourChooser +# import wx diff --git a/wxPython/wx/lib/colourchooser/pycolourchooser.py b/wxPython/wx/lib/colourchooser/pycolourchooser.py index 0ddebe9ba5..34d15c94d2 100644 --- a/wxPython/wx/lib/colourchooser/pycolourchooser.py +++ b/wxPython/wx/lib/colourchooser/pycolourchooser.py @@ -1,10 +1,10 @@ """ -wxPyColourChooser +PyColourChooser Copyright (C) 2002 Michael Gilfix -This file is part of wxPyColourChooser. +This file is part of PyColourChooser. -This version of wxPyColourChooser is open source; you can redistribute it +This version of PyColourChooser is open source; you can redistribute it and/or modify it under the licensed terms. This program is distributed in the hope that it will be useful, @@ -16,6 +16,13 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # o 2.5 compatability update. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxPyColorChooser -> PyColorChooser +# o wxPyColourChooser -> PyColourChooser +# o Added wx.InitAllImageHandlers() to test code since +# that's where it belongs. +# import wx @@ -27,7 +34,7 @@ import intl from intl import _ # _ -class wxPyColourChooser(wx.Panel): +class PyColourChooser(wx.Panel): """A Pure-Python implementation of the colour chooser dialog. The PyColourChooser is a pure python implementation of the colour @@ -383,7 +390,13 @@ def main(): def OnInit(self): frame = wx.Frame(None, -1, 'PyColourChooser Test') - chooser = wxPyColourChooser(frame, -1) + # Added here because that's where it's supposed to be, + # not embedded in the library. If it's embedded in the + # library, debug messages will be generated for duplicate + # handlers. + wx.InitAllImageHandlers() + + chooser = PyColourChooser(frame, -1) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(chooser, 0, 0) frame.SetAutoLayout(True) diff --git a/wxPython/wx/lib/colourchooser/pycolourslider.py b/wxPython/wx/lib/colourchooser/pycolourslider.py index bd8f892ea7..4c880c8d7d 100644 --- a/wxPython/wx/lib/colourchooser/pycolourslider.py +++ b/wxPython/wx/lib/colourchooser/pycolourslider.py @@ -1,14 +1,14 @@ """ -wxPyColourChooser +PyColourChooser Copyright (C) 2002 Michael Gilfix -This file is part of wxPyColourChooser. +This file is part of PyColourChooser. You should have received a file COPYING containing license terms along with this program; if not, write to Michael Gilfix (mgilfix@eecs.tufts.edu) for a copy. -This version of wxPyColourChooser is open source; you can redistribute it and/or +This version of PyColourChooser is open source; you can redistribute it and/or modify it under the terms listed in the file COPYING. This program is distributed in the hope that it will be useful, @@ -20,6 +20,11 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # o 2.5 compatability update. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxPyColorChooser -> PyColorChooser +# o wxPyColourChooser -> PyColourChooser +# import wx diff --git a/wxPython/wx/lib/colourchooser/pypalette.py b/wxPython/wx/lib/colourchooser/pypalette.py index f6ede14fd2..4af5a7af1f 100644 --- a/wxPython/wx/lib/colourchooser/pypalette.py +++ b/wxPython/wx/lib/colourchooser/pypalette.py @@ -1,14 +1,14 @@ """ -wxPyColourChooser +PyColourChooser Copyright (C) 2002 Michael Gilfix -This file is part of wxPyColourChooser. +This file is part of PyColourChooser. You should have received a file COPYING containing license terms along with this program; if not, write to Michael Gilfix (mgilfix@eecs.tufts.edu) for a copy. -This version of wxPyColourChooser is open source; you can redistribute it and/or +This version of PyColourChooser is open source; you can redistribute it and/or modify it under the terms listed in the file COPYING. This program is distributed in the hope that it will be useful, @@ -19,6 +19,13 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # o 2.5 compatability update. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxPyColorChooser -> PyColorChooser +# o wxPyColourChooser -> PyColourChooser +# o Commented out wx.InitAllImageHandlers() (see comments at that +# point for explanation +# import cStringIO import zlib @@ -164,7 +171,12 @@ class PyPalette(canvas.Canvas): def __init__(self, parent, id): """Creates a palette object.""" # Load the pre-generated palette XPM - wx.InitAllImageHandlers() + + # Leaving this in causes warning messages in some cases. + # It is the responsibility of the app to init the image + # handlers, IAW RD + #wx.InitAllImageHandlers() + self.palette = getBitmap () canvas.Canvas.__init__ (self, parent, id, size=(200, 192)) diff --git a/wxPython/wx/lib/editor/__init__.py b/wxPython/wx/lib/editor/__init__.py index 60c6de2085..05c8d86a7c 100644 --- a/wxPython/wx/lib/editor/__init__.py +++ b/wxPython/wx/lib/editor/__init__.py @@ -13,9 +13,13 @@ # # o 2.5 compatability update. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxEditor -> Editor +# # This file makes this directory into a Python package # import the main classes into the package namespace. -from editor import wxEditor +from editor import Editor diff --git a/wxPython/wx/lib/editor/editor.py b/wxPython/wx/lib/editor/editor.py index ef709333b0..b3f4f1b155 100644 --- a/wxPython/wx/lib/editor/editor.py +++ b/wxPython/wx/lib/editor/editor.py @@ -1,5 +1,5 @@ #---------------------------------------------------------------------- -# Name: wxPython.lib.editor.wxEditor +# Name: wxPython.lib.editor.Editor # Purpose: An intelligent text editor with colorization capabilities. # # Original @@ -24,6 +24,10 @@ # # o 2.5 compatability update. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxEditor -> Editor +# import os import time @@ -75,7 +79,7 @@ class Scroller: #---------------------------------------------------------------------- -class wxEditor(wx.ScrolledWindow): +class Editor(wx.ScrolledWindow): def __init__(self, parent, id, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0): diff --git a/wxPython/wx/lib/grids.py b/wxPython/wx/lib/grids.py index f13d4ed15b..cbd82f4316 100644 --- a/wxPython/wx/lib/grids.py +++ b/wxPython/wx/lib/grids.py @@ -14,15 +14,26 @@ # # o 2.5 Compatability changes # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o In keeping with the common idiom, the sizers in this module +# have been given the 'Py' prefix to avoid confusion with the +# native sizers of the same name. However, the reverse renamer +# still has the old wx*Sizer since the whole point of the +# reverse renamer is backward compatability. +# o wxGridSizer -> PyGridSizer +# o wxFlexGridSizer -> PyFlexGridSizer +# o Deprecation warning added. +# """ -In this module you will find wxGridSizer and wxFlexGridSizer. Please -note that these sizers have since been ported to C++ and those -versions are now exposed in the regular wxPython wrappers. However I -am also leaving them here in the library so they can serve as an -example of how to implement sizers in Python. +In this module you will find PyGridSizer and PyFlexGridSizer. Please +note that these sizers have since been ported to C++ (as wx.GridSizer +and wx.FlexGridSizer) and those versions are now exposed in the regular +wxPython wrappers. However I am also leaving them here in the library +so they can serve as an example of how to implement sizers in Python. -wxGridSizer: Sizes and positions items such that all rows are the same +PyGridSizer: Sizes and positions items such that all rows are the same height and all columns are the same width. You can specify a gap in pixels to be used between the rows and/or the columns. When you create the sizer you specify the number of rows or the number of @@ -33,7 +44,7 @@ center of the space. When the sizer is resized, all the items are resized the same amount so all rows and all columns remain the same size. -wxFlexGridSizer: Derives from wxGridSizer and adds the ability for +PyFlexGridSizer: Derives from PyGridSizer and adds the ability for particular rows and/or columns to be marked as growable. This means that when the sizer changes size, the growable rows and colums are the ones that stretch. The others remain at their initial size. @@ -41,11 +52,28 @@ ones that stretch. The others remain at their initial size. import operator +import warnings import wx +warningmsg = r"""\ + +################################################\ +# THIS MODULE IS DEPRECATED | +# | +# You should use the native wx.GridSizer and | +# wx.FlexGridSizer unless there is a compelling | +# need to use this module. | +################################################/ + + +""" + +warnings.warn(warningmsg, DeprecationWarning, stacklevel=2) + + #---------------------------------------------------------------------- -class wxGridSizer(wx.PySizer): +class PyGridSizer(wx.PySizer): def __init__(self, rows=0, cols=0, hgap=0, vgap=0): wx.PySizer.__init__(self) if rows == 0 and cols == 0: @@ -171,7 +199,7 @@ class wxGridSizer(wx.PySizer): -class wxFlexGridSizer(wxGridSizer): +class PyFlexGridSizer(wxGridSizer): def __init__(self, rows=0, cols=0, hgap=0, vgap=0): wxGridSizer.__init__(self, rows, cols, hgap, vgap) self.rowHeights = [] diff --git a/wxPython/wx/lib/imagebrowser.py b/wxPython/wx/lib/imagebrowser.py index 27b56de806..36938131bd 100644 --- a/wxPython/wx/lib/imagebrowser.py +++ b/wxPython/wx/lib/imagebrowser.py @@ -124,7 +124,7 @@ class ImageDialog(wx.Dialog): self.y_pos = 20 self.delta = 20 - size = wxSize(80, 25) + size = wx.Size(80, 25) self.set_dir = os.getcwd() self.set_file = None diff --git a/wxPython/wx/lib/infoframe.py b/wxPython/wx/lib/infoframe.py index 13f209a903..b1352b437d 100644 --- a/wxPython/wx/lib/infoframe.py +++ b/wxPython/wx/lib/infoframe.py @@ -1,3 +1,9 @@ +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxPyInformationalMessagesFrame -> PyInformationalMessagesFrame +# o dummy_wxPyInformationalMessagesFrame -> dummy_PyInformationalMessagesFrame +# + """ infoframe.py Released under wxWindows license etc. @@ -30,7 +36,7 @@ Typical usage: from wxPython.lib.infoframe import * ... # ... modify your wxApp as follows: class myApp(wxApp): - outputWindowClass = wxPyInformationalMessagesFrame + outputWindowClass = PyInformationalMessagesFrame ... If you're running on Linux, you'll also have to supply an argument 1 to your constructor of myApp to redirect stdout/stderr to this window (it's done @@ -39,7 +45,7 @@ automatically for you on Windows). If you don't want to redirect stdout/stderr, but use the class directly: do it this way: - InformationalMessagesFrame = wxPyInformationalMessagesFrame\ + InformationalMessagesFrame = PyInformationalMessagesFrame\ ([options from progname (default ""), txt (default "informational messages"]) @@ -192,7 +198,7 @@ class _MyStatusBar(wx.StatusBar): -class wxPyInformationalMessagesFrame: +class PyInformationalMessagesFrame: def __init__(self, progname="", text="informational messages", @@ -456,7 +462,7 @@ class wxPyInformationalMessagesFrame: -class Dummy_wxPyInformationalMessagesFrame: +class Dummy_PyInformationalMessagesFrame: def __init__(self,progname=""): self.softspace = 1 def __call__(self,*args): diff --git a/wxPython/wx/lib/intctrl.py b/wxPython/wx/lib/intctrl.py index 380896797e..65ff2e58fa 100644 --- a/wxPython/wx/lib/intctrl.py +++ b/wxPython/wx/lib/intctrl.py @@ -9,7 +9,7 @@ # NOTE: # This was written to provide a standard integer edit control for wxPython. # -# wxIntCtrl permits integer (long) values to be retrieved or set via +# IntCtrl permits integer (long) values to be retrieved or set via # .GetValue() and .SetValue(), and provides an EVT_INT() event function # for trapping changes to the control. # @@ -21,7 +21,7 @@ # contents of the control with '-' will result in a selected (absolute) # value of -1. # -# wxIntCtrl also supports range limits, with the option of either +# IntCtrl also supports range limits, with the option of either # enforcing them or simply coloring the text of the control if the limits # are exceeded. #---------------------------------------------------------------------------- @@ -29,6 +29,12 @@ # # o 2.5 Compatability changes # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxIntUpdateEvent -> IntUpdateEvent +# o wxIntValidator -> IntValidator +# o wxIntCtrl -> IntCtrl +# import string import types @@ -59,7 +65,7 @@ EVT_INT = wx.PyEventBinder(wxEVT_COMMAND_INT_UPDATED, 1) WXK_CTRL_X = (ord('X')+1) - ord('A') WXK_CTRL_V = (ord('V')+1) - ord('A') -class wxIntUpdatedEvent(wx.PyCommandEvent): +class IntUpdatedEvent(wx.PyCommandEvent): def __init__(self, id, value = 0, object=None): wx.PyCommandEvent.__init__(self, wxEVT_COMMAND_INT_UPDATED, id) @@ -74,9 +80,9 @@ class wxIntUpdatedEvent(wx.PyCommandEvent): #---------------------------------------------------------------------------- -class wxIntValidator( wx.PyValidator ): +class IntValidator( wx.PyValidator ): """ - Validator class used with wxIntCtrl; handles all validation of input + Validator class used with IntCtrl; handles all validation of input prior to changing the value of the underlying wx.TextCtrl. """ def __init__(self): @@ -341,12 +347,12 @@ class wxIntValidator( wx.PyValidator ): #---------------------------------------------------------------------------- -class wxIntCtrl(wx.TextCtrl): +class IntCtrl(wx.TextCtrl): """ This class provides a control that takes and returns integers as value, and provides bounds support and optional value limiting. - wxIntCtrl( + IntCtrl( parent, id = -1, value = 0, pos = wxDefaultPosition, @@ -404,10 +410,10 @@ class wxIntCtrl(wx.TextCtrl): when the bounds are set but the control is not limited. validator - Normally None, wxIntCtrl uses its own validator to do value + Normally None, IntCtrl uses its own validator to do value validation and input control. However, a validator derived - from wxIntValidator can be supplied to override the data - transfer methods for the wxIntValidator class. + from IntValidator can be supplied to override the data + transfer methods for the IntValidator class. """ def __init__ ( @@ -431,7 +437,7 @@ class wxIntCtrl(wx.TextCtrl): self.__oldvalue = None if validator == wx.DefaultValidator: - validator = wxIntValidator() + validator = IntValidator() wx.TextCtrl.__init__( self, parent, id, self._toGUI(0), @@ -464,7 +470,7 @@ class wxIntCtrl(wx.TextCtrl): if value != self.__oldvalue: try: self.GetEventHandler().ProcessEvent( - wxIntUpdatedEvent( self.GetId(), self.GetValue(), self ) ) + IntUpdatedEvent( self.GetId(), self.GetValue(), self ) ) except ValueError: return # let normal processing of the text continue @@ -632,7 +638,7 @@ class wxIntCtrl(wx.TextCtrl): if( not (value is None and self.IsNoneAllowed()) and type(value) not in (types.IntType, types.LongType) ): raise ValueError ( - 'wxIntCtrl requires integer values, passed %s'% repr(value) ) + 'IntCtrl requires integer values, passed %s'% repr(value) ) min = self.GetMin() max = self.GetMax() @@ -729,10 +735,10 @@ class wxIntCtrl(wx.TextCtrl): return '' elif type(value) == types.LongType and not self.IsLongAllowed(): raise ValueError ( - 'wxIntCtrl requires integer value, passed long' ) + 'IntCtrl requires integer value, passed long' ) elif type(value) not in (types.IntType, types.LongType): raise ValueError ( - 'wxIntCtrl requires integer value, passed %s'% repr(value) ) + 'IntCtrl requires integer value, passed %s'% repr(value) ) elif self.IsLimited(): min = self.GetMin() @@ -850,7 +856,7 @@ if __name__ == '__main__': style = wx.DEFAULT_DIALOG_STYLE ): wx.Dialog.__init__(self, parent, id, title, pos, size, style) - self.int_ctrl = wxIntCtrl(self, wx.NewId(), size=(55,20)) + self.int_ctrl = IntCtrl(self, wx.NewId(), size=(55,20)) self.OK = wx.Button( self, wx.ID_OK, "OK") self.Cancel = wx.Button( self, wx.ID_CANCEL, "Cancel") @@ -883,7 +889,7 @@ if __name__ == '__main__': return True def OnClick(self, event): - dlg = myDialog(self.panel, -1, "test wxIntCtrl") + dlg = myDialog(self.panel, -1, "test IntCtrl") dlg.int_ctrl.SetValue(501) dlg.int_ctrl.SetInsertionPoint(1) dlg.int_ctrl.SetSelection(1,2) diff --git a/wxPython/wx/lib/maskedctrl.py b/wxPython/wx/lib/maskedctrl.py index 84edabbde1..d5537775ae 100644 --- a/wxPython/wx/lib/maskedctrl.py +++ b/wxPython/wx/lib/maskedctrl.py @@ -10,21 +10,25 @@ # # o Updated for wx namespace (minor) # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Removed wx prefix +# """

-wxMaskedCtrl is actually a factory function for several types of +MaskedCtrl is actually a factory function for several types of masked edit controls:

    -
  • wxMaskedTextCtrl - standard masked edit text box
  • -
  • wxMaskedComboBox - adds combobox capabilities
  • -
  • wxIpAddrCtrl - adds logical input semantics for IP address entry
  • -
  • wxTimeCtrl - special subclass handling lots of time formats as values
  • -
  • wxMaskedNumCtrl - special subclass handling numeric values
  • +
  • MaskedTextCtrl - standard masked edit text box
  • +
  • MaskedComboBox - adds combobox capabilities
  • +
  • IpAddrCtrl - adds logical input semantics for IP address entry
  • +
  • TimeCtrl - special subclass handling lots of time formats as values
  • +
  • MaskedNumCtrl - special subclass handling numeric values

-wxMaskedCtrl works by looking for a special controlType +MaskedCtrl works by looking for a special controlType parameter in the variable arguments of the control, to determine what kind of instance to return. controlType can be one of: @@ -38,22 +42,22 @@ controlType can be one of: These constants are also available individually, ie, you can use either of the following:


-    from wxPython.wx.lib.maskedctrl import wxMaskedCtrl, MASKEDCOMBO, MASKEDTEXT, NUMBER
-    from wxPython.wx.lib.maskedctrl import wxMaskedCtrl, controlTypes
+    from wxPython.wx.lib.maskedctrl import MaskedCtrl, MASKEDCOMBO, MASKEDTEXT, NUMBER
+    from wxPython.wx.lib.maskedctrl import MaskedCtrl, controlTypes
 
If not specified as a keyword argument, the default controlType is controlTypes.MASKEDTEXT.

-Each of the above classes has its own unique arguments, but wxMaskedCtrl -provides a single "unified" interface for masked controls. wxMaskedTextCtrl, -wxMaskedComboBox and wxIpAddrCtrl are all documented below; the others have +Each of the above classes has its own unique arguments, but MaskedCtrl +provides a single "unified" interface for masked controls. MaskedTextCtrl, +MaskedComboBox and IpAddrCtrl are all documented below; the others have their own demo pages and interface descriptions. """ -from wx.lib.maskededit import wxMaskedTextCtrl, wxMaskedComboBox, wxIpAddrCtrl -from wx.lib.maskednumctrl import wxMaskedNumCtrl -from wx.lib.timectrl import wxTimeCtrl +from wx.lib.maskededit import MaskedTextCtrl, MaskedComboBox, IpAddrCtrl +from wx.lib.maskednumctrl import MaskedNumCtrl +from wx.lib.timectrl import TimeCtrl # "type" enumeration for class instance factory function @@ -72,7 +76,7 @@ class controlTypes: NUMBER = NUMBER -def wxMaskedCtrl( *args, **kwargs): +def MaskedCtrl( *args, **kwargs): """ Actually a factory function providing a unifying interface for generating masked controls. @@ -84,19 +88,19 @@ def wxMaskedCtrl( *args, **kwargs): del kwargs['controlType'] if controlType == MASKEDTEXT: - return wxMaskedTextCtrl(*args, **kwargs) + return MaskedTextCtrl(*args, **kwargs) elif controlType == MASKEDCOMBO: - return wxMaskedComboBox(*args, **kwargs) + return MaskedComboBox(*args, **kwargs) elif controlType == IPADDR: - return wxIpAddrCtrl(*args, **kwargs) + return IpAddrCtrl(*args, **kwargs) elif controlType == TIME: - return wxTimeCtrl(*args, **kwargs) + return TimeCtrl(*args, **kwargs) elif controlType == NUMBER: - return wxMaskedNumCtrl(*args, **kwargs) + return MaskedNumCtrl(*args, **kwargs) else: raise AttributeError( diff --git a/wxPython/wx/lib/maskededit.py b/wxPython/wx/lib/maskededit.py index 36523d1be7..3b1630e153 100644 --- a/wxPython/wx/lib/maskededit.py +++ b/wxPython/wx/lib/maskededit.py @@ -12,12 +12,12 @@ # This was written way it is because of the lack of masked edit controls # in wxWindows/wxPython. # -# wxMaskedEdit controls are based on a suggestion made on [wxPython-Users] by +# MaskedEdit controls are based on a suggestion made on [wxPython-Users] by # Jason Hihn, and borrows liberally from Will Sadkin's original masked edit -# control for time entry, wxTimeCtrl (which is now rewritten using this +# control for time entry, TimeCtrl (which is now rewritten using this # control!). # -# wxMaskedEdit controls do not normally use validators, because they do +# MaskedEdit controls do not normally use validators, because they do # careful manipulation of the cursor in the text window on each keystroke, # and validation is cursor-position specific, so the control intercepts the # key codes before the validator would fire. However, validators can be @@ -33,21 +33,30 @@ # # o Missed wx.DateTime stuff earlier. # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxMaskedEditMixin -> MaskedEditMixin +# o wxMaskedTextCtrl -> MaskedTextCtrl +# o wxMaskedComboBoxSelectEvent -> MaskedComboBoxSelectEvent +# o wxMaskedComboBox -> MaskedComboBox +# o wxIpAddrCtrl -> IpAddrCtrl +# o wxTimeCtrl -> TimeCtrl +# """\ Masked Edit Overview: ===================== -wxMaskedTextCtrl +MaskedTextCtrl is a sublassed text control that can carefully control the user's input based on a mask string you provide. General usage example: - control = wxMaskedTextCtrl( win, -1, '', mask = '(###) ###-####') + control = MaskedTextCtrl( win, -1, '', mask = '(###) ###-####') The example above will create a text control that allows only numbers to be entered and then only in the positions indicated in the mask by the # sign. -wxMaskedComboBox +MaskedComboBox is a similar subclass of wxComboBox that allows the same sort of masking, but also can do auto-complete of values, and can require the value typed to be in the list of choices to be colored appropriately. @@ -55,20 +64,20 @@ wxMaskedCtrl is actually a factory function for several types of masked edit controls: - wxMaskedTextCtrl - standard masked edit text box - wxMaskedComboBox - adds combobox capabilities - wxIpAddrCtrl - adds special semantics for IP address entry - wxTimeCtrl - special subclass handling lots of types as values + MaskedTextCtrl - standard masked edit text box + MaskedComboBox - adds combobox capabilities + IpAddrCtrl - adds special semantics for IP address entry + TimeCtrl - special subclass handling lots of types as values wxMaskedNumCtrl - special subclass handling numeric values It works by looking for a controlType parameter in the keyword arguments of the control, to determine what kind of instance to return. If not specified as a keyword argument, the default control type returned - will be wxMaskedTextCtrl. + will be MaskedTextCtrl. Each of the above classes has its own set of arguments, but wxMaskedCtrl provides a single "unified" interface for masked controls. Those for - wxMaskedTextCtrl, wxMaskedComboBox and wxIpAddrCtrl are all documented + MaskedTextCtrl, MaskedComboBox and IpAddrCtrl are all documented below; the others have their own demo pages and interface descriptions. (See end of following discussion for how to configure the wxMaskedCtrl() to select the above control types.) @@ -252,7 +261,7 @@ decimalChar= choices= A list of strings that are allowed choices for the control. choiceRequired= value must be member of choices list compareNoCase= Perform case-insensitive matching when validating against list - Note: for wxMaskedComboBox, this defaults to True. + Note: for MaskedComboBox, this defaults to True. emptyInvalid= Boolean indicating whether an empty value should be considered invalid validFunc= A function to call of the form: bool = func(candidate_value) @@ -406,7 +415,7 @@ decimalChar= after construction; it takes a list of key/value pairs as arguments, where the keys can be any of the mask-specific parameters in the constructor. Eg: - ctl = wxMaskedTextCtrl( self, -1 ) + ctl = MaskedTextCtrl( self, -1 ) ctl.SetCtrlParameters( mask='###-####', defaultValue='555-1212', formatcodes='F') @@ -487,7 +496,7 @@ Naming Conventions The following methods must be used and/or defined when deriving a control from wxMaskedEditMixin. NOTE: if deriving from a *masked edit* control - (eg. class wxIpAddrCtrl(wxMaskedTextCtrl) ), then this is NOT necessary, + (eg. class IpAddrCtrl(MaskedTextCtrl) ), then this is NOT necessary, as it's already been done for you in the base class. ._SetInitialValue() @@ -517,8 +526,8 @@ Naming Conventions Similarly to _GetSelection, each class derived from wxMaskedEditMixin must define the function for setting the start and end of the current text selection. - (eg. .SetSelection() for wxMaskedTextCtrl, and .SetMark() for - wxMaskedComboBox. + (eg. .SetSelection() for MaskedTextCtrl, and .SetMark() for + MaskedComboBox. ._GetInsertionPoint() ._SetInsertionPoint() @@ -565,7 +574,7 @@ Naming Conventions ._IsEditable() REQUIRED Each class derived from wxMaskedEditMixin must define the function used to determine if the base control is - editable or not. (For wxMaskedComboBox, this has to + editable or not. (For MaskedComboBox, this has to be done with code, rather than specifying the proper function in the base control, as there isn't one...) ._CalcSize() REQUIRED @@ -600,7 +609,7 @@ Event Handling These 5 handlers must be "wired up" for the wxMaskedEdit control to provide default behavior. (The setupEventHandling - is an argument to wxMaskedTextCtrl and wxMaskedComboBox, so + is an argument to MaskedTextCtrl and MaskedComboBox, so that controls derived from *them* may replace one of these handlers if they so choose.) @@ -628,7 +637,7 @@ Event Handling ._AddNavKeycode(keycode, handler=None) ._AddNavKey(char, handler=None) Allows controls to specify other keys (and optional handlers) - to be treated as navigational characters. (eg. '.' in wxIpAddrCtrl) + to be treated as navigational characters. (eg. '.' in IpAddrCtrl) ._GetNavKeycodes() Returns the current list of navigational keycodes. @@ -657,7 +666,7 @@ Event Handling By default, it adjusts the year in date fields if mask is a date, It can be overridden by a derived class to adjust the value of the control at that time. - (eg. wxIpAddrCtrl reformats the address in this way.) + (eg. IpAddrCtrl reformats the address in this way.) ._Change() Called by internal EVT_TEXT handler. Return False to force skip of the normal class change event. @@ -685,7 +694,7 @@ Event Handling _OnCtrl_Z(event) 'undo' - resets value to previous value (if any) _OnChangeField(event) primarily used for tab events, but can be - used for other keys (eg. '.' in wxIpAddrCtrl) + used for other keys (eg. '.' in IpAddrCtrl) _OnErase(event) used for backspace and delete _OnHome(event) @@ -1043,26 +1052,26 @@ masktags = { 'excludeChars': am_pm_exclude, 'formatcodes': 'TF!', 'validRegex': '^' + hours + ':' + minutes + ':' + seconds + ' (A|P)M', - 'description': "HH:MM:SS (A|P)M\n(see wxTimeCtrl)" + 'description': "HH:MM:SS (A|P)M\n(see TimeCtrl)" }, "TIMEHHMM": { 'mask': "##:## AM", 'excludeChars': am_pm_exclude, 'formatcodes': 'TF!', 'validRegex': '^' + hours + ':' + minutes + ' (A|P)M', - 'description': "HH:MM (A|P)M\n(see wxTimeCtrl)" + 'description': "HH:MM (A|P)M\n(see TimeCtrl)" }, "MILTIMEHHMMSS": { 'mask': "##:##:##", 'formatcodes': 'TF', 'validRegex': '^' + milhours + ':' + minutes + ':' + seconds, - 'description': "Military HH:MM:SS\n(see wxTimeCtrl)" + 'description': "Military HH:MM:SS\n(see TimeCtrl)" }, "MILTIMEHHMM": { 'mask': "##:##", 'formatcodes': 'TF', 'validRegex': '^' + milhours + ':' + minutes, - 'description': "Military HH:MM\n(see wxTimeCtrl)" + 'description': "Military HH:MM\n(see TimeCtrl)" }, "USSOCIALSEC": { 'mask': "###-##-####", @@ -1117,7 +1126,7 @@ masktags = { 'mask': "###.###.###.###", 'formatcodes': 'F_Sr', 'validRegex': "( \d| \d\d|(1\d\d|2[0-4]\d|25[0-5]))(\.( \d| \d\d|(1\d\d|2[0-4]\d|25[0-5]))){3}", - 'description': "IP Address\n(see wxIpAddrCtrl)" + 'description': "IP Address\n(see IpAddrCtrl)" } } @@ -1525,7 +1534,7 @@ class Field: ## ---------- ---------- ---------- ---------- ---------- ---------- ---------- -class wxMaskedEditMixin: +class MaskedEditMixin: """ This class allows us to abstract the masked edit functionality that could be associated with any text entry control. (eg. wxTextCtrl, wxComboBox, etc.) @@ -1566,7 +1575,7 @@ class wxMaskedEditMixin: # Validate legitimate set of parameters: for key in kwargs.keys(): - if key.replace('Color', 'Colour') not in wxMaskedEditMixin.valid_ctrl_params.keys() + Field.valid_params.keys(): + if key.replace('Color', 'Colour') not in MaskedEditMixin.valid_ctrl_params.keys() + Field.valid_params.keys(): raise TypeError('%s: invalid parameter "%s"' % (name, key)) ## Set up dictionary that can be used by subclasses to override or add to default @@ -1620,7 +1629,7 @@ class wxMaskedEditMixin: '&': string.punctuation } - ## self._ignoreChange is used by wxMaskedComboBox, because + ## self._ignoreChange is used by MaskedComboBox, because ## of the hack necessary to determine the selection; it causes ## EVT_TEXT messages from the combobox to be ignored if set. self._ignoreChange = False @@ -1633,7 +1642,7 @@ class wxMaskedEditMixin: # Set defaults for each parameter for this instance, and fully # populate initial parameter list for configuration: - for key, value in wxMaskedEditMixin.valid_ctrl_params.items(): + for key, value in MaskedEditMixin.valid_ctrl_params.items(): setattr(self, '_' + key, copy.copy(value)) if not kwargs.has_key(key): ## dbg('%s: "%s"' % (key, repr(value))) @@ -1651,7 +1660,7 @@ class wxMaskedEditMixin: parameters after construction. """ dbg(suspend=1) - dbg('wxMaskedEditMixin::SetCtrlParameters', indent=1) + dbg('MaskedEditMixin::SetCtrlParameters', indent=1) ## dbg('kwargs:', indent=1) ## for key, value in kwargs.items(): ## dbg(key, '=', value) @@ -1662,7 +1671,7 @@ class wxMaskedEditMixin: ctrl_kwargs = {} for key, value in kwargs.items(): key = key.replace('Color', 'Colour') # for b-c, and standard wxPython spelling - if key not in wxMaskedEditMixin.valid_ctrl_params.keys() + Field.valid_params.keys(): + if key not in MaskedEditMixin.valid_ctrl_params.keys() + Field.valid_params.keys(): dbg(indent=0, suspend=0) raise TypeError('Invalid keyword argument "%s" for control "%s"' % (key, self.name)) elif key in Field.valid_params.keys(): @@ -1737,7 +1746,7 @@ class wxMaskedEditMixin: ## dbg(indent=0) # determine if changing parameters that should affect the entire control: - for key in wxMaskedEditMixin.valid_ctrl_params.keys(): + for key in MaskedEditMixin.valid_ctrl_params.keys(): if key in ( 'mask', 'fields' ): continue # (processed separately) if ctrl_kwargs.has_key(key): setattr(self, '_' + key, ctrl_kwargs[key]) @@ -1870,7 +1879,7 @@ class wxMaskedEditMixin: """ Routine for retrieving the value of any given parameter """ - if wxMaskedEditMixin.valid_ctrl_params.has_key(paramname.replace('Color','Colour')): + if MaskedEditMixin.valid_ctrl_params.has_key(paramname.replace('Color','Colour')): return getattr(self, '_' + paramname.replace('Color', 'Colour')) elif Field.valid_params.has_key(paramname): return self._ctrl_constraints._GetParameter(paramname) @@ -2393,7 +2402,7 @@ class wxMaskedEditMixin: """ dbg(suspend=1) - dbg('wxMaskedEditMixin::_configure("%s")' % mask, indent=1) + dbg('MaskedEditMixin::_configure("%s")' % mask, indent=1) # Preprocess specified mask to expand {n} syntax, handle escaped # mask characters, etc and build the resulting positionally keyed @@ -2534,7 +2543,7 @@ class wxMaskedEditMixin: It will also set/reset the font if necessary and apply formatting to the control at this time. """ - dbg('wxMaskedEditMixin::_SetInitialValue("%s")' % value, indent=1) + dbg('MaskedEditMixin::_SetInitialValue("%s")' % value, indent=1) if not value: self._prevValue = self._curValue = self._template # don't apply external validation rules in this case, as template may @@ -2562,7 +2571,7 @@ class wxMaskedEditMixin: def _calcSize(self, size=None): """ Calculate automatic size if allowed; must be called after the base control is instantiated""" -## dbg('wxMaskedEditMixin::_calcSize', indent=1) +## dbg('MaskedEditMixin::_calcSize', indent=1) cont = (size is None or size == wx.DefaultSize) if cont and self._autofit: @@ -2580,7 +2589,7 @@ class wxMaskedEditMixin: def _setFont(self): """ Set the control's font typeface -- pass the font name as str.""" -## dbg('wxMaskedEditMixin::_setFont', indent=1) +## dbg('MaskedEditMixin::_setFont', indent=1) if not self._useFixedWidthFont: self._font = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT) else: @@ -2607,7 +2616,7 @@ class wxMaskedEditMixin: EVT_TEXT events for the same change.) """ newvalue = self._GetValue() - dbg('wxMaskedEditMixin::_OnTextChange: value: "%s"' % newvalue, indent=1) + dbg('MaskedEditMixin::_OnTextChange: value: "%s"' % newvalue, indent=1) bValid = False if self._ignoreChange: # ie. if an "intermediate text change event" dbg(indent=0) @@ -2645,7 +2654,7 @@ class wxMaskedEditMixin: if key in self._nav and event.ControlDown(): # then this is the only place we will likely see these events; # process them now: - dbg('wxMaskedEditMixin::OnKeyDown: calling _OnChar') + dbg('MaskedEditMixin::OnKeyDown: calling _OnChar') self._OnChar(event) return # else allow regular EVT_CHAR key processing @@ -2657,7 +2666,7 @@ class wxMaskedEditMixin: This is the engine of wxMaskedEdit controls. It examines each keystroke, decides if it's allowed, where it should go or what action to take. """ - dbg('wxMaskedEditMixin::_OnChar', indent=1) + dbg('MaskedEditMixin::_OnChar', indent=1) # Get keypress value, adjusted by control options (e.g. convert to upper etc) key = event.GetKeyCode() @@ -2837,7 +2846,7 @@ class wxMaskedEditMixin: 10, 14 etc. """ - dbg('wxMaskedEditMixin::_FindFieldExtent(pos=%s, getslice=%s)' % ( + dbg('MaskedEditMixin::_FindFieldExtent(pos=%s, getslice=%s)' % ( str(pos), str(getslice)) ,indent=1) field = self._FindField(pos) @@ -2867,7 +2876,7 @@ class wxMaskedEditMixin: when calculating the current field. """ -## dbg('wxMaskedEditMixin::_FindField(pos=%s)' % str(pos) ,indent=1) +## dbg('MaskedEditMixin::_FindField(pos=%s)' % str(pos) ,indent=1) if pos is None: pos = self._GetInsertionPoint() elif pos < 0 or pos > self._masklength: raise IndexError('position %s out of range of control' % str(pos)) @@ -2883,7 +2892,7 @@ class wxMaskedEditMixin: def ClearValue(self): """ Blanks the current control value by replacing it with the default value.""" - dbg("wxMaskedEditMixin::ClearValue - value reset to default value (template)") + dbg("MaskedEditMixin::ClearValue - value reset to default value (template)") self._SetValue( self._template ) self._SetInsertionPoint(0) self.Refresh() @@ -2902,7 +2911,7 @@ class wxMaskedEditMixin: Makes up-arrow act like shift-tab should; ie. take you to start of previous field. """ - dbg('wxMaskedEditMixin::_OnUpNumeric', indent=1) + dbg('MaskedEditMixin::_OnUpNumeric', indent=1) event.m_shiftDown = 1 dbg('event.ShiftDown()?', event.ShiftDown()) self._OnChangeField(event) @@ -2914,7 +2923,7 @@ class wxMaskedEditMixin: Used in response to left/right navigation keys; makes these actions skip over mask template chars. """ - dbg("wxMaskedEditMixin::_OnArrow", indent=1) + dbg("MaskedEditMixin::_OnArrow", indent=1) pos = self._GetInsertionPoint() keycode = event.GetKeyCode() sel_start, sel_to = self._GetSelection() @@ -2978,9 +2987,9 @@ class wxMaskedEditMixin: def _OnCtrl_S(self, event): """ Default Ctrl-S handler; prints value information if demo enabled. """ - dbg("wxMaskedEditMixin::_OnCtrl_S") + dbg("MaskedEditMixin::_OnCtrl_S") if self._demo: - print 'wxMaskedEditMixin.GetValue() = "%s"\nwxMaskedEditMixin.GetPlainValue() = "%s"' % (self.GetValue(), self.GetPlainValue()) + print 'MaskedEditMixin.GetValue() = "%s"\nMaskedEditMixin.GetPlainValue() = "%s"' % (self.GetValue(), self.GetPlainValue()) print "Valid? => " + str(self.IsValid()) print "Current field, start, end, value =", str( self._FindFieldExtent(getslice=True)) return False @@ -2989,7 +2998,7 @@ class wxMaskedEditMixin: def _OnCtrl_X(self, event=None): """ Handles ctrl-x keypress in control and Cut operation on context menu. Should return False to skip other processing. """ - dbg("wxMaskedEditMixin::_OnCtrl_X", indent=1) + dbg("MaskedEditMixin::_OnCtrl_X", indent=1) self.Cut() dbg(indent=0) return False @@ -3003,7 +3012,7 @@ class wxMaskedEditMixin: def _OnCtrl_V(self, event=None): """ Handles ctrl-V keypress in control and Paste operation on context menu. Should return False to skip other processing. """ - dbg("wxMaskedEditMixin::_OnCtrl_V", indent=1) + dbg("MaskedEditMixin::_OnCtrl_V", indent=1) self.Paste() dbg(indent=0) return False @@ -3011,7 +3020,7 @@ class wxMaskedEditMixin: def _OnCtrl_Z(self, event=None): """ Handles ctrl-Z keypress in control and Undo operation on context menu. Should return False to skip other processing. """ - dbg("wxMaskedEditMixin::_OnCtrl_Z", indent=1) + dbg("MaskedEditMixin::_OnCtrl_Z", indent=1) self.Undo() dbg(indent=0) return False @@ -3030,7 +3039,7 @@ class wxMaskedEditMixin: def _OnErase(self, event=None): """ Handles backspace and delete keypress in control. Should return False to skip other processing.""" - dbg("wxMaskedEditMixin::_OnErase", indent=1) + dbg("MaskedEditMixin::_OnErase", indent=1) sel_start, sel_to = self._GetSelection() ## check for a range of selected text if event is None: # called as action routine from Cut() operation. @@ -3256,7 +3265,7 @@ class wxMaskedEditMixin: def _OnEnd(self,event): """ Handles End keypress in control. Should return False to skip other processing. """ - dbg("wxMaskedEditMixin::_OnEnd", indent=1) + dbg("MaskedEditMixin::_OnEnd", indent=1) pos = self._adjustPos(self._GetInsertionPoint(), event.GetKeyCode()) if not event.ControlDown(): end = self._masklength # go to end of control @@ -3323,14 +3332,14 @@ class wxMaskedEditMixin: Changes the event to look like a tab event, so we can then call event.Skip() on it, and have the parent form "do the right thing." """ - dbg('wxMaskedEditMixin::OnReturn') + dbg('MaskedEditMixin::OnReturn') event.m_keyCode = wx.WXK_TAB event.Skip() def _OnHome(self,event): """ Handles Home keypress in control. Should return False to skip other processing.""" - dbg("wxMaskedEditMixin::_OnHome", indent=1) + dbg("MaskedEditMixin::_OnHome", indent=1) pos = self._adjustPos(self._GetInsertionPoint(), event.GetKeyCode()) sel_start, sel_to = self._GetSelection() @@ -3410,7 +3419,7 @@ class wxMaskedEditMixin: control-shift-TAB, these events are not sent to the controls by the framework. """ - dbg('wxMaskedEditMixin::_OnChangeField', indent = 1) + dbg('MaskedEditMixin::_OnChangeField', indent = 1) # determine end of current field: pos = self._GetInsertionPoint() dbg('current pos:', pos) @@ -3432,7 +3441,7 @@ class wxMaskedEditMixin: # NOTE: doesn't yet work with SHIFT-tab under wx; the control # never sees this event! (But I've coded for it should it ever work, - # and it *does* work for '.' in wxIpAddrCtrl.) + # and it *does* work for '.' in IpAddrCtrl.) field = self._FindField(pos) index = field._index field_start = field._extent[0] @@ -3540,7 +3549,7 @@ class wxMaskedEditMixin: def _OnDecimalPoint(self, event): - dbg('wxMaskedEditMixin::_OnDecimalPoint', indent=1) + dbg('MaskedEditMixin::_OnDecimalPoint', indent=1) pos = self._adjustPos(self._GetInsertionPoint(), event.GetKeyCode()) @@ -3579,7 +3588,7 @@ class wxMaskedEditMixin: def _OnChangeSign(self, event): - dbg('wxMaskedEditMixin::_OnChangeSign', indent=1) + dbg('MaskedEditMixin::_OnChangeSign', indent=1) key = event.GetKeyCode() pos = self._adjustPos(self._GetInsertionPoint(), key) value = self._eraseSelection() @@ -3635,7 +3644,7 @@ class wxMaskedEditMixin: This handler is only registered if the mask is a numeric mask. It allows the insertion of ',' or '.' if appropriate. """ - dbg('wxMaskedEditMixin::_OnGroupChar', indent=1) + dbg('MaskedEditMixin::_OnGroupChar', indent=1) keep_processing = True pos = self._adjustPos(self._GetInsertionPoint(), event.GetKeyCode()) sel_start, sel_to = self._GetSelection() @@ -3691,7 +3700,7 @@ class wxMaskedEditMixin: def _OnAutoCompleteField(self, event): - dbg('wxMaskedEditMixin::_OnAutoCompleteField', indent =1) + dbg('MaskedEditMixin::_OnAutoCompleteField', indent =1) pos = self._GetInsertionPoint() field = self._FindField(pos) edit_start, edit_end, slice = self._FindFieldExtent(pos, getslice=True) @@ -3757,7 +3766,7 @@ class wxMaskedEditMixin: Function called if autoselect feature is enabled and entire control is selected: """ - dbg('wxMaskedEditMixin::OnAutoSelect', field._index) + dbg('MaskedEditMixin::OnAutoSelect', field._index) if match_index is not None: field._autoCompleteIndex = match_index @@ -3966,7 +3975,7 @@ class wxMaskedEditMixin: """ 'Fixes' an floating point control. Collapses spaces, right-justifies, etc. """ - dbg('wxMaskedEditMixin::_adjustFloat, candidate = "%s"' % candidate, indent=1) + dbg('MaskedEditMixin::_adjustFloat, candidate = "%s"' % candidate, indent=1) lenInt,lenFraction = [len(s) for s in self._mask.split('.')] ## Get integer, fraction lengths if candidate is None: value = self._GetValue() @@ -4014,7 +4023,7 @@ class wxMaskedEditMixin: def _adjustInt(self, candidate=None): """ 'Fixes' an integer control. Collapses spaces, right or left-justifies.""" - dbg("wxMaskedEditMixin::_adjustInt", candidate) + dbg("MaskedEditMixin::_adjustInt", candidate) lenInt = self._masklength if candidate is None: value = self._GetValue() else: value = candidate @@ -4056,7 +4065,7 @@ class wxMaskedEditMixin: 'Fixes' a date control, expanding the year if it can. Applies various self-formatting options. """ - dbg("wxMaskedEditMixin::_adjustDate", indent=1) + dbg("MaskedEditMixin::_adjustDate", indent=1) if candidate is None: text = self._GetValue() else: text = candidate dbg('text=', text) @@ -4116,7 +4125,7 @@ class wxMaskedEditMixin: def _goEnd(self, getPosOnly=False): """ Moves the insertion point to the end of user-entry """ - dbg("wxMaskedEditMixin::_goEnd; getPosOnly:", getPosOnly, indent=1) + dbg("MaskedEditMixin::_goEnd; getPosOnly:", getPosOnly, indent=1) text = self._GetValue() ## dbg('text: "%s"' % text) i = 0 @@ -4149,7 +4158,7 @@ class wxMaskedEditMixin: def _goHome(self, getPosOnly=False): """ Moves the insertion point to the beginning of user-entry """ - dbg("wxMaskedEditMixin::_goHome; getPosOnly:", getPosOnly, indent=1) + dbg("MaskedEditMixin::_goHome; getPosOnly:", getPosOnly, indent=1) text = self._GetValue() for i in range(self._masklength): if self._isMaskChar(i): @@ -4298,7 +4307,7 @@ class wxMaskedEditMixin: value has been changed or set programatically. """ dbg(suspend=1) - dbg('wxMaskedEditMixin::_applyFormatting', indent=1) + dbg('MaskedEditMixin::_applyFormatting', indent=1) # Handle negative numbers if self._signOk: @@ -4348,7 +4357,7 @@ class wxMaskedEditMixin: def _getAbsValue(self, candidate=None): """ Return an unsigned value (i.e. strip the '-' prefix if any), and sign position(s). """ - dbg('wxMaskedEditMixin::_getAbsValue; candidate="%s"' % candidate, indent=1) + dbg('MaskedEditMixin::_getAbsValue; candidate="%s"' % candidate, indent=1) if candidate is None: text = self._GetValue() else: text = candidate right_signpos = text.find(')') @@ -4466,7 +4475,7 @@ class wxMaskedEditMixin: """ Return a signed value by adding a "-" prefix if the value is set to negative, or a space if positive. """ - dbg('wxMaskedEditMixin::_getSignedValue; candidate="%s"' % candidate, indent=1) + dbg('MaskedEditMixin::_getSignedValue; candidate="%s"' % candidate, indent=1) if candidate is None: text = self._GetValue() else: text = candidate @@ -4501,9 +4510,9 @@ class wxMaskedEditMixin: def GetPlainValue(self, candidate=None): """ Returns control's value stripped of the template text. - plainvalue = wxMaskedEditMixin.GetPlainValue() + plainvalue = MaskedEditMixin.GetPlainValue() """ - dbg('wxMaskedEditMixin::GetPlainValue; candidate="%s"' % candidate, indent=1) + dbg('MaskedEditMixin::GetPlainValue; candidate="%s"' % candidate, indent=1) if candidate is None: text = self._GetValue() else: text = candidate @@ -4572,7 +4581,7 @@ class wxMaskedEditMixin: def IsValid(self, value=None): """ Indicates whether the value specified (or the current value of the control if not specified) is considered valid.""" -## dbg('wxMaskedEditMixin::IsValid("%s")' % value, indent=1) +## dbg('MaskedEditMixin::IsValid("%s")' % value, indent=1) if value is None: value = self._GetValue() ret = self._CheckValid(value) ## dbg(indent=0) @@ -4581,7 +4590,7 @@ class wxMaskedEditMixin: def _eraseSelection(self, value=None, sel_start=None, sel_to=None): """ Used to blank the selection when inserting a new character. """ - dbg("wxMaskedEditMixin::_eraseSelection", indent=1) + dbg("MaskedEditMixin::_eraseSelection", indent=1) if value is None: value = self._GetValue() if sel_start is None or sel_to is None: sel_start, sel_to = self._GetSelection() ## check for a range of selected text @@ -4621,7 +4630,7 @@ class wxMaskedEditMixin: def _insertKey(self, char, pos, sel_start, sel_to, value, allowAutoSelect=False): """ Handles replacement of the character at the current insertion point.""" - dbg('wxMaskedEditMixin::_insertKey', "\'" + char + "\'", pos, sel_start, sel_to, '"%s"' % value, indent=1) + dbg('MaskedEditMixin::_insertKey', "\'" + char + "\'", pos, sel_start, sel_to, '"%s"' % value, indent=1) text = self._eraseSelection(value) field = self._FindField(pos) @@ -4813,7 +4822,7 @@ class wxMaskedEditMixin: preserve the correct selection when the focus event is not due to tab, we need to pull the following trick: """ - dbg('wxMaskedEditMixin::_OnFocus') + dbg('MaskedEditMixin::_OnFocus') wx.CallAfter(self._fixSelection) event.Skip() self.Refresh() @@ -4826,7 +4835,7 @@ class wxMaskedEditMixin: effect of coloring the control appropriately. """ dbg(suspend=1) - dbg('wxMaskedEditMixin::_CheckValid: candidate="%s"' % candidate, indent=1) + dbg('MaskedEditMixin::_CheckValid: candidate="%s"' % candidate, indent=1) oldValid = self._valid if candidate is None: value = self._GetValue() else: value = candidate @@ -4947,7 +4956,7 @@ class wxMaskedEditMixin: """ Validate the current date value using the provided Regex filter. Generally used for character types.BufferType """ - dbg('wxMaskedEditMixin::_validateDate', indent=1) + dbg('MaskedEditMixin::_validateDate', indent=1) if candidate is None: value = self._GetValue() else: value = candidate dbg('value = "%s"' % value) @@ -5023,7 +5032,7 @@ class wxMaskedEditMixin: """ Validate the current time value using the provided Regex filter. Generally used for character types.BufferType """ - dbg('wxMaskedEditMixin::_validateTime', indent=1) + dbg('MaskedEditMixin::_validateTime', indent=1) # wxDateTime doesn't take kindly to leading/trailing spaces when parsing, # so we eliminate them here: if candidate is None: value = self._GetValue().strip() @@ -5049,7 +5058,7 @@ class wxMaskedEditMixin: def _OnKillFocus(self,event): """ Handler for EVT_KILL_FOCUS event. """ - dbg('wxMaskedEditMixin::_OnKillFocus', 'isDate=',self._isDate, indent=1) + dbg('MaskedEditMixin::_OnKillFocus', 'isDate=',self._isDate, indent=1) if self._mask and self._IsEditable(): self._AdjustField(self._GetInsertionPoint()) self._CheckValid() ## Call valid handler @@ -5073,7 +5082,7 @@ class wxMaskedEditMixin: we can assume the cause, change the insertion point to the start of the control, and deselect. """ - dbg('wxMaskedEditMixin::_fixSelection', indent=1) + dbg('MaskedEditMixin::_fixSelection', indent=1) if not self._mask or not self._IsEditable(): dbg(indent=0) return @@ -5166,7 +5175,7 @@ class wxMaskedEditMixin: derived control because the mixin functions can't override a method of a sibling class. """ - dbg("wxMaskedEditMixin::_Cut", indent=1) + dbg("MaskedEditMixin::_Cut", indent=1) value = self._GetValue() dbg('current value: "%s"' % value) sel_start, sel_to = self._GetSelection() ## check for a range of selected text @@ -5224,7 +5233,7 @@ class wxMaskedEditMixin: template. """ dbg(suspend=1) - dbg('wxMaskedEditMixin::_validatePaste("%(paste_text)s", %(sel_start)d, %(sel_to)d), raise_on_invalid? %(raise_on_invalid)d' % locals(), indent=1) + dbg('MaskedEditMixin::_validatePaste("%(paste_text)s", %(sel_start)d, %(sel_to)d), raise_on_invalid? %(raise_on_invalid)d' % locals(), indent=1) select_length = sel_to - sel_start maxlength = select_length dbg('sel_to - sel_start:', maxlength) @@ -5320,7 +5329,7 @@ class wxMaskedEditMixin: derived control because the mixin functions can't override a method of a sibling class. """ - dbg('wxMaskedEditMixin::_Paste (value = "%s")' % value, indent=1) + dbg('MaskedEditMixin::_Paste (value = "%s")' % value, indent=1) if value is None: paste_text = self._getClipboardContents() else: @@ -5440,7 +5449,7 @@ class wxMaskedEditMixin: def _Undo(self): """ Provides an Undo() method in base controls. """ - dbg("wxMaskedEditMixin::_Undo", indent=1) + dbg("MaskedEditMixin::_Undo", indent=1) value = self._GetValue() prev = self._prevValue dbg('current value: "%s"' % value) @@ -5681,7 +5690,7 @@ class wxMaskedEditMixin: def _OnContextMenu(self, event): - dbg('wxMaskedEditMixin::OnContextMenu()', indent=1) + dbg('MaskedEditMixin::OnContextMenu()', indent=1) menu = wxMenu() menu.Append(wxID_UNDO, "Undo", "") menu.AppendSeparator() @@ -5723,9 +5732,9 @@ class wxMaskedEditMixin: ## ---------- ---------- ---------- ---------- ---------- ---------- ---------- -class wxMaskedTextCtrl( wx.TextCtrl, wxMaskedEditMixin ): +class MaskedTextCtrl( wx.TextCtrl, MaskedEditMixin ): """ - This is the primary derivation from wxMaskedEditMixin. It provides + This is the primary derivation from MaskedEditMixin. It provides a general masked text control that can be configured with different masks. """ @@ -5745,7 +5754,7 @@ class wxMaskedTextCtrl( wx.TextCtrl, wxMaskedEditMixin ): name=name) self.controlInitialized = True - wxMaskedEditMixin.__init__( self, name, **kwargs ) + MaskedEditMixin.__init__( self, name, **kwargs ) self._SetInitialValue(value) if setupEventHandling: @@ -5761,29 +5770,29 @@ class wxMaskedTextCtrl( wx.TextCtrl, wxMaskedEditMixin ): def __repr__(self): - return "" % self.GetValue() + return "" % self.GetValue() def _GetSelection(self): """ Allow mixin to get the text selection of this control. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ return self.GetSelection() def _SetSelection(self, sel_start, sel_to): """ Allow mixin to set the text selection of this control. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ -## dbg("wxMaskedTextCtrl::_SetSelection(%(sel_start)d, %(sel_to)d)" % locals()) +## dbg("MaskedTextCtrl::_SetSelection(%(sel_start)d, %(sel_to)d)" % locals()) return self.SetSelection( sel_start, sel_to ) def SetSelection(self, sel_start, sel_to): """ This is just for debugging... """ - dbg("wxMaskedTextCtrl::SetSelection(%(sel_start)d, %(sel_to)d)" % locals()) + dbg("MaskedTextCtrl::SetSelection(%(sel_start)d, %(sel_to)d)" % locals()) wx.TextCtrl.SetSelection(self, sel_start, sel_to) @@ -5791,30 +5800,30 @@ class wxMaskedTextCtrl( wx.TextCtrl, wxMaskedEditMixin ): return self.GetInsertionPoint() def _SetInsertionPoint(self, pos): -## dbg("wxMaskedTextCtrl::_SetInsertionPoint(%(pos)d)" % locals()) +## dbg("MaskedTextCtrl::_SetInsertionPoint(%(pos)d)" % locals()) self.SetInsertionPoint(pos) def SetInsertionPoint(self, pos): """ This is just for debugging... """ - dbg("wxMaskedTextCtrl::SetInsertionPoint(%(pos)d)" % locals()) + dbg("MaskedTextCtrl::SetInsertionPoint(%(pos)d)" % locals()) wx.TextCtrl.SetInsertionPoint(self, pos) def _GetValue(self): """ Allow mixin to get the raw value of the control with this function. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ return self.GetValue() def _SetValue(self, value): """ Allow mixin to set the raw value of the control with this function. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ - dbg('wxMaskedTextCtrl::_SetValue("%(value)s")' % locals(), indent=1) + dbg('MaskedTextCtrl::_SetValue("%(value)s")' % locals(), indent=1) # Record current selection and insertion point, for undo self._prevSelection = self._GetSelection() self._prevInsertionPoint = self._GetInsertionPoint() @@ -5828,7 +5837,7 @@ class wxMaskedTextCtrl( wx.TextCtrl, wxMaskedEditMixin ): masked control. NOTE: this must be done in the class derived from the base wx control. """ - dbg('wxMaskedTextCtrl::SetValue = "%s"' % value, indent=1) + dbg('MaskedTextCtrl::SetValue = "%s"' % value, indent=1) if not self._mask: wx.TextCtrl.SetValue(self, value) # revert to base control behavior @@ -5887,7 +5896,7 @@ class wxMaskedTextCtrl( wx.TextCtrl, wxMaskedEditMixin ): def Clear(self): """ Blanks the current control value by replacing it with the default value.""" - dbg("wxMaskedTextCtrl::Clear - value reset to default value (template)") + dbg("MaskedTextCtrl::Clear - value reset to default value (template)") if self._mask: self.ClearValue() else: @@ -5897,9 +5906,9 @@ class wxMaskedTextCtrl( wx.TextCtrl, wxMaskedEditMixin ): def _Refresh(self): """ Allow mixin to refresh the base control with this function. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ - dbg('wxMaskedTextCtrl::_Refresh', indent=1) + dbg('MaskedTextCtrl::_Refresh', indent=1) wx.TextCtrl.Refresh(self) dbg(indent=0) @@ -5910,7 +5919,7 @@ class wxMaskedTextCtrl( wx.TextCtrl, wxMaskedEditMixin ): validate the contents of the masked control as it refreshes. NOTE: this must be done in the class derived from the base wx control. """ - dbg('wxMaskedTextCtrl::Refresh', indent=1) + dbg('MaskedTextCtrl::Refresh', indent=1) self._CheckValid() self._Refresh() dbg(indent=0) @@ -5919,7 +5928,7 @@ class wxMaskedTextCtrl( wx.TextCtrl, wxMaskedEditMixin ): def _IsEditable(self): """ Allow mixin to determine if the base control is editable with this function. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ return wx.TextCtrl.IsEditable(self) @@ -5982,7 +5991,7 @@ class wxMaskedTextCtrl( wx.TextCtrl, wxMaskedEditMixin ): ## ---------- ---------- ---------- ---------- ---------- ---------- ---------- ## Because calling SetSelection programmatically does not fire EVT_COMBOBOX ## events, we have to do it ourselves when we auto-complete. -class wxMaskedComboBoxSelectEvent(wx.PyCommandEvent): +class MaskedComboBoxSelectEvent(wx.PyCommandEvent): def __init__(self, id, selection = 0, object=None): wx.PyCommandEvent.__init__(self, wx.EVT_COMMAND_COMBOBOX_SELECTED, id) @@ -5995,7 +6004,7 @@ class wxMaskedComboBoxSelectEvent(wx.PyCommandEvent): return self.__selection -class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): +class MaskedComboBox( wx.ComboBox, MaskedEditMixin ): """ This masked edit control adds the ability to use a masked input on a combobox, and do auto-complete of such values. @@ -6022,7 +6031,7 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): if not kwargs.has_key('compareNoCase'): kwargs['compareNoCase'] = True - wxMaskedEditMixin.__init__( self, name, **kwargs ) + MaskedEditMixin.__init__( self, name, **kwargs ) self._choices = self._ctrl_constraints._choices dbg('self._choices:', self._choices) @@ -6077,7 +6086,7 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): def __repr__(self): - return "" % self.GetValue() + return "" % self.GetValue() def _CalcSize(self, size=None): @@ -6092,14 +6101,14 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): def _GetSelection(self): """ Allow mixin to get the text selection of this control. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ return self.GetMark() def _SetSelection(self, sel_start, sel_to): """ Allow mixin to set the text selection of this control. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ return self.SetMark( sel_start, sel_to ) @@ -6114,14 +6123,14 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): def _GetValue(self): """ Allow mixin to get the raw value of the control with this function. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ return self.GetValue() def _SetValue(self, value): """ Allow mixin to set the raw value of the control with this function. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ # For wxComboBox, ensure that values are properly padded so that # if varying length choices are supplied, they always show up @@ -6203,7 +6212,7 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): def _Refresh(self): """ Allow mixin to refresh the base control with this function. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ wx.ComboBox.Refresh(self) @@ -6220,7 +6229,7 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): def _IsEditable(self): """ Allow mixin to determine if the base control is editable with this function. - REQUIRED by any class derived from wxMaskedEditMixin. + REQUIRED by any class derived from MaskedEditMixin. """ return not self.__readonly @@ -6326,7 +6335,7 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): Override mixin's default SetCtrlParameters to detect changes in choice list, so we can update the base control: """ - wxMaskedEditMixin.SetCtrlParameters(self, **kwargs ) + MaskedEditMixin.SetCtrlParameters(self, **kwargs ) if( self.controlInitialized and (kwargs.has_key('choices') or self._choices != self._ctrl_constraints._choices) ): wx.ComboBox.Clear(self) @@ -6343,7 +6352,7 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): events. """ dbg(suspend=1) # turn off debugging around this function - dbg('wxMaskedComboBox::GetMark', indent=1) + dbg('MaskedComboBox::GetMark', indent=1) if self.__readonly: dbg(indent=0) return 0, 0 # no selection possible for editing @@ -6377,7 +6386,7 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): Necessary for bookkeeping on choice selection, to keep current value current. """ - dbg('wxMaskedComboBox::SetSelection(%d)' % index) + dbg('MaskedComboBox::SetSelection(%d)' % index) if self._mask: self._prevValue = self._curValue self._curValue = self._choices[index] @@ -6405,7 +6414,7 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): on the text of the control somehow interferes with the combobox's selection mechanism for the arrow keys. """ - dbg('wxMaskedComboBox::OnSelectChoice', indent=1) + dbg('MaskedComboBox::OnSelectChoice', indent=1) if not self._mask: event.Skip() @@ -6453,13 +6462,13 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): Override mixin (empty) autocomplete handler, so that autocompletion causes combobox to update appropriately. """ - dbg('wxMaskedComboBox::OnAutoSelect', field._index, indent=1) + dbg('MaskedComboBox::OnAutoSelect', field._index, indent=1) ## field._autoCompleteIndex = match_index if field == self._ctrl_constraints: self.SetSelection(match_index) dbg('issuing combo selection event') self.GetEventHandler().ProcessEvent( - wxMaskedComboBoxSelectEvent( self.GetId(), match_index, self ) ) + MaskedComboBoxSelectEvent( self.GetId(), match_index, self ) ) self._CheckValid() dbg('field._autoCompleteIndex:', match_index) dbg('self.GetSelection():', self.GetSelection()) @@ -6476,7 +6485,7 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): programmatic wxComboBox.SetSelection() call to pick the appropriate item in the list. (and then do the usual OnReturn bit.) """ - dbg('wxMaskedComboBox::OnReturn', indent=1) + dbg('MaskedComboBox::OnReturn', indent=1) dbg('current value: "%s"' % self.GetValue(), 'current index:', self.GetSelection()) if self.GetSelection() == -1 and self.GetValue().lower().strip() in self._ctrl_constraints._compareChoices: wx.CallAfter(self.SetSelection, self._ctrl_constraints._autoCompleteIndex) @@ -6488,9 +6497,9 @@ class wxMaskedComboBox( wx.ComboBox, wxMaskedEditMixin ): ## ---------- ---------- ---------- ---------- ---------- ---------- ---------- -class wxIpAddrCtrl( wxMaskedTextCtrl ): +class IpAddrCtrl( MaskedTextCtrl ): """ - This class is a particular type of wxMaskedTextCtrl that accepts + This class is a particular type of MaskedTextCtrl that accepts and understands the semantics of IP addresses, reformats input as you move from field to field, and accepts '.' as a navigation character, so that typing an IP address can be done naturally. @@ -6500,7 +6509,7 @@ class wxIpAddrCtrl( wxMaskedTextCtrl ): size = wx.DefaultSize, style = wx.TE_PROCESS_TAB, validator = wx.DefaultValidator, - name = 'wxIpAddrCtrl', + name = 'IpAddrCtrl', setupEventHandling = True, ## setup event handling by default **kwargs): @@ -6512,7 +6521,7 @@ class wxIpAddrCtrl( wxMaskedTextCtrl ): kwargs['validRegex'] = "( \d| \d\d|(1\d\d|2[0-4]\d|25[0-5]))(\.( \d| \d\d|(1\d\d|2[0-4]\d|25[0-5]))){3}" - wxMaskedTextCtrl.__init__( + MaskedTextCtrl.__init__( self, parent, id=id, value = value, pos=pos, size=size, style = style, @@ -6539,7 +6548,7 @@ class wxIpAddrCtrl( wxMaskedTextCtrl ): def OnDot(self, event): - dbg('wxIpAddrCtrl::OnDot', indent=1) + dbg('IpAddrCtrl::OnDot', indent=1) pos = self._adjustPos(self._GetInsertionPoint(), event.GetKeyCode()) oldvalue = self.GetValue() edit_start, edit_end, slice = self._FindFieldExtent(pos, getslice=True) @@ -6556,18 +6565,18 @@ class wxIpAddrCtrl( wxMaskedTextCtrl ): def GetAddress(self): - value = wxMaskedTextCtrl.GetValue(self) + value = MaskedTextCtrl.GetValue(self) return value.replace(' ','') # remove spaces from the value def _OnCtrl_S(self, event): - dbg("wxIpAddrCtrl::_OnCtrl_S") + dbg("IpAddrCtrl::_OnCtrl_S") if self._demo: print "value:", self.GetAddress() return False def SetValue(self, value): - dbg('wxIpAddrCtrl::SetValue(%s)' % str(value), indent=1) + dbg('IpAddrCtrl::SetValue(%s)' % str(value), indent=1) if type(value) not in (types.StringType, types.UnicodeType): dbg(indent=0) raise ValueError('%s must be a string', str(value)) @@ -6604,7 +6613,7 @@ class wxIpAddrCtrl( wxMaskedTextCtrl ): else: dbg('parts:', parts) value = string.join(parts, '.') - wxMaskedTextCtrl.SetValue(self, value) + MaskedTextCtrl.SetValue(self, value) dbg(indent=0) @@ -6723,7 +6732,7 @@ def getDay(dateStr,dateFmt): class test(wx.PySimpleApp): def OnInit(self): from wx.lib.rcsizer import RowColSizer - self.frame = wx.Frame( None, -1, "wxMaskedEditMixin 0.0.7 Demo Page #1", size = (700,600)) + self.frame = wx.Frame( None, -1, "MaskedEditMixin 0.0.7 Demo Page #1", size = (700,600)) self.panel = wx.Panel( self.frame, -1) self.sizer = RowColSizer() self.labels = [] @@ -6803,7 +6812,7 @@ Try entering nonsensical or partial values in validated fields to see what happe self.sizer.Add( wx.StaticText( self.panel, -1, control[4][:20]),row=rowcount, col=3,border=5, flag=wx.ALL) if control in controls[:]:#-2]: - newControl = wxMaskedTextCtrl( self.panel, -1, "", + newControl = MaskedTextCtrl( self.panel, -1, "", mask = control[1], excludeChars = control[2], formatcodes = control[3], @@ -6815,7 +6824,7 @@ Try entering nonsensical or partial values in validated fields to see what happe demo = True) if control[6]: newControl.SetCtrlParameters(choiceRequired = True) else: - newControl = wxMaskedComboBox( self.panel, -1, "", + newControl = MaskedComboBox( self.panel, -1, "", choices = control[7], choiceRequired = True, mask = control[1], @@ -6928,19 +6937,19 @@ To see a great example of validations in action, try entering a bad email addres ("US Zip Code","USZIP"), ("US Zip+4","USZIPPLUS4"), ("Email Address","EMAIL"), - ("IP Address", "(derived control wxIpAddrCtrl)") + ("IP Address", "(derived control IpAddrCtrl)") ] for control in controls: self.sizer.Add( wx.StaticText( self.panel, -1, control[0]),row=rowcount, col=0,border=5,flag=wx.ALL) self.sizer.Add( wx.StaticText( self.panel, -1, control[1]),row=rowcount, col=1,border=5, flag=wx.ALL) if control in controls[:-1]: - self.sizer.Add( wxMaskedTextCtrl( self.panel, -1, "", + self.sizer.Add( MaskedTextCtrl( self.panel, -1, "", autoformat = control[1], demo = True), row=rowcount,col=2,flag=wx.ALL,border=5) else: - self.sizer.Add( wxIpAddrCtrl( self.panel, -1, "", demo=True ), + self.sizer.Add( IpAddrCtrl( self.panel, -1, "", demo=True ), row=rowcount,col=2,flag=wx.ALL,border=5) rowcount += 1 @@ -6976,14 +6985,14 @@ i=1 ## control in the EVT_TEXT handler, and if *different*, call event.Skip() ## to propagate it down the event chain, and let the application see it. ## -## 2. WS: wxMaskedComboBox is deficient in several areas, all having to do with the +## 2. WS: MaskedComboBox is deficient in several areas, all having to do with the ## behavior of the underlying control that I can't fix. The problems are: ## a) The background coloring doesn't work in the text field of the control; ## instead, there's a only border around it that assumes the correct color. ## b) The control will not pass WXK_TAB to the event handler, no matter what ## I do, and there's no style wxCB_PROCESS_TAB like wxTE_PROCESS_TAB to -## indicate that we want these events. As a result, wxMaskedComboBox -## doesn't do the nice field-tabbing that wxMaskedTextCtrl does. +## indicate that we want these events. As a result, MaskedComboBox +## doesn't do the nice field-tabbing that MaskedTextCtrl does. ## c) Auto-complete had to be reimplemented for the control because programmatic ## setting of the value of the text field does not set up the auto complete ## the way that the control processing keystrokes does. (But I think I've @@ -6994,7 +7003,7 @@ i=1 ## implemented has its flaws, not the least of which is that due to the ## strategy that I'm using, the paste buffer is always replaced by the ## contents of the control's selection when in focus, on each keystroke; -## this makes it impossible to paste anything into a wxMaskedComboBox +## this makes it impossible to paste anything into a MaskedComboBox ## at the moment... :-( ## e) The other deficient behavior, likely induced by the workaround for (d), ## is that you can can't shift-left to select more than one character @@ -7004,7 +7013,7 @@ i=1 ## 3. WS: Controls on wxPanels don't seem to pass Shift-WXK_TAB to their ## EVT_KEY_DOWN or EVT_CHAR event handlers. Until this is fixed in ## wxWindows, shift-tab won't take you backwards through the fields of -## a wxMaskedTextCtrl like it should. Until then Shifted arrow keys will +## a MaskedTextCtrl like it should. Until then Shifted arrow keys will ## work like shift-tab and tab ought to. ## @@ -7014,7 +7023,7 @@ i=1 ## fields. Example: City validates against list of cities, or zip vs zip code list. ## 2. Allow optional monetary symbols (eg. $, pounds, etc.) at front of a "decimal" ## control. -## 3. Fix shift-left selection for wxMaskedComboBox. +## 3. Fix shift-left selection for MaskedComboBox. ## 5. Transform notion of "decimal control" to be less "entire control"-centric, ## so that monetary symbols can be included and still have the appropriate ## semantics. (Big job, as currently written, but would make control even @@ -7027,15 +7036,15 @@ i=1 ## (Reported) bugs fixed: ## 1. Right-click menu allowed "cut" operation that destroyed mask ## (was implemented by base control) -## 2. wxMaskedComboBox didn't allow .Append() of mixed-case values; all +## 2. MaskedComboBox didn't allow .Append() of mixed-case values; all ## got converted to lower case. -## 3. wxMaskedComboBox selection didn't deal with spaces in values +## 3. MaskedComboBox selection didn't deal with spaces in values ## properly when autocompleting, and didn't have a concept of "next" ## match for handling choice list duplicates. -## 4. Size of wxMaskedComboBox was always default. +## 4. Size of MaskedComboBox was always default. ## 5. Email address regexp allowed some "non-standard" things, and wasn't ## general enough. -## 6. Couldn't easily reset wxMaskedComboBox contents programmatically. +## 6. Couldn't easily reset MaskedComboBox contents programmatically. ## 7. Couldn't set emptyInvalid during construction. ## 8. Under some versions of wxPython, readonly comboboxes can apparently ## return a GetInsertionPoint() result (655535), causing masked control @@ -7110,7 +7119,7 @@ i=1 ## 13. Fixed a couple of coding bugs being flagged by Python2.1. ## 14. Fixed several issues with sign positioning, erasure and validity ## checking for "numeric" masked controls. -## 15. Added validation to wxIpAddrCtrl.SetValue(). +## 15. Added validation to IpAddrCtrl.SetValue(). ## ## Version 1.1 ## 1. Changed calling interface to use boolean "useFixedWidthFont" (True by default) @@ -7134,7 +7143,7 @@ i=1 ## fixed failure to obey case conversion codes when pasting. ## 11. Implemented '0' (zero-pad) formatting code, as it wasn't being done anywhere... ## 12. Removed condition from OnDecimalPoint, so that it always truncates right on '.' -## 13. Enhanced wxIpAddrCtrl to use right-insert fields, selection on field traversal, +## 13. Enhanced IpAddrCtrl to use right-insert fields, selection on field traversal, ## individual field validation to prevent field values > 255, and require explicit ## tab/. to change fields. ## 14. Added handler for left double-click to select field under cursor. @@ -7143,7 +7152,7 @@ i=1 ## attribute, for more consistent and controllable coloring. ## 17. Added retainFieldValidation parameter, allowing top-level constraints ## such as "validRequired" to be set independently of field-level equivalent. -## (needed in wxTimeCtrl for bounds constraints.) +## (needed in TimeCtrl for bounds constraints.) ## 18. Refactored code a bit, cleaned up and commented code more heavily, fixed ## some of the logic for setting/resetting parameters, eg. fillChar, defaultValue, ## etc. @@ -7180,9 +7189,9 @@ i=1 ## than making assumptions about character width. ## 7. Fixed GetMaskParameter(), which was non-functional in previous version. ## 8. Fixed exceptions raised to provide info on which control had the error. -## 9. Fixed bug in choice management of wxMaskedComboBox. -## 10. Fixed bug in wxIpAddrCtrl causing traceback if field value was of -## the form '# #'. Modified control code for wxIpAddrCtrl so that '.' +## 9. Fixed bug in choice management of MaskedComboBox. +## 10. Fixed bug in IpAddrCtrl causing traceback if field value was of +## the form '# #'. Modified control code for IpAddrCtrl so that '.' ## in the middle of a field clips the rest of that field, similar to ## decimal and integer controls. ## @@ -7210,14 +7219,14 @@ i=1 ## is not desired in every position. Added IsDefault() function to mean "does the value ## equal the template?" and modified .IsEmpty() to mean "do all of the editable ## positions in the template == the fillChar?" -## 10. Extracted mask logic into mixin, so we can have both wxMaskedTextCtrl and wxMaskedComboBox, +## 10. Extracted mask logic into mixin, so we can have both MaskedTextCtrl and MaskedComboBox, ## now included. -## 11. wxMaskedComboBox now adds the capability to validate from list of valid values. +## 11. MaskedComboBox now adds the capability to validate from list of valid values. ## Example: City validates against list of cities, or zip vs zip code list. ## 12. Fixed oversight in EVT_TEXT handler that prevented the events from being ## passed to the next handler in the event chain, causing updates to the ## control to be invisible to the parent code. -## 13. Added IPADDR autoformat code, and subclass wxIpAddrCtrl for controlling tabbing within +## 13. Added IPADDR autoformat code, and subclass IpAddrCtrl for controlling tabbing within ## the control, that auto-reformats as you move between cells. ## 14. Mask characters [A,a,X,#] can now appear in the format string as literals, by using '\'. ## 15. It is now possible to specify repeating masks, e.g. #{3}-#{3}-#{14} @@ -7238,7 +7247,7 @@ i=1 ## 19. Enhanced tabbing logic so that tab takes you to the next field if the ## control is a multi-field control. ## 20. Added stub method called whenever the control "changes fields", that -## can be overridden by subclasses (eg. wxIpAddrCtrl.) +## can be overridden by subclasses (eg. IpAddrCtrl.) ## 21. Changed a lot of code to be more functionally-oriented so side-effects ## aren't as problematic when maintaining code and/or adding features. ## Eg: IsValid() now does not have side-effects; it merely reflects the @@ -7367,7 +7376,7 @@ i=1 ## 4. Home and End keys now supported to move cursor to beginning or end of field. ## 5. Un-signed integers and decimals now supported. ## 6. Cosmetic improvements to the demo. -## 7. Class renamed to wxMaskedTextCtrl. +## 7. Class renamed to MaskedTextCtrl. ## 8. Can now specify include characters that will override the basic ## controls: for example, includeChars = "@." for email addresses ## 9. Added mask character 'C' -> allow any upper or lowercase character diff --git a/wxPython/wx/lib/maskednumctrl.py b/wxPython/wx/lib/maskednumctrl.py index c8e7e4bb83..138a88adbe 100644 --- a/wxPython/wx/lib/maskednumctrl.py +++ b/wxPython/wx/lib/maskednumctrl.py @@ -9,10 +9,10 @@ # NOTE: # This was written to provide a numeric edit control for wxPython that # does things like right-insert (like a calculator), and does grouping, etc. -# (ie. the features of wxMaskedTextCtrl), but allows Get/Set of numeric +# (ie. the features of MaskedTextCtrl), but allows Get/Set of numeric # values, rather than text. # -# wxMaskedNumCtrl permits integer, and floating point values to be set +# MaskedNumCtrl permits integer, and floating point values to be set # retrieved or set via .GetValue() and .SetValue() (type chosen based on # fraction width, and provides an EVT_MASKEDNUM() event function for trapping # changes to the control. @@ -24,38 +24,45 @@ # Similarly, replacing the contents of the control with '-' will result in # a selected (absolute) value of -1. # -# wxMaskedNumCtrl also supports range limits, with the option of either +# MaskedNumCtrl also supports range limits, with the option of either # enforcing them or simply coloring the text of the control if the limits # are exceeded. # -# wxMaskedNumCtrl is intended to support fixed-point numeric entry, and -# is derived from wxMaskedTextCtrl. As such, it supports a limited range +# MaskedNumCtrl is intended to support fixed-point numeric entry, and +# is derived from MaskedTextCtrl. As such, it supports a limited range # of values to comply with a fixed-width entry mask. #---------------------------------------------------------------------------- # 12/09/2003 - Jeff Grimmett (grimmtooth@softhome.net) # # o Updated for wx namespace # +# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wxMaskedEditMixin -> MaskedEditMixin +# o wxMaskedTextCtrl -> MaskedTextCtrl +# o wxMaskedNumNumberUpdatedEvent -> MaskedNumNumberUpdatedEvent +# o wxMaskedNumCtrl -> MaskedNumCtrl +# """

-wxMaskedNumCtrl: +MaskedNumCtrl:

  • allows you to get and set integer or floating point numbers as value,
  • provides bounds support and optional value limiting,
  • -
  • has the right-insert input style that wxMaskedTextCtrl supports,
  • +
  • has the right-insert input style that MaskedTextCtrl supports,
  • provides optional automatic grouping, sign control and format, grouping and decimal character selection, etc. etc.

-Being derived from wxMaskedTextCtrl, the control only allows +Being derived from MaskedTextCtrl, the control only allows fixed-point notation. That is, it has a fixed (though reconfigurable) maximum width for the integer portion and optional fixed width fractional portion.

Here's the API:

-    wxMaskedNumCtrl(
+    MaskedNumCtrl(
          parent, id = -1,
          value = 0,
          pos = wxDefaultPosition,
@@ -361,7 +368,7 @@ MAXINT = maxint     # (constants should be in upper case)
 MININT = -maxint-1
 
 from wx.tools.dbg import Logger
-from wx.lib.maskededit import wxMaskedEditMixin, wxMaskedTextCtrl, Field
+from wx.lib.maskededit import MaskedEditMixin, MaskedTextCtrl, Field
 
 dbg = Logger()
 dbg(enable=0)
@@ -373,7 +380,7 @@ EVT_MASKEDNUM = wx.PyEventBinder(wxEVT_COMMAND_MASKED_NUMBER_UPDATED, 1)
 
 #----------------------------------------------------------------------------
 
-class wxMaskedNumNumberUpdatedEvent(wx.PyCommandEvent):
+class MaskedNumNumberUpdatedEvent(wx.PyCommandEvent):
     def __init__(self, id, value = 0, object=None):
         wx.PyCommandEvent.__init__(self, wxEVT_COMMAND_MASKED_NUMBER_UPDATED, id)
 
@@ -388,7 +395,7 @@ class wxMaskedNumNumberUpdatedEvent(wx.PyCommandEvent):
 
 #----------------------------------------------------------------------------
 
-class wxMaskedNumCtrl(wxMaskedTextCtrl):
+class MaskedNumCtrl(MaskedTextCtrl):
 
     valid_ctrl_params = {
         'integerWidth': 10,                 # by default allow all 32-bit integers
@@ -419,21 +426,21 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
                 name = "maskednum",
                 **kwargs ):
 
-        dbg('wxMaskedNumCtrl::__init__', indent=1)
+        dbg('MaskedNumCtrl::__init__', indent=1)
 
         # Set defaults for control:
         dbg('setting defaults:')
-        for key, param_value in wxMaskedNumCtrl.valid_ctrl_params.items():
+        for key, param_value in MaskedNumCtrl.valid_ctrl_params.items():
             # This is done this way to make setattr behave consistently with
             # "private attribute" name mangling
             setattr(self, '_' + key, copy.copy(param_value))
 
         # Assign defaults for all attributes:
-        init_args = copy.deepcopy(wxMaskedNumCtrl.valid_ctrl_params)
+        init_args = copy.deepcopy(MaskedNumCtrl.valid_ctrl_params)
         dbg('kwargs:', kwargs)
         for key, param_value in kwargs.items():
             key = key.replace('Color', 'Colour')
-            if key not in wxMaskedNumCtrl.valid_ctrl_params.keys():
+            if key not in MaskedNumCtrl.valid_ctrl_params.keys():
                 raise AttributeError('invalid keyword argument "%s"' % key)
             else:
                 init_args[key] = param_value
@@ -490,7 +497,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         self._typedSign = False
 
         # Construct the base control:
-        wxMaskedTextCtrl.__init__(
+        MaskedTextCtrl.__init__(
                 self, parent, id, '',
                 pos, size, style, validator, name,
                 mask = mask,
@@ -517,14 +524,14 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
 
         # Ensure proper coloring:
         self.Refresh()
-        dbg('finished wxMaskedNumCtrl::__init__', indent=0)
+        dbg('finished MaskedNumCtrl::__init__', indent=0)
 
 
     def SetParameters(self, **kwargs):
         """
         This routine is used to initialize and reconfigure the control:
         """
-        dbg('wxMaskedNumCtrl::SetParameters', indent=1)
+        dbg('MaskedNumCtrl::SetParameters', indent=1)
         maskededit_kwargs = {}
         reset_fraction_width = False
 
@@ -596,9 +603,9 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         # for all other parameters, assign keyword args as appropriate:
         for key, param_value in kwargs.items():
             key = key.replace('Color', 'Colour')
-            if key not in wxMaskedNumCtrl.valid_ctrl_params.keys():
+            if key not in MaskedNumCtrl.valid_ctrl_params.keys():
                 raise AttributeError('invalid keyword argument "%s"' % key)
-            elif key not in wxMaskedEditMixin.valid_ctrl_params.keys():
+            elif key not in MaskedEditMixin.valid_ctrl_params.keys():
                 setattr(self, '_' + key, param_value)
             elif key in ('mask', 'autoformat'): # disallow explicit setting of mask
                 raise AttributeError('invalid keyword argument "%s"' % key)
@@ -726,7 +733,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
             dbg('abs(value):', value)
             self._isNeg = False
 
-        elif not self._allowNone and wxMaskedTextCtrl.GetValue(self) == '':
+        elif not self._allowNone and MaskedTextCtrl.GetValue(self) == '':
             if self._min > 0:
                 value = self._min
             else:
@@ -746,7 +753,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
             sel_start, sel_to = self.GetSelection()
             self._SetValue(self._toGUI(value))
         self.Refresh() # recolor as appropriate
-        dbg('finished wxMaskedNumCtrl::SetParameters', indent=0)
+        dbg('finished MaskedNumCtrl::SetParameters', indent=0)
 
 
 
@@ -768,7 +775,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         else:
             fracstart, fracend = self._fields[1]._extent
             if candidate is None:
-                value = self._toGUI(wxMaskedTextCtrl.GetValue(self))
+                value = self._toGUI(MaskedTextCtrl.GetValue(self))
             else:
                 value = self._toGUI(candidate)
             fracstring = value[fracstart:fracend].strip()
@@ -778,14 +785,14 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
                 return string.atof(fracstring)
 
     def _OnChangeSign(self, event):
-        dbg('wxMaskedNumCtrl::_OnChangeSign', indent=1)
+        dbg('MaskedNumCtrl::_OnChangeSign', indent=1)
         self._typedSign = True
-        wxMaskedEditMixin._OnChangeSign(self, event)
+        MaskedEditMixin._OnChangeSign(self, event)
         dbg(indent=0)
 
 
     def _disallowValue(self):
-        dbg('wxMaskedNumCtrl::_disallowValue')
+        dbg('MaskedNumCtrl::_disallowValue')
         # limited and -1 is out of bounds
         if self._typedSign:
             self._isNeg = False
@@ -805,7 +812,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         by the user.
         """
 
-        dbg('wxMaskedNumCtrl::_SetValue("%s")' % value, indent=1)
+        dbg('MaskedNumCtrl::_SetValue("%s")' % value, indent=1)
 
         if( (self._fractionWidth and value.find(self._decimalChar) == -1) or
             (self._fractionWidth == 0 and value.find(self._decimalChar) != -1) ) :
@@ -817,8 +824,8 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
 
         if numvalue == "":
             if self._allowNone:
-                dbg('calling base wxMaskedTextCtrl._SetValue(self, "%s")' % value)
-                wxMaskedTextCtrl._SetValue(self, value)
+                dbg('calling base MaskedTextCtrl._SetValue(self, "%s")' % value)
+                MaskedTextCtrl._SetValue(self, value)
                 self.Refresh()
                 return
             elif self._min > 0 and self.IsLimited():
@@ -918,7 +925,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
             # reasonable instead:
             dbg('setting replacement value:', replacement)
             self._SetValue(self._toGUI(replacement))
-            sel_start = wxMaskedTextCtrl.GetValue(self).find(str(abs(replacement)))   # find where it put the 1, so we can select it
+            sel_start = MaskedTextCtrl.GetValue(self).find(str(abs(replacement)))   # find where it put the 1, so we can select it
             sel_to = sel_start + len(str(abs(replacement)))
             dbg('queuing selection of (%d, %d)' %(sel_start, sel_to))
             wx.CallAfter(self.SetInsertionPoint, sel_start)
@@ -944,18 +951,18 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
 
 
         sel_start, sel_to = self._GetSelection()     # record current insertion point
-        dbg('calling base wxMaskedTextCtrl._SetValue(self, "%s")' % adjvalue)
-        wxMaskedTextCtrl._SetValue(self, adjvalue)
+        dbg('calling base MaskedTextCtrl._SetValue(self, "%s")' % adjvalue)
+        MaskedTextCtrl._SetValue(self, adjvalue)
         # After all actions so far scheduled, check that resulting cursor
         # position is appropriate, and move if not:
         wx.CallAfter(self._CheckInsertionPoint)
 
-        dbg('finished wxMaskedNumCtrl::_SetValue', indent=0)
+        dbg('finished MaskedNumCtrl::_SetValue', indent=0)
 
     def _CheckInsertionPoint(self):
         # If current insertion point is before the end of the integer and
         # its before the 1st digit, place it just after the sign position:
-        dbg('wxMaskedNumCtrl::CheckInsertionPoint', indent=1)
+        dbg('MaskedNumCtrl::CheckInsertionPoint', indent=1)
         sel_start, sel_to = self._GetSelection()
         text = self._GetValue()
         if sel_to < self._fields[0]._extent[1] and text[sel_to] in (' ', '-', '('):
@@ -972,13 +979,13 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         grouping characters auto selects the digit before or after the
         grouping character, so that the erasure does the right thing.
         """
-        dbg('wxMaskedNumCtrl::_OnErase', indent=1)
+        dbg('MaskedNumCtrl::_OnErase', indent=1)
 
         #if grouping digits, make sure deletes next to group char always
         # delete next digit to appropriate side:
         if self._groupDigits:
             key = event.GetKeyCode()
-            value = wxMaskedTextCtrl.GetValue(self)
+            value = MaskedTextCtrl.GetValue(self)
             sel_start, sel_to = self._GetSelection()
 
             if key == wx.WXK_BACK:
@@ -1004,7 +1011,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
                     self.SetInsertionPoint(sel_start)
                     self.SetSelection(sel_start, sel_to+1)
 
-        wxMaskedTextCtrl._OnErase(self, event)
+        MaskedTextCtrl._OnErase(self, event)
         dbg(indent=0)
 
 
@@ -1017,8 +1024,8 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         text events.  So we check for actual changes to the text
         before passing the events on.
         """
-        dbg('wxMaskedNumCtrl::OnTextChange', indent=1)
-        if not wxMaskedTextCtrl._OnTextChange(self, event):
+        dbg('MaskedNumCtrl::OnTextChange', indent=1)
+        if not MaskedTextCtrl._OnTextChange(self, event):
             dbg(indent=0)
             return
 
@@ -1028,7 +1035,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         if value != self._oldvalue:
             try:
                 self.GetEventHandler().ProcessEvent(
-                    wxMaskedNumNumberUpdatedEvent( self.GetId(), self.GetValue(), self ) )
+                    MaskedNumNumberUpdatedEvent( self.GetId(), self.GetValue(), self ) )
             except ValueError:
                 dbg(indent=0)
                 return
@@ -1039,7 +1046,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
 
     def _GetValue(self):
         """
-        Override of wxMaskedTextCtrl to allow amixin to get the raw text value of the
+        Override of MaskedTextCtrl to allow amixin to get the raw text value of the
         control with this function.
         """
         return wx.TextCtrl.GetValue(self)
@@ -1049,7 +1056,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         """
         Returns the current numeric value of the control.
         """
-        return self._fromGUI( wxMaskedTextCtrl.GetValue(self) )
+        return self._fromGUI( MaskedTextCtrl.GetValue(self) )
 
     def SetValue(self, value):
         """
@@ -1060,7 +1067,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         A ValueError exception will be raised if an invalid value
         is specified.
         """
-        wxMaskedTextCtrl.SetValue( self, self._toGUI(value) )
+        MaskedTextCtrl.SetValue( self, self._toGUI(value) )
 
 
     def SetIntegerWidth(self, value):
@@ -1091,7 +1098,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         If min > the max value allowed by the width of the control,
         the function will return False, and the min will not be set.
         """
-        dbg('wxMaskedNumCtrl::SetMin(%s)' % repr(min), indent=1)
+        dbg('MaskedNumCtrl::SetMin(%s)' % repr(min), indent=1)
         if( self._max is None
             or min is None
             or (self._max is not None and self._max >= min) ):
@@ -1296,7 +1303,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         type and bounds checking and raises ValueError if argument is
         not a valid value.
         """
-        dbg('wxMaskedNumCtrl::_toGUI(%s)' % repr(value), indent=1)
+        dbg('MaskedNumCtrl::_toGUI(%s)' % repr(value), indent=1)
         if value is None and self.IsNoneAllowed():
             dbg(indent=0)
             return self._template
@@ -1311,12 +1318,12 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
                     value = long(value)
             except Exception, e:
                 dbg('exception raised:', e, indent=0)
-                raise ValueError ('wxMaskedNumCtrl requires numeric value, passed %s'% repr(value) )
+                raise ValueError ('MaskedNumCtrl requires numeric value, passed %s'% repr(value) )
 
         elif type(value) not in (types.IntType, types.LongType, types.FloatType):
             dbg(indent=0)
             raise ValueError (
-                'wxMaskedNumCtrl requires numeric value, passed %s'% repr(value) )
+                'MaskedNumCtrl requires numeric value, passed %s'% repr(value) )
 
         if not self._allowNegative and value < 0:
             raise ValueError (
@@ -1366,7 +1373,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         Conversion function used in getting the value of the control.
         """
         dbg(suspend=0)
-        dbg('wxMaskedNumCtrl::_fromGUI(%s)' % value, indent=1)
+        dbg('MaskedNumCtrl::_fromGUI(%s)' % value, indent=1)
         # One or more of the underlying text control implementations
         # issue an intermediate EVT_TEXT when replacing the control's
         # value, where the intermediate value is an empty string.
@@ -1419,7 +1426,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
         Preprocessor for base control paste; if value needs to be right-justified
         to fit in control, do so prior to paste:
         """
-        dbg('wxMaskedNumCtrl::_Paste (value = "%s")' % value)
+        dbg('MaskedNumCtrl::_Paste (value = "%s")' % value)
         if value is None:
             paste_text = self._getClipboardContents()
         else:
@@ -1431,7 +1438,7 @@ class wxMaskedNumCtrl(wxMaskedTextCtrl):
             paste_text = self._toGUI(paste_text)
             self._SetSelection(0, len(self._mask))
 
-        return wxMaskedEditMixin._Paste(self,
+        return MaskedEditMixin._Paste(self,
                                         paste_text,
                                         raise_on_invalid=raise_on_invalid,
                                         just_return_value=just_return_value)
@@ -1450,7 +1457,7 @@ if __name__ == '__main__':
             style = wx.DEFAULT_DIALOG_STYLE ):
             wx.Dialog.__init__(self, parent, id, title, pos, size, style)
 
-            self.int_ctrl = wxMaskedNumCtrl(self, wx.NewId(), size=(55,20))
+            self.int_ctrl = MaskedNumCtrl(self, wx.NewId(), size=(55,20))
             self.OK = wx.Button( self, wx.ID_OK, "OK")
             self.Cancel = wx.Button( self, wx.ID_CANCEL, "Cancel")
 
@@ -1483,7 +1490,7 @@ if __name__ == '__main__':
             return True
 
         def OnClick(self, event):
-            dlg = myDialog(self.panel, -1, "test wxMaskedNumCtrl")
+            dlg = myDialog(self.panel, -1, "test MaskedNumCtrl")
             dlg.int_ctrl.SetValue(501)
             dlg.int_ctrl.SetInsertionPoint(1)
             dlg.int_ctrl.SetSelection(1,2)
diff --git a/wxPython/wx/lib/mixins/grid.py b/wxPython/wx/lib/mixins/grid.py
index a6d40673d5..f24b65058f 100644
--- a/wxPython/wx/lib/mixins/grid.py
+++ b/wxPython/wx/lib/mixins/grid.py
@@ -1,6 +1,6 @@
 #----------------------------------------------------------------------------
 # Name:        wxPython.lib.mixins.grid
-# Purpose:     Helpful mix-in classes for wxGrid
+# Purpose:     Helpful mix-in classes for wx.Grid
 #
 # Author:      Robin Dunn
 #
@@ -14,6 +14,10 @@
 # o 2.5 compatability update.
 # o Untested
 #
+# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxGridAutoEditMixin -> GridAutoEditMixin
+#
 
 import  wx
 import  wx.grid
@@ -21,7 +25,7 @@ import  wx.grid
 #----------------------------------------------------------------------------
 
 
-class wxGridAutoEditMixin:
+class GridAutoEditMixin:
     """A mix-in class that automatically enables the grid edit control when
     a cell is selected.
 
diff --git a/wxPython/wx/lib/mixins/listctrl.py b/wxPython/wx/lib/mixins/listctrl.py
index 07284e69cd..28247de2f4 100644
--- a/wxPython/wx/lib/mixins/listctrl.py
+++ b/wxPython/wx/lib/mixins/listctrl.py
@@ -14,13 +14,18 @@
 # o 2.5 compatability update.
 # o ListCtrlSelectionManagerMix untested.
 #
+# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxColumnSorterMixin -> ColumnSorterMixin 
+# o wxListCtrlAutoWidthMixin -> ListCtrlAutoWidthMixin 
+#
 
 import  locale
 import  wx
 
 #----------------------------------------------------------------------------
 
-class wxColumnSorterMixin:
+class ColumnSorterMixin:
     """
     A mixin class that handles sorting of a wx.ListCtrl in REPORT mode when
     the column header is clicked on.
@@ -144,7 +149,7 @@ class wxColumnSorterMixin:
 #----------------------------------------------------------------------------
 #----------------------------------------------------------------------------
 
-class wxListCtrlAutoWidthMixin:
+class ListCtrlAutoWidthMixin:
     """ A mix-in class that automatically resizes the last column to take up
         the remaining width of the wx.ListCtrl.
 
diff --git a/wxPython/wx/lib/multisash.py b/wxPython/wx/lib/multisash.py
index 7d364910e7..fac6afd531 100644
--- a/wxPython/wx/lib/multisash.py
+++ b/wxPython/wx/lib/multisash.py
@@ -7,12 +7,18 @@
 # Created:      2002/11/20
 # Version:      0.1
 # RCS-ID:       $Id$
-# License:      wxWindows licensie
+# License:      wxWindows license
 #----------------------------------------------------------------------
 # 12/09/2003 - Jeff Grimmett (grimmtooth@softhome.net)
 #
 # o 2.5 compatability update.
 #
+# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxMultiSash -> MultiSash
+# o wxMultiSplit -> MultiSplit wxMultiViewLeaf
+# o wxMultiViewLeaf -> MultiViewLeaf
+#
 
 import wx
 
@@ -24,11 +30,11 @@ CR_SIZE = SH_SIZE * 3
 
 #----------------------------------------------------------------------
 
-class wxMultiSash(wx.Window):
+class MultiSash(wx.Window):
     def __init__(self, *_args,**_kwargs):
         apply(wx.Window.__init__,(self,) + _args,_kwargs)
         self._defChild = EmptyChild
-        self.child = wxMultiSplit(self,self,(0,0),self.GetSize())
+        self.child = MultiSplit(self,self,(0,0),self.GetSize())
         self.Bind(wx.EVT_SIZE,self.OnMultiSize)
 
     def SetDefaultChildClass(self,childCls):
@@ -43,7 +49,7 @@ class wxMultiSash(wx.Window):
 
     def Clear(self):
         old = self.child
-        self.child = wxMultiSplit(self,self,(0,0),self.GetSize())
+        self.child = MultiSplit(self,self,(0,0),self.GetSize())
         old.Destroy()
         self.child.OnSize(None)
 
@@ -59,7 +65,7 @@ class wxMultiSash(wx.Window):
         exec 'import %s' % mod
         self._defChild = eval(dChild)
         old = self.child
-        self.child = wxMultiSplit(self,self,wxPoint(0,0),self.GetSize())
+        self.child = MultiSplit(self,self,wxPoint(0,0),self.GetSize())
         self.child.SetSaveData(data['child'])
         old.Destroy()
         self.OnMultiSize(None)
@@ -69,7 +75,7 @@ class wxMultiSash(wx.Window):
 #----------------------------------------------------------------------
 
 
-class wxMultiSplit(wx.Window):
+class MultiSplit(wx.Window):
     def __init__(self,multiView,parent,pos,size,view1 = None):
         wx.Window.__init__(self,id = -1,parent = parent,pos = pos,size = size,
                           style = wx.CLIP_CHILDREN)
@@ -80,7 +86,7 @@ class wxMultiSplit(wx.Window):
             self.view1.Reparent(self)
             self.view1.MoveXY(0,0)
         else:
-            self.view1 = wxMultiViewLeaf(self.multiView,self,
+            self.view1 = MultiViewLeaf(self.multiView,self,
                                          (0,0),self.GetSize())
         self.direction = None
 
@@ -90,11 +96,11 @@ class wxMultiSplit(wx.Window):
         saveData = {}
         if self.view1:
             saveData['view1'] = self.view1.GetSaveData()
-            if isinstance(self.view1,wxMultiSplit):
+            if isinstance(self.view1,MultiSplit):
                 saveData['view1IsSplit'] = 1
         if self.view2:
             saveData['view2'] = self.view2.GetSaveData()
-            if isinstance(self.view2,wxMultiSplit):
+            if isinstance(self.view2,MultiSplit):
                 saveData['view2IsSplit'] = 1
         saveData['direction'] = self.direction
         v1,v2 = self.GetPosition()
@@ -113,10 +119,10 @@ class wxMultiSplit(wx.Window):
             isSplit = data.get('view1IsSplit',None)
             old = self.view1
             if isSplit:
-                self.view1 = wxMultiSplit(self.multiView,self,
+                self.view1 = MultiSplit(self.multiView,self,
                                           (0,0),self.GetSize())
             else:
-                self.view1 = wxMultiViewLeaf(self.multiView,self,
+                self.view1 = MultiViewLeaf(self.multiView,self,
                                              (0,0),self.GetSize())
             self.view1.SetSaveData(v1Data)
             if old:
@@ -126,10 +132,10 @@ class wxMultiSplit(wx.Window):
             isSplit = data.get('view2IsSplit',None)
             old = self.view2
             if isSplit:
-                self.view2 = wxMultiSplit(self.multiView,self,
+                self.view2 = MultiSplit(self.multiView,self,
                                           (0,0),self.GetSize())
             else:
-                self.view2 = wxMultiViewLeaf(self.multiView,self,
+                self.view2 = MultiViewLeaf(self.multiView,self,
                                              (0,0),self.GetSize())
             self.view2.SetSaveData(v2Data)
             if old:
@@ -152,13 +158,13 @@ class wxMultiSplit(wx.Window):
     def AddLeaf(self,direction,caller,pos):
         if self.view2:
             if caller == self.view1:
-                self.view1 = wxMultiSplit(self.multiView,self,
+                self.view1 = MultiSplit(self.multiView,self,
                                           caller.GetPosition(),
                                           caller.GetSize(),
                                           caller)
                 self.view1.AddLeaf(direction,caller,pos)
             else:
-                self.view2 = wxMultiSplit(self.multiView,self,
+                self.view2 = MultiSplit(self.multiView,self,
                                           caller.GetPosition(),
                                           caller.GetSize(),
                                           caller)
@@ -174,7 +180,7 @@ class wxMultiSplit(wx.Window):
                 x,y = (0,pos)
                 w1,h1 = (w,h-pos)
                 w2,h2 = (w,pos)
-            self.view2 = wxMultiViewLeaf(self.multiView, self, (x,y), (w1,h1))
+            self.view2 = MultiViewLeaf(self.multiView, self, (x,y), (w1,h1))
             self.view1.SetSize((w2,h2))
             self.view2.OnSize(None)
 
@@ -281,7 +287,7 @@ class wxMultiSplit(wx.Window):
 #----------------------------------------------------------------------
 
 
-class wxMultiViewLeaf(wx.Window):
+class MultiViewLeaf(wx.Window):
     def __init__(self,multiView,parent,pos,size):
         wx.Window.__init__(self,id = -1,parent = parent,pos = pos,size = size,
                           style = wx.CLIP_CHILDREN)
diff --git a/wxPython/wx/lib/mvctree.py b/wxPython/wx/lib/mvctree.py
index 227c7a0a04..6a9a9bf3ef 100644
--- a/wxPython/wx/lib/mvctree.py
+++ b/wxPython/wx/lib/mvctree.py
@@ -3,15 +3,22 @@
 # o 2.5 compatability update.
 # o I'm a little nervous about some of it though.
 #
+# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxTreeModel -> TreeModel
+# o wxMVCTree -> MVCTree
+# o wxMVCTreeEvent -> MVCTreeEvent
+# o wxMVCTreeNotifyEvent -> MVCTreeNotifyEvent
+#
 
 """
-wxMVCTree is a control which handles hierarchical data. It is constructed
+MVCTree is a control which handles hierarchical data. It is constructed
 in model-view-controller architecture, so the display of that data, and
 the content of the data can be changed greatly without affecting the other parts.
 
-wxMVCTree actually is even more configurable than MVC normally implies, because
+MVCTree actually is even more configurable than MVC normally implies, because
 almost every aspect of it is pluggable:
-    wxMVCTree - Overall controller, and the window that actually gets placed
+    MVCTree - Overall controller, and the window that actually gets placed
     in the GUI.
         Painter - Paints the control. The 'view' part of MVC.
            NodePainter - Paints just the nodes
@@ -57,7 +64,7 @@ warnings.warn(warningmsg, DeprecationWarning, stacklevel=2)
 
 class MVCTreeNode:
     """
-    Used internally by wxMVCTree to manage its data. Contains information about
+    Used internally by MVCTree to manage its data. Contains information about
     screen placement, the actual data associated with it, and more. These are
     the nodes passed to all the other helper parts to do their work with.
     """
@@ -151,7 +158,7 @@ class Transform:
 
 class Painter:
     """
-    This is the interface that wxMVCTree expects from painters. All painters should
+    This is the interface that MVCTree expects from painters. All painters should
     be Painter subclasses.
     """
     def __init__(self, tree):
@@ -236,7 +243,7 @@ class Painter:
         evt.Skip()
 
 
-class wxTreeModel:
+class TreeModel:
     """
     Interface for tree models
     """
@@ -305,7 +312,7 @@ class TextConverter:
         raise NotImplementedError
 
 
-class BasicTreeModel(wxTreeModel):
+class BasicTreeModel(TreeModel):
     """
     A very simple treemodel implementation, but flexible enough for many needs.
     """
@@ -333,21 +340,21 @@ class BasicTreeModel(wxTreeModel):
         if not self.children.has_key(parent):
             self.children[parent]=[]
         self.children[parent].append(child)
-        wxTreeModel.AddChild(self, parent, child)
+        TreeModel.AddChild(self, parent, child)
         return child
 
     def RemoveNode(self, node):
         parent = self.parents[node]
         del self.parents[node]
         self.children[parent].remove(node)
-        wxTreeModel.RemoveNode(self, node)
+        TreeModel.RemoveNode(self, node)
 
     def InsertChild(self, parent, child, index):
         self.parents[child]=parent
         if not self.children.has_key(parent):
             self.children[parent]=[]
         self.children[parent].insert(child, index)
-        wxTreeModel.InsertChild(self, parent, child, index)
+        TreeModel.InsertChild(self, parent, child, index)
         return child
 
     def IsLeaf(self, node):
@@ -728,7 +735,7 @@ EVT_MVCTREE_ADD_ITEM = wx.PyEventBinder(wxEVT_MVCTREE_ADD_ITEM, 1)
 EVT_MVCTREE_DELETE_ITEM = wx.PyEventBinder(wxEVT_MVCTREE_DELETE_ITEM, 1)
 EVT_MVCTREE_KEY_DOWN = wx.PyEventBinder(wxEVT_MVCTREE_KEY_DOWN, 1)
 
-class wxMVCTreeEvent(wx.PyCommandEvent):
+class MVCTreeEvent(wx.PyCommandEvent):
     def __init__(self, type, id, node = None, nodes = None, keyEvent = None, **kwargs):
         apply(wx.PyCommandEvent.__init__, (self, type, id), kwargs)
         self.node = node
@@ -741,14 +748,14 @@ class wxMVCTreeEvent(wx.PyCommandEvent):
     def getKeyEvent(self):
         return self.keyEvent
 
-class wxMVCTreeNotifyEvent(wxMVCTreeEvent):
+class MVCTreeNotifyEvent(MVCTreeEvent):
     def __init__(self, type, id, node = None, nodes = None, **kwargs):
-        apply(wxMVCTreeEvent.__init__, (self, type, id, node, nodes), kwargs)
+        apply(MVCTreeEvent.__init__, (self, type, id, node, nodes), kwargs)
         self.notify = wx.NotifyEvent(type, id)
     def getNotifyEvent(self):
         return self.notify
 
-class wxMVCTree(wx.ScrolledWindow):
+class MVCTree(wx.ScrolledWindow):
     """
     The main mvc tree class.
     """
@@ -801,28 +808,28 @@ class wxMVCTree(wx.ScrolledWindow):
         return self.transform
 
     def __repr__(self):
-        return "" % str(hex(id(self)))
+        return "" % str(hex(id(self)))
 
     def __str__(self):
         return self.__repr__()
 
     def NodeAdded(self, parent, child):
-        e = wxMVCTreeEvent(wxEVT_MVCTREE_ADD_ITEM, self.GetId(), node = child, nodes = [parent, child])
+        e = MVCTreeEvent(wxEVT_MVCTREE_ADD_ITEM, self.GetId(), node = child, nodes = [parent, child])
         self.GetEventHandler().ProcessEvent(e)
         self.painter.ClearBuffer()
 
     def NodeInserted(self, parent, child, index):
-        e = wxMVCTreeEvent(wxEVT_MVCTREE_ADD_ITEM, self.GetId(), node = child, nodes = [parent, child])
+        e = MVCTreeEvent(wxEVT_MVCTREE_ADD_ITEM, self.GetId(), node = child, nodes = [parent, child])
         self.GetEventHandler().ProcessEvent(e)
         self.painter.ClearBuffer()
 
     def NodeRemoved(self, node):
-        e = wxMVCTreeEvent(wxEVT_MVCTREE_DELETE_ITEM, self.GetId(), node = child, nodes = [parent, child])
+        e = MVCTreeEvent(wxEVT_MVCTREE_DELETE_ITEM, self.GetId(), node = child, nodes = [parent, child])
         self.GetEventHandler().ProcessEvent(e)
         self.painter.ClearBuffer()
 
     def OnKeyDown(self, evt):
-        e = wxMVCTreeEvent(wxEVT_MVCTREE_KEY_DOWN, self.GetId(), keyEvent = evt)
+        e = MVCTreeEvent(wxEVT_MVCTREE_KEY_DOWN, self.GetId(), keyEvent = evt)
         self.GetEventHandler().ProcessEvent(e)
 
     def SetFont(self, font):
@@ -862,7 +869,7 @@ class wxMVCTree(wx.ScrolledWindow):
 
     def SetDoubleBuffered(self, bool):
         """
-        By default wxMVCTree is double-buffered.
+        By default MVCTree is double-buffered.
         """
         self.doubleBuffered = bool
 
@@ -923,7 +930,7 @@ class wxMVCTree(wx.ScrolledWindow):
     def SetSelection(self, nodeTuple):
         if type(nodeTuple) != type(()):
             nodeTuple = (nodeTuple,)
-        e = wxMVCTreeNotifyEvent(wxEVT_MVCTREE_SEL_CHANGING, self.GetId(), nodeTuple[0], nodes = nodeTuple)
+        e = MVCTreeNotifyEvent(wxEVT_MVCTREE_SEL_CHANGING, self.GetId(), nodeTuple[0], nodes = nodeTuple)
         self.GetEventHandler().ProcessEvent(e)
         if not e.notify.IsAllowed():
             return
@@ -934,7 +941,7 @@ class wxMVCTree(wx.ScrolledWindow):
             treenode = self.nodemap[node]
             node.selected = False
         self._selections = list(nodeTuple)
-        e = wxMVCTreeEvent(wxEVT_MVCTREE_SEL_CHANGED, self.GetId(), nodeTuple[0], nodes = nodeTuple)
+        e = MVCTreeEvent(wxEVT_MVCTREE_SEL_CHANGED, self.GetId(), nodeTuple[0], nodes = nodeTuple)
         self.GetEventHandler().ProcessEvent(e)
 
     def IsMultiSelect(self):
@@ -951,7 +958,7 @@ class wxMVCTree(wx.ScrolledWindow):
             return
         for ed in self._editors:
             if ed.CanEdit(node):
-                e = wxMVCTreeNotifyEvent(wxEVT_MVCTREE_BEGIN_EDIT, self.GetId(), node)
+                e = MVCTreeNotifyEvent(wxEVT_MVCTREE_BEGIN_EDIT, self.GetId(), node)
                 self.GetEventHandler().ProcessEvent(e)
                 if not e.notify.IsAllowed():
                     return
@@ -965,7 +972,7 @@ class wxMVCTree(wx.ScrolledWindow):
             self._currentEditor = None
 
     def _EditEnding(self, node):
-        e = wxMVCTreeNotifyEvent(wxEVT_MVCTREE_END_EDIT, self.GetId(), node)
+        e = MVCTreeNotifyEvent(wxEVT_MVCTREE_END_EDIT, self.GetId(), node)
         self.GetEventHandler().ProcessEvent(e)
         if not e.notify.IsAllowed():
             return False
@@ -976,23 +983,23 @@ class wxMVCTree(wx.ScrolledWindow):
     def SetExpanded(self, node, bool):
         treenode = self.nodemap[node]
         if bool:
-            e = wxMVCTreeNotifyEvent(wxEVT_MVCTREE_ITEM_EXPANDING, self.GetId(), node)
+            e = MVCTreeNotifyEvent(wxEVT_MVCTREE_ITEM_EXPANDING, self.GetId(), node)
             self.GetEventHandler().ProcessEvent(e)
             if not e.notify.IsAllowed():
                 return
             if not treenode.built:
                 self.LoadChildren(treenode)
         else:
-            e = wxMVCTreeNotifyEvent(wxEVT_MVCTREE_ITEM_COLLAPSING, self.GetId(), node)
+            e = MVCTreeNotifyEvent(wxEVT_MVCTREE_ITEM_COLLAPSING, self.GetId(), node)
             self.GetEventHandler().ProcessEvent(e)
             if not e.notify.IsAllowed():
                 return
         treenode.expanded = bool
         e = None
         if treenode.expanded:
-            e = wxMVCTreeEvent(wxEVT_MVCTREE_ITEM_EXPANDED, self.GetId(), node)
+            e = MVCTreeEvent(wxEVT_MVCTREE_ITEM_EXPANDED, self.GetId(), node)
         else:
-            e = wxMVCTreeEvent(wxEVT_MVCTREE_ITEM_COLLAPSED, self.GetId(), node)
+            e = MVCTreeEvent(wxEVT_MVCTREE_ITEM_COLLAPSED, self.GetId(), node)
         self.GetEventHandler().ProcessEvent(e)
         self.layout.Layout(self.currentRoot)
         self.transform.Transform(self.currentRoot, self.offset, self.rotation)
@@ -1005,7 +1012,7 @@ class wxMVCTree(wx.ScrolledWindow):
         nodeTuple = nodeOrTuple
         if type(nodeOrTuple)!= type(()):
             nodeTuple = (nodeOrTuple,)
-        e = wxMVCTreeNotifyEvent(wxEVT_MVCTREE_SEL_CHANGING, self.GetId(), nodeTuple[0], nodes = nodeTuple)
+        e = MVCTreeNotifyEvent(wxEVT_MVCTREE_SEL_CHANGING, self.GetId(), nodeTuple[0], nodes = nodeTuple)
         self.GetEventHandler().ProcessEvent(e)
         if not e.notify.IsAllowed():
             return
@@ -1046,7 +1053,7 @@ class wxMVCTree(wx.ScrolledWindow):
                         treenode = self.nodemap[node]
                         treenode.selected = True
                         changeparents.append(treenode)
-        e = wxMVCTreeEvent(wxEVT_MVCTREE_SEL_CHANGED, self.GetId(), nodeTuple[0], nodes = nodeTuple)
+        e = MVCTreeEvent(wxEVT_MVCTREE_SEL_CHANGED, self.GetId(), nodeTuple[0], nodes = nodeTuple)
         self.GetEventHandler().ProcessEvent(e)
         dc = wx.ClientDC(self)
         self.PrepareDC(dc)
@@ -1064,7 +1071,7 @@ class wxMVCTree(wx.ScrolledWindow):
             treenode = self.nodemap[node]
             changeparents.append(treenode)
             treenode.selected = False
-        e = wxMVCTreeEvent(wxEVT_MVCTREE_SEL_CHANGED, self.GetId(), node, nodes = nodeTuple)
+        e = MVCTreeEvent(wxEVT_MVCTREE_SEL_CHANGED, self.GetId(), node, nodes = nodeTuple)
         self.GetEventHandler().ProcessEvent(e)
         dc = wx.ClientDC(self)
         self.PrepareDC(dc)
diff --git a/wxPython/wx/lib/popupctl.py b/wxPython/wx/lib/popupctl.py
index 8815018f1d..44dc77dec1 100644
--- a/wxPython/wx/lib/popupctl.py
+++ b/wxPython/wx/lib/popupctl.py
@@ -13,6 +13,11 @@
 #
 # o 2.5 compatability update.
 #
+# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxPopupDialog -> PopupDialog
+# o wxPopupControl -> PopupControl
+#
 
 import  wx
 from wx.lib.buttons import GenButtonEvent
@@ -142,7 +147,7 @@ class PopButton(wx.PyControl):
 
 
 # Tried to use wxPopupWindow but the control misbehaves on MSW
-class wxPopupDialog(wx.Dialog):
+class PopupDialog(wx.Dialog):
     def __init__(self,parent,content = None):
         wx.Dialog.__init__(self,parent,-1,'', style = wx.BORDER_SIMPLE|wx.STAY_ON_TOP)
 
@@ -187,7 +192,7 @@ class wxPopupDialog(wx.Dialog):
 #---------------------------------------------------------------------------
 
 
-class wxPopupControl(wx.PyControl):
+class PopupControl(wx.PyControl):
     def __init__(self,*_args,**_kwargs):
         if _kwargs.has_key('value'):
             del _kwargs['value']
@@ -216,7 +221,7 @@ class wxPopupControl(wx.PyControl):
     def OnButton(self,evt):
         if not self.pop:
             if self.content:
-                self.pop = wxPopupDialog(self,self.content)
+                self.pop = PopupDialog(self,self.content)
                 del self.content
             else:
                 print 'No Content to pop'
@@ -250,4 +255,4 @@ class wxPopupControl(wx.PyControl):
 
 
 # an alias
-wxPopupCtrl = wxPopupControl
+PopupCtrl = PopupControl
diff --git a/wxPython/wx/lib/rightalign.py b/wxPython/wx/lib/rightalign.py
index f002373799..646b7505c9 100644
--- a/wxPython/wx/lib/rightalign.py
+++ b/wxPython/wx/lib/rightalign.py
@@ -16,6 +16,10 @@
 # o 2.5 compatability update.
 # o Added deprecation warning.
 #
+# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxRightTextCtrl -> RightTextCtrl
+#
 
 """
 Some time ago, I asked about how to right-align
@@ -60,7 +64,7 @@ warnings.warn(warningmsg, DeprecationWarning, stacklevel=2)
 
 #----------------------------------------------------------------------
 
-class wxRightTextCtrl(wx.TextCtrl):
+class RightTextCtrl(wx.TextCtrl):
     def __init__(self, parent, id, *args, **kwargs):
         wx.TextCtrl.__init__(self, parent, id, *args, **kwargs)
         self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
diff --git a/wxPython/wx/lib/scrolledpanel.py b/wxPython/wx/lib/scrolledpanel.py
index c716647b1f..f9640c03b2 100644
--- a/wxPython/wx/lib/scrolledpanel.py
+++ b/wxPython/wx/lib/scrolledpanel.py
@@ -1,5 +1,5 @@
 #----------------------------------------------------------------------------
-# Name:         wxScrolledPanel.py
+# Name:         scrolledpanel.py
 # Author:       Will Sadkin
 # Created:      03/21/2003
 # Copyright:    (c) 2003 by Will Sadkin
@@ -10,13 +10,17 @@
 #
 # o 2.5 compatability update.
 #
+# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxScrolledPanel -> ScrolledPanel
+#
 
 import  wx
 
 
-class wxScrolledPanel( wx.ScrolledWindow ):
+class ScrolledPanel( wx.ScrolledWindow ):
     """\
-wxScrolledPanel fills a "hole" in the implementation of wxScrolledWindow,
+ScrolledPanel fills a "hole" in the implementation of wx.ScrolledWindow,
 providing automatic scrollbar and scrolling behavior and the tab traversal
 management that wxScrolledWindow lacks.  This code was based on the original
 demo code showing how to do this, but is now available for general use
@@ -37,7 +41,7 @@ as a proper class (and the demo is now converted to just use it.)
         """
         This function sets up the event handling necessary to handle
         scrolling properly. It should be called within the __init__
-        function of any class that is derived from wxScrolledPanel,
+        function of any class that is derived from ScrolledPanel,
         once the controls on the panel have been constructed and
         thus the size of the scrolling area can be determined.
 
diff --git a/wxPython/wx/lib/timectrl.py b/wxPython/wx/lib/timectrl.py
index 4628110fb9..f3c40ab2bc 100644
--- a/wxPython/wx/lib/timectrl.py
+++ b/wxPython/wx/lib/timectrl.py
@@ -1,5 +1,5 @@
 #----------------------------------------------------------------------------
-# Name:         wxTimeCtrl.py
+# Name:         timectrl.py
 # Author:       Will Sadkin
 # Created:      09/19/2002
 # Copyright:    (c) 2002 by Will Sadkin, 2002
@@ -13,12 +13,12 @@
 #   component of that control is inaccessible through the interface exposed in
 #   wxPython.
 #
-#   wxTimeCtrl does not use validators, because it does careful manipulation
+#   TimeCtrl does not use validators, because it does careful manipulation
 #   of the cursor in the text window on each keystroke, and validation is
 #   cursor-position specific, so the control intercepts the key codes before the
 #   validator would fire.
 #
-#   wxTimeCtrl now also supports .SetValue() with either strings or wxDateTime
+#   TimeCtrl now also supports .SetValue() with either strings or wxDateTime
 #   values, as well as range limits, with the option of either enforcing them
 #   or simply coloring the text of the control if the limits are exceeded.
 #
@@ -37,22 +37,27 @@
 #   lock up. Noted in other places using it too, it's not this module
 #   that's at fault.
 # 
+# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o wxMaskedTextCtrl -> MaskedTextCtrl
+# o wxTimeCtrl -> TimeCtrl
+#
 
 """
 

-wxTimeCtrl provides a multi-cell control that allows manipulation of a time +TimeCtrl provides a multi-cell control that allows manipulation of a time value. It supports 12 or 24 hour format, and you can use wxDateTime or mxDateTime to get/set values from the control.

-Left/right/tab keys to switch cells within a wxTimeCtrl, and the up/down arrows act -like a spin control. wxTimeCtrl also allows for an actual spin button to be attached +Left/right/tab keys to switch cells within a TimeCtrl, and the up/down arrows act +like a spin control. TimeCtrl also allows for an actual spin button to be attached to the control, so that it acts like the up/down arrow keys.

The ! or c key sets the value of the control to the current time.

-Here's the API for wxTimeCtrl: +Here's the API for TimeCtrl:

-    wxTimeCtrl(
+    TimeCtrl(
          parent, id = -1,
          value = '12:00:00 AM',
          pos = wxDefaultPosition,
@@ -77,10 +82,10 @@ Here's the API for wxTimeCtrl:
     
The size of the control will be automatically adjusted for 12/24 hour format if wxDefaultSize is specified.
style -
By default, wxTimeCtrl will process TAB events, by allowing tab to the +
By default, TimeCtrl will process TAB events, by allowing tab to the different cells within the control.
validator -
By default, wxTimeCtrl just uses the default (empty) validator, as all +
By default, TimeCtrl just uses the default (empty) validator, as all of its validation for entry control is handled internally. However, a validator can be supplied to provide data transfer capability to the control.
@@ -91,11 +96,11 @@ Here's the API for wxTimeCtrl:
spinButton
If specified, this button's events will be bound to the behavior of the - wxTimeCtrl, working like up/down cursor key events. (See BindSpinButton.) + TimeCtrl, working like up/down cursor key events. (See BindSpinButton.)
min
Defines the lower bound for "valid" selections in the control. - By default, wxTimeCtrl doesn't have bounds. You must set both upper and lower + By default, TimeCtrl doesn't have bounds. You must set both upper and lower bounds to make the control pay attention to them, (as only one bound makes no sense with times.) "Valid" times will fall between the min and max "pie wedge" of the clock. @@ -253,7 +258,7 @@ import types import wx from wx.tools.dbg import Logger -from wx.lib.maskededit import wxMaskedTextCtrl, Field +from wx.lib.maskededit import MaskedTextCtrl, Field dbg = Logger() dbg(enable=0) @@ -277,7 +282,7 @@ class TimeUpdatedEvent(wx.PyCommandEvent): return self.value -class wxTimeCtrl(wxMaskedTextCtrl): +class TimeCtrl(MaskedTextCtrl): valid_ctrl_params = { 'display_seconds' : True, # by default, shows seconds @@ -285,7 +290,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): 'max': None, 'limited': False, # by default, no limiting even if bounds set 'useFixedWidthFont': True, # by default, use a fixed-width font - 'oob_color': "Yellow" # by default, the default wxMaskedTextCtrl "invalid" color + 'oob_color': "Yellow" # by default, the default MaskedTextCtrl "invalid" color } def __init__ ( @@ -300,10 +305,10 @@ class wxTimeCtrl(wxMaskedTextCtrl): # set defaults for control: dbg('setting defaults:') - for key, param_value in wxTimeCtrl.valid_ctrl_params.items(): + for key, param_value in TimeCtrl.valid_ctrl_params.items(): # This is done this way to make setattr behave consistently with # "private attribute" name mangling - setattr(self, "_wxTimeCtrl__" + key, copy.copy(param_value)) + setattr(self, "_TimeCtrl__" + key, copy.copy(param_value)) # create locals from current defaults, so we can override if # specified in kwargs, and handle uniformly: @@ -320,7 +325,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): # assign keyword args as appropriate: for key, param_value in kwargs.items(): - if key not in wxTimeCtrl.valid_ctrl_params.keys(): + if key not in TimeCtrl.valid_ctrl_params.keys(): raise AttributeError('invalid keyword argument "%s"' % key) if key == "display_seconds": @@ -383,7 +388,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): maskededit_kwargs['formatcodes'] = 'T!' # Now we can initialize the base control: - wxMaskedTextCtrl.__init__( + MaskedTextCtrl.__init__( self, parent, id=id, pos=pos, size=size, style = style, @@ -420,7 +425,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): self.Bind(wx.EVT_LEFT_DCLICK, self._OnDoubleClick ) ## select field under cursor on dclick self.Bind(wx.EVT_KEY_DOWN, self._OnKeyDown ) ## capture control events not normally seen, eg ctrl-tab. self.Bind(wx.EVT_CHAR, self.__OnChar ) ## remove "shift" attribute from colon key event, - ## then call wxMaskedTextCtrl._OnChar with + ## then call MaskedTextCtrl._OnChar with ## the possibly modified event. self.Bind(wx.EVT_TEXT, self.__OnTextChange, self ) ## color control appropriately and EVT_TIMEUPDATE events @@ -443,7 +448,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): This function binds an externally created spin button to the control, so that up/down events from the button automatically change the control. """ - dbg('wxTimeCtrl::BindSpinButton') + dbg('TimeCtrl::BindSpinButton') self.__spinButton = sb if self.__spinButton: # bind event handlers to spin ctrl @@ -452,7 +457,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): def __repr__(self): - return "" % self.GetValue() + return "" % self.GetValue() def SetValue(self, value): @@ -462,7 +467,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): and convert wxDateTime, mxDateTime, or 12/24 format time string into the appropriate format string for the control. """ - dbg('wxTimeCtrl::SetValue(%s)' % repr(value), indent=1) + dbg('TimeCtrl::SetValue(%s)' % repr(value), indent=1) try: strtime = self._toGUI(self.__validateValue(value)) except: @@ -491,7 +496,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): elif as_mxDateTimeDelta: value = DateTime.DateTimeDelta(0, value.GetHour(), value.GetMinute(), value.GetSecond()) else: - value = wxMaskedTextCtrl.GetValue(self) + value = MaskedTextCtrl.GetValue(self) return value @@ -504,7 +509,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): def GetWxDateTime(self, value=None): """ - This function is the conversion engine for wxTimeCtrl; it takes + This function is the conversion engine for TimeCtrl; it takes one of the following types: time string wxDateTime @@ -520,7 +525,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): """ global accept_mx dbg(suspend=1) - dbg('wxTimeCtrl::GetWxDateTime(%s)' % repr(value), indent=1) + dbg('TimeCtrl::GetWxDateTime(%s)' % repr(value), indent=1) if value is None: dbg('getting control value') value = self.GetValue() @@ -608,7 +613,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): adjusted to the new minimum value; if not limited, the value in the control will be colored as invalid. """ - dbg('wxTimeCtrl::SetMin(%s)'% repr(min), indent=1) + dbg('TimeCtrl::SetMin(%s)'% repr(min), indent=1) if min is not None: try: min = self.GetWxDateTime(min) @@ -636,7 +641,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): by default, or as a string if as_string argument is True. """ dbg(suspend=1) - dbg('wxTimeCtrl::GetMin, as_string?', as_string, indent=1) + dbg('TimeCtrl::GetMin, as_string?', as_string, indent=1) if self.__min is None: dbg('(min == None)') ret = self.__min @@ -667,7 +672,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): adjusted to this maximum value; if not limited, the value in the control will be colored as invalid. """ - dbg('wxTimeCtrl::SetMax(%s)' % repr(max), indent=1) + dbg('TimeCtrl::SetMax(%s)' % repr(max), indent=1) if max is not None: try: max = self.GetWxDateTime(max) @@ -695,7 +700,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): by default, or as a string if as_string argument is True. """ dbg(suspend=1) - dbg('wxTimeCtrl::GetMin, as_string?', as_string, indent=1) + dbg('TimeCtrl::GetMin, as_string?', as_string, indent=1) if self.__max is None: dbg('(max == None)') ret = self.__max @@ -746,7 +751,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): limiting, but coloring of out-of-bounds values will still take place if bounds have been set for the control. """ - dbg('wxTimeCtrl::SetLimited(%d)' % limited, indent=1) + dbg('TimeCtrl::SetLimited(%d)' % limited, indent=1) self.__limited = limited if not limited: @@ -842,7 +847,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): dbg('ValueError getting wxDateTime for %s' % repr(value), indent=0) raise - dbg('wxTimeCtrl::IsInBounds(%s)' % repr(value), indent=1) + dbg('TimeCtrl::IsInBounds(%s)' % repr(value), indent=1) if self.__min is None or self.__max is None: dbg(indent=0) return True @@ -889,7 +894,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): def __OnTextChange(self, event=None): - dbg('wxTimeCtrl::OnTextChange', indent=1) + dbg('TimeCtrl::OnTextChange', indent=1) # Allow wxMaskedtext base control to color as appropriate, # and Skip the EVT_TEXT event (if appropriate.) @@ -900,7 +905,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): ## event iff the value has actually changed. The masked edit ## OnTextChange routine does this, and returns True on a valid event, ## False otherwise. - if not wxMaskedTextCtrl._OnTextChange(self, event): + if not MaskedTextCtrl._OnTextChange(self, event): return dbg('firing TimeUpdatedEvent...') @@ -916,14 +921,14 @@ class wxTimeCtrl(wxMaskedTextCtrl): This is necessary to handle the optional spin button, because the insertion point is lost when the focus shifts to the spin button. """ - dbg('wxTimeCtrl::SetInsertionPoint', pos, indent=1) - wxMaskedTextCtrl.SetInsertionPoint(self, pos) # (causes EVT_TEXT event to fire) + dbg('TimeCtrl::SetInsertionPoint', pos, indent=1) + MaskedTextCtrl.SetInsertionPoint(self, pos) # (causes EVT_TEXT event to fire) self.__posCurrent = self.GetInsertionPoint() dbg(indent=0) def SetSelection(self, sel_start, sel_to): - dbg('wxTimeCtrl::SetSelection', sel_start, sel_to, indent=1) + dbg('TimeCtrl::SetSelection', sel_start, sel_to, indent=1) # Adjust selection range to legal extent if not already if sel_start < 0: @@ -936,7 +941,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): sel_to = cell_end self.__bSelection = sel_start != sel_to - wxMaskedTextCtrl.SetSelection(self, sel_start, sel_to) + MaskedTextCtrl.SetSelection(self, sel_start, sel_to) dbg(indent=0) @@ -961,7 +966,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): Event handler for any bound spin button on EVT_SPIN_UP; causes control to behave as if up arrow was pressed. """ - dbg('wxTimeCtrl::OnSpinUp', indent=1) + dbg('TimeCtrl::OnSpinUp', indent=1) self.__OnSpin(WXK_UP) keep_processing = False dbg(indent=0) @@ -973,7 +978,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): Event handler for any bound spin button on EVT_SPIN_DOWN; causes control to behave as if down arrow was pressed. """ - dbg('wxTimeCtrl::OnSpinDown', indent=1) + dbg('TimeCtrl::OnSpinDown', indent=1) self.__OnSpin(WXK_DOWN) keep_processing = False dbg(indent=0) @@ -987,13 +992,13 @@ class wxTimeCtrl(wxMaskedTextCtrl): It then calls the base control's _OnChar routine with the modified event instance. """ - dbg('wxTimeCtrl::OnChar', indent=1) + dbg('TimeCtrl::OnChar', indent=1) keycode = event.GetKeyCode() dbg('keycode:', keycode) if keycode == ord(':'): dbg('colon seen! removing shift attribute') event.m_shiftDown = False - wxMaskedTextCtrl._OnChar(self, event ) ## handle each keypress + MaskedTextCtrl._OnChar(self, event ) ## handle each keypress dbg(indent=0) @@ -1012,7 +1017,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): Event handler for motion events; this handler changes limits the selection to the new cell boundaries. """ - dbg('wxTimeCtrl::LimitSelection', indent=1) + dbg('TimeCtrl::LimitSelection', indent=1) pos = self.GetInsertionPoint() self.__posCurrent = pos sel_start, sel_to = self.GetSelection() @@ -1031,7 +1036,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): def __IncrementValue(self, key, pos): - dbg('wxTimeCtrl::IncrementValue', key, pos, indent=1) + dbg('TimeCtrl::IncrementValue', key, pos, indent=1) text = self.GetValue() field = self._FindField(pos) dbg('field: ', field._index) @@ -1095,7 +1100,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): not a valid value for the control as currently specified. It is used by both the SetValue() and the IsValid() methods. """ - dbg('wxTimeCtrl::__validateValue(%s)' % repr(value), indent=1) + dbg('TimeCtrl::__validateValue(%s)' % repr(value), indent=1) if not value: dbg(indent=0) raise ValueError('%s not a valid time value' % repr(value)) @@ -1115,7 +1120,7 @@ class wxTimeCtrl(wxMaskedTextCtrl): return value #---------------------------------------------------------------------------- -# Test jig for wxTimeCtrl: +# Test jig for TimeCtrl: if __name__ == '__main__': import traceback @@ -1130,7 +1135,7 @@ if __name__ == '__main__': self.test_mx = test_mx - self.tc = wxTimeCtrl(self, 10, fmt24hr = fmt24hr) + self.tc = TimeCtrl(self, 10, fmt24hr = fmt24hr) sb = wx.SpinButton( self, 20, wx.DefaultPosition, (-1,20), 0 ) self.tc.BindSpinButton(sb) @@ -1160,7 +1165,7 @@ if __name__ == '__main__': fmt24hr = '24' in sys.argv test_mx = 'mx' in sys.argv try: - frame = wx.Frame(None, -1, "wxTimeCtrl Test", (20,20), (100,100) ) + frame = wx.Frame(None, -1, "TimeCtrl Test", (20,20), (100,100) ) panel = TestPanel(frame, -1, (-1,-1), fmt24hr=fmt24hr, test_mx = test_mx) frame.Show(True) except: diff --git a/wxPython/wx/tools/dbg.py b/wxPython/wx/tools/dbg.py index 5556098d1c..5c791f8864 100644 --- a/wxPython/wx/tools/dbg.py +++ b/wxPython/wx/tools/dbg.py @@ -7,6 +7,10 @@ # Copyright: (c) 2002 by Will Sadkin, 2002 # License: wxWindows license #---------------------------------------------------------------------------- +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o V2.5 compatability update +# """ This module provides a useful debugging framework that supports @@ -217,20 +221,22 @@ class Logger: #------------------------------------------------------------ if __name__ == "__main__": - from wxPython.wx import * - wxLog_SetActiveTarget( wxLogStderr() ) + import sys + import wx + + wx.Log_SetActiveTarget( wx.LogStderr() ) logger = Logger('module') dbg = logger.dbg dbg(enable=1) logger('test __call__ interface') dbg('testing wxLog output to stderr:', wxlog=1, indent=1) dbg('1,2,3...') - dbg('testing wxLogNull:') - devnull = wxLogNull() + dbg('testing wx.LogNull:') + devnull = wx.LogNull() dbg('4,5,6...') # shouldn't print, according to doc... del devnull - dbg('(resuming to wxLogStdErr)', '7,8,9...', indent=0) - dbg('disabling wxLog output, switching to stderr:') + dbg('(resuming to wx.LogStdErr)', '7,8,9...', indent=0) + dbg('disabling wx.Log output, switching to stderr:') dbg(wxlog=0, stream=sys.stderr) dbg(logger._outstream, 'switching back to stdout:') dbg(stream=None) diff --git a/wxPython/wx/tools/img2img.py b/wxPython/wx/tools/img2img.py index a405fb112c..130b78ab94 100644 --- a/wxPython/wx/tools/img2img.py +++ b/wxPython/wx/tools/img2img.py @@ -8,25 +8,31 @@ # Copyright: (c) 2002 by Total Control Software # Licence: wxWindows license #---------------------------------------------------------------------- +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o V2.5 compatability update +# +import getopt +import glob +import os +import sys -import sys, os, glob, getopt -from wxPython.wx import * - +import wx def convert(file, maskClr, outputDir, outputName, outType, outExt): if os.path.splitext(file)[1].lower() == ".ico": - icon = wxIcon(file, wxBITMAP_TYPE_ICO) - img = wxBitmapFromIcon(icon) + icon = wx.Icon(file, wx.BITMAP_TYPE_ICO) + img = wx.BitmapFromIcon(icon) else: - img = wxBitmap(file, wxBITMAP_TYPE_ANY) + img = wx.Bitmap(file, wx.BITMAP_TYPE_ANY) if not img.Ok(): return 0, file + " failed to load!" else: if maskClr: om = img.GetMask() - mask = wxMaskColour(img, maskClr) + mask = wx.MaskColour(img, maskClr) img.SetMask(mask) if om is not None: om.Destroy() @@ -38,7 +44,7 @@ def convert(file, maskClr, outputDir, outputName, outType, outExt): if img.SaveFile(newname, outType): return 1, file + " converted to " + newname else: - img = wxImageFromBitmap(img) + img = wx.ImageFromBitmap(img) if img.SaveFile(newname, outType): return 1, "ok" else: diff --git a/wxPython/wx/tools/img2png.py b/wxPython/wx/tools/img2png.py index 60201a4cf3..4416df9ebf 100644 --- a/wxPython/wx/tools/img2png.py +++ b/wxPython/wx/tools/img2png.py @@ -8,6 +8,10 @@ # Copyright: (c) 2002 by Total Control Software # Licence: wxWindows license #---------------------------------------------------------------------- +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o V2.5 compatability update +# """ img2png.py -- convert several image formats to PNG format @@ -32,15 +36,16 @@ Options: """ -import sys -import img2img -from wxPython import wx +import sys +import wx +import img2img + def main(): # some bitmap related things need to have a wxApp initialized... - if wx.wxGetApp() is None: - app = wx.wxPySimpleApp() - img2img.main(sys.argv[1:], wx.wxBITMAP_TYPE_PNG, ".png", __doc__) + if wx.GetApp() is None: + app = wx.PySimpleApp() + img2img.main(sys.argv[1:], wx.BITMAP_TYPE_PNG, ".png", __doc__) if __name__ == '__main__': main() diff --git a/wxPython/wx/tools/img2py.py b/wxPython/wx/tools/img2py.py index bd510ff3e9..b4f6b4c9e4 100644 --- a/wxPython/wx/tools/img2py.py +++ b/wxPython/wx/tools/img2py.py @@ -8,6 +8,10 @@ # Copyright: (c) 2002 by Total Control Software # Licence: wxWindows license #---------------------------------------------------------------------- +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o V2.5 compatability update +# """ @@ -54,12 +58,23 @@ Options: # - Cliff Wells # 20021206: Added catalog (-c) option. # +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o V2.5 compatability update +# + +import cPickle +import cStringIO +import getopt +import glob +import os +import sys +import tempfile +import zlib +import wx -import sys, os, glob, getopt, tempfile -import cPickle, cStringIO, zlib -import img2img -from wxPython import wx +import img2img def crunch_data(data, compressed): @@ -116,8 +131,8 @@ def main(args): return # some bitmap related things need to have a wxApp initialized... - if wx.wxGetApp() is None: - app = wx.wxPySimpleApp() + if wx.GetApp() is None: + app = wx.PySimpleApp() append = 0 compressed = 1 @@ -154,7 +169,7 @@ def main(args): # convert the image file to a temporary file tfname = tempfile.mktemp() - ok, msg = img2img.convert(image_file, maskClr, None, tfname, wx.wxBITMAP_TYPE_PNG, ".png") + ok, msg = img2img.convert(image_file, maskClr, None, tfname, wx.BITMAP_TYPE_PNG, ".png") if not ok: print msg return @@ -198,9 +213,9 @@ def main(args): out.write("#" + "-" * 70 + "\n") if not append: out.write("# This file was generated by %s\n#\n" % sys.argv[0]) - out.write("from wxPython.wx import wxImageFromStream, wxBitmapFromImage\n") + out.write("from wx import ImageFromStream, BitmapFromImage\n") if icon: - out.write("from wxPython.wx import wxEmptyIcon\n") + out.write("from wx import EmptyIcon\n") if compressed: out.write("import cStringIO, zlib\n\n\n") else: @@ -222,14 +237,14 @@ def main(args): out.write("def get%sBitmap():\n" - " return wxBitmapFromImage(get%sImage())\n\n" + " return BitmapFromImage(get%sImage())\n\n" "def get%sImage():\n" " stream = cStringIO.StringIO(get%sData())\n" - " return wxImageFromStream(stream)\n\n" + " return ImageFromStream(stream)\n\n" % tuple([imgName] * 4)) if icon: out.write("def get%sIcon():\n" - " icon = wxEmptyIcon()\n" + " icon = EmptyIcon()\n" " icon.CopyFromBitmap(get%sBitmap())\n" " return icon\n\n" % tuple([imgName] * 2)) diff --git a/wxPython/wx/tools/img2xpm.py b/wxPython/wx/tools/img2xpm.py index 08c1b97437..97c6d6061d 100644 --- a/wxPython/wx/tools/img2xpm.py +++ b/wxPython/wx/tools/img2xpm.py @@ -8,6 +8,10 @@ # Copyright: (c) 2002 by Total Control Software # Licence: wxWindows license #---------------------------------------------------------------------- +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o V2.5 compatability update +# """ img2xpm.py -- convert several image formats to XPM @@ -31,16 +35,17 @@ Options: the -o option. """ +import sys + +import wx -import sys -import img2img -from wxPython import wx +import img2img def main(): # some bitmap related things need to have a wxApp initialized... - if wx.wxGetApp() is None: - app = wx.wxPySimpleApp() - img2img.main(sys.argv[1:], wx.wxBITMAP_TYPE_XPM, ".xpm", __doc__) + if wx.GetApp() is None: + app = wx.PySimpleApp() + img2img.main(sys.argv[1:], wx.BITMAP_TYPE_XPM, ".xpm", __doc__) if __name__ == '__main__': diff --git a/wxPython/wxPython/lib/colourchooser/pycolourchooser.py b/wxPython/wxPython/lib/colourchooser/pycolourchooser.py index a0d731e262..d77994fa3c 100644 --- a/wxPython/wxPython/lib/colourchooser/pycolourchooser.py +++ b/wxPython/wxPython/lib/colourchooser/pycolourchooser.py @@ -7,4 +7,4 @@ import wx.lib.colourchooser.pycolourchooser __doc__ = wx.lib.colourchooser.pycolourchooser.__doc__ main = wx.lib.colourchooser.pycolourchooser.main -wxPyColourChooser = wx.lib.colourchooser.pycolourchooser.wxPyColourChooser +wxPyColourChooser = wx.lib.colourchooser.pycolourchooser.PyColourChooser diff --git a/wxPython/wxPython/lib/editor/__init__.py b/wxPython/wxPython/lib/editor/__init__.py index a5dab2cdd6..f43bb028a0 100644 --- a/wxPython/wxPython/lib/editor/__init__.py +++ b/wxPython/wxPython/lib/editor/__init__.py @@ -1,2 +1,2 @@ -from editor import wxEditor +from editor import Editor diff --git a/wxPython/wxPython/lib/editor/editor.py b/wxPython/wxPython/lib/editor/editor.py index bd30f4da99..806be039b4 100644 --- a/wxPython/wxPython/lib/editor/editor.py +++ b/wxPython/wxPython/lib/editor/editor.py @@ -10,4 +10,4 @@ ForceBetween = wx.lib.editor.editor.ForceBetween LineSplitter = wx.lib.editor.editor.LineSplitter LineTrimmer = wx.lib.editor.editor.LineTrimmer Scroller = wx.lib.editor.editor.Scroller -wxEditor = wx.lib.editor.editor.wxEditor +wxEditor = wx.lib.editor.editor.Editor diff --git a/wxPython/wxPython/lib/grids.py b/wxPython/wxPython/lib/grids.py index 23acfd0c41..93733cb1b1 100644 --- a/wxPython/wxPython/lib/grids.py +++ b/wxPython/wxPython/lib/grids.py @@ -6,5 +6,5 @@ import wx.lib.grids __doc__ = wx.lib.grids.__doc__ -wxFlexGridSizer = wx.lib.grids.wxFlexGridSizer -wxGridSizer = wx.lib.grids.wxGridSizer +wxFlexGridSizer = wx.lib.grids.PyFlexGridSizer +wxGridSizer = wx.lib.grids.PyGridSizer diff --git a/wxPython/wxPython/lib/infoframe.py b/wxPython/wxPython/lib/infoframe.py index 9a24bcb008..ff4035bec5 100644 --- a/wxPython/wxPython/lib/infoframe.py +++ b/wxPython/wxPython/lib/infoframe.py @@ -6,6 +6,6 @@ import wx.lib.infoframe __doc__ = wx.lib.infoframe.__doc__ -Dummy_wxPyInformationalMessagesFrame = wx.lib.infoframe.Dummy_wxPyInformationalMessagesFrame +Dummy_wxPyInformationalMessagesFrame = wx.lib.infoframe.Dummy_PyInformationalMessagesFrame _MyStatusBar = wx.lib.infoframe._MyStatusBar -wxPyInformationalMessagesFrame = wx.lib.infoframe.wxPyInformationalMessagesFrame +wxPyInformationalMessagesFrame = wx.lib.infoframe.PyInformationalMessagesFrame diff --git a/wxPython/wxPython/lib/intctrl.py b/wxPython/wxPython/lib/intctrl.py index 203a5d3d12..8496e214f9 100644 --- a/wxPython/wxPython/lib/intctrl.py +++ b/wxPython/wxPython/lib/intctrl.py @@ -7,6 +7,6 @@ import wx.lib.intctrl __doc__ = wx.lib.intctrl.__doc__ EVT_INT = wx.lib.intctrl.EVT_INT -wxIntCtrl = wx.lib.intctrl.wxIntCtrl -wxIntUpdatedEvent = wx.lib.intctrl.wxIntUpdatedEvent -wxIntValidator = wx.lib.intctrl.wxIntValidator +wxIntCtrl = wx.lib.intctrl.IntCtrl +wxIntUpdatedEvent = wx.lib.intctrl.IntUpdatedEvent +wxIntValidator = wx.lib.intctrl.IntValidator diff --git a/wxPython/wxPython/lib/maskedctrl.py b/wxPython/wxPython/lib/maskedctrl.py index 526a4ba129..c022bf40e3 100644 --- a/wxPython/wxPython/lib/maskedctrl.py +++ b/wxPython/wxPython/lib/maskedctrl.py @@ -7,4 +7,4 @@ import wx.lib.maskedctrl __doc__ = wx.lib.maskedctrl.__doc__ controlTypes = wx.lib.maskedctrl.controlTypes -wxMaskedCtrl = wx.lib.maskedctrl.wxMaskedCtrl +wxMaskedCtrl = wx.lib.maskedctrl.MaskedCtrl diff --git a/wxPython/wxPython/lib/maskededit.py b/wxPython/wxPython/lib/maskededit.py index 76d480eab1..42e4331cd5 100644 --- a/wxPython/wxPython/lib/maskededit.py +++ b/wxPython/wxPython/lib/maskededit.py @@ -9,8 +9,8 @@ __doc__ = wx.lib.maskededit.__doc__ Field = wx.lib.maskededit.Field test = wx.lib.maskededit.test test2 = wx.lib.maskededit.test2 -wxIpAddrCtrl = wx.lib.maskededit.wxIpAddrCtrl -wxMaskedComboBox = wx.lib.maskededit.wxMaskedComboBox -wxMaskedComboBoxSelectEvent = wx.lib.maskededit.wxMaskedComboBoxSelectEvent -wxMaskedEditMixin = wx.lib.maskededit.wxMaskedEditMixin -wxMaskedTextCtrl = wx.lib.maskededit.wxMaskedTextCtrl +wxIpAddrCtrl = wx.lib.maskededit.IpAddrCtrl +wxMaskedComboBox = wx.lib.maskededit.MaskedComboBox +wxMaskedComboBoxSelectEvent = wx.lib.maskededit.MaskedComboBoxSelectEvent +wxMaskedEditMixin = wx.lib.maskededit.MaskedEditMixin +wxMaskedTextCtrl = wx.lib.maskededit.MaskedTextCtrl diff --git a/wxPython/wxPython/lib/maskednumctrl.py b/wxPython/wxPython/lib/maskednumctrl.py index 8b0201fee5..99e09bc188 100644 --- a/wxPython/wxPython/lib/maskednumctrl.py +++ b/wxPython/wxPython/lib/maskednumctrl.py @@ -7,5 +7,5 @@ import wx.lib.maskednumctrl __doc__ = wx.lib.maskednumctrl.__doc__ EVT_MASKEDNUM = wx.lib.maskednumctrl.EVT_MASKEDNUM -wxMaskedNumCtrl = wx.lib.maskednumctrl.wxMaskedNumCtrl -wxMaskedNumNumberUpdatedEvent = wx.lib.maskednumctrl.wxMaskedNumNumberUpdatedEvent +wxMaskedNumCtrl = wx.lib.maskednumctrl.MaskedNumCtrl +wxMaskedNumNumberUpdatedEvent = wx.lib.maskednumctrl.MaskedNumNumberUpdatedEvent diff --git a/wxPython/wxPython/lib/mixins/grid.py b/wxPython/wxPython/lib/mixins/grid.py index da6eede40a..b21d342df2 100644 --- a/wxPython/wxPython/lib/mixins/grid.py +++ b/wxPython/wxPython/lib/mixins/grid.py @@ -6,4 +6,4 @@ import wx.lib.mixins.grid __doc__ = wx.lib.mixins.grid.__doc__ -wxGridAutoEditMixin = wx.lib.mixins.grid.wxGridAutoEditMixin +wxGridAutoEditMixin = wx.lib.mixins.grid.GridAutoEditMixin diff --git a/wxPython/wxPython/lib/mixins/listctrl.py b/wxPython/wxPython/lib/mixins/listctrl.py index 97eb33a445..0f2bbf1811 100644 --- a/wxPython/wxPython/lib/mixins/listctrl.py +++ b/wxPython/wxPython/lib/mixins/listctrl.py @@ -9,6 +9,6 @@ __doc__ = wx.lib.mixins.listctrl.__doc__ ListCtrlSelectionManagerMix = wx.lib.mixins.listctrl.ListCtrlSelectionManagerMix getListCtrlSelection = wx.lib.mixins.listctrl.getListCtrlSelection selectBeforePopup = wx.lib.mixins.listctrl.selectBeforePopup -wxColumnSorterMixin = wx.lib.mixins.listctrl.wxColumnSorterMixin -wxListCtrlAutoWidthMixin = wx.lib.mixins.listctrl.wxListCtrlAutoWidthMixin +wxColumnSorterMixin = wx.lib.mixins.listctrl.ColumnSorterMixin +wxListCtrlAutoWidthMixin = wx.lib.mixins.listctrl.ListCtrlAutoWidthMixin diff --git a/wxPython/wxPython/lib/multisash.py b/wxPython/wxPython/lib/multisash.py index 577e9944ff..3244554368 100644 --- a/wxPython/wxPython/lib/multisash.py +++ b/wxPython/wxPython/lib/multisash.py @@ -11,6 +11,6 @@ MultiClient = wx.lib.multisash.MultiClient MultiCloser = wx.lib.multisash.MultiCloser MultiCreator = wx.lib.multisash.MultiCreator MultiSizer = wx.lib.multisash.MultiSizer -wxMultiSash = wx.lib.multisash.wxMultiSash -wxMultiSplit = wx.lib.multisash.wxMultiSplit -wxMultiViewLeaf = wx.lib.multisash.wxMultiViewLeaf +wxMultiSash = wx.lib.multisash.MultiSash +wxMultiSplit = wx.lib.multisash.MultiSplit +wxMultiViewLeaf = wx.lib.multisash.MultiViewLeaf diff --git a/wxPython/wxPython/lib/mvctree.py b/wxPython/wxPython/lib/mvctree.py index e093a6b422..4b879c48c6 100644 --- a/wxPython/wxPython/lib/mvctree.py +++ b/wxPython/wxPython/lib/mvctree.py @@ -35,7 +35,7 @@ TreeLayout = wx.lib.mvctree.TreeLayout TreeLinePainter = wx.lib.mvctree.TreeLinePainter TreeNodePainter = wx.lib.mvctree.TreeNodePainter TreePainter = wx.lib.mvctree.TreePainter -wxMVCTree = wx.lib.mvctree.wxMVCTree -wxMVCTreeEvent = wx.lib.mvctree.wxMVCTreeEvent -wxMVCTreeNotifyEvent = wx.lib.mvctree.wxMVCTreeNotifyEvent -wxTreeModel = wx.lib.mvctree.wxTreeModel +wxMVCTree = wx.lib.mvctree.MVCTree +wxMVCTreeEvent = wx.lib.mvctree.MVCTreeEvent +wxMVCTreeNotifyEvent = wx.lib.mvctree.MVCTreeNotifyEvent +wxTreeModel = wx.lib.mvctree.TreeModel diff --git a/wxPython/wxPython/lib/plot.py b/wxPython/wxPython/lib/plot.py new file mode 100644 index 0000000000..c22391152f --- /dev/null +++ b/wxPython/wxPython/lib/plot.py @@ -0,0 +1,22 @@ +## This file imports items from the wx package into the wxPython package for +## backwards compatibility. Some names will also have a 'wx' added on if +## that is how they used to be named in the old wxPython package. + +import wx.lib.plot + +__doc__ = wx.lib.plot.__doc__ + +PolyPoints = wx.lib.plot.PolyPoints +PolyLine = wx.lib.plot.PolyLine +PolyMarker = wx.lib.plot.PolyMarker +PlotGraphics = wx.lib.plot.PlotGraphics +PlotCanvas = wx.lib.plot.PlotCanvas +PlotPrintout = wx.lib.plot.PlotPrintout +FloatDCWrapper = wx.lib.plot.FloatDCWrapper +_draw1Objects = wx.lib.plot._draw1Objects +_draw2Objects = wx.lib.plot._draw2Objects +_draw3Objects = wx.lib.plot._draw3Objects +_draw4Objects = wx.lib.plot._draw4Objects +_draw5Objects = wx.lib.plot._draw5Objects +__test = wx.lib.plot.__test + diff --git a/wxPython/wxPython/lib/popupctl.py b/wxPython/wxPython/lib/popupctl.py index e84a34e81c..64b618bc55 100644 --- a/wxPython/wxPython/lib/popupctl.py +++ b/wxPython/wxPython/lib/popupctl.py @@ -8,5 +8,6 @@ __doc__ = wx.lib.popupctl.__doc__ PopButton = wx.lib.popupctl.PopButton wxPopupControl = wx.lib.popupctl.wxPopupControl -wxPopupCtrl = wx.lib.popupctl.wxPopupCtrl -wxPopupDialog = wx.lib.popupctl.wxPopupDialog +wxPopupCtrl = wx.lib.popupctl.PopupCtrl +wxPopupControl = wx.lib.popupctl.PopupControl +wxPopupDialog = wx.lib.popupctl.PopupDialog diff --git a/wxPython/wxPython/lib/rightalign.py b/wxPython/wxPython/lib/rightalign.py index 70168f76d9..90ae172b8e 100644 --- a/wxPython/wxPython/lib/rightalign.py +++ b/wxPython/wxPython/lib/rightalign.py @@ -6,4 +6,4 @@ import wx.lib.rightalign __doc__ = wx.lib.rightalign.__doc__ -wxRightTextCtrl = wx.lib.rightalign.wxRightTextCtrl +wxRightTextCtrl = wx.lib.rightalign.RightTextCtrl diff --git a/wxPython/wxPython/lib/scrolledpanel.py b/wxPython/wxPython/lib/scrolledpanel.py index afa154eb3e..7a64258a90 100644 --- a/wxPython/wxPython/lib/scrolledpanel.py +++ b/wxPython/wxPython/lib/scrolledpanel.py @@ -6,4 +6,4 @@ import wx.lib.scrolledpanel __doc__ = wx.lib.scrolledpanel.__doc__ -wxScrolledPanel = wx.lib.scrolledpanel.wxScrolledPanel +wxScrolledPanel = wx.lib.scrolledpanel.ScrolledPanel diff --git a/wxPython/wxPython/lib/timectrl.py b/wxPython/wxPython/lib/timectrl.py index 30c06b147a..da46bcf97a 100644 --- a/wxPython/wxPython/lib/timectrl.py +++ b/wxPython/wxPython/lib/timectrl.py @@ -8,4 +8,4 @@ __doc__ = wx.lib.timectrl.__doc__ EVT_TIMEUPDATE = wx.lib.timectrl.EVT_TIMEUPDATE TimeUpdatedEvent = wx.lib.timectrl.TimeUpdatedEvent -wxTimeCtrl = wx.lib.timectrl.wxTimeCtrl +wxTimeCtrl = wx.lib.timectrl.TimeCtrl diff --git a/wxPython/wxPython/lib/wxPlotCanvas.py b/wxPython/wxPython/lib/wxPlotCanvas.py new file mode 100644 index 0000000000..6d18d9a84d --- /dev/null +++ b/wxPython/wxPython/lib/wxPlotCanvas.py @@ -0,0 +1,13 @@ +## This file imports items from the wx package into the wxPython package for +## backwards compatibility. Some names will also have a 'wx' added on if +## that is how they used to be named in the old wxPython package. + +import wx.lib.wxPlotCanvas + +__doc__ = wx.lib.wxPlotCanvas.__doc__ + +PolyPoints = wx.lib.wxPlotCanvas.PolyPoints +PolyLine = wx.lib.wxPlotCanvas.PolyLine +PolyMarker = wx.lib.wxPlotCanvas.PolyMarker +PlotGraphics = wx.lib.wxPlotCanvas.PlotGraphics +PlotCanvas = wx.lib.wxPlotCanvas.PlotCanvas -- 2.45.2