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
This commit is contained in:
Robin Dunn
2003-12-22 19:09:54 +00:00
parent 88568e48e4
commit d4b73b1b8e
62 changed files with 865 additions and 580 deletions

View File

@@ -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

View File

@@ -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",

View File

@@ -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
-----------

View File

@@ -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 = """<html><body>
<P>
<B>wxIntCtrl</B> provides a control that takes and returns integers as
<B>IntCtrl</B> provides a control that takes and returns integers as
value, and provides bounds support and optional value limiting.
<P>
<P>
Here's the API for wxIntCtrl:
Here's the API for IntCtrl:
<DL><PRE>
<B>wxIntCtrl</B>(
<B>IntCtrl</B>(
parent, id = -1,
<B>value</B> = 0,
<B>min</B> = None,

View File

@@ -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")

View File

@@ -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.
<h4>ListCtrlAutoWidthMixin</h4>
<code><b>wxListCtrlAutoWidthMixin()</b></code>
<code><b>ListCtrlAutoWidthMixin()</b></code>
<p>A mix-in class that automatically resizes the last column to take up the
remaining width of the ListCtrl.

View File

@@ -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.

View File

@@ -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

View File

@@ -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 = """<html><body>
<h2><center>wxMultiSash</center></h2>
<h2><center>MultiSash</center></h2>
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.

View File

@@ -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 = """<html><body>
<h2><center>wxPopupControl</center></h2>
<h2><center>PopupControl</center></h2>
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.

View File

@@ -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 <mgilfix@eecs.tufts.edu>
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

View File

@@ -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)

View File

@@ -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 = """<html><body>
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.
</body></html>

View File

@@ -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 )