From 95bfd958bda8955ac81277c78e5627c926154f39 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 13 Jan 2004 03:17:17 +0000 Subject: [PATCH] More demo conversion and cleanup from Jeff git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/demo/ActiveXWrapper_Acrobat.py | 5 --- wxPython/demo/ActiveXWrapper_IE.py | 5 --- wxPython/demo/AnalogClockWindow.py | 4 -- wxPython/demo/ArtProvider.py | 18 +++----- wxPython/demo/Button.py | 14 +++--- wxPython/demo/Calendar.py | 19 +------- wxPython/demo/CalendarCtrl.py | 22 ++++------ wxPython/demo/CheckBox.py | 19 +++----- wxPython/demo/CheckListBox.py | 13 ++---- wxPython/demo/Choice.py | 6 --- wxPython/demo/ColorPanel.py | 4 +- wxPython/demo/ColourDB.py | 16 ++----- wxPython/demo/ColourDialog.py | 8 +--- wxPython/demo/ColourSelect.py | 13 ------ wxPython/demo/ComboBox.py | 14 ++---- wxPython/demo/ContextHelp.py | 8 ---- wxPython/demo/CustomDragAndDrop.py | 8 ---- wxPython/demo/Dialog.py | 8 +--- wxPython/demo/DialogUnits.py | 3 -- wxPython/demo/DirDialog.py | 4 -- wxPython/demo/DragAndDrop.py | 11 ----- wxPython/demo/DragImage.py | 4 -- wxPython/demo/DrawXXXList.py | 10 ----- wxPython/demo/DynamicSashWindow.py | 4 -- wxPython/demo/EditableListBox.py | 5 --- wxPython/demo/Editor.py | 12 ----- wxPython/demo/EventManager.py | 10 ----- wxPython/demo/FancyText.py | 15 ------- wxPython/demo/FileBrowseButton.py | 13 ------ wxPython/demo/FileDialog.py | 6 +-- wxPython/demo/FileDialog_Save.py | 12 ++--- wxPython/demo/FileHistory.py | 4 -- wxPython/demo/FindReplaceDialog.py | 4 +- wxPython/demo/FloatBar.py | 17 ++------ wxPython/demo/FloatCanvas.py | 4 -- wxPython/demo/FontDialog.py | 6 --- wxPython/demo/FontEnumerator.py | 4 -- wxPython/demo/Frame.py | 6 +-- wxPython/demo/GLCanvas.py | 4 +- wxPython/demo/Gauge.py | 6 +-- wxPython/demo/GenericButtons.py | 26 +++++------ wxPython/demo/GenericDirCtrl.py | 4 -- wxPython/demo/Grid.py | 20 ++++----- wxPython/demo/GridBagSizer.py | 10 ++--- wxPython/demo/GridCustEditor.py | 6 +-- wxPython/demo/GridCustTable.py | 6 --- wxPython/demo/GridDragAndDrop.py | 4 -- wxPython/demo/GridDragable.py | 10 ----- wxPython/demo/GridEnterHandler.py | 4 -- wxPython/demo/GridHugeTable.py | 4 -- wxPython/demo/GridSimple.py | 11 ----- wxPython/demo/GridStdEdRend.py | 5 --- wxPython/demo/Grid_MegaExample.py | 10 ++--- wxPython/demo/HtmlWindow.py | 16 +------ wxPython/demo/IEHtmlWin.py | 4 +- wxPython/demo/Image.py | 4 -- wxPython/demo/ImageBrowser.py | 10 ----- wxPython/demo/ImageFromStream.py | 4 -- wxPython/demo/IntCtrl.py | 17 -------- wxPython/demo/KeyEvents.py | 12 ----- wxPython/demo/LEDNumberCtrl.py | 6 +-- wxPython/demo/LayoutAnchors.py | 6 --- wxPython/demo/LayoutConstraints.py | 4 -- wxPython/demo/Layoutf.py | 17 ++------ wxPython/demo/ListBox.py | 6 +-- wxPython/demo/ListCtrl.py | 20 --------- wxPython/demo/ListCtrl_virtual.py | 8 ---- wxPython/demo/Listbook.py | 15 ++----- wxPython/demo/MDIDemo.py | 7 --- wxPython/demo/MDISashDemo.py | 5 --- wxPython/demo/MDIWindows.py | 4 -- wxPython/demo/MVCTree.py | 12 ----- wxPython/demo/Mask.py | 4 -- wxPython/demo/MaskedEditControls.py | 22 ---------- wxPython/demo/MaskedNumCtrl.py | 16 ------- wxPython/demo/Menu.py | 13 +++--- wxPython/demo/MessageDialog.py | 6 +-- wxPython/demo/MiniFrame.py | 10 ++--- wxPython/demo/MultiSash.py | 18 -------- wxPython/demo/MultipleChoiceDialog.py | 14 +----- wxPython/demo/Notebook.py | 10 ++--- wxPython/demo/OGL.py | 2 +- wxPython/demo/OOR.py | 4 -- wxPython/demo/PageSetupDialog.py | 8 +--- wxPython/demo/PlotCanvas.py | 9 +--- wxPython/demo/PopupControl.py | 20 ++------- wxPython/demo/PopupMenu.py | 3 -- wxPython/demo/PopupWindow.py | 27 ++++++------ wxPython/demo/PrintDialog.py | 8 +--- wxPython/demo/PrintFramework.py | 6 --- wxPython/demo/Process.py | 12 ++--- wxPython/demo/PyColourChooser.py | 13 ------ wxPython/demo/PyCrust.py | 4 -- wxPython/demo/PyPlot.py | 4 -- wxPython/demo/PyShell.py | 4 -- wxPython/demo/PythonEvents.py | 4 -- wxPython/demo/RadioBox.py | 15 ++----- wxPython/demo/RadioButton.py | 10 ++--- wxPython/demo/RightTextCtrl.py | 29 +++---------- wxPython/demo/RowColSizer.py | 9 ---- wxPython/demo/SashWindow.py | 11 ++--- wxPython/demo/ScrolledMessageDialog.py | 16 ------- wxPython/demo/ScrolledPanel.py | 20 +-------- wxPython/demo/ScrolledWindow.py | 6 --- wxPython/demo/ShapedWindow.py | 4 -- wxPython/demo/SingleChoiceDialog.py | 4 -- wxPython/demo/Sizers.py | 5 --- wxPython/demo/Slider.py | 6 +-- wxPython/demo/SpinButton.py | 12 ++--- wxPython/demo/SpinCtrl.py | 11 ++--- wxPython/demo/SplitterWindow.py | 6 +-- wxPython/demo/StaticBitmap.py | 10 ++--- wxPython/demo/StaticText.py | 12 ++--- wxPython/demo/StatusBar.py | 6 +-- wxPython/demo/StyledTextCtrl_1.py | 13 +++--- wxPython/demo/StyledTextCtrl_2.py | 6 +-- wxPython/demo/TablePrint.py | 15 ------- wxPython/demo/TextCtrl.py | 6 +-- wxPython/demo/TextEntryDialog.py | 10 ++--- wxPython/demo/Threads.py | 11 ----- wxPython/demo/Throbber.py | 32 ++++---------- wxPython/demo/TimeCtrl.py | 19 +------- wxPython/demo/Timer.py | 58 +++++++++++++++---------- wxPython/demo/ToggleButton.py | 8 +--- wxPython/demo/ToolBar.py | 31 ++++++++++--- wxPython/demo/TreeCtrl.py | 8 +--- wxPython/demo/TreeListCtrl.py | 8 +--- wxPython/demo/URLDragAndDrop.py | 4 -- wxPython/demo/Unicode.py | 4 -- wxPython/demo/VListBox.py | 12 ++--- wxPython/demo/Validator.py | 7 +-- wxPython/demo/Wave.py | 4 -- wxPython/demo/Wizard.py | 24 +++------- wxPython/demo/XMLtreeview.py | 4 -- wxPython/demo/XmlResource.py | 4 -- wxPython/demo/XmlResourceHandler.py | 16 ++----- wxPython/demo/XmlResourceSubclass.py | 8 +--- wxPython/demo/encode_bitmaps.py | 6 --- wxPython/demo/infoframe.py | 10 ----- wxPython/demo/pyTree.py | 5 --- wxPython/demo/viewer.py | 5 --- wxPython/demo/widgetTest.py | 3 -- 142 files changed, 283 insertions(+), 1156 deletions(-) diff --git a/wxPython/demo/ActiveXWrapper_Acrobat.py b/wxPython/demo/ActiveXWrapper_Acrobat.py index adc9128502..d5ec2ac4c3 100644 --- a/wxPython/demo/ActiveXWrapper_Acrobat.py +++ b/wxPython/demo/ActiveXWrapper_Acrobat.py @@ -13,11 +13,6 @@ have Acrobat Reader 4.0 installed it won't work. """ -# 11/24/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for 2.5 -# - import sys import wx diff --git a/wxPython/demo/ActiveXWrapper_IE.py b/wxPython/demo/ActiveXWrapper_IE.py index 04674a5684..02317ac11d 100644 --- a/wxPython/demo/ActiveXWrapper_IE.py +++ b/wxPython/demo/ActiveXWrapper_IE.py @@ -18,11 +18,6 @@ shown.) """ -# 11/24/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for V2.5 -# - import sys import wx diff --git a/wxPython/demo/AnalogClockWindow.py b/wxPython/demo/AnalogClockWindow.py index 552693eef4..aa0afeb7c0 100644 --- a/wxPython/demo/AnalogClockWindow.py +++ b/wxPython/demo/AnalogClockWindow.py @@ -1,7 +1,3 @@ -# 11/4/03 - grimmtooth@softhome.net (Jeff Grimmett) -# -# o wx Namespace -# import wx import wx.lib.analogclock as aclock diff --git a/wxPython/demo/ArtProvider.py b/wxPython/demo/ArtProvider.py index 02b326680e..26b88061b4 100644 --- a/wxPython/demo/ArtProvider.py +++ b/wxPython/demo/ArtProvider.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import cStringIO import wx @@ -225,21 +221,21 @@ def runTest(frame, nb, log): overview = """ -

wxArtProvider

+

wx.ArtProvider

-wxArtProvider class can be used to customize the look of wxWindows +wx.ArtProvider class can be used to customize the look of wxWindows applications. When wxWindows internal classes need to display an icon or a bitmap (e.g. in the standard file dialog), it does not use a -hard-coded resource but asks wxArtProvider for it instead. This way -the users can plug in their own wxArtProvider class and easily replace +hard-coded resource but asks wx.ArtProvider for it instead. This way +the users can plug in their own wx.ArtProvider class and easily replace standard art with his/her own version. It is easy thing to do: all -that is needed is to derive a class from wxArtProvider, override it's +that is needed is to derive a class from wx.ArtProvider, override it's CreateBitmap method and register the provider with -wxArtProvider_PushProvider. +wx.ArtProvider_PushProvider.

This class can also be used to get the platform native icons as -provided by wxArtProvider_GetBitmap or wxArtProvider_GetIcon methods. +provided by wx.ArtProvider_GetBitmap or wx.ArtProvider_GetIcon methods. """ diff --git a/wxPython/demo/Button.py b/wxPython/demo/Button.py index 039ff89e4b..628d0936e7 100644 --- a/wxPython/demo/Button.py +++ b/wxPython/demo/Button.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import images @@ -42,9 +38,15 @@ class TestPanel(wx.Panel): mask = wx.MaskColour(bmp, wx.BLUE) bmp.SetMask(mask) - wx.BitmapButton(self, 30, bmp, (160, 20), + b = wx.BitmapButton(self, 30, bmp, (160, 20), (bmp.GetWidth()+10, bmp.GetHeight()+10)) - self.Bind(wx.EVT_BUTTON, self.OnClick, id=30) + b.SetToolTipString("This is a bitmap button.") + self.Bind(wx.EVT_BUTTON, self.OnClick, b) + + + b = wx.Button(self, 40, "Flat Button", (20,150), style=wx.NO_BORDER) + b.SetToolTipString("This button has a style flag of wx.NO_BORDER") + self.Bind(wx.EVT_BUTTON, self.OnClick, b) def OnClick(self, event): diff --git a/wxPython/demo/Calendar.py b/wxPython/demo/Calendar.py index d9134beb5d..a0d4591278 100644 --- a/wxPython/demo/Calendar.py +++ b/wxPython/demo/Calendar.py @@ -1,5 +1,5 @@ #---------------------------------------------------------------------------- -# Name: wxCalendar.py +# Name: Calendar.py # Purpose: Calendar control display testing on panel for wxPython demo # # Author: Lorne White (email: lwhite1@planet.eon.net) @@ -11,14 +11,9 @@ # 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) # # o Updated for wx namespace -# o Some updating of the library itself will be needed for this demo to work -# correctly. # # 11/26/2003 - Jeff Grimmett (grimmtooth@softhome.net) # -# o Problems have changed a little. The print dialog requires -# a wx.Size to work with the calendar library. wx.core doesn't -# approve, though, so we get deprecation warnings. # o Ugh. AFter updating to the Bind() method, things lock up # on various control clicks. Will have to debug. Only seems # to happen on windows with calendar controls, though. @@ -28,16 +23,6 @@ # o Lockup issue clarification: it appears that the spinner is # the culprit. # -# 12/01/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o New Bind() method now fully supported. -# -# 12/17/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wxCalendar renamed to Calendar -# o Got rid of unneeded IDs where Bind() could figure it -# out for itself. -# import os @@ -394,7 +379,7 @@ class PrintCalend: self.font = wx.SWISS self.bold = wx.NORMAL - self.sel_key = None # last used by + self.sel_key = None # last used by self.sel_lst = [] # highlighted selected days self.size = None diff --git a/wxPython/demo/CalendarCtrl.py b/wxPython/demo/CalendarCtrl.py index 03fc569b4d..f8e5ba78c1 100644 --- a/wxPython/demo/CalendarCtrl.py +++ b/wxPython/demo/CalendarCtrl.py @@ -1,10 +1,6 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx -import wx.lib.calendar as calendar +import wx.calendar #---------------------------------------------------------------------- @@ -13,20 +9,20 @@ class TestPanel(wx.Panel): wx.Panel.__init__(self, parent, ID) self.log = log - cal = calendar.CalendarCtrl(self, -1, wx.DateTime_Now(), pos = (25,50), - style = calendar.CAL_SHOW_HOLIDAYS - | calendar.CAL_SUNDAY_FIRST - | calendar.CAL_SEQUENTIAL_MONTH_SELECTION + cal = wx.calendar.CalendarCtrl(self, -1, wx.DateTime_Now(), pos = (25,50), + style = wx.calendar.CAL_SHOW_HOLIDAYS + | wx.calendar.CAL_SUNDAY_FIRST + | wx.calendar.CAL_SEQUENTIAL_MONTH_SELECTION ) - self.Bind(calendar.EVT_CALENDAR, self.OnCalSelected, id=cal.GetId()) + self.Bind(wx.calendar.EVT_CALENDAR, self.OnCalSelected, id=cal.GetId()) b = wx.Button(self, -1, "Destroy the Calendar", pos = (250, 50)) self.Bind(wx.EVT_BUTTON, self.OnButton, id= b.GetId()) self.cal = cal # Set up control to display a set of holidays: - self.Bind(calendar.EVT_CALENDAR_MONTH, self.OnChangeMonth, id=cal.GetId()) + self.Bind(wx.calendar.EVT_CALENDAR_MONTH, self.OnChangeMonth, cal) self.holidays = [(1,1), (10,31), (12,25) ] # (these don't move around) self.OnChangeMonth() @@ -55,7 +51,7 @@ def runTest(frame, nb, log): overview = """\ -

wxCalendarCtrl

+

CalendarCtrl

Yet another calendar control. This one is a wrapper around the C++ version described in the docs. This one will probably be a bit more efficient @@ -64,8 +60,6 @@ so I think both will stay in wxPython. """ - - if __name__ == '__main__': import sys,os import run diff --git a/wxPython/demo/CheckBox.py b/wxPython/demo/CheckBox.py index 41fb677987..e436b35794 100644 --- a/wxPython/demo/CheckBox.py +++ b/wxPython/demo/CheckBox.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -14,11 +10,10 @@ class TestCheckBox(wx.Panel): wx.StaticText(self, -1, "This example uses the wxCheckBox control.", (10, 10)) - cID = wx.NewId() - cb1 = wx.CheckBox(self, cID, " Apples", (65, 40), (150, 20), wx.NO_BORDER) - cb2 = wx.CheckBox(self, cID+1, " Oranges", (65, 60), (150, 20), wx.NO_BORDER) + cb1 = wx.CheckBox(self, -1, " Apples", (65, 40), (150, 20), wx.NO_BORDER) + cb2 = wx.CheckBox(self, -1, " Oranges", (65, 60), (150, 20), wx.NO_BORDER) cb2.SetValue(True) - cb3 = wx.CheckBox(self, cID+2, " Pears", (65, 80), (150, 20), wx.NO_BORDER) + cb3 = wx.CheckBox(self, -1, " Pears", (65, 80), (150, 20), wx.NO_BORDER) self.Bind(wx.EVT_CHECKBOX, self.EvtCheckBox, cb1) self.Bind(wx.EVT_CHECKBOX, self.EvtCheckBox, cb2) @@ -36,15 +31,13 @@ def runTest(frame, nb, log): #--------------------------------------------------------------------------- - - - overview = """\ -A checkbox is a labelled box which is either on (checkmark is visible) or off (no checkmark). +A checkbox is a labelled box which is either on (checkmark is visible) or off +(no checkmark). """ - +#--------------------------------------------------------------------------- if __name__ == '__main__': import sys,os diff --git a/wxPython/demo/CheckListBox.py b/wxPython/demo/CheckListBox.py index ef80a7637b..904ac1bb25 100644 --- a/wxPython/demo/CheckListBox.py +++ b/wxPython/demo/CheckListBox.py @@ -1,8 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Why is there a popup menu in this demo? -# import wx @@ -19,15 +14,15 @@ class TestPanel(wx.Panel): wx.StaticText(self, -1, "This example uses the wxCheckListBox control.", (45, 15)) - lb = wx.CheckListBox(self, 60, (80, 50), (80, 120), sampleList) - self.Bind(wx.EVT_LISTBOX, self.EvtListBox, id=60) - self.Bind(wx.EVT_LISTBOX_DCLICK, self.EvtListBoxDClick, id=60) + lb = wx.CheckListBox(self, -1, (80, 50), (80, 120), sampleList) + self.Bind(wx.EVT_LISTBOX, self.EvtListBox, lb) + self.Bind(wx.EVT_LISTBOX_DCLICK, self.EvtListBoxDClick, lb) lb.SetSelection(0) self.lb = lb pos = lb.GetPosition().x + lb.GetSize().width + 25 btn = wx.Button(self, -1, "Test SetString", (pos, 50)) - self.Bind(wx.EVT_BUTTON, self.OnTestButton, id=btn.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnTestButton, btn) self.Bind(wx.EVT_RIGHT_UP, self.OnDoPopup) def EvtListBox(self, event): diff --git a/wxPython/demo/Choice.py b/wxPython/demo/Choice.py index 39e2db847a..afa3ac1264 100644 --- a/wxPython/demo/Choice.py +++ b/wxPython/demo/Choice.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -51,8 +47,6 @@ The number of choices and the choice array are consilidated into one python """ - - if __name__ == '__main__': import sys,os import run diff --git a/wxPython/demo/ColorPanel.py b/wxPython/demo/ColorPanel.py index 72f725842b..a5b6a91cc7 100644 --- a/wxPython/demo/ColorPanel.py +++ b/wxPython/demo/ColorPanel.py @@ -1,9 +1,7 @@ -# 11/4/03 - grimmtooth@softhome.net (Jeff Grimmett) -# -# o Updated for wx namespace # # Note: this module is not a demo per se, but is used by many of # the demo modules for various purposes. +# import wx diff --git a/wxPython/demo/ColourDB.py b/wxPython/demo/ColourDB.py index 3db76c0a06..1680c31a9d 100644 --- a/wxPython/demo/ColourDB.py +++ b/wxPython/demo/ColourDB.py @@ -1,16 +1,6 @@ -# 11/4/03 - grimmtooth@softhome.net (Jeff Grimmett) -# -# o Updated to use wx namespace -# -# 11/24/03 - grimmtooth@softhome.net (Jeff Grimmett) -# -# o Had to move the call to wx.updateColourDB() -# o Updated several places to change discrete pos and size parameters -# into two-tuples. -# import wx -import wx.lib.colourdb as cdb +import wx.lib.colourdb import images @@ -22,7 +12,7 @@ class TestWindow(wx.ScrolledWindow): wx.ScrolledWindow.__init__(self, parent, -1) # Populate our color list - self.clrList = cdb.getColourList() + self.clrList = wx.lib.colourdb.getColourList() # Just for style points, we'll use this as a background image. #self.clrList.sort() @@ -165,7 +155,7 @@ def runTest(frame, nb, log): # Note 11/24/03 - jg - I moved this into runTest() because # there must be a wx.App existing before this function # can be called - this is a change from 2.4 -> 2.5. - cdb.updateColourDB() + wx.lib.colourdb.updateColourDB() win = TestPanel(nb) diff --git a/wxPython/demo/ColourDialog.py b/wxPython/demo/ColourDialog.py index be0fc703d4..136e58722f 100644 --- a/wxPython/demo/ColourDialog.py +++ b/wxPython/demo/ColourDialog.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -43,12 +39,12 @@ to suit your needs. In the example, we set the dialog up to show the extended co data selection pane. Otherwise, only the more compact and less extensive colour dialog is shown. You may also preset the colour as well as other items. -If the user selects something and selects OK, then the wxColourData instance contains +If the user selects something and selects OK, then the wx.ColourData instance contains the colour data that the user selected. Before destroying the dialog, retrieve the data. Do not try to retain the wx.ColourData instance. It will probably not be valid after the dialog is destroyed. -Along with he wxColourDialog documentation, see also the wx.ColourData documentation +Along with he wx.ColourDialog documentation, see also the wx.ColourData documentation for details. """ diff --git a/wxPython/demo/ColourSelect.py b/wxPython/demo/ColourSelect.py index 6f2a9e1465..8cd0750a4b 100644 --- a/wxPython/demo/ColourSelect.py +++ b/wxPython/demo/ColourSelect.py @@ -15,20 +15,7 @@ # - use sizers # - other minor "improvements" #---------------------------------------------------------------------------- -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for V2.5 -# -# 11/24/2003 - Jeff Grimmett (grimmtooth@softhome.net) # -# o Added Bind() handlers to what events can handle it. However, the -# colourselect library must be converted before its events can be -# bound using the Bind() method. -# -# 12/01/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o colourselect lib converted; demo converted to match. -# import wx import wx.lib.colourselect as csel diff --git a/wxPython/demo/ComboBox.py b/wxPython/demo/ComboBox.py index eb995d51a5..04337e661c 100644 --- a/wxPython/demo/ComboBox.py +++ b/wxPython/demo/ComboBox.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -24,7 +20,7 @@ class TestComboBox(wx.Panel): #'this is a long item that needs a scrollbar...', 'six', 'seven', 'eight'] - wx.StaticText(self, -1, "This example uses the wxComboBox control.", (8, 10)) + wx.StaticText(self, -1, "This example uses the wx.ComboBox control.", (8, 10)) wx.StaticText(self, -1, "Select one:", (15, 50), (75, 18)) # This combobox is created with a preset list of values. @@ -33,11 +29,6 @@ class TestComboBox(wx.Panel): (95, -1), sampleList, wx.CB_DROPDOWN #|wxTE_PROCESS_ENTER ) - ##import win32api, win32con - ##win32api.SendMessage(cb.GetHandle(), - ## win32con.CB_SETHORIZONTALEXTENT, - ## 200, 0) - self.Bind(wx.EVT_COMBOBOX, self.EvtComboBox, cb) self.Bind(wx.EVT_TEXT, self.EvtText, cb) self.Bind(wx.EVT_TEXT_ENTER, self.EvtTextEnter, cb) @@ -85,7 +76,6 @@ def runTest(frame, nb, log): #--------------------------------------------------------------------------- - overview = """\ A ComboBox is like a combination of an edit control and a listbox. It can be displayed as static list with editable or read-only text field; or a drop-down @@ -108,6 +98,8 @@ event is generated every time that the user hits a key in the ComboBox entry fie """ +#--------------------------------------------------------------------------- + if __name__ == '__main__': import sys,os import run diff --git a/wxPython/demo/ContextHelp.py b/wxPython/demo/ContextHelp.py index 4625330d0a..3a6727c504 100644 --- a/wxPython/demo/ContextHelp.py +++ b/wxPython/demo/ContextHelp.py @@ -1,11 +1,3 @@ -# 11/4/2003 - grimmtooth@softhome.net (Jeff Grimmett) -# -# o Modified for V2.5 -# -# 11/24/2003 - grimmtooth@softhome.net (Jeff Grimmett) -# -# o Removed import of wx.help - now part of wx.core. -# import wx diff --git a/wxPython/demo/CustomDragAndDrop.py b/wxPython/demo/CustomDragAndDrop.py index 34570e1cf8..b1c1e5a890 100644 --- a/wxPython/demo/CustomDragAndDrop.py +++ b/wxPython/demo/CustomDragAndDrop.py @@ -1,11 +1,3 @@ -# 11/5/2003 - Modified by grimmtooth@softhome.net (Jeff Grimmett) -# -# o Updated for wx namespace -# -# 11/24/2003 - Modified by grimmtooth@softhome.net (Jeff Grimmett) -# -# o Issues around line 167. I'm stuck. -# import cPickle import wx diff --git a/wxPython/demo/Dialog.py b/wxPython/demo/Dialog.py index 263c2cfb50..3c4fb71721 100644 --- a/wxPython/demo/Dialog.py +++ b/wxPython/demo/Dialog.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -19,7 +15,7 @@ class TestDialog(wx.Dialog): style=wx.DEFAULT_DIALOG_STYLE ): - # Instead of calling wxDialog.__init__ we precreate the dialog + # Instead of calling wx.Dialog.__init__ we precreate the dialog # so we can set an extra style that must be set before # creation, and then we create the GUI dialog using the Create # method. @@ -36,7 +32,7 @@ class TestDialog(wx.Dialog): # contents sizer = wx.BoxSizer(wx.VERTICAL) - label = wx.StaticText(self, -1, "This is a wxDialog") + label = wx.StaticText(self, -1, "This is a wx.Dialog") label.SetHelpText("This is the help text for the label") sizer.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5) diff --git a/wxPython/demo/DialogUnits.py b/wxPython/demo/DialogUnits.py index 8e1e36685c..975eb175c0 100644 --- a/wxPython/demo/DialogUnits.py +++ b/wxPython/demo/DialogUnits.py @@ -10,9 +10,6 @@ # Copyright: (c) 1998 by Total Control Software # Licence: wxWindows license #---------------------------------------------------------------------------- -# Updated 11/9/2003 by Jeff Grimmett (grimmtooth@softhome.net) -# -# o Converted for V2.5 compatability # import wx diff --git a/wxPython/demo/DirDialog.py b/wxPython/demo/DirDialog.py index dc936d2272..10a4dc2ebc 100644 --- a/wxPython/demo/DirDialog.py +++ b/wxPython/demo/DirDialog.py @@ -1,7 +1,3 @@ -# 11/17/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx diff --git a/wxPython/demo/DragAndDrop.py b/wxPython/demo/DragAndDrop.py index d04bdc7048..5039872fc2 100644 --- a/wxPython/demo/DragAndDrop.py +++ b/wxPython/demo/DragAndDrop.py @@ -1,14 +1,3 @@ -# 11/5/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Got rid of all the hardcoded window IDs. -# o Fixed a bug in class TestPanel() (empty sizer Add()) -# -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Fixed a bug in the BMP file dialog; was using GetFilename() -# instead of GetPath() to get the file to load. -# import wx diff --git a/wxPython/demo/DragImage.py b/wxPython/demo/DragImage.py index ad8f880a5d..05f7853a99 100644 --- a/wxPython/demo/DragImage.py +++ b/wxPython/demo/DragImage.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import images diff --git a/wxPython/demo/DrawXXXList.py b/wxPython/demo/DrawXXXList.py index 07adb42961..a7537af348 100644 --- a/wxPython/demo/DrawXXXList.py +++ b/wxPython/demo/DrawXXXList.py @@ -1,13 +1,3 @@ -# 11/5/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Replaced all calls to deprecated whrandom module with up to date random calls. -# See Python docs regarding whrandom for details. -# -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o New binding -# import random import time diff --git a/wxPython/demo/DynamicSashWindow.py b/wxPython/demo/DynamicSashWindow.py index 8deeceb0d7..a3f3106b8f 100644 --- a/wxPython/demo/DynamicSashWindow.py +++ b/wxPython/demo/DynamicSashWindow.py @@ -1,7 +1,3 @@ -# 11/17/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import wx.gizmos as gizmos diff --git a/wxPython/demo/EditableListBox.py b/wxPython/demo/EditableListBox.py index 6d10604a54..c89cb3ebfb 100644 --- a/wxPython/demo/EditableListBox.py +++ b/wxPython/demo/EditableListBox.py @@ -1,8 +1,3 @@ -# 11/17/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Added overview text based on source code delving. -# import wx import wx.gizmos as gizmos diff --git a/wxPython/demo/Editor.py b/wxPython/demo/Editor.py index 904dc3f144..1a3b508c19 100644 --- a/wxPython/demo/Editor.py +++ b/wxPython/demo/Editor.py @@ -1,15 +1,3 @@ -# 11/17/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/28/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# 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 diff --git a/wxPython/demo/EventManager.py b/wxPython/demo/EventManager.py index a846958e4b..8d77084aa7 100644 --- a/wxPython/demo/EventManager.py +++ b/wxPython/demo/EventManager.py @@ -8,16 +8,6 @@ # Copyright: (c) 2002 by Robb Shecter (robb@acm.org) # Licence: wxWindows license #--------------------------------------------------------------------------- -# -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o What happened to wx.Color()? -# - import wx import wx.lib.evtmgr as em diff --git a/wxPython/demo/FancyText.py b/wxPython/demo/FancyText.py index 8b08afe393..306d53db59 100644 --- a/wxPython/demo/FancyText.py +++ b/wxPython/demo/FancyText.py @@ -1,18 +1,3 @@ -# 11/5/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated to wx namespace -# -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Issues previously noted have evaporated. -# o Hoo boy, the doc string in the lib needs fixed :-) -# -# 12/02/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Making the library's doc string acceptable for the overview rendered -# it unusable in the library's own test code, so I copied it over -# and massaged the XML into useful HTML. -# import wx import wx.lib.fancytext as fancytext diff --git a/wxPython/demo/FileBrowseButton.py b/wxPython/demo/FileBrowseButton.py index 41897eeb28..2746101ea2 100644 --- a/wxPython/demo/FileBrowseButton.py +++ b/wxPython/demo/FileBrowseButton.py @@ -1,16 +1,3 @@ -# 11/7/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Uncommented fbbhCallback in TestPanel.fbbh init. Appears to work fine. -# Wonder why it was commented. -# o Unrelated: TestPanel.dbb appears to cause a program error in the demo. If -# it is commented out, everything works fine. Investigating. -# o Bernhard has responded to query, does not plan on updating demo. -# -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o All issues, including the program error, have gone away in V2.5. -# """ Demonstrate filebrowsebutton module of the wxPython.lib Library. diff --git a/wxPython/demo/FileDialog.py b/wxPython/demo/FileDialog.py index 0d42aa54e6..9129c4381b 100644 --- a/wxPython/demo/FileDialog.py +++ b/wxPython/demo/FileDialog.py @@ -1,7 +1,3 @@ -# 11/17/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import os import wx @@ -9,7 +5,7 @@ import wx #--------------------------------------------------------------------------- # This is how you pre-establish a file filter so that the dialog -# only shows the extention(s) you want it to. +# only shows the extension(s) you want it to. wildcard = "Python source (*.py)|*.py|" \ "Compiled Python (*.pyc)|*.pyc|" \ "All files (*.*)|*.*" diff --git a/wxPython/demo/FileDialog_Save.py b/wxPython/demo/FileDialog_Save.py index 55fdae0596..f87108d4c6 100644 --- a/wxPython/demo/FileDialog_Save.py +++ b/wxPython/demo/FileDialog_Save.py @@ -1,7 +1,3 @@ -# 11/17/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import os import wx @@ -9,7 +5,7 @@ import wx #--------------------------------------------------------------------------- # This is how you pre-establish a file filter so that the dialog -# only shows the extention(s) you want it to. +# only shows the extension(s) you want it to. wildcard = "Python source (*.py)|*.py|" \ "Compiled Python (*.pyc)|*.pyc|" \ "SPAM files (*.spam)|*.spam|" \ @@ -76,10 +72,10 @@ There are two ways to get the results back from the dialog. GetFiles() returns o the file names themselves, in a Python list. GetPaths() returns the full path and filenames combined as a Python list. -One important thing to note: if you use the file extention filters, then files saved -with the filter set to something will automatically get that extention appended to them +One important thing to note: if you use the file extension filters, then files saved +with the filter set to something will automatically get that extension appended to them if it is not already there. For example, suppose the dialog was displaying the 'egg' -extention and you entered a file name of 'fried'. It would be saved as 'fried.egg.' +extension and you entered a file name of 'fried'. It would be saved as 'fried.egg.' Yum! """ diff --git a/wxPython/demo/FileHistory.py b/wxPython/demo/FileHistory.py index 7a0dc4962f..98403b1493 100644 --- a/wxPython/demo/FileHistory.py +++ b/wxPython/demo/FileHistory.py @@ -1,7 +1,3 @@ -# 11/17/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import os import wx diff --git a/wxPython/demo/FindReplaceDialog.py b/wxPython/demo/FindReplaceDialog.py index 54cc07ee3b..6812b05b66 100644 --- a/wxPython/demo/FindReplaceDialog.py +++ b/wxPython/demo/FindReplaceDialog.py @@ -63,8 +63,6 @@ class TestPanel(wx.Panel): et = evt.GetEventType() - #print evt.GetReplaceString() - if et in map: evtType = map[et] else: @@ -77,7 +75,7 @@ class TestPanel(wx.Panel): else: replaceTxt = "" - self.log.write("%s -- Find text: %s %s Flags: %d \n" % + self.log.write("%s -- Find text: %s Replace text: %s Flags: %d \n" % (evtType, evt.GetFindString(), replaceTxt, evt.GetFlags())) diff --git a/wxPython/demo/FloatBar.py b/wxPython/demo/FloatBar.py index c218731bb4..0130f3be0e 100644 --- a/wxPython/demo/FloatBar.py +++ b/wxPython/demo/FloatBar.py @@ -1,17 +1,8 @@ -# 11/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) # -# o Updated for wx namespace -# o OK, Main.py indicates this is deprecated. But I don't see a -# replacement yet. So conversion is done anyway. -# -# 11/28/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Issues - library has to be converted to work properly -# with new namespace. -# -# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wxFloatBar -> FloatBar +# Please note that wx.lib.floatbar is not formally supported as +# part of wxPython. If it works, fine. If not, unfortunate. +# GTK users can use the wx.TB_DOCKABLE flag with a regular +# wx.ToolBar, but everyone else has to take thier chances. # import wx diff --git a/wxPython/demo/FloatCanvas.py b/wxPython/demo/FloatCanvas.py index 2443131388..9fe43d606e 100644 --- a/wxPython/demo/FloatCanvas.py +++ b/wxPython/demo/FloatCanvas.py @@ -1,7 +1,3 @@ -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for V2.5 -# import wx diff --git a/wxPython/demo/FontDialog.py b/wxPython/demo/FontDialog.py index 2135c491f1..6457226b33 100644 --- a/wxPython/demo/FontDialog.py +++ b/wxPython/demo/FontDialog.py @@ -1,7 +1,3 @@ -# 11/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -16,8 +12,6 @@ class TestPanel(wx.Panel): self.Bind(wx.EVT_BUTTON, self.OnSelectFont, btn) self.sampleText = wx.TextCtrl(self, -1, "Sample Text") - #from wxPython.lib.stattext import wxGenStaticText - #self.sampleText = wxGenStaticText(self, -1, "Sample Text") self.curFont = self.sampleText.GetFont() self.curClr = wx.BLACK diff --git a/wxPython/demo/FontEnumerator.py b/wxPython/demo/FontEnumerator.py index 71ce22e784..9f646a6d4c 100644 --- a/wxPython/demo/FontEnumerator.py +++ b/wxPython/demo/FontEnumerator.py @@ -1,7 +1,3 @@ -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for V2.5 -# import wx diff --git a/wxPython/demo/Frame.py b/wxPython/demo/Frame.py index b2028e6eb5..eef20b1c2a 100644 --- a/wxPython/demo/Frame.py +++ b/wxPython/demo/Frame.py @@ -1,7 +1,3 @@ -# 11/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -31,7 +27,7 @@ class MyFrame(wx.Frame): #--------------------------------------------------------------------------- def runTest(frame, nb, log): - win = MyFrame(frame, -1, "This is a wxFrame", size=(350, 200), + win = MyFrame(frame, -1, "This is a wx.Frame", size=(350, 200), style = wx.DEFAULT_FRAME_STYLE)# | wx.FRAME_TOOL_WINDOW ) frame.otherWin = win win.Show(True) diff --git a/wxPython/demo/GLCanvas.py b/wxPython/demo/GLCanvas.py index 51c231e22a..dd5d27eaec 100644 --- a/wxPython/demo/GLCanvas.py +++ b/wxPython/demo/GLCanvas.py @@ -29,7 +29,7 @@ except ImportError: if not haveGLCanvas: def runTest(frame, nb, log): dlg = wx.MessageDialog( - frame, 'The wxGLCanvas has not been included with this build of wxPython!', + frame, 'The wx.GLCanvas has not been included with this build of wxPython!', 'Sorry', wx.OK | wx.ICON_INFORMATION ) @@ -69,7 +69,7 @@ else: box.Add(btn, 0, wx.ALIGN_CENTER|wx.ALL, 15) self.Bind(wx.EVT_BUTTON, self.OnButton, id=k) - #** Enable this to show putting a wxGLCanvas on the wxPanel + #** Enable this to show putting a wx.GLCanvas on the wxPanel if 0: c = CubeCanvas(self) c.SetSize((200, 200)) diff --git a/wxPython/demo/Gauge.py b/wxPython/demo/Gauge.py index 5d65255f09..e6836f683e 100644 --- a/wxPython/demo/Gauge.py +++ b/wxPython/demo/Gauge.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -13,7 +9,7 @@ class TestPanel(wx.Panel): self.log = log self.count = 0 - wx.StaticText(self, -1, "This example shows the wxGauge control.", (45, 15)) + wx.StaticText(self, -1, "This example shows the wx.Gauge control.", (45, 15)) self.g1 = wx.Gauge(self, -1, 50, (110, 50), (250, 25)) self.g1.SetBezelFace(3) diff --git a/wxPython/demo/GenericButtons.py b/wxPython/demo/GenericButtons.py index 6ab17eb837..bbbb6d8c02 100644 --- a/wxPython/demo/GenericButtons.py +++ b/wxPython/demo/GenericButtons.py @@ -1,7 +1,3 @@ -# 11/6/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import wx.lib.buttons as buttons @@ -20,30 +16,30 @@ class TestPanel(wx.Panel): # A regular button, selected as the default button b = wx.Button(self, -1, "A real button") b.SetDefault() - self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) sizer.Add(b) # Same thing, but NOT set as the default button b = wx.Button(self, -1, "non-default") - self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) sizer.Add(b) sizer.Add((10,10)) # Plain old text button based off GenButton() b = buttons.GenButton(self, -1, 'Hello') - self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) sizer.Add(b) # Plain old text button, disabled. b = buttons.GenButton(self, -1, 'disabled') - self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) b.Enable(False) sizer.Add(b) # This time, we let the botton be as big as it can be. # Also, this one is fancier, with custom colors and bezel size. b = buttons.GenButton(self, -1, 'bigger') - self.Bind(wx.EVT_BUTTON, self.OnBiggerButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnBiggerButton, b) b.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD, False)) b.SetBezelWidth(5) ###b.SetBestSize() @@ -56,20 +52,20 @@ class TestPanel(wx.Panel): # An image button bmp = images.getTest2Bitmap() b = buttons.GenBitmapButton(self, -1, bmp) - self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) sizer.Add(b) # An image button, disabled. bmp = images.getTest2Bitmap() b = buttons.GenBitmapButton(self, -1, bmp) - self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) sizer.Add(b) b.Enable(False) # An image button, using a mask to get rid of the # undesireable part of the image b = buttons.GenBitmapButton(self, -1, None) - self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) bmp = images.getBulb1Bitmap() mask = wx.MaskColour(bmp, wx.BLUE) bmp.SetMask(mask) @@ -83,12 +79,12 @@ class TestPanel(wx.Panel): # A toggle button b = buttons.GenToggleButton(self, -1, "Toggle Button") - self.Bind(wx.EVT_BUTTON, self.OnToggleButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnToggleButton, b) sizer.Add(b) # An image toggle button b = buttons.GenBitmapToggleButton(self, -1, None) - self.Bind(wx.EVT_BUTTON, self.OnToggleButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnToggleButton, b) bmp = images.getBulb1Bitmap() mask = wx.MaskColour(bmp, wx.BLUE) bmp.SetMask(mask) @@ -103,7 +99,7 @@ class TestPanel(wx.Panel): # A bitmap button with text. b = buttons.GenBitmapTextButton(self, -1, None, "Bitmapped Text", size = (200, 45)) - self.Bind(wx.EVT_BUTTON, self.OnButton, id=b.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnButton, b) bmp = images.getBulb1Bitmap() mask = wx.MaskColour(bmp, wx.BLUE) bmp.SetMask(mask) diff --git a/wxPython/demo/GenericDirCtrl.py b/wxPython/demo/GenericDirCtrl.py index 30d8bbb75e..abfc54bb46 100644 --- a/wxPython/demo/GenericDirCtrl.py +++ b/wxPython/demo/GenericDirCtrl.py @@ -1,7 +1,3 @@ -# 11/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx diff --git a/wxPython/demo/Grid.py b/wxPython/demo/Grid.py index 78eae6b678..f1f9fb8309 100644 --- a/wxPython/demo/Grid.py +++ b/wxPython/demo/Grid.py @@ -1,20 +1,16 @@ -# 11/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx #--------------------------------------------------------------------------- buttonDefs = { - 814 : ('GridSimple', ' Simple wxGrid, catching all events '), - 815 : ('GridStdEdRend', ' wxGrid showing Editors and Renderers '), - 818 : ('GridHugeTable', ' A wxGrid with a HUGE table (100 MILLION cells!) '), - 817 : ('GridCustTable', ' wxGrid using a custom Table, with non-string data '), + 814 : ('GridSimple', ' Simple wx.Grid, catching all events '), + 815 : ('GridStdEdRend', ' wx.Grid showing Editors and Renderers '), + 818 : ('GridHugeTable', ' A wx.Grid with a HUGE table (100 MILLION cells!) '), + 817 : ('GridCustTable', ' wx.Grid using a custom Table, with non-string data '), 819 : ('GridEnterHandler',' Remapping keys to behave differently '), 820 : ('GridCustEditor', ' Shows how to create a custom Cell Editor '), - 821 : ('GridDragable', ' A wxGrid with dragable rows and columns '), + 821 : ('GridDragable', ' A wx.Grid with dragable rows and columns '), 822 : ('GridDragAndDrop', ' Shows how to make a grid a drop target for files'), } @@ -58,12 +54,12 @@ def runTest(frame, nb, log): overview = """\ -

wxGrid

+

wx.Grid

This demo shows various ways of using the new and -improved wxGrid class. Unfortunatly it has not been +improved wx.Grid class. Unfortunatly it has not been documented yet, and while it is somewhat backwards compatible, if you -try to go by the current wxGrid documentation you will probably just +try to go by the current wx.Grid documentation you will probably just confuse yourself.

You can look at the sources for these samples to learn a lot about how diff --git a/wxPython/demo/GridBagSizer.py b/wxPython/demo/GridBagSizer.py index 51ebb0c1de..a0ee009bce 100644 --- a/wxPython/demo/GridBagSizer.py +++ b/wxPython/demo/GridBagSizer.py @@ -3,7 +3,7 @@ import wx # This module uses the new wx namespace #---------------------------------------------------------------------- gbsDescription = """\ -The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned +The wx.GridBagSizer is similar to the wx.FlexGridSizer except the items are explicitly positioned in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this static text is positioned at (0,0) and it spans 7 columns. """ @@ -11,7 +11,7 @@ static text is positioned at (0,0) and it spans 7 columns. class TestFrame(wx.Frame): def __init__(self): - wx.Frame.__init__(self, None, -1, "wxGridBagSizer") + wx.Frame.__init__(self, None, -1, "wx.GridBagSizer") p = wx.Panel(self, -1) p.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) @@ -93,7 +93,7 @@ class TestFrame(wx.Frame): else: if self.gbs.CheckForIntersection( (3,6), (1,1) ): wx.MessageBox("""\ -wxGridBagSizer will not allow items to be in the same cell as +wx.GridBagSizer will not allow items to be in the same cell as another item, so this operation will fail. You will also get an assert when compiled in debug mode.""", "Warning", wx.OK | wx.ICON_INFORMATION) @@ -130,9 +130,9 @@ def runTest(frame, nb, log): overview = """ -

wxGridBagSizer

+

wx.GridBagSizer

-The wxGridBagSizer is more or less a port of the the RowColSizer (that +The wx.GridBagSizer is more or less a port of the the RowColSizer (that has been in the wxPython.lib package for quite some time) to C++. It allows items to be placed at specific layout grid cells, and items can span across more than one row or column. diff --git a/wxPython/demo/GridCustEditor.py b/wxPython/demo/GridCustEditor.py index 71b62a7a46..06040b31ea 100644 --- a/wxPython/demo/GridCustEditor.py +++ b/wxPython/demo/GridCustEditor.py @@ -1,7 +1,3 @@ -# 11/6/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# Modified for wx namespace -# import string @@ -18,7 +14,7 @@ class MyCellEditor(gridlib.PyGridCellEditor): Notice that in order to call the base class version of these special methods we use the method name preceded by "base_". This is because these - methods are "virtual" in C++ so if we try to call wxGridCellEditor.Create + methods are "virtual" in C++ so if we try to call wx.GridCellEditor.Create for example, then when the wxPython extension module tries to call ptr->Create(...) then it actually calls the derived class version which looks up the method in this class and calls it, causing a recursion loop. diff --git a/wxPython/demo/GridCustTable.py b/wxPython/demo/GridCustTable.py index 519a2b3979..8bfec55394 100644 --- a/wxPython/demo/GridCustTable.py +++ b/wxPython/demo/GridCustTable.py @@ -1,9 +1,3 @@ -# 11/6/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Also corrected minor bug where 'true' was being used instead of 'True'. -# Doesn't fail for * import (I guess that is still defined in wx), but does -# in the manner we're importing wx now. import wx import wx.grid as gridlib diff --git a/wxPython/demo/GridDragAndDrop.py b/wxPython/demo/GridDragAndDrop.py index ae11c7c2fd..6188e1f9f4 100644 --- a/wxPython/demo/GridDragAndDrop.py +++ b/wxPython/demo/GridDragAndDrop.py @@ -1,7 +1,3 @@ -# 11/6/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# """ Example showing how to make a grid a drop target for files. diff --git a/wxPython/demo/GridDragable.py b/wxPython/demo/GridDragable.py index b30467c209..8f375b8eb7 100644 --- a/wxPython/demo/GridDragable.py +++ b/wxPython/demo/GridDragable.py @@ -1,13 +1,3 @@ -# 11/6/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Modified for V2.5 -# -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wx renamer didn't appear to 'catch' all the classes in -# wx.lib.gridmovers -# o Event binder not working properly with wx.lib.gridmovers -# import wx import wx.grid as gridlib diff --git a/wxPython/demo/GridEnterHandler.py b/wxPython/demo/GridEnterHandler.py index 0b6971b033..bdcd8ccb7d 100644 --- a/wxPython/demo/GridEnterHandler.py +++ b/wxPython/demo/GridEnterHandler.py @@ -1,7 +1,3 @@ -# 11/6/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import wx.grid as gridlib diff --git a/wxPython/demo/GridHugeTable.py b/wxPython/demo/GridHugeTable.py index 078af65bee..e0fe1e415f 100644 --- a/wxPython/demo/GridHugeTable.py +++ b/wxPython/demo/GridHugeTable.py @@ -1,7 +1,3 @@ -# 11/6/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import wx.grid as gridlib diff --git a/wxPython/demo/GridSimple.py b/wxPython/demo/GridSimple.py index fca404d151..156839a6a6 100644 --- a/wxPython/demo/GridSimple.py +++ b/wxPython/demo/GridSimple.py @@ -1,14 +1,3 @@ -# 11/6/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for V2.5 -# o The mixin features were all commented out. Is it broke? Should it even -# be in the source? Or is it left as an exercise to the reader? -# -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Robin confirms, this is tutorial code. But be warned! It has not been -# converted OR tested! -# import wx import wx.grid as gridlib diff --git a/wxPython/demo/GridStdEdRend.py b/wxPython/demo/GridStdEdRend.py index 3e0f2f294b..6b5110a3f2 100644 --- a/wxPython/demo/GridStdEdRend.py +++ b/wxPython/demo/GridStdEdRend.py @@ -1,8 +1,3 @@ -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for V2.5 -# o There is one wx.Size() I haven't figured out how to get rid of yet. -# import random diff --git a/wxPython/demo/Grid_MegaExample.py b/wxPython/demo/Grid_MegaExample.py index 751e7ab291..f6d6a503fd 100644 --- a/wxPython/demo/Grid_MegaExample.py +++ b/wxPython/demo/Grid_MegaExample.py @@ -1,7 +1,3 @@ -# 11/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import wx.grid as Grid @@ -10,7 +6,7 @@ import images class MegaTable(Grid.PyGridTableBase): """ - A custom wxGrid Table using user supplied data + A custom wx.Grid Table using user supplied data """ def __init__(self, data, colnames, plugins): """data is a list of the form @@ -90,7 +86,7 @@ class MegaTable(Grid.PyGridTableBase): def _updateColAttrs(self, grid): """ - wxGrid -> update the column attributes to add the + wx.Grid -> update the column attributes to add the appropriate renderer given the column name. (renderers are stored in the self.plugins dictionary) @@ -187,7 +183,7 @@ class MegaTable(Grid.PyGridTableBase): # -------------------------------------------------------------------- -# Sample wxGrid renderers +# Sample wx.Grid renderers class MegaImageRenderer(Grid.PyGridCellRenderer): def __init__(self, table): diff --git a/wxPython/demo/HtmlWindow.py b/wxPython/demo/HtmlWindow.py index edfe7027b6..d21fea1768 100644 --- a/wxPython/demo/HtmlWindow.py +++ b/wxPython/demo/HtmlWindow.py @@ -1,15 +1,3 @@ -# 11/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 12/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o got the wxpTag stuff working right. -# -# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wxScrolledMessageDialog -> ScrolledMessageDialog -# import os import sys @@ -211,9 +199,9 @@ def runTest(frame, nb, log): overview = """ -

wxHtmlWindow

+

wx.HtmlWindow

-

wxHtmlWindow is capable of parsing and rendering most +

wx.HtmlWindow is capable of parsing and rendering most simple HTML tags.

It is not intended to be a high-end HTML browser. If you're diff --git a/wxPython/demo/IEHtmlWin.py b/wxPython/demo/IEHtmlWin.py index 33e5b8c8be..4818e9d9b4 100644 --- a/wxPython/demo/IEHtmlWin.py +++ b/wxPython/demo/IEHtmlWin.py @@ -196,9 +196,9 @@ def runTest(frame, nb, log): overview = """\ -

wxIEHtmlWin

+

wx.IEHtmlWin

-The wxIEHtmlWin class is the first example of using a contributed +The wx.IEHtmlWin class is the first example of using a contributed wxActiveX class in wxWindows C++. It is still experimental, but I think it is useful. diff --git a/wxPython/demo/Image.py b/wxPython/demo/Image.py index 415bfd9ce7..6193f004d7 100644 --- a/wxPython/demo/Image.py +++ b/wxPython/demo/Image.py @@ -1,7 +1,3 @@ -# 11/19/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx diff --git a/wxPython/demo/ImageBrowser.py b/wxPython/demo/ImageBrowser.py index dd1c817aff..491457ca84 100644 --- a/wxPython/demo/ImageBrowser.py +++ b/wxPython/demo/ImageBrowser.py @@ -8,16 +8,6 @@ # Date: Feb 26, 2001 # Licence: wxWindows license #---------------------------------------------------------------------------- -# -# 11/23/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Library has to be updated, it is using obsolete names -# (wxPyDefaultSize, etc) -# import os diff --git a/wxPython/demo/ImageFromStream.py b/wxPython/demo/ImageFromStream.py index 720389a818..5bc72afb55 100644 --- a/wxPython/demo/ImageFromStream.py +++ b/wxPython/demo/ImageFromStream.py @@ -1,7 +1,3 @@ -# 11/19/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import cStringIO diff --git a/wxPython/demo/IntCtrl.py b/wxPython/demo/IntCtrl.py index 27b968c5a2..1b56843e75 100644 --- a/wxPython/demo/IntCtrl.py +++ b/wxPython/demo/IntCtrl.py @@ -1,20 +1,3 @@ -# 11/19/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/29/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o intctrl needs the renamer applied. -# o intctrl needs new event binders. -# -# 12/08/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o All issues corrected -# -# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wxIntCtrl -> IntCtrl -# import wx import wx.lib.intctrl diff --git a/wxPython/demo/KeyEvents.py b/wxPython/demo/KeyEvents.py index c992865219..5439dfb76e 100644 --- a/wxPython/demo/KeyEvents.py +++ b/wxPython/demo/KeyEvents.py @@ -1,15 +1,3 @@ -# 11/19/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/29/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# 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 diff --git a/wxPython/demo/LEDNumberCtrl.py b/wxPython/demo/LEDNumberCtrl.py index 7bb46e1647..4814864d4b 100644 --- a/wxPython/demo/LEDNumberCtrl.py +++ b/wxPython/demo/LEDNumberCtrl.py @@ -1,7 +1,3 @@ -# 11/19/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import time @@ -55,7 +51,7 @@ overview = """\ source, which was a bit reluctant to reveal its secrets. My appologies if I missed anything - jmg

-wxLEDNumberCtrl( parent, id=-1, pos=wx.DefaultPosition, +LEDNumberCtrl( parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=LED_ALIGN_LEFT | LED_DRAW_FADED)

This is a control that simulates an LED clock display. It only accepts diff --git a/wxPython/demo/LayoutAnchors.py b/wxPython/demo/LayoutAnchors.py index acc7617d6c..d4b674885d 100644 --- a/wxPython/demo/LayoutAnchors.py +++ b/wxPython/demo/LayoutAnchors.py @@ -1,9 +1,3 @@ -# 11/6/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o In the lambda function at the top, removed the leading 'wx' from the -# ID names to remove confusion with 'official' wx members. -# import wx import wx.lib.anchors as anchors diff --git a/wxPython/demo/LayoutConstraints.py b/wxPython/demo/LayoutConstraints.py index 29ffeaf080..ec682a5a77 100644 --- a/wxPython/demo/LayoutConstraints.py +++ b/wxPython/demo/LayoutConstraints.py @@ -1,7 +1,3 @@ -# 11/19/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx diff --git a/wxPython/demo/Layoutf.py b/wxPython/demo/Layoutf.py index fcf059819b..8958a533f0 100644 --- a/wxPython/demo/Layoutf.py +++ b/wxPython/demo/Layoutf.py @@ -1,24 +1,15 @@ -# 11/12/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Controls now use dynamic IDs instead of hardcoded IDs. -# import wx import wx.lib.layoutf as layoutf #--------------------------------------------------------------------------- -ID_Button = wx.NewId() - -#--------------------------------------------------------------------------- - class TestLayoutf(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent, -1) self.SetAutoLayout(True) - self.Bind(wx.EVT_BUTTON, self.OnButton, id=ID_Button) + self.Bind(wx.EVT_BUTTON, self.OnButton) self.panelA = wx.Window(self, -1, style=wx.SIMPLE_BORDER) self.panelA.SetBackgroundColour(wx.BLUE) @@ -38,10 +29,10 @@ class TestLayoutf(wx.Panel): layoutf.Layoutf('t_10#3;r=r10#1;b=b10#1;l>10#2', (self,self.panelA,self.panelB)) ) - b = wx.Button(self.panelA, ID_Button, ' Panel A ') + b = wx.Button(self.panelA, -1, ' Panel A ') b.SetConstraints(layoutf.Layoutf('X=X#1;Y=Y#1;h*;w%w50#1', (self.panelA,))) - b = wx.Button(self.panelB, ID_Button, ' Panel B ') + b = wx.Button(self.panelB, -1, ' Panel B ') b.SetConstraints(layoutf.Layoutf('t=t2#1;r=r4#1;h*;w*', (self.panelB,))) self.panelD = wx.Window(self.panelC, -1, style=wx.SIMPLE_BORDER) @@ -50,7 +41,7 @@ class TestLayoutf(wx.Panel): layoutf.Layoutf('b%h50#1;r%w50#1;h=h#2;w=w#2', (self.panelC, b)) ) - b = wx.Button(self.panelC, ID_Button, ' Panel C ') + b = wx.Button(self.panelC, -1, ' Panel C ') b.SetConstraints(layoutf.Layoutf('t_#1;l>#1;h*;w*', (self.panelD,))) wx.StaticText(self.panelD, -1, "Panel D", (4, 4)).SetBackgroundColour(wx.GREEN) diff --git a/wxPython/demo/ListBox.py b/wxPython/demo/ListBox.py index c3a69d6919..83840b1238 100644 --- a/wxPython/demo/ListBox.py +++ b/wxPython/demo/ListBox.py @@ -1,7 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -78,7 +74,7 @@ class TestListBox(wx.Panel): 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen'] - wx.StaticText(self, -1, "This example uses the wxListBox control.", (45, 10)) + wx.StaticText(self, -1, "This example uses the wx.ListBox control.", (45, 10)) wx.StaticText(self, -1, "Select one:", (15, 50), (65, 18)) self.lb1 = wx.ListBox(self, 60, (80, 50), (80, 120), sampleList, wx.LB_SINGLE) self.Bind(wx.EVT_LISTBOX, self.EvtListBox, self.lb1) diff --git a/wxPython/demo/ListCtrl.py b/wxPython/demo/ListCtrl.py index 879bc1baa0..fc99a93627 100644 --- a/wxPython/demo/ListCtrl.py +++ b/wxPython/demo/ListCtrl.py @@ -9,26 +9,6 @@ # Copyright: (c) 1998 by Total Control Software # Licence: wxWindows license #---------------------------------------------------------------------------- -# -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/29/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o listctrl mixin needs wx renamer. -# o wx.ListItem.GetText() returns a wxString pointer, not the text. -# -# 12/14/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# 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 diff --git a/wxPython/demo/ListCtrl_virtual.py b/wxPython/demo/ListCtrl_virtual.py index 75f5d97573..757575b34d 100644 --- a/wxPython/demo/ListCtrl_virtual.py +++ b/wxPython/demo/ListCtrl_virtual.py @@ -1,11 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/29/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wx.ListItem.GetText() returns a wxString pointer, not the text. -# import wx import images diff --git a/wxPython/demo/Listbook.py b/wxPython/demo/Listbook.py index 2186205cb3..c17359a4be 100644 --- a/wxPython/demo/Listbook.py +++ b/wxPython/demo/Listbook.py @@ -1,19 +1,10 @@ -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/29/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Bunches of imports that might need to go away for the final roll-out. -# import sys import wx -import images - import ColorPanel +import images colourList = [ "Aquamarine", "Black", "Blue", "Blue Violet", "Brown", "Cadet Blue", "Coral", "Cornflower Blue", "Cyan", "Dark Grey", "Dark Green", @@ -112,10 +103,10 @@ def runTest(frame, nb, log): overview = """\ -

wxListbook

+

wx.Listbook

This class is a control similar to a notebook control, but with a -wxListCtrl instead of a set of tabs. +wx.ListCtrl instead of a set of tabs. """ diff --git a/wxPython/demo/MDIDemo.py b/wxPython/demo/MDIDemo.py index 190b5a4a5e..6f65a039ff 100644 --- a/wxPython/demo/MDIDemo.py +++ b/wxPython/demo/MDIDemo.py @@ -1,10 +1,3 @@ -#!/usr/bin/env python - -# 11/12/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Replaced hardcoded menu IDs with dynamic IDs -# import wx diff --git a/wxPython/demo/MDISashDemo.py b/wxPython/demo/MDISashDemo.py index 99faae0913..d5d86905a0 100644 --- a/wxPython/demo/MDISashDemo.py +++ b/wxPython/demo/MDISashDemo.py @@ -1,10 +1,5 @@ #!/usr/bin/env python -# 11/6/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# - import wx import ScrolledWindow diff --git a/wxPython/demo/MDIWindows.py b/wxPython/demo/MDIWindows.py index a28390a674..fb68174246 100644 --- a/wxPython/demo/MDIWindows.py +++ b/wxPython/demo/MDIWindows.py @@ -1,7 +1,3 @@ -# 11/12/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx diff --git a/wxPython/demo/MVCTree.py b/wxPython/demo/MVCTree.py index 79ad083a85..93071461df 100644 --- a/wxPython/demo/MVCTree.py +++ b/wxPython/demo/MVCTree.py @@ -1,15 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Library must be updated for this to run. -# -# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wxMVCTree -> MVCTree -# import os import sys diff --git a/wxPython/demo/Mask.py b/wxPython/demo/Mask.py index 8d5a43c58b..0af29a3761 100644 --- a/wxPython/demo/Mask.py +++ b/wxPython/demo/Mask.py @@ -1,7 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx diff --git a/wxPython/demo/MaskedEditControls.py b/wxPython/demo/MaskedEditControls.py index 09f6fdcaaa..278a302fb8 100644 --- a/wxPython/demo/MaskedEditControls.py +++ b/wxPython/demo/MaskedEditControls.py @@ -1,25 +1,3 @@ -# 11/23/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/26/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o the three libraries below all have not been hit by the -# wx renamer. -# -# 12/09/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o A few changes to correct my own mistakes earlier :-). -# -# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wxMaskedTextCtrl -> MaskedTextCtrl -# o wxMaskedComboBox -> MaskedComboBox -# o wxIpAddrCtrl -> IpAddrCtrl -# o wxMaskedNumCtrl -> MaskedNumCtrl -# o wxTimeCtrl -> TimeCtrl -# o wxScrolledPanel -> ScrolledPanel -# import string import sys diff --git a/wxPython/demo/MaskedNumCtrl.py b/wxPython/demo/MaskedNumCtrl.py index 855726b100..81ad6cfe33 100644 --- a/wxPython/demo/MaskedNumCtrl.py +++ b/wxPython/demo/MaskedNumCtrl.py @@ -1,19 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/29/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wx.lib.maskednumctrl needs hit up with the renamer and new binders -# -# 12/09/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Issues with lib corrected. -# -# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wxMaskedNumCtrl -> MaskedNumCtrl -# import string import sys diff --git a/wxPython/demo/Menu.py b/wxPython/demo/Menu.py index 516241efcf..45ca029fba 100644 --- a/wxPython/demo/Menu.py +++ b/wxPython/demo/Menu.py @@ -4,10 +4,12 @@ # menus in wxPython 2.3.3 # #------------------------------------------------------------------- -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) # -# o Updated for wx namespace -# +# o Debug message when adding a menu item (see last menu): +# +# Debug: ..\..\src\msw\menuitem.cpp(370): 'GetMenuState' failed with +# error 0x00000002 (the system cannot find the file specified.). +# import time import wx @@ -139,7 +141,6 @@ check the source for this sample to see how to implement them. text = item.GetText() help = item.GetHelp() - #print text, help # but in this case just call Skip so the default is done event.Skip() @@ -263,7 +264,7 @@ def runTest(frame, nb, log): overview = """\ -A demo of using wxMenuBar and wxMenu in various ways. +A demo of using wx.MenuBar and wx.Menu in various ways. A menu is a popup (or pull down) list of items, one of which may be selected before the menu goes away (clicking elsewhere dismisses the menu). Menus may be @@ -278,7 +279,7 @@ Menu items may be either normal items, check items or radio items. Normal items don't have any special properties while the check items have a boolean flag associated to them and they show a checkmark in the menu when the flag is set. wxWindows automatically toggles the flag value when the item is clicked and its value may -be retrieved using either IsChecked method of wxMenu or wxMenuBar itself or by +be retrieved using either IsChecked method of wx.Menu or wx.MenuBar itself or by using wxEvent.IsChecked when you get the menu notification for the item in question. The radio items are similar to the check items except that all the other items diff --git a/wxPython/demo/MessageDialog.py b/wxPython/demo/MessageDialog.py index 009c30fb11..2ac09775e5 100644 --- a/wxPython/demo/MessageDialog.py +++ b/wxPython/demo/MessageDialog.py @@ -1,7 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -27,7 +23,7 @@ and, if so, what kind. The dialog can be modal or not; of modal, the user's response is in the return code of ShowModal(). If not, the response can be taken from GetReturnCode() (inherited -from the wxDialog super class). If not modal and the return code is required, it +from the wx.Dialog). If not modal and the return code is required, it must be retrieved before the dialog is destroyed. """ diff --git a/wxPython/demo/MiniFrame.py b/wxPython/demo/MiniFrame.py index 42e237ae4f..b337885342 100644 --- a/wxPython/demo/MiniFrame.py +++ b/wxPython/demo/MiniFrame.py @@ -1,7 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -30,7 +26,7 @@ class MyMiniFrame(wx.MiniFrame): #--------------------------------------------------------------------------- def runTest(frame, nb, log): - win = MyMiniFrame(frame, "This is a wxMiniFrame", + win = MyMiniFrame(frame, "This is a wx.MiniFrame", #pos=(250,250), size=(200,200), style=wx.DEFAULT_FRAME_STYLE | wx.TINY_CAPTION_HORIZ) win.SetSize((200, 200)) @@ -43,9 +39,9 @@ def runTest(frame, nb, log): overview = """\ -A miniframe is a frame with a small title bar. It is suitable for floating +A MiniFrame is a Frame with a small title bar. It is suitable for floating toolbars that must not take up too much screen area. In other respects, it's the -same as a wxFrame. +same as a wx.Frame. """ diff --git a/wxPython/demo/MultiSash.py b/wxPython/demo/MultiSash.py index ce95868047..d978b0395e 100644 --- a/wxPython/demo/MultiSash.py +++ b/wxPython/demo/MultiSash.py @@ -1,21 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wx renamer needs to be applied to multisash lib. -# o There appears to be a problem with the image that -# the library is trying to use for the alternate cursor -# -# 12/09/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o renamer issue shelved. -# -# 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wxMultiSash -> MultiSash -# import wx import wx.lib.multisash as sash diff --git a/wxPython/demo/MultipleChoiceDialog.py b/wxPython/demo/MultipleChoiceDialog.py index e354d28070..3407650814 100644 --- a/wxPython/demo/MultipleChoiceDialog.py +++ b/wxPython/demo/MultipleChoiceDialog.py @@ -1,15 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wx renamer not applied to lib. -# -# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wxMultipleChoiceDialog -> MultipleChoiceDialog -# import wx import wx.lib.dialogs @@ -40,7 +28,7 @@ This is a Python implementation of a dialog that is not yet implemented in wxWin proper, so don't let the wxWindows documentation mislead you.

MultipleChoiceDialog(self, parent, msg, title, lst, -pos = wx.wxDefaultPosition, size = (200,200), style = wx.wxDEFAULT_DIALOG_STYLE) +pos = wx.wxDefaultPosition, size = (200,200), style = wx.DEFAULT_DIALOG_STYLE)

diff --git a/wxPython/demo/Notebook.py b/wxPython/demo/Notebook.py index c9740ce678..5102914318 100644 --- a/wxPython/demo/Notebook.py +++ b/wxPython/demo/Notebook.py @@ -1,7 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import sys @@ -116,14 +112,14 @@ def runTest(frame, nb, log): overview = """\ -

wxNotebook

+

wx.Notebook

This class represents a notebook control, which manages multiple windows with associated tabs.

-To use the class, create a wxNotebook object and call AddPage or +To use the class, create a wx.Notebook object and call AddPage or InsertPage, passing a window to be used as the page. Do not explicitly -delete the window for a page that is currently managed by wxNotebook. +delete the window for a page that is currently managed by wx.Notebook. """ diff --git a/wxPython/demo/OGL.py b/wxPython/demo/OGL.py index eb7cea9c83..3e3ac4e80d 100644 --- a/wxPython/demo/OGL.py +++ b/wxPython/demo/OGL.py @@ -313,7 +313,7 @@ class __Cleanup: def __del__(self): self.cleanup() -# when this module gets cleaned up then wxOGLCleanUp() will get called +# when this module gets cleaned up then wx.OGLCleanUp() will get called __cu = __Cleanup() diff --git a/wxPython/demo/OOR.py b/wxPython/demo/OOR.py index 904e191556..fa746c10f9 100644 --- a/wxPython/demo/OOR.py +++ b/wxPython/demo/OOR.py @@ -1,7 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import wx.html as wxhtml diff --git a/wxPython/demo/PageSetupDialog.py b/wxPython/demo/PageSetupDialog.py index a4e7e4e215..a496884795 100644 --- a/wxPython/demo/PageSetupDialog.py +++ b/wxPython/demo/PageSetupDialog.py @@ -1,7 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -37,12 +33,12 @@ The page setup dialog contains controls for paper size (A4, A5 etc.), orientatio (landscape or portrait), and controls for setting left, top, right and bottom margin sizes in millimetres. -When the dialog has been closed, you need to query the wxPageSetupDialogData object +When the dialog has been closed, you need to query the wx.PageSetupDialogData object associated with the dialog. Note that the OK and Cancel buttons do not destroy the dialog; this must be done by the application. As with other dialogs, do not destroy the dialog until you are done -with the data, and, conversely, do not use the wxPageSetupDialogData after the +with the data, and, conversely, do not use the wx.PageSetupDialogData after the dialog is destroyed. diff --git a/wxPython/demo/PlotCanvas.py b/wxPython/demo/PlotCanvas.py index 4311942af3..9d0bf9f302 100644 --- a/wxPython/demo/PlotCanvas.py +++ b/wxPython/demo/PlotCanvas.py @@ -1,12 +1,7 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) + # -# o Updated for wx namespace -# -# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# wx.lib.wxPlotCanvas is deprecated. Use wx.lib.plot instead. # -# o wxPlotCanvas must be updated with new draw mechanics (tuples) before -# it can be used with 2.5. -# import wx import wx.lib.wxPlotCanvas as plot diff --git a/wxPython/demo/PopupControl.py b/wxPython/demo/PopupControl.py index d312a9319c..8b824b21f6 100644 --- a/wxPython/demo/PopupControl.py +++ b/wxPython/demo/PopupControl.py @@ -1,15 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# 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 @@ -89,12 +77,12 @@ overview = """

PopupControl

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 +that will popup another window similar to how a wx.ComboBox works. The popup window can contain whatever is needed to edit the value. This -example uses a wxCalendarCtrl. +example uses a wx.CalendarCtrl. -

Currently a wxDialog is used for the popup. Eventually a -wxPopupWindow should be used... +

Currently a wx.Dialog is used for the popup. Eventually a +wx.PopupWindow should be used... """ diff --git a/wxPython/demo/PopupMenu.py b/wxPython/demo/PopupMenu.py index 9dd5435b2d..0ff54a4bd9 100644 --- a/wxPython/demo/PopupMenu.py +++ b/wxPython/demo/PopupMenu.py @@ -1,6 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace import wx diff --git a/wxPython/demo/PopupWindow.py b/wxPython/demo/PopupWindow.py index cc4d71b83f..daea319286 100644 --- a/wxPython/demo/PopupWindow.py +++ b/wxPython/demo/PopupWindow.py @@ -1,14 +1,9 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace # # 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) # # o Some issues with the listbox example; I tried correcting # it but it's still not working the way it should. Commented -# out for now but will be revisited. -# o The math in determining the popup window's position is -# a bit off. +# out for now, as I found it. # import wx @@ -23,7 +18,7 @@ except NameError: #--------------------------------------------------------------------------- class TestPopup(wx.PopupWindow): - """Adds a bit of text and mouse movement to the wxPopupWindow""" + """Adds a bit of text and mouse movement to the wx.PopupWindow""" def __init__(self, parent, style): wx.PopupWindow.__init__(self, parent, style) self.SetBackgroundColour("CADET BLUE") @@ -76,15 +71,15 @@ class TestPopup(wx.PopupWindow): class TestTransientPopup(wx.PopupTransientWindow): - """Adds a bit of text and mouse movement to the wxPopupWindow""" + """Adds a bit of text and mouse movement to the wx.PopupWindow""" def __init__(self, parent, style, log): wx.PopupTransientWindow.__init__(self, parent, style) self.log = log panel = wx.Panel(self, -1) panel.SetBackgroundColour("#FFB6C1") st = wx.StaticText(panel, -1, - "wxPopupTransientWindow is a\n" - "wxPopupWindow which disappears\n" + "wx.PopupTransientWindow is a\n" + "wx.PopupWindow which disappears\n" "automatically when the user\n" "clicks the mouse outside it or if it\n" "(or its first child) loses focus in \n" @@ -109,16 +104,16 @@ class TestPanel(wx.Panel): wx.Panel.__init__(self, parent, -1) self.log = log - b = wx.Button(self, -1, "Show wxPopupWindow", (25, 50)) + b = wx.Button(self, -1, "Show wx.PopupWindow", (25, 50)) self.Bind(wx.EVT_BUTTON, self.OnShowPopup, b) - b = wx.Button(self, -1, "Show wxPopupTransientWindow", (25, 95)) + b = wx.Button(self, -1, "Show wx.PopupTransientWindow", (25, 95)) self.Bind(wx.EVT_BUTTON, self.OnShowPopupTransient, b) # This isn't working so well, not sure why. Commented out for # now. -# b = wx.Button(self, -1, "Show wxPopupWindow with listbox", (25, 140)) +# b = wx.Button(self, -1, "Show wx.PopupWindow with listbox", (25, 140)) # self.Bind(wx.EVT_BUTTON, self.OnShowPopupListbox, b) @@ -160,6 +155,10 @@ class TestPanel(wx.Panel): win.Show(True) +# This class is currently not implemented in the demo. It does not +# behave the way it should, so for the time being it's only here +# for show. If you figure out how to make it work, please send +# a corrected file to Robin! class TestPopupWithListbox(wx.PopupWindow): def __init__(self, parent, style, log): wx.PopupWindow.__init__(self, parent, style) @@ -197,7 +196,7 @@ def runTest(frame, nb, log): return win else: dlg = wx.MessageDialog( - frame, 'wxPopupWindow is not available on this platform.', + frame, 'wx.PopupWindow is not available on this platform.', 'Sorry', wx.OK | wx.ICON_INFORMATION ) diff --git a/wxPython/demo/PrintDialog.py b/wxPython/demo/PrintDialog.py index 981f0ea965..04540625f0 100644 --- a/wxPython/demo/PrintDialog.py +++ b/wxPython/demo/PrintDialog.py @@ -1,7 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx #--------------------------------------------------------------------------- @@ -29,9 +25,9 @@ def runTest(frame, nb, log): overview = """\ This class represents the print and print setup common dialogs. You may obtain -a wxPrinterDC device context from a successfully dismissed print dialog. +a wx.PrinterDC device context from a successfully dismissed print dialog. -User information is stored in a wxPrintDialogData object that is passed to the +User information is stored in a wx.PrintDialogData object that is passed to the dialog at creation time, and it is filled in by the user. As with other dialogs, do not use this data once the dialog is dismissed, and do not destroy the dialog until you have everything you need from it. diff --git a/wxPython/demo/PrintFramework.py b/wxPython/demo/PrintFramework.py index ac9d3a1c57..ea3881e68f 100644 --- a/wxPython/demo/PrintFramework.py +++ b/wxPython/demo/PrintFramework.py @@ -1,9 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Got rid of static buton IDs -# o Took at a stab at a lucid overview string. -# import wx import ScrolledWindow diff --git a/wxPython/demo/Process.py b/wxPython/demo/Process.py index 42c46c2cd6..af9e4cd9f4 100644 --- a/wxPython/demo/Process.py +++ b/wxPython/demo/Process.py @@ -1,7 +1,3 @@ -# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -15,8 +11,8 @@ class TestPanel(wx.Panel): self.process = None self.Bind(wx.EVT_IDLE, self.OnIdle) - # We can either derive from wxProcess and override OnTerminate - # or we can let wxProcess send this window an event that is + # We can either derive from wx.Process and override OnTerminate + # or we can let wx.Process send this window an event that is # caught in the normal way... self.Bind(wx.EVT_END_PROCESS, self.OnProcessEnded) @@ -139,9 +135,9 @@ def runTest(frame, nb, log): overview = """\ -

wxProcess

+

wx.Process

-wxProcess lets you get notified when an asyncronous child process +wx.Process lets you get notified when an asyncronous child process started by wxExecute terminates, and also to get input/output streams for the child process's stdout, stderr and stdin. diff --git a/wxPython/demo/PyColourChooser.py b/wxPython/demo/PyColourChooser.py index b31fe51326..0bad427a48 100644 --- a/wxPython/demo/PyColourChooser.py +++ b/wxPython/demo/PyColourChooser.py @@ -1,16 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 12/14/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# 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 diff --git a/wxPython/demo/PyCrust.py b/wxPython/demo/PyCrust.py index b0c4226e6f..9aa95fcd0c 100644 --- a/wxPython/demo/PyCrust.py +++ b/wxPython/demo/PyCrust.py @@ -1,7 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx.py as py diff --git a/wxPython/demo/PyPlot.py b/wxPython/demo/PyPlot.py index 3f004249d8..954f37ec6e 100644 --- a/wxPython/demo/PyPlot.py +++ b/wxPython/demo/PyPlot.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o New demo -# import wx import wx.lib.plot diff --git a/wxPython/demo/PyShell.py b/wxPython/demo/PyShell.py index 99d88ce078..7fe18707f6 100644 --- a/wxPython/demo/PyShell.py +++ b/wxPython/demo/PyShell.py @@ -1,7 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx.py as py diff --git a/wxPython/demo/PythonEvents.py b/wxPython/demo/PythonEvents.py index 55b583939a..c83ac1afc6 100644 --- a/wxPython/demo/PythonEvents.py +++ b/wxPython/demo/PythonEvents.py @@ -1,7 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import sys diff --git a/wxPython/demo/RadioBox.py b/wxPython/demo/RadioBox.py index cd583a3378..2d925375d2 100644 --- a/wxPython/demo/RadioBox.py +++ b/wxPython/demo/RadioBox.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -26,7 +22,7 @@ class TestRadioBox(wx.Panel): self.Bind(wx.EVT_RADIOBOX, self.EvtRadioBox, rb) #rb.SetBackgroundColour(wx.BLUE) rb.SetToolTip(wx.ToolTip("This is a ToolTip!")) - #rb.SetLabel("wxRadioBox") + #rb.SetLabel("wx.RadioBox") sizer.Add(rb, 0, wx.ALL, 20) @@ -46,10 +42,6 @@ class TestRadioBox(wx.Panel): def EvtRadioBox(self, event): self.log.WriteText('EvtRadioBox: %d\n' % event.GetInt()) -# Doesn't appear to be used for anything. -# def EvtRadioButton(self, event): -# self.log.write('EvtRadioButton:%d\n' % event.GetId()) - #--------------------------------------------------------------------------- def runTest(frame, nb, log): @@ -59,9 +51,10 @@ def runTest(frame, nb, log): overview = """\ -A radio box item is used to select one of number of mutually exclusive +A RadioBox is used to select one of a number of mutually exclusive choices. It is displayed as a vertical column or horizontal row of -labelled buttons. +labelled buttons, surrounded by a box that can optionally have a +label. """ diff --git a/wxPython/demo/RadioButton.py b/wxPython/demo/RadioButton.py index ad4ee8ce7c..e74b0f52e6 100644 --- a/wxPython/demo/RadioButton.py +++ b/wxPython/demo/RadioButton.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -114,9 +110,9 @@ overview = """\ This demo shows how individual radio buttons can be used to build more complicated selection mechanisms...

-It uses 2 groups of wxRadioButtons, where the groups are defined by -instantiation. When a wxRadioButton is created with the wxRB_GROUP -style, all subsequent wxRadioButtons created without it are implicitly +It uses 2 groups of wx.RadioButtons, where the groups are defined by +instantiation. When a wx.RadioButton is created with the wx.RB_GROUP +style, all subsequent wx.RadioButtons created without it are implicitly added to that group by the framework. """ diff --git a/wxPython/demo/RightTextCtrl.py b/wxPython/demo/RightTextCtrl.py index 9d28c46c79..aa8e3e8bb1 100644 --- a/wxPython/demo/RightTextCtrl.py +++ b/wxPython/demo/RightTextCtrl.py @@ -1,28 +1,11 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o The rightalign library needs converted for this to work correctly. -# -# 12/11/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# 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 | -# wx.TextCtrl now supports the wx.TE_RIGHT style flag, which makes this | -# control completely superfluous. | -############################################################################/ +#####################################################################\ +# Note: This control is deprecated because wx.TextCtrl now supports | +# the wx.TE_RIGHT style flag, which makes this control completely | +# superfluous. | +#####################################################################/ import wx -import wx.lib.rightalign as right +import wx.lib.rightalign as right #---------------------------------------------------------------------- diff --git a/wxPython/demo/RowColSizer.py b/wxPython/demo/RowColSizer.py index ad76bd7c1f..efdb3c754f 100644 --- a/wxPython/demo/RowColSizer.py +++ b/wxPython/demo/RowColSizer.py @@ -1,12 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Gotta fix the overview. -# -# 11/26/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Overview fixed. -# import wx import wx.lib.rcsizer as rcs diff --git a/wxPython/demo/SashWindow.py b/wxPython/demo/SashWindow.py index b70a3ee7a1..aee3be673a 100644 --- a/wxPython/demo/SashWindow.py +++ b/wxPython/demo/SashWindow.py @@ -1,8 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Should be renamed to wxSashLayoutWindow.py -# import wx @@ -133,13 +128,13 @@ def runTest(frame, nb, log): overview = """\ -wxSashLayoutWindow responds to OnCalculateLayout events generated by +wx.SashLayoutWindow responds to OnCalculateLayout events generated by wxLayoutAlgorithm. It allows the application to use simple accessors to specify how the window should be laid out, rather than having to respond -to events. The fact that the class derives from wxSashWindow allows sashes +to events. The fact that the class derives from wx.SashWindow allows sashes to be used if required, to allow the windows to be user-resizable. -The documentation for wxLayoutAlgorithm explains the purpose of this class +The documentation for wx.LayoutAlgorithm explains the purpose of this class in more detail. """ diff --git a/wxPython/demo/ScrolledMessageDialog.py b/wxPython/demo/ScrolledMessageDialog.py index 03158917af..711fbecd0c 100644 --- a/wxPython/demo/ScrolledMessageDialog.py +++ b/wxPython/demo/ScrolledMessageDialog.py @@ -1,19 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o dialogs library needs updated to wx -# -# 12/01/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o dialogs library converted. All is well. -# -# 12/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o wxScrolledMessageDialog -> ScrolledMessageDialog -# import wx import wx.lib.dialogs diff --git a/wxPython/demo/ScrolledPanel.py b/wxPython/demo/ScrolledPanel.py index 947051cf1a..cab8cc8eb2 100644 --- a/wxPython/demo/ScrolledPanel.py +++ b/wxPython/demo/ScrolledPanel.py @@ -1,22 +1,6 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o scrolledpanel lib needs wx update -# -# 12/11/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# 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 +import wx.lib.scrolledpanel as scrolled #---------------------------------------------------------------------- @@ -33,7 +17,7 @@ class TestPanel(scrolled.ScrolledPanel): "ScrolledPanel extends wx.ScrolledWindow, 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" + "demo panel for this sample is also using it -- the \nwxStaticLine " "below is intentionally made too long so a scrollbar will be " "activated." ) diff --git a/wxPython/demo/ScrolledWindow.py b/wxPython/demo/ScrolledWindow.py index 411d73aee7..be75668981 100644 --- a/wxPython/demo/ScrolledWindow.py +++ b/wxPython/demo/ScrolledWindow.py @@ -1,11 +1,5 @@ -# 11/12/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Rudimentary overview doc added. -# import wx - import images BUFFERED = 1 diff --git a/wxPython/demo/ShapedWindow.py b/wxPython/demo/ShapedWindow.py index 586f6b09ab..137481e28c 100644 --- a/wxPython/demo/ShapedWindow.py +++ b/wxPython/demo/ShapedWindow.py @@ -1,7 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import images diff --git a/wxPython/demo/SingleChoiceDialog.py b/wxPython/demo/SingleChoiceDialog.py index 34c6f50b5f..157e172541 100644 --- a/wxPython/demo/SingleChoiceDialog.py +++ b/wxPython/demo/SingleChoiceDialog.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx diff --git a/wxPython/demo/Sizers.py b/wxPython/demo/Sizers.py index 252a635776..e7d286caa6 100644 --- a/wxPython/demo/Sizers.py +++ b/wxPython/demo/Sizers.py @@ -1,8 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Issues exist that will probably need to be addressed in the 2.5 build. -# # 11/26/2003 - Jeff Grimmett (grimmtooth@softhome.net) # # o Had to do a bit of rework for the demo; there was no panel attached diff --git a/wxPython/demo/Slider.py b/wxPython/demo/Slider.py index 11284aa86a..cea042fad0 100644 --- a/wxPython/demo/Slider.py +++ b/wxPython/demo/Slider.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -13,7 +9,7 @@ class TestPanel(wx.Panel): self.log = log self.count = 0 - wx.StaticText(self, -1, "This is a wxSlider.", (45, 15)) + wx.StaticText(self, -1, "This is a wx.Slider.", (45, 15)) slider = wx.Slider( self, 100, 25, 1, 100, (30, 60), (250, -1), diff --git a/wxPython/demo/SpinButton.py b/wxPython/demo/SpinButton.py index acbe912fb1..eb5504f006 100644 --- a/wxPython/demo/SpinButton.py +++ b/wxPython/demo/SpinButton.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# # 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) # # o EVT_SPIN events (or something about them) freezes up the app. @@ -17,7 +13,7 @@ class TestPanel(wx.Panel): self.log = log self.count = 0 - wx.StaticText(self, -1, "This example uses the wxSpinButton control.", (45, 15)) + wx.StaticText(self, -1, "This example uses the wx.SpinButton control.", (45, 15)) self.text = wx.TextCtrl(self, -1, "1", (30, 50), (60, -1)) h = self.text.GetSize().height @@ -43,12 +39,12 @@ def runTest(frame, nb, log): overview = """\ -A wxSpinButton has two small up and down (or left and right) arrow buttons. +A wx.SpinButton has two small up and down (or left and right) arrow buttons. It is often used next to a text control for increment and decrementing a value. -Portable programs should try to use wxSpinCtrl instead as wxSpinButton is not +Portable programs should try to use wx.SpinCtrl instead as wx.SpinButton is not implemented for all platforms (Win32 and GTK only currently). -NB: the range supported by this control (and wxSpinCtrl) depends on the platform +NB: the range supported by this control (and wx.SpinCtrl) depends on the platform but is at least -0x8000 to 0x7fff. Under GTK and Win32 with sufficiently new version of comctrl32.dll (at least 4.71 is required, 5.80 is recommended) the full 32 bit range is supported. diff --git a/wxPython/demo/SpinCtrl.py b/wxPython/demo/SpinCtrl.py index 427be32326..0104fc1f7a 100644 --- a/wxPython/demo/SpinCtrl.py +++ b/wxPython/demo/SpinCtrl.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -13,11 +9,10 @@ class TestPanel(wx.Panel): self.log = log self.count = 0 - wx.StaticText(self, -1, "This example uses the wxSpinCtrl control.", (45, 15)) + wx.StaticText(self, -1, "This example uses the wx.SpinCtrl control.", (45, 15)) sc = wx.SpinCtrl(self, -1, "", (30, 50), (80, -1)) sc.SetRange(1,100) sc.SetValue(5) - #sc.Enable(False) #---------------------------------------------------------------------- @@ -30,9 +25,9 @@ def runTest(frame, nb, log): overview = """\ -wxSpinCtrl combines wxTextCtrl and wxSpinButton in one control. +wx.SpinCtrl combines wx.TextCtrl and wx.SpinButton in one control. -Portable programs should try to use wxSpinCtrl instead as wxSpinButton is not +Portable programs should try to use this control as wx.SpinButton is not implemented for all platforms (Win32 and GTK only currently). NB: the range supported by this control depends on the platform diff --git a/wxPython/demo/SplitterWindow.py b/wxPython/demo/SplitterWindow.py index d25e626923..565bdd4047 100644 --- a/wxPython/demo/SplitterWindow.py +++ b/wxPython/demo/SplitterWindow.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -50,7 +46,7 @@ def runTest(frame, nb, log): overview = """\ This class manages up to two subwindows. The current view can be split into two programmatically (perhaps from a menu command), and unsplit -either programmatically or via the wxSplitterWindow user interface. +either programmatically or via the wx.SplitterWindow user interface. """ if __name__ == '__main__': diff --git a/wxPython/demo/StaticBitmap.py b/wxPython/demo/StaticBitmap.py index 2bfecf0433..e6492edc15 100644 --- a/wxPython/demo/StaticBitmap.py +++ b/wxPython/demo/StaticBitmap.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import images @@ -14,7 +10,7 @@ class TestPanel(wx.Panel): self.log = log self.count = 0 - wx.StaticText(self, -1, "This is a wxStaticBitmap.", (45, 15)) + wx.StaticText(self, -1, "This is a wx.StaticBitmap.", (45, 15)) bmp = images.getTest2Bitmap() mask = wx.MaskColour(bmp, wx.BLUE) @@ -36,12 +32,12 @@ def runTest(frame, nb, log): #---------------------------------------------------------------------- overview = """\ -A static bitmap control displays a bitmap. +A StaticBitmap control displays a bitmap. The bitmap to be displayed should have a small number of colours, such as 16, to avoid palette problems. -A bitmap can be derived from most image formats using the wxImage class. +A bitmap can be derived from most image formats using the wx.Image class. """ diff --git a/wxPython/demo/StaticText.py b/wxPython/demo/StaticText.py index 22874ef480..8bee69d258 100644 --- a/wxPython/demo/StaticText.py +++ b/wxPython/demo/StaticText.py @@ -1,9 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Removed the USE_GENERIC code because it doesn't work unless you use -# the 'from wx import *' methodology. -# import wx @@ -14,7 +8,7 @@ class TestPanel(wx.Panel): wx.Panel.__init__(self, parent, -1) wx.StaticText(self, -1, "This is an example of static text", (20, 10)) - wx.StaticText(self, -1, "using the wxStaticText Control.", (20, 30)) + wx.StaticText(self, -1, "using the wx.StaticText Control.", (20, 30)) wx.StaticText( self, -1, "Is this yellow?", (20, 70), (90, -1) @@ -34,7 +28,7 @@ class TestPanel(wx.Panel): text.SetFont(font) #text.SetSize(text.GetBestSize()) - wx.StaticText(self, -1, "Multi-line wxStaticText\nline 2\nline 3\n\nafter empty line", (20,150)) + wx.StaticText(self, -1, "Multi-line wx.StaticText\nline 2\nline 3\n\nafter empty line", (20,150)) wx.StaticText(self, -1, "Align right multi-line\nline 2\nline 3\n\nafter empty line", (220,150), style=wx.ALIGN_RIGHT) @@ -49,7 +43,7 @@ def runTest(frame, nb, log): overview = '''\ -A static text control displays one or more lines of read-only text. +A StaticText control displays one or more lines of read-only text. ''' diff --git a/wxPython/demo/StatusBar.py b/wxPython/demo/StatusBar.py index 0d1cd90880..64aaf4c848 100644 --- a/wxPython/demo/StatusBar.py +++ b/wxPython/demo/StatusBar.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import time import wx @@ -14,6 +10,8 @@ class CustomStatusBar(wx.StatusBar): # This status bar has three fields self.SetFieldsCount(3) + # Sets the three fields to be relative widths to each other. + self.SetStatusWidths([-2, -1, -2]) self.log = log self.sizeChanged = False self.Bind(wx.EVT_SIZE, self.OnSize) diff --git a/wxPython/demo/StyledTextCtrl_1.py b/wxPython/demo/StyledTextCtrl_1.py index 5eff81c883..821d85c73e 100644 --- a/wxPython/demo/StyledTextCtrl_1.py +++ b/wxPython/demo/StyledTextCtrl_1.py @@ -1,11 +1,8 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace # # 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) # # o EVT_STC_DRAG_OVER event GetdragResult() is not an int -# o wx.TheClipboard.Flush() generates an error on program exit. +# o wx.TheClipboard.Flush() generates a warning on program exit. # import wx @@ -20,7 +17,7 @@ debug = 1 demoText = """\ -This editor is provided by a class named wxStyledTextCtrl. As +This editor is provided by a class named wx.StyledTextCtrl. As the name suggests, you can define styles that can be applied to sections of text. This will typically be used for things like syntax highlighting code editors, but I'm sure that there are other @@ -35,7 +32,7 @@ If you do you can simply register an event handler and the editor will let you know when the visible portion of the text needs styling. -wxStyledTextEditor also supports setting markers in the margin... +wx.StyledTextEditor also supports setting markers in the margin... @@ -59,7 +56,7 @@ else: #---------------------------------------------------------------------- -# This shows how to catch the Modified event from the wxStyledTextCtrl +# This shows how to catch the Modified event from the wx.StyledTextCtrl class MySTC(stc.StyledTextCtrl): def __init__(self, parent, ID, log): @@ -189,7 +186,7 @@ def runTest(frame, nb, log): decode = codecs.lookup("utf-8")[1] ed.GotoPos(ed.GetLength()) - ed.AddText("\n\nwxStyledTextCtrl can also do Unicode:\n") + ed.AddText("\n\nwx.StyledTextCtrl can also do Unicode:\n") unitext, l = decode('\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd - ' '\xd0\xbb\xd1\x83\xd1\x87\xd1\x88\xd0\xb8\xd0\xb9 ' '\xd1\x8f\xd0\xb7\xd1\x8b\xd0\xba \xd0\xbf\xd1\x80\xd0\xbe\xd0\xb3\xd1\x80\xd0\xb0\xd0\xbc\xd0\xbc\xd0\xb8\xd1\x80\xd0\xbe\xd0\xb2\xd0\xb0\xd0\xbd\xd0\xb8\xd1\x8f!\n\n') diff --git a/wxPython/demo/StyledTextCtrl_2.py b/wxPython/demo/StyledTextCtrl_2.py index f9514cf521..8d82fc1c68 100644 --- a/wxPython/demo/StyledTextCtrl_2.py +++ b/wxPython/demo/StyledTextCtrl_2.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import keyword @@ -94,7 +90,7 @@ class PythonSTC(stc.StyledTextCtrl): self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_EMPTY, "white", "black"); self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_EMPTY, "white", "black"); - elif self.fold_symbols == 2: + elif self.fold_symbols == 2: # Like a flattened tree control using circular headers and curved joins self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_CIRCLEMINUS, "white", "#404040"); self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_CIRCLEPLUS, "white", "#404040"); diff --git a/wxPython/demo/TablePrint.py b/wxPython/demo/TablePrint.py index 8d4de77e89..58e483e0a8 100644 --- a/wxPython/demo/TablePrint.py +++ b/wxPython/demo/TablePrint.py @@ -1,18 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Color preview example generates deprecation warnings. -# -# 11/26/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Note: wx.NamedColour must remain because printout.py requiress it. -# o printout.py is generating a snootful of errors all related to the -# requirement for tuples on the base DC calls now -# -# 12/10/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Issues corrected. -# import os diff --git a/wxPython/demo/TextCtrl.py b/wxPython/demo/TextCtrl.py index 8c954a43b1..b12a113b13 100644 --- a/wxPython/demo/TextCtrl.py +++ b/wxPython/demo/TextCtrl.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import sys import wx @@ -161,7 +157,7 @@ def runTest(frame, nb, log): overview = """\ -A text control allows text to be displayed and (possibly) edited. It may be single +A TextCtrl allows text to be displayed and (possibly) edited. It may be single line or multi-line, support styles or not, be read-only or not, and even supports text masking for such things as passwords. diff --git a/wxPython/demo/TextEntryDialog.py b/wxPython/demo/TextEntryDialog.py index 3083749bd1..b435bfd5a8 100644 --- a/wxPython/demo/TextEntryDialog.py +++ b/wxPython/demo/TextEntryDialog.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -10,7 +6,7 @@ import wx def runTest(frame, nb, log): dlg = wx.TextEntryDialog( frame, 'What is your favorite programming language?', - 'Duh??', 'Python') + 'Eh??', 'Python') dlg.SetValue("Python is the best!") @@ -26,8 +22,8 @@ def runTest(frame, nb, log): overview = """\ This class represents a dialog that requests a one-line text string from the user. -It is implemented as a generic wxWindows dialog. Along with the usual wxDialog -style flags, all of the wxTextCtrl TE_* style flags are accepted, so, for example, +It is implemented as a generic wxWindows dialog. Along with the usual wx.Dialog +style flags, all of the wx.TextCtrl TE_* style flags are accepted, so, for example, wx.TE_PASSWORD could be used to create a password dialog. As with other dialogs of this type, the user input must be retrieved prior to diff --git a/wxPython/demo/Threads.py b/wxPython/demo/Threads.py index bd4385707a..7f66ee85fd 100644 --- a/wxPython/demo/Threads.py +++ b/wxPython/demo/Threads.py @@ -1,14 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Replaced deprecated whrandom with random module. -# -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Currently uses lib.newevent; should probably be updated to use -# new-style event binder. OTOH, this is the only place we get -# to see that library used that I know of. -# import random import time diff --git a/wxPython/demo/Throbber.py b/wxPython/demo/Throbber.py index 1029434064..3096c4850c 100644 --- a/wxPython/demo/Throbber.py +++ b/wxPython/demo/Throbber.py @@ -1,13 +1,5 @@ -# -# Throbber.py - Cliff Wells -# -# 11/23/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx -import wx.lib.rcsizer as rcs import wx.lib.throbber as throb import throbImages # this was created using a modified version of img2py @@ -87,37 +79,34 @@ class TestPanel(wx.Panel): self.otherThrobber.Bind(wx.EVT_LEFT_DOWN, self.OnClickThrobber) box = wx.BoxSizer(wx.VERTICAL) - sizer = rcs.RowColSizer() + sizer = wx.GridBagSizer() box.Add(sizer, 1, wx.EXPAND|wx.ALL, 5) sizer.AddGrowableCol(1) - sizer.Add( - self.otherThrobber, row = 0, col = 2, rowspan = 4, - flag = wx.ALIGN_CENTER_VERTICAL - ) + sizer.Add(self.otherThrobber, (0, 2), (4, 1),flag = wx.ALIGN_CENTER_VERTICAL) row = 2 # use a list so we can keep our order for t in ['plain', 'reverse', 'autoreverse', 'label', 'overlay', 'overlay+text']: sizer.Add( - self.throbbers[t]['throbber'], row = row, col = 0, + self.throbbers[t]['throbber'], (row, 0), (1, 1), flag = wx.ALIGN_CENTER|wx.ALL, border=2 ) sizer.Add( wx.StaticText(self, -1, self.throbbers[t]['text']), - row = row, col = 1, flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT + (row, 1), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT ) row += 1 # start and stop buttons startButton = wx.Button(self, -1, "Start") - self.Bind(wx.EVT_BUTTON, self.OnStartAnimation, id=startButton.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnStartAnimation, startButton) stopButton = wx.Button(self, -1, "Stop") - self.Bind(wx.EVT_BUTTON, self.OnStopAnimation, id=stopButton.GetId()) + self.Bind(wx.EVT_BUTTON, self.OnStopAnimation, stopButton) buttonBox = wx.BoxSizer(wx.HORIZONTAL) buttonBox.AddMany([ @@ -125,12 +114,9 @@ class TestPanel(wx.Panel): (stopButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5), ]) - sizer.Add(buttonBox, - row = len(self.throbbers) + 3, - col = 0, - colspan = 3, - flag = wx.ALIGN_CENTER - ) + sizer.Add( + buttonBox, (len(self.throbbers) + 3, 0), (1, 3), flag = wx.ALIGN_CENTER + ) self.SetSizer(box) self.SetAutoLayout(True) diff --git a/wxPython/demo/TimeCtrl.py b/wxPython/demo/TimeCtrl.py index aa5cf52762..60c86abce8 100644 --- a/wxPython/demo/TimeCtrl.py +++ b/wxPython/demo/TimeCtrl.py @@ -1,21 +1,8 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace # # 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) # -# o wx renamer needed for timectrl lib # o presense of spin control causing probs (see spin ctrl demo for details) # -# 12/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# 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 @@ -182,10 +169,10 @@ class TestPanel( scrolled.ScrolledPanel ): elif self.radioWx.GetValue(): now = wx.DateTime_Now() self.time12.SetValue( now ) - # (demonstrates that G/SetValue returns/takes a wxDateTime) + # (demonstrates that G/SetValue returns/takes a wx.DateTime) self.time24.SetValue( self.time12.GetValue(as_wxDateTime=True) ) - # (demonstrates that G/SetValue returns/takes a wxTimeSpan) + # (demonstrates that G/SetValue returns/takes a wx.TimeSpan) self.spinless_ctrl.SetValue( self.time12.GetValue(as_wxTimeSpan=True) ) elif self.radioMx.GetValue(): @@ -218,8 +205,6 @@ class TestPanel( scrolled.ScrolledPanel ): cur_min, cur_max = self.target_ctrl.GetBounds() - # jmg - A little expirimental change to ensure that min - # or max contain valid values before we use them if min and (min != cur_min): self.target_ctrl.SetMin( min ) if max and (max != cur_max): self.target_ctrl.SetMax( max ) diff --git a/wxPython/demo/Timer.py b/wxPython/demo/Timer.py index 7f71b1f442..86892c7f88 100644 --- a/wxPython/demo/Timer.py +++ b/wxPython/demo/Timer.py @@ -1,7 +1,27 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace # +# 1/11/2004 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o It appears that wx.Timer has an issue where if you use +# +# self.timer = wx.Timer(self, -1) +# +# to create it, then +# +# self.timer.GetId() +# +# doesn't seem to return anything meaningful. In the demo, doing this +# results in only one of the two handlers being called for both timers. +# This means that +# +# self.Bind(wx.EVT_TIMER, self.onTimer, self.timer) +# +# doesn't work right. However, using +# +# self.timer = wx.Timer(self, wx.NewId()) +# +# makes it work OK. I believe this is a bug, but wiser heads than mine +# should determine this. +# import time import wx @@ -10,41 +30,33 @@ import wx ## For your convenience; an example of creating your own timer class. ## -## class TestTimer(wxTimer): +## class TestTimer(wx.Timer): ## def __init__(self, log = None): -## wxTimer.__init__(self) +## wx.Timer.__init__(self) ## self.log = log ## def Notify(self): -## wxBell() +## wx.Bell() ## if self.log: ## self.log.WriteText('beep!\n') #--------------------------------------------------------------------------- -ID_Start = wx.NewId() -ID_Stop = wx.NewId() -ID_Timer = wx.NewId() -ID_Timer2 = wx.NewId() - class TestTimerWin(wx.Panel): def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log wx.StaticText(self, -1, "This is a timer example", (15, 30)) - wx.Button(self, ID_Start, ' Start ', (15, 75), wx.DefaultSize) - wx.Button(self, ID_Stop, ' Stop ', (115, 75), wx.DefaultSize) - - self.timer = wx.Timer(self, # object to send the event to - ID_Timer) # event id to use + startBtn = wx.Button(self, -1, ' Start ', (15, 75), wx.DefaultSize) + stopBtn = wx.Button(self, -1, ' Stop ', (115, 75), wx.DefaultSize) - self.timer2 = wx.Timer(self, # object to send the event to - ID_Timer2) # event id to use + self.timer = wx.Timer(self, wx.NewId()) + self.timer2 = wx.Timer(self, wx.NewId()) - self.Bind(wx.EVT_BUTTON, self.OnStart, id=ID_Start) - self.Bind(wx.EVT_BUTTON, self.OnStop, id=ID_Stop) - self.Bind(wx.EVT_TIMER, self.OnTimer, id=ID_Timer) - self.Bind(wx.EVT_TIMER, self.OnTimer2, id=ID_Timer2) + self.Bind(wx.EVT_BUTTON, self.OnStart, startBtn) + self.Bind(wx.EVT_BUTTON, self.OnStop, stopBtn) + self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer) + self.Bind(wx.EVT_TIMER, self.OnTimer2, self.timer2) def OnStart(self, event): self.timer.Start(1000) @@ -75,7 +87,7 @@ def runTest(frame, nb, log): overview = """\ -The wxTimer class allows you to execute code at specified intervals from +The wx.Timer class allows you to execute code at specified intervals from within the wxPython event loop. Timers can be one-shot or repeating. """ diff --git a/wxPython/demo/ToggleButton.py b/wxPython/demo/ToggleButton.py index 7beec9983a..43a7d0a370 100644 --- a/wxPython/demo/ToggleButton.py +++ b/wxPython/demo/ToggleButton.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx @@ -41,7 +37,7 @@ def runTest(frame, nb, log): win = TestPanel(nb, log) return win else: - dlg = wx.MessageDialog(frame, 'wxToggleButton is not available on this platform.', + dlg = wx.MessageDialog(frame, 'wx.ToggleButton is not available on this platform.', 'Sorry', wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy() @@ -51,7 +47,7 @@ def runTest(frame, nb, log): overview = """\ -wxToggleButton is a button that stays pressed when clicked by the user. +wx.ToggleButton is a button that stays pressed when clicked by the user. In other words, it is similar to wxCheckBox in functionality but looks like a wxButton. diff --git a/wxPython/demo/ToolBar.py b/wxPython/demo/ToolBar.py index b609061504..7707de09de 100644 --- a/wxPython/demo/ToolBar.py +++ b/wxPython/demo/ToolBar.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import images @@ -132,7 +128,32 @@ def runTest(frame, nb, log): overview = """\ - +wx.ToolBar is a narrow strip of icons on one side of a frame (top, bottom, sides) +that acts much like a menu does, except it is always visible. Additionally, actual +wxWindows controls, such as wx.TextCtrl or wx.ComboBox, can be added to the toolbar +and used from within it. + +Toolbar creation is a two-step process. First, the toolbar is defined using the +various Add* methods of wx.ToolBar. Once all is set up, then wx.Toolbar.Realize() +must be called to render it. + +wx.Toolbar events are also propogated as Menu events; this is especially handy when +you have a menu bar that contains items that carry out the same function. For example, +it is not uncommon to have a little 'floppy' toolbar icon to 'save' the current file +(whatever it is) as well as a FILE/SAVE menu item that does the same thing. In this +case, both events can be captured and acted upon using the same event handler +with no ill effects. + +If there are cases where a toolbar icon should *not* be associated with a menu item, +use a unique ID to trap it. + +There are a number of ways to create a toolbar for a wx.Frame. wx.Frame.CreateToolBar() +does all the work except it adds no buttons at all unless you override the virtual method +OnCreateToolBar(). On the other hand, you can just subclass wx.ToolBar and then use +wx.Frame.SetToolBar() instead. + +Note that wx.TB_DOCKABLE is only supported under GTK. An attempt to alleviate this +is provided in wx.lib.floatbar, but it is not formally supported. """ diff --git a/wxPython/demo/TreeCtrl.py b/wxPython/demo/TreeCtrl.py index 547d05c87c..78cb5231e6 100644 --- a/wxPython/demo/TreeCtrl.py +++ b/wxPython/demo/TreeCtrl.py @@ -1,7 +1,3 @@ -# 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import string import wx @@ -191,9 +187,9 @@ def runTest(frame, nb, log): overview = """\ -A tree control presents information as a hierarchy, with items that may be +A TreeCtrl presents information as a hierarchy, with items that may be expanded to show further items. Items in a tree control are referenced by -wxTreeItemId handles. +wx.TreeItemId handles. """ diff --git a/wxPython/demo/TreeListCtrl.py b/wxPython/demo/TreeListCtrl.py index 4015c0665f..9295a09e96 100644 --- a/wxPython/demo/TreeListCtrl.py +++ b/wxPython/demo/TreeListCtrl.py @@ -1,7 +1,3 @@ -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import wx.gizmos as gizmos @@ -104,9 +100,9 @@ def runTest(frame, nb, log): overview = """ -

wxTreeListCtrl

+

TreeListCtrl

-The wx.TreeListCtrl is essentially a wx.TreeCtrl with extra columns, +The TreeListCtrl is essentially a wx.TreeCtrl with extra columns, such that the look is similar to a wx.ListCtrl. diff --git a/wxPython/demo/URLDragAndDrop.py b/wxPython/demo/URLDragAndDrop.py index 74b326c241..6ed2d17c81 100644 --- a/wxPython/demo/URLDragAndDrop.py +++ b/wxPython/demo/URLDragAndDrop.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx diff --git a/wxPython/demo/Unicode.py b/wxPython/demo/Unicode.py index 8aed883bf1..ac5eca5385 100644 --- a/wxPython/demo/Unicode.py +++ b/wxPython/demo/Unicode.py @@ -1,7 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx diff --git a/wxPython/demo/VListBox.py b/wxPython/demo/VListBox.py index cbe7707698..f54e185508 100644 --- a/wxPython/demo/VListBox.py +++ b/wxPython/demo/VListBox.py @@ -1,13 +1,9 @@ -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx #---------------------------------------------------------------------- -# The wxVListBox is much like a regular wxListBox except you draw the +# The wx.VListBox is much like a regular wx.ListBox except you draw the # items yourself and the items can vary in height. class MyVListBox(wx.VListBox): @@ -109,7 +105,7 @@ def runTest(frame, nb, log): overview = """ -

wxVListBox and wxHtmlListBox

+

wx.VListBox and wx.HtmlListBox


The "V" in wxVListBox stands for both "virtual" because it can have an @@ -119,8 +115,8 @@ interface as wxListBox and also emits the same events so you can use the same EVT_LISTBOX function to connect a handler.

-The wxHtmlListBox derives from wxVListBox, but draws each item itself -as a wxHtmlCell. This means that you just need to provide a snippet +The wx.HtmlListBox derives from wx.VListBox, but draws each item itself +as a wx.HtmlCell. This means that you just need to provide a snippet of HTML for each item when requested. diff --git a/wxPython/demo/Validator.py b/wxPython/demo/Validator.py index b31b56b8f3..7215e07f18 100644 --- a/wxPython/demo/Validator.py +++ b/wxPython/demo/Validator.py @@ -1,12 +1,7 @@ -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import string import wx - #---------------------------------------------------------------------- ALPHA_ONLY = 1 @@ -220,7 +215,7 @@ def runTest(frame, nb, log): overview = """\ -wxValidator is the base class for a family of validator classes that mediate +wx.Validator is the base class for a family of validator classes that mediate between a class of control, and application data.

A validator has three major roles: diff --git a/wxPython/demo/Wave.py b/wxPython/demo/Wave.py index b84e62148b..8ecd80fbaa 100644 --- a/wxPython/demo/Wave.py +++ b/wxPython/demo/Wave.py @@ -1,7 +1,3 @@ -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx diff --git a/wxPython/demo/Wizard.py b/wxPython/demo/Wizard.py index 7c7d5d80f6..697fe9c2d0 100644 --- a/wxPython/demo/Wizard.py +++ b/wxPython/demo/Wizard.py @@ -1,14 +1,6 @@ -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# -# 11/3-/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o WizardPage* doesn't support GetId() -# import wx -import wx.wizard as wiz +import wx.wizard as wiz import images #---------------------------------------------------------------------- @@ -99,8 +91,6 @@ class UseAltBitmapPage(wiz.PyWizardPage): #---------------------------------------------------------------------- class TestPanel(wx.Panel): - ID_wiz = wx.NewId() - def __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1) @@ -111,9 +101,9 @@ class TestPanel(wx.Panel): b = wx.Button(self, -1, "Run Dynamic Wizard", pos=(50, 100)) self.Bind(wx.EVT_BUTTON, self.OnRunDynamicWizard, b) - wiz.EVT_WIZARD_PAGE_CHANGED(self, self.ID_wiz, self.OnWizPageChanged) - wiz.EVT_WIZARD_PAGE_CHANGING(self, self.ID_wiz, self.OnWizPageChanging) - wiz.EVT_WIZARD_CANCEL(self, self.ID_wiz, self.OnWizCancel) + self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnWizPageChanged) + self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnWizPageChanging) + self.Bind(wiz.EVT_WIZARD_CANCEL, self.OnWizCancel) def OnWizPageChanged(self, evt): @@ -152,8 +142,7 @@ class TestPanel(wx.Panel): def OnRunSimpleWizard(self, evt): # Create the wizard and the pages - wizard = wiz.Wizard(self, self.ID_wiz, "Simple Wizard", - images.getWizTest1Bitmap()) + wizard = wiz.Wizard(self, -1, "Simple Wizard", images.getWizTest1Bitmap()) page1 = TitledPage(wizard, "Page 1") page2 = TitledPage(wizard, "Page 2") page3 = TitledPage(wizard, "Page 3") @@ -186,8 +175,7 @@ wxWizardPageSimple class can easily be used for the pages.""")) #wizard.SetExtraStyle(wx.WIZARD_EX_HELPBUTTON) #wizard.Create(self, self.ID_wiz, "Simple Wizard", # images.getWizTest1Bitmap()) - wizard = wiz.Wizard(self, self.ID_wiz, "Simple Wizard", - images.getWizTest1Bitmap()) + wizard = wiz.Wizard(self, -1, "Simple Wizard", images.getWizTest1Bitmap()) page1 = TitledPage(wizard, "Page 1") page2 = SkipNextPage(wizard, "Page 2") diff --git a/wxPython/demo/XMLtreeview.py b/wxPython/demo/XMLtreeview.py index 48edac38e9..0af13a34c4 100644 --- a/wxPython/demo/XMLtreeview.py +++ b/wxPython/demo/XMLtreeview.py @@ -1,7 +1,3 @@ -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import sys import wx diff --git a/wxPython/demo/XmlResource.py b/wxPython/demo/XmlResource.py index 208e229eac..15e96eb42e 100644 --- a/wxPython/demo/XmlResource.py +++ b/wxPython/demo/XmlResource.py @@ -1,7 +1,3 @@ -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import wx.xrc as xrc diff --git a/wxPython/demo/XmlResourceHandler.py b/wxPython/demo/XmlResourceHandler.py index 2098c5da41..b15defd373 100644 --- a/wxPython/demo/XmlResourceHandler.py +++ b/wxPython/demo/XmlResourceHandler.py @@ -1,13 +1,3 @@ -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o There are issues using the wx namespace within the xrc code. -# -# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Error report: "Error: No handler found for XML node 'object', -# class 'wx.StaticText'!"; no text shows on panel. -# import wx import wx.xrc as xrc @@ -21,7 +11,7 @@ resourceText = r''' 200,100 - + 10,10 @@ -177,9 +167,9 @@ def runTest(frame, nb, log): overview = """ -

wxXmlResourceHandler

+

wx.XmlResourceHandler

-Deriving a class from wxXmlResourceHandler allows you to specify your +Deriving a class from wx.XmlResourceHandler allows you to specify your own classes in XRC resources, and your handler class will then be used to create instances of that class when the resource is loaded. diff --git a/wxPython/demo/XmlResourceSubclass.py b/wxPython/demo/XmlResourceSubclass.py index 4fc5a275c4..ed0390f455 100644 --- a/wxPython/demo/XmlResourceSubclass.py +++ b/wxPython/demo/XmlResourceSubclass.py @@ -1,7 +1,3 @@ -# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import wx import wx.xrc as xrc @@ -18,7 +14,7 @@ resourceText = r''' 200,100 - @@ -90,7 +86,7 @@ def runTest(frame, nb, log): overview = """ -

wxXmlResourceSubclass

+

wx.XmlResourceSubclass

Sometimes it is necessary to use custom classes, but you still want them to be created from XRC. The subclass XRC attribute allows you to diff --git a/wxPython/demo/encode_bitmaps.py b/wxPython/demo/encode_bitmaps.py index c3864545fa..4d4945b54f 100644 --- a/wxPython/demo/encode_bitmaps.py +++ b/wxPython/demo/encode_bitmaps.py @@ -1,9 +1,3 @@ -#!/usr/bin/env python -#---------------------------------------------------------------------- -# 11/5/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Modified for wx namespace -# """ This is a way to save the startup time when running img2py on lots of diff --git a/wxPython/demo/infoframe.py b/wxPython/demo/infoframe.py index 3d4312e82f..14d744b874 100644 --- a/wxPython/demo/infoframe.py +++ b/wxPython/demo/infoframe.py @@ -1,13 +1,3 @@ -# 11/12/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o wx module doesn't like the doc string. -# -# 11/25/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Library didn't get hit by the wx renamer. -# o Docstring issues resolved. -# import sys diff --git a/wxPython/demo/pyTree.py b/wxPython/demo/pyTree.py index 89d8be4468..24892a90b1 100644 --- a/wxPython/demo/pyTree.py +++ b/wxPython/demo/pyTree.py @@ -1,8 +1,3 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# - """ Hello, and welcome to this test of the wxTreeItemData class. diff --git a/wxPython/demo/viewer.py b/wxPython/demo/viewer.py index 61d6eeefc8..a0332d98cb 100644 --- a/wxPython/demo/viewer.py +++ b/wxPython/demo/viewer.py @@ -1,9 +1,4 @@ #!/usr/bin/env python -# -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# """ Run wxPython in a second thread. diff --git a/wxPython/demo/widgetTest.py b/wxPython/demo/widgetTest.py index ad4c07ee92..052b3ed8e8 100644 --- a/wxPython/demo/widgetTest.py +++ b/wxPython/demo/widgetTest.py @@ -1,6 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace # # This file is used for the wx.HtmlWindow demo. # -- 2.45.2