From 9f24505715136be8d3cfb1f97c40272eff45efae Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 10 Jul 2013 01:15:34 +0000 Subject: [PATCH] Merge of PR 11 with the whitespace-only changes omitted. See https://github.com/RobinD42/Phoenix/pull/11 Mostly phoenix-port changes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wx/lib/agw/aui/aui_switcherdialog.py | 15 +++++- wx/lib/agw/aui/aui_utilities.py | 14 ++++- wx/lib/agw/aui/auibar.py | 14 ++++- wx/lib/agw/aui/dockart.py | 14 ++++- wx/lib/agw/aui/tabart.py | 20 +++++-- wx/lib/agw/balloontip.py | 1 - wx/lib/agw/buttonpanel.py | 1 - wx/lib/agw/cubecolourdialog.py | 4 +- wx/lib/agw/customtreectrl.py | 35 +++++++------ wx/lib/agw/floatspin.py | 14 ++--- wx/lib/agw/fmcustomizedlg.py | 14 ++++- wx/lib/agw/foldpanelbar.py | 1 - wx/lib/agw/genericmessagedialog.py | 1 - wx/lib/agw/hyperlink.py | 1 - wx/lib/agw/knobctrl.py | 1 - wx/lib/agw/multidirdialog.py | 5 +- wx/lib/agw/peakmeter.py | 1 - wx/lib/agw/piectrl.py | 1 - wx/lib/agw/pybusyinfo.py | 1 - wx/lib/agw/pycollapsiblepane.py | 1 - wx/lib/agw/pygauge.py | 3 +- wx/lib/agw/pyprogress.py | 1 - wx/lib/agw/rulerctrl.py | 1 - wx/lib/agw/shapedbutton.py | 1 - wx/lib/agw/thumbnailctrl.py | 13 ++--- wx/lib/analogclock/__init__.py | 4 -- wx/lib/analogclock/analogclock.py | 13 ++--- wx/lib/analogclock/helpers.py | 3 +- .../lib_setup/buttontreectrlpanel.py | 15 ++++-- wx/lib/analogclock/lib_setup/colourselect.py | 10 ++-- wx/lib/analogclock/lib_setup/fontselect.py | 6 +-- wx/lib/analogclock/setup.py | 7 +-- wx/lib/busy.py | 1 - wx/lib/calendar.py | 5 +- wx/lib/colourchooser/canvas.py | 3 +- wx/lib/colourchooser/pycolourbox.py | 3 +- wx/lib/colourchooser/pycolourchooser.py | 15 +++--- wx/lib/combotreebox.py | 18 +++++-- wx/lib/dialogs.py | 7 ++- wx/lib/docview.py | 5 +- wx/lib/embeddedimage.py | 2 +- wx/lib/evtmgr.py | 15 +++--- wx/lib/fancytext.py | 18 +++++-- wx/lib/filebrowsebutton.py | 7 +-- wx/lib/flashwin.py | 1 + wx/lib/floatbar.py | 23 ++++---- wx/lib/floatcanvas/FloatCanvas.py | 42 +++++++++------ wx/lib/floatcanvas/GUIMode.py | 14 ++++- wx/lib/floatcanvas/Utilities/BBox.py | 14 ++++- wx/lib/floatcanvas/Utilities/BBoxTest.py | 15 +++++- wx/lib/graphics.py | 5 +- wx/lib/gridmovers.py | 33 ++++++------ wx/lib/imagebrowser.py | 7 +-- wx/lib/intctrl.py | 23 ++++---- wx/lib/itemspicker.py | 16 +++++- wx/lib/langlistctrl.py | 7 +-- wx/lib/masked/combobox.py | 2 +- wx/lib/masked/timectrl.py | 2 +- wx/lib/mixins/listctrl.py | 4 +- wx/lib/mixins/rubberband.py | 27 +++++----- wx/lib/mixins/treemixin.py | 19 ++++++- wx/lib/nvdlg.py | 3 +- wx/lib/ogl/_bmpshape.py | 7 +-- wx/lib/ogl/_composit.py | 3 +- wx/lib/ogl/_divided.py | 3 +- wx/lib/ogl/_drawn.py | 3 +- wx/lib/ogl/_lines.py | 3 +- wx/lib/pdfviewer/viewer.py | 26 +++++----- wx/lib/platebtn.py | 11 ++-- wx/lib/plot.py | 21 ++++---- wx/lib/popupctl.py | 5 +- wx/lib/printout.py | 9 ++-- wx/lib/pubsub/autosetuppubsubv1.py | 11 ++-- wx/lib/pubsub/core/__init__.py | 6 +-- wx/lib/pubsub/core/callables.py | 11 ++-- wx/lib/pubsub/core/datamsg.py | 13 +++-- wx/lib/pubsub/core/kwargs/publisher.py | 9 +++- wx/lib/pubsub/core/topicobj.py | 13 +++-- wx/lib/pubsub/pubsub1/pub.py | 16 ++++-- wx/lib/pubsub/pubsub2/__init__.py | 1 - wx/lib/pubsub/pubsub2/pub.py | 11 +++- wx/lib/pubsub/pubsubconf.py | 1 - wx/lib/pubsub/utils/misc.py | 10 +++- wx/lib/pydocview.py | 52 ++++++++++--------- wx/lib/rpcMixin.py | 3 +- wx/lib/scrolledpanel.py | 3 +- wx/lib/sheet.py | 3 +- wx/lib/sized_controls.py | 11 ++-- wx/lib/splitter.py | 7 +-- wx/lib/wordwrap.py | 5 +- wx/py/PyWrap.py | 10 +++- wx/py/editor.py | 9 +++- wx/py/magic.py | 8 ++- wx/py/parse.py | 14 +++-- wx/py/sliceshell.py | 25 +++++---- wx/tools/dbg.py | 3 +- wx/tools/genaxmodule.py | 6 ++- wx/tools/img2img.py | 2 +- wx/tools/pywxrc.py | 19 +++---- 99 files changed, 617 insertions(+), 348 deletions(-) diff --git a/wx/lib/agw/aui/aui_switcherdialog.py b/wx/lib/agw/aui/aui_switcherdialog.py index 71ae8f64..d4cbc4fb 100644 --- a/wx/lib/agw/aui/aui_switcherdialog.py +++ b/wx/lib/agw/aui/aui_switcherdialog.py @@ -1,3 +1,15 @@ +#---------------------------------------------------------------------------- +# Name: aui_switcherdialog.py +# Purpose: +# +# Author: +# +# Created: +# Version: +# Date: +# Licence: wxWindows license +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ Description =========== @@ -1161,7 +1173,7 @@ class SwitcherDialog(wx.Dialog): # Convert a colour to a 6-digit hex string def ColourToHexString(self, col): - hx = '%02x%02x%02x' % tuple([int(c) for c in col]) + hx = '%02x%02x%02x%02x' % tuple([int(c) for c in col]) return hx @@ -1212,4 +1224,3 @@ class SwitcherDialog(wx.Dialog): self._borderColour = colour - \ No newline at end of file diff --git a/wx/lib/agw/aui/aui_utilities.py b/wx/lib/agw/aui/aui_utilities.py index 200debd2..7f5efdc1 100644 --- a/wx/lib/agw/aui/aui_utilities.py +++ b/wx/lib/agw/aui/aui_utilities.py @@ -1,3 +1,15 @@ +#---------------------------------------------------------------------------- +# Name: aui_utilities.py +# Purpose: +# +# Author: Andrea Gavana +# +# Created: +# Version: +# Date: 31 March 2009 +# Licence: wxWindows license +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ This module contains some common functions used by :mod:`lib.agw.aui` to manipulate colours, bitmaps, text, gradient shadings and custom dragging images @@ -237,7 +249,7 @@ def LightColour(colour, percent): r = colour.Red() + ((i*rd*100)/high)/100 g = colour.Green() + ((i*gd*100)/high)/100 b = colour.Blue() + ((i*bd*100)/high)/100 - return wx.Colour(r, g, b) + return wx.Colour(int(r), int(g), int(b)) def PaneCreateStippleBitmap(): diff --git a/wx/lib/agw/aui/auibar.py b/wx/lib/agw/aui/auibar.py index fcd627e6..7c504d06 100644 --- a/wx/lib/agw/aui/auibar.py +++ b/wx/lib/agw/aui/auibar.py @@ -1,3 +1,15 @@ +#---------------------------------------------------------------------------- +# Name: auibar.py +# Purpose: +# +# Author: Andrea Gavana +# +# Created: +# Version: +# Date: 31 March 2009 +# Licence: wxWindows license +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ `auibar.py` contains an implementation of :class:`AuiToolBar`, which is a completely owner-drawn toolbar perfectly integrated with the AUI layout system. This allows drag and drop of @@ -1421,7 +1433,7 @@ class AuiDefaultToolBarArt(object): item.SetOrientation(orientation) - menuPopup.AppendItem(m) + menuPopup.Append(m) if kind in [ITEM_CHECK, ITEM_RADIO]: state = (item.state & AUI_BUTTON_STATE_CHECKED and [True] or [False])[0] m.Check(state) diff --git a/wx/lib/agw/aui/dockart.py b/wx/lib/agw/aui/dockart.py index 67063e9f..584937c1 100644 --- a/wx/lib/agw/aui/dockart.py +++ b/wx/lib/agw/aui/dockart.py @@ -1,3 +1,15 @@ +#---------------------------------------------------------------------------- +# Name: dockart.py +# Purpose: +# +# Author: Andrea Gavana +# +# Created: +# Version: +# Date: 31 March 2009 +# Licence: wxWindows license +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ Dock art provider code - a dock provider provides all drawing functionality to the AUI dock manager. This allows the dock manager to have a plugable look-and-feel. @@ -145,7 +157,7 @@ class AuiDefaultDockArt(object): if isMac: self._caption_font = wx.SMALL_FONT else: - self._caption_font = wx.Font(8, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False) + self._caption_font = wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False) self.SetDefaultPaneBitmaps(isMac) self._restore_bitmap = wx.Bitmap(restore_xpm) diff --git a/wx/lib/agw/aui/tabart.py b/wx/lib/agw/aui/tabart.py index d80c3066..a09b9718 100644 --- a/wx/lib/agw/aui/tabart.py +++ b/wx/lib/agw/aui/tabart.py @@ -1,3 +1,15 @@ +#---------------------------------------------------------------------------- +# Name: tabart.py +# Purpose: +# +# Author: Andrea Gavana +# +# Created: +# Version: +# Date: 31 March 2009 +# Licence: wxWindows license +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ Tab art provider code - a tab provider provides all drawing functionality to the :class:`~lib.agw.aui.auibook.AuiNotebook`. This allows the @@ -114,7 +126,7 @@ class AuiDefaultTabArt(object): self._normal_font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) self._selected_font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - self._selected_font.SetWeight(wx.BOLD) + self._selected_font.SetWeight(wx.FONTWEIGHT_BOLD) self._measuring_font = self._selected_font self._fixed_tab_width = 100 @@ -949,7 +961,7 @@ class AuiDefaultTabArt(object): if page.bitmap: menuItem.SetBitmap(page.bitmap) - menuPopup.AppendItem(menuItem) + menuPopup.Append(menuItem) else: @@ -999,7 +1011,7 @@ class AuiSimpleTabArt(object): self._normal_font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) self._selected_font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - self._selected_font.SetWeight(wx.BOLD) + self._selected_font.SetWeight(wx.FONTWEIGHT_BOLD) self._measuring_font = self._selected_font self._agwFlags = 0 @@ -1483,7 +1495,7 @@ class AuiSimpleTabArt(object): if page.bitmap: menuItem.SetBitmap(page.bitmap) - menuPopup.AppendItem(menuItem) + menuPopup.Append(menuItem) else: diff --git a/wx/lib/agw/balloontip.py b/wx/lib/agw/balloontip.py index 534b5e97..7ccde5db 100644 --- a/wx/lib/agw/balloontip.py +++ b/wx/lib/agw/balloontip.py @@ -1155,4 +1155,3 @@ if __name__ == '__main__': app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/buttonpanel.py b/wx/lib/agw/buttonpanel.py index 11e8f142..728f6a1d 100644 --- a/wx/lib/agw/buttonpanel.py +++ b/wx/lib/agw/buttonpanel.py @@ -2831,4 +2831,3 @@ if __name__ == '__main__': frame.Show() app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/cubecolourdialog.py b/wx/lib/agw/cubecolourdialog.py index 150d64a8..45d7a9fc 100644 --- a/wx/lib/agw/cubecolourdialog.py +++ b/wx/lib/agw/cubecolourdialog.py @@ -91,8 +91,8 @@ Usage example:: # returned as a three-tuple (r, g, b) in this particular case. colour = colourData.GetColour() r, g, b, alpha = colour.Red(), colour.Green(), colour.Blue(), colour.Alpha() - print "You selected (RGBA): %d, %d, %d, %d"%(r, g, b, alpha) - print "You selected (HSVA): %d, %d, %d, %d"%(h, s, v, a) + print("You selected (RGBA): %d, %d, %d, %d"%(r, g, b, alpha)) + print("You selected (HSVA): %d, %d, %d, %d"%(h, s, v, a)) # Once the dialog is destroyed, Mr. wx.ColourData is no longer your # friend. Don't use it again! diff --git a/wx/lib/agw/customtreectrl.py b/wx/lib/agw/customtreectrl.py index 6c1f0880..f1982164 100644 --- a/wx/lib/agw/customtreectrl.py +++ b/wx/lib/agw/customtreectrl.py @@ -2491,11 +2491,12 @@ class GenericTreeItem(object): # evaluate the item h = theCtrl.GetLineHeight(self) - if point.y > self._y and point.y < self._y + h: + pointX, pointY = point[0], point[1] + if pointY > self._y and pointY < self._y + h: y_mid = self._y + h//2 - if point.y < y_mid: + if pointY < y_mid: flags |= TREE_HITTEST_ONITEMUPPERPART else: flags |= TREE_HITTEST_ONITEMLOWERPART @@ -2505,20 +2506,20 @@ class GenericTreeItem(object): if wx.Platform == "__WXMAC__": # according to the drawing code the triangels are drawn # at -4 , -4 from the position up to +10/+10 max - if point.x > xCross-4 and point.x < xCross+10 and point.y > y_mid-4 and \ - point.y < y_mid+10 and self.HasPlus() and theCtrl.HasButtons(): + if pointX > xCross-4 and pointX < xCross+10 and pointY > y_mid-4 and \ + pointY < y_mid+10 and self.HasPlus() and theCtrl.HasButtons(): flags |= TREE_HITTEST_ONITEMBUTTON return self, flags else: # 5 is the size of the plus sign - if point.x > xCross-6 and point.x < xCross+6 and point.y > y_mid-6 and \ - point.y < y_mid+6 and self.HasPlus() and theCtrl.HasButtons(): + if pointX > xCross-6 and pointX < xCross+6 and pointY > y_mid-6 and \ + pointY < y_mid+6 and self.HasPlus() and theCtrl.HasButtons(): flags |= TREE_HITTEST_ONITEMBUTTON return self, flags - if point.x >= self._x and point.x <= self._x + self._width: + if pointX >= self._x and pointX <= self._x + self._width: image_w = -1 wcheck = 0 @@ -2530,23 +2531,23 @@ class GenericTreeItem(object): if self.GetCheckedImage() is not None: wcheck, hcheck = theCtrl._imageListCheck.GetSize(self.GetCheckedImage()) - if wcheck and point.x <= self._x + wcheck + 1: + if wcheck and pointX <= self._x + wcheck + 1: flags |= TREE_HITTEST_ONITEMCHECKICON return self, flags - if image_w != -1 and point.x <= self._x + wcheck + image_w + 1: + if image_w != -1 and pointX <= self._x + wcheck + image_w + 1: flags |= TREE_HITTEST_ONITEMICON else: flags |= TREE_HITTEST_ONITEMLABEL return self, flags - if point.x < self._x: + if pointX < self._x: if theCtrl.HasAGWFlag(TR_FULL_ROW_HIGHLIGHT): flags |= TREE_HITTEST_ONITEM else: flags |= TREE_HITTEST_ONITEMINDENT - if point.x > self._x + self._width: + if pointX > self._x + self._width: if theCtrl.HasAGWFlag(TR_FULL_ROW_HIGHLIGHT): flags |= TREE_HITTEST_ONITEM else: @@ -7454,13 +7455,14 @@ class CustomTreeCtrl(wx.ScrolledWindow): w, h = self.GetSize() flags = 0 - if point.x < 0: + pointX, pointY = point[0], point[1] + if pointX < 0: flags |= TREE_HITTEST_TOLEFT - if point.x > w: + if pointX > w: flags |= TREE_HITTEST_TORIGHT - if point.y < 0: + if pointY < 0: flags |= TREE_HITTEST_ABOVE - if point.y > h: + if pointY > h: flags |= TREE_HITTEST_BELOW if flags: @@ -7973,6 +7975,9 @@ class CustomTreeCtrl(wx.ScrolledWindow): ## if item.HasPlus(): self.Toggle(item) + #TODO/Bug?: Temp Hack - MCow. Phoenix after rightclick menu item gets set to white or background colour + # and becomes invisible. Set to black in meantime + self.SetItemTextColour(thisItem, wx.BLACK) #self.GetItemTextColour(thisItem) def OnInternalIdle(self): """ diff --git a/wx/lib/agw/floatspin.py b/wx/lib/agw/floatspin.py index 9f750a4e..832c0dce 100644 --- a/wx/lib/agw/floatspin.py +++ b/wx/lib/agw/floatspin.py @@ -1252,12 +1252,12 @@ class FixedPoint(object): Example:: >>> x = FixedPoint("5.55") # precision defaults to 2 - >>> print x + >>> print(x) 5.55 >>> x.set_precision(1) # round to one fraction digit - >>> print x + >>> print(x) 5.6 - >>> print FixedPoint("5.55", 1) # same thing setting to 1 in constructor + >>> print(FixedPoint("5.55", 1)) # same thing setting to 1 in constructor 5.6 >>> repr(x) # returns constructor string that reproduces object exactly "FixedPoint('5.6', 1)" @@ -1278,9 +1278,9 @@ class FixedPoint(object): is carried out using -- and the result inherits -- the :class:`FixedPoint`'s precision. Example:: - >>> print FixedPoint(1) / 7 + >>> print(FixedPoint(1) / 7) 0.14 - >>> print FixedPoint(1, 30) / 7 + >>> print(FixedPoint(1, 30) / 7) 0.142857142857142857142857142857 >>> @@ -1302,9 +1302,9 @@ class FixedPoint(object): (up to final rounding to the requested precision), so is greatly preferred. Example:: - >>> print FixedPoint(1.1e30) + >>> print(FixedPoint(1.1e30)) 1099999999999999993725589651456.00 - >>> print FixedPoint("1.1e30") + >>> print(FixedPoint("1.1e30")) 1100000000000000000000000000000.00 >>> diff --git a/wx/lib/agw/fmcustomizedlg.py b/wx/lib/agw/fmcustomizedlg.py index fb427d05..d267fcc3 100644 --- a/wx/lib/agw/fmcustomizedlg.py +++ b/wx/lib/agw/fmcustomizedlg.py @@ -1,3 +1,15 @@ +#---------------------------------------------------------------------------- +# Name: fmcustomizeddlg.py +# Purpose: +# +# Author: +# +# Created: +# Version: +# Date: +# Licence: wxWindows license +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ This module contains a custom dialog class used to personalize the appearance of a :class:`~lib.agw.flatmenu.FlatMenu` on the fly, allowing also the user of your application to do the same. @@ -138,7 +150,7 @@ class FMTitlePanel(wx.Panel): # Draw the text font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - font.SetWeight(wx.BOLD) + font.SetWeight(wx.FONTWEIGHT_BOLD) dc.SetFont(font) dc.SetTextForeground(wx.BLACK) dc.DrawText(self._title, 5, 5) diff --git a/wx/lib/agw/foldpanelbar.py b/wx/lib/agw/foldpanelbar.py index 15f93a20..2f47d0a7 100644 --- a/wx/lib/agw/foldpanelbar.py +++ b/wx/lib/agw/foldpanelbar.py @@ -2280,4 +2280,3 @@ if __name__ == '__main__': frame.Show() app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/genericmessagedialog.py b/wx/lib/agw/genericmessagedialog.py index 9feb1e86..a121180d 100644 --- a/wx/lib/agw/genericmessagedialog.py +++ b/wx/lib/agw/genericmessagedialog.py @@ -1601,4 +1601,3 @@ if __name__ == '__main__': app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/hyperlink.py b/wx/lib/agw/hyperlink.py index 0eaf6a86..f6572c37 100644 --- a/wx/lib/agw/hyperlink.py +++ b/wx/lib/agw/hyperlink.py @@ -662,4 +662,3 @@ if __name__ == '__main__': frame.Show() app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/knobctrl.py b/wx/lib/agw/knobctrl.py index ba8052a6..efdad064 100644 --- a/wx/lib/agw/knobctrl.py +++ b/wx/lib/agw/knobctrl.py @@ -942,4 +942,3 @@ if __name__ == '__main__': frame.Show() app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/multidirdialog.py b/wx/lib/agw/multidirdialog.py index 2591f59a..4da44165 100644 --- a/wx/lib/agw/multidirdialog.py +++ b/wx/lib/agw/multidirdialog.py @@ -63,13 +63,13 @@ Usage example:: agwStyle=MDD.DD_MULTIPLE|MDD.DD_DIR_MUST_EXIST) if dlg.ShowModal() != wx.ID_OK: - print "You Cancelled The Dialog!" + print("You Cancelled The Dialog!") dlg.Destroy() return paths = dlg.GetPaths() for indx, path in enumerate(paths): - print "Path %d: %s"%(indx+1, path) + print("Path %d: %s"%(indx+1, path)) dlg.Destroy() @@ -613,4 +613,3 @@ if __name__ == '__main__': app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/peakmeter.py b/wx/lib/agw/peakmeter.py index ecf167d3..de3b829f 100644 --- a/wx/lib/agw/peakmeter.py +++ b/wx/lib/agw/peakmeter.py @@ -928,4 +928,3 @@ if __name__ == '__main__': frame.Show() app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/piectrl.py b/wx/lib/agw/piectrl.py index c918e75a..84563f8e 100644 --- a/wx/lib/agw/piectrl.py +++ b/wx/lib/agw/piectrl.py @@ -1050,4 +1050,3 @@ if __name__ == '__main__': frame.Show() app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/pybusyinfo.py b/wx/lib/agw/pybusyinfo.py index 4e101d25..7ca321ff 100644 --- a/wx/lib/agw/pybusyinfo.py +++ b/wx/lib/agw/pybusyinfo.py @@ -397,4 +397,3 @@ if __name__ == '__main__': app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/pycollapsiblepane.py b/wx/lib/agw/pycollapsiblepane.py index 41a441fe..cdec4db5 100644 --- a/wx/lib/agw/pycollapsiblepane.py +++ b/wx/lib/agw/pycollapsiblepane.py @@ -938,4 +938,3 @@ if __name__ == '__main__': frame.Show() app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/pygauge.py b/wx/lib/agw/pygauge.py index 0f5fa559..b2d89c81 100644 --- a/wx/lib/agw/pygauge.py +++ b/wx/lib/agw/pygauge.py @@ -493,7 +493,7 @@ class PyGauge(wx.Window): self._update_value.append(value[i] + v) self._update_step.append(float(value[i])/(time/50.0)) - #print self._update_ + #print(self._update_) if not self._timer: self._timer = wx.Timer(self, self._timerId) @@ -567,4 +567,3 @@ if __name__ == '__main__': app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/pyprogress.py b/wx/lib/agw/pyprogress.py index 5df301b3..10862da1 100644 --- a/wx/lib/agw/pyprogress.py +++ b/wx/lib/agw/pyprogress.py @@ -911,4 +911,3 @@ if __name__ == '__main__': dlg.Destroy() app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/rulerctrl.py b/wx/lib/agw/rulerctrl.py index 7beb2c27..5e996ebf 100644 --- a/wx/lib/agw/rulerctrl.py +++ b/wx/lib/agw/rulerctrl.py @@ -1885,4 +1885,3 @@ if __name__ == '__main__': app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/shapedbutton.py b/wx/lib/agw/shapedbutton.py index c083707c..faa04464 100644 --- a/wx/lib/agw/shapedbutton.py +++ b/wx/lib/agw/shapedbutton.py @@ -1807,4 +1807,3 @@ if __name__ == '__main__': frame.Show() app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/agw/thumbnailctrl.py b/wx/lib/agw/thumbnailctrl.py index 2894d6fb..156f2171 100644 --- a/wx/lib/agw/thumbnailctrl.py +++ b/wx/lib/agw/thumbnailctrl.py @@ -26,6 +26,7 @@ # # Or, Obviously, To The wxPython Mailing List!!! # +# Tags: phoenix-port # # End Of Comments # --------------------------------------------------------------------------- # @@ -2425,17 +2426,17 @@ class ScrolledThumbnail(wx.ScrolledWindow): (6) ``-`` key zooms out. """ - if event.m_keyCode == ord("s"): + if event.KeyCode == ord("s"): self.Rotate() - elif event.m_keyCode == ord("d"): + elif event.KeyCode == ord("d"): self.Rotate(270) - elif event.m_keyCode == ord("a"): + elif event.KeyCode == ord("a"): self.Rotate(180) - elif event.m_keyCode == wx.WXK_DELETE: + elif event.KeyCode == wx.WXK_DELETE: self.DeleteFiles() - elif event.m_keyCode in [wx.WXK_ADD, wx.WXK_NUMPAD_ADD]: + elif event.KeyCode in [wx.WXK_ADD, wx.WXK_NUMPAD_ADD]: self.ZoomIn() - elif event.m_keyCode in [wx.WXK_SUBTRACT, wx.WXK_NUMPAD_SUBTRACT]: + elif event.KeyCode in [wx.WXK_SUBTRACT, wx.WXK_NUMPAD_SUBTRACT]: self.ZoomOut() event.Skip() diff --git a/wx/lib/analogclock/__init__.py b/wx/lib/analogclock/__init__.py index 03c3bc8a..0b9a391a 100644 --- a/wx/lib/analogclock/__init__.py +++ b/wx/lib/analogclock/__init__.py @@ -138,7 +138,3 @@ For updates please visit . from analogclock import AnalogClock, AnalogClockWindow from styles import * - -# -## -### eof diff --git a/wx/lib/analogclock/analogclock.py b/wx/lib/analogclock/analogclock.py index 16a7c4d3..c0182ead 100644 --- a/wx/lib/analogclock/analogclock.py +++ b/wx/lib/analogclock/analogclock.py @@ -5,6 +5,7 @@ # Distributed under the wxWidgets license. # # For more info please see the __init__.py file. +# Tags: phoenix-port import wx @@ -14,7 +15,7 @@ from setup import Setup #---------------------------------------------------------------------- -class AnalogClock(wx.PyWindow): +class AnalogClock(wx.Window): """An analog clock.""" def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, @@ -22,7 +23,7 @@ class AnalogClock(wx.PyWindow): clockStyle=DEFAULT_CLOCK_STYLE, minutesStyle=TICKS_CIRCLE, hoursStyle=TICKS_POLY): - wx.PyWindow.__init__(self, parent, id, pos, size, style, name) + wx.Window.__init__(self, parent, id, pos, size, style, name) # Base size for scale calc purposes. self.basesize = wx.Size(348, 348) @@ -166,7 +167,7 @@ class AnalogClock(wx.PyWindow): to make sure the buffer is always the same size as the window. """ - self.faceBitmap = wx.EmptyBitmap(*size.Get()) + self.faceBitmap = wx.Bitmap(*size.Get()) # Recalc all coords. scale = min([float(size.width) / self.basesize.width, @@ -614,7 +615,7 @@ class AnalogClockWindow(AnalogClock): # Test stuff ---------------------------------------------------------- if __name__ == "__main__": - print wx.VERSION_STRING + print(wx.VERSION_STRING) class AcDemoApp(wx.App): def OnInit(self): @@ -627,7 +628,3 @@ if __name__ == "__main__": acApp = AcDemoApp(0) acApp.MainLoop() - -# -## -### eof diff --git a/wx/lib/analogclock/helpers.py b/wx/lib/analogclock/helpers.py index c459067d..128ef4b1 100644 --- a/wx/lib/analogclock/helpers.py +++ b/wx/lib/analogclock/helpers.py @@ -3,6 +3,7 @@ # http://j.domaindlx.com/elements28/wxpython/ # 15 Fev 2006, 22:00 GMT-03:00 # Distributed under the wxWidgets license. +# Tags: phoenix-port from time import strftime, localtime import math @@ -657,7 +658,7 @@ class TickSet: if a_tick.text is not None: self.font.SetPointSize(size) dc = wx.MemoryDC() - dc.SelectObject(wx.EmptyBitmap(*clocksize.Get())) + dc.SelectObject(wx.Bitmap(*clocksize.Get())) dc.SetFont(self.font) maxsize = size for tick in self.ticks.values(): diff --git a/wx/lib/analogclock/lib_setup/buttontreectrlpanel.py b/wx/lib/analogclock/lib_setup/buttontreectrlpanel.py index b76aea6b..3cbab5bd 100644 --- a/wx/lib/analogclock/lib_setup/buttontreectrlpanel.py +++ b/wx/lib/analogclock/lib_setup/buttontreectrlpanel.py @@ -1,3 +1,15 @@ +#---------------------------------------------------------------------------- +# Name: buttontreectrlpanel.py +# Purpose: +# +# Author: E. A. Tacao +# +# Created: +# Version: 0.03 +# Date: 12 Fev 2006, 22:00 GMT-03:00 +# Licence: +# Tags: phoenix-port +#---------------------------------------------------------------------------- __author__ = "E. A. Tacao " __date__ = "12 Fev 2006, 22:00 GMT-03:00" __version__ = "0.03" @@ -285,6 +297,3 @@ ButtonTreeCtrlPanel.checkbox_tri = PyEmbeddedImage( "wFOt4bZug2PfxDNdARosBvBlC1YNGnSH52UV30c9wQOLAXzZglWDBj3BaoAXBliRvlQ6XGWK" "fucKTYUl4c5UOHYAAAAASUVORK5CYII=") -# -## -### eof diff --git a/wx/lib/analogclock/lib_setup/colourselect.py b/wx/lib/analogclock/lib_setup/colourselect.py index f3a1ddf7..c770503b 100644 --- a/wx/lib/analogclock/lib_setup/colourselect.py +++ b/wx/lib/analogclock/lib_setup/colourselect.py @@ -3,6 +3,7 @@ # http://j.domaindlx.com/elements28/wxpython/ # 15 Fev 2006, 22:00 GMT-03:00 # Distributed under the wxWidgets license. +# Tags: phoenix-port import wx from wx.lib.newevent import NewEvent @@ -17,7 +18,7 @@ from wx.lib.buttons import GenBitmapButton class ColourSelect(GenBitmapButton): def __init__(self, parent, size=(21, 21), value=wx.BLACK): w, h = size[0] - 5, size[1] - 5 - GenBitmapButton.__init__(self, parent, wx.ID_ANY, wx.EmptyBitmap(w, h), + GenBitmapButton.__init__(self, parent, wx.ID_ANY, wx.Bitmap(w, h), size=size) self.SetBezelWidth(1) @@ -29,7 +30,7 @@ class ColourSelect(GenBitmapButton): def _makeBitmap(self): bdr = 8; w, h = self.GetSize() - bmp = wx.EmptyBitmap(w - bdr, h - bdr) + bmp = wx.Bitmap(w - bdr, h - bdr) dc = wx.MemoryDC() dc.SelectObject(bmp) @@ -73,8 +74,3 @@ class ColourSelect(GenBitmapButton): if changed: nevt = ColourSelectEvent(id=self.GetId(), obj=self, val=self.value) wx.PostEvent(self.parent, nevt) - - -# -## -### eof diff --git a/wx/lib/analogclock/lib_setup/fontselect.py b/wx/lib/analogclock/lib_setup/fontselect.py index 9f93e024..1d36ef1a 100644 --- a/wx/lib/analogclock/lib_setup/fontselect.py +++ b/wx/lib/analogclock/lib_setup/fontselect.py @@ -3,6 +3,7 @@ # http://j.domaindlx.com/elements28/wxpython/ # 15 Fev 2006, 22:00 GMT-03:00 # Distributed under the wxWidgets license. +# Tags: phoenix-port import wx from wx.lib.newevent import NewEvent @@ -54,8 +55,3 @@ class FontSelect(GenButton): if changed: nevt = FontSelectEvent(id=self.GetId(), obj=self, val=self.value) wx.PostEvent(self.parent, nevt) - - -# -## -### eof diff --git a/wx/lib/analogclock/setup.py b/wx/lib/analogclock/setup.py index c09d2fc0..04b7b916 100644 --- a/wx/lib/analogclock/setup.py +++ b/wx/lib/analogclock/setup.py @@ -3,6 +3,7 @@ # http://j.domaindlx.com/elements28/wxpython/ # 15 Fev 2006, 22:00 GMT-03:00 # Distributed under the wxWidgets license. +# Tags: phoenix-port import wx @@ -155,7 +156,7 @@ class _Group_1(_GroupBase): box = wx.StaticBoxSizer(wx.StaticBox(self, label=title), wx.VERTICAL) - sizer = self.sizer = wx.GridBagSizer(2, 6) + sizer = self.sizer = wx.GridBagSizer(vgap=2, hgap=6) p = wx.StaticText(self, label="Border:") sizer.Add(p, pos=(0, 0), flag=wx.ALIGN_CENTRE_VERTICAL) @@ -467,7 +468,3 @@ class Setup(wx.Dialog): wx.EndBusyCursor() - -# -# -### eof diff --git a/wx/lib/busy.py b/wx/lib/busy.py index 30fe06ed..6f7172d9 100644 --- a/wx/lib/busy.py +++ b/wx/lib/busy.py @@ -139,7 +139,6 @@ laborum.""" wx.Sleep(2) -if __name__ == '__main__': app = wx.App(False) frm = wx.Frame(None, title="BusyInfoTest") wx.CallLater(1000, test1, frm) diff --git a/wx/lib/calendar.py b/wx/lib/calendar.py index c382252e..452aa570 100644 --- a/wx/lib/calendar.py +++ b/wx/lib/calendar.py @@ -5,9 +5,10 @@ # Author: Lorne White (email: lorne.white@telusplanet.net) # # Created: -# Version 0.92 +# Version: 0.92 # Date: Nov 26, 2001 # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- # 12/01/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -830,7 +831,7 @@ class Calendar( wx.Control ): if delta <> None: curDate = wx.DateTime.FromDMY(int(self.cal_days[self.sel_key]),self.month - 1,self.year) - timeSpan = wx.TimeSpan_Days(delta) + timeSpan = wx.TimeSpan.Days(delta) newDate = curDate + timeSpan if curDate.GetMonth() == newDate.GetMonth(): diff --git a/wx/lib/colourchooser/canvas.py b/wx/lib/colourchooser/canvas.py index 23ff9eea..ca630189 100644 --- a/wx/lib/colourchooser/canvas.py +++ b/wx/lib/colourchooser/canvas.py @@ -21,6 +21,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # o wxPyColorChooser -> PyColorChooser # o wxPyColourChooser -> PyColourChooser # +# Tags: phoenix-port import wx @@ -39,7 +40,7 @@ class BitmapBuffer(wx.MemoryDC): self.height = height self.colour = colour - self.bitmap = wx.EmptyBitmap(self.width, self.height) + self.bitmap = wx.Bitmap(self.width, self.height) self.SelectObject(self.bitmap) # Initialize the buffer to the background colour diff --git a/wx/lib/colourchooser/pycolourbox.py b/wx/lib/colourchooser/pycolourbox.py index a1108c7b..a5ecbc90 100644 --- a/wx/lib/colourchooser/pycolourbox.py +++ b/wx/lib/colourchooser/pycolourbox.py @@ -20,6 +20,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # o wxPyColorChooser -> PyColorChooser # o wxPyColourChooser -> PyColourChooser # +# Tags: phoenix-port import wx @@ -37,7 +38,7 @@ class PyColourBox(wx.Panel): self.colour_box = wx.Window(self, -1, style=wx.SIMPLE_BORDER) - sizer = wx.GridSizer(1, 1) + sizer = wx.GridSizer(rows=1, cols=1, vgap=0, hgap=0) sizer.Add(self.colour_box, 0, wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL) sizer.SetItemMinSize(self.colour_box, size[0] - 5, size[1] - 5) self.SetAutoLayout(True) diff --git a/wx/lib/colourchooser/pycolourchooser.py b/wx/lib/colourchooser/pycolourchooser.py index 442eb743..4947edf4 100644 --- a/wx/lib/colourchooser/pycolourchooser.py +++ b/wx/lib/colourchooser/pycolourchooser.py @@ -23,6 +23,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # o Added wx.InitAllImageHandlers() to test code since # that's where it belongs. # +# Tags: phoenix-port import wx @@ -129,7 +130,7 @@ class PyColourChooser(wx.Panel): # Create the basic colours palette self.colour_boxs = [ ] - colour_grid = wx.GridSizer(6, 8) + colour_grid = wx.GridSizer(rows=6, cols=8, vgap=0, hgap=0) for name in self.colour_names: new_id = wx.NewId() box = pycolourbox.PyColourBox(self, new_id) @@ -141,7 +142,7 @@ class PyColourChooser(wx.Panel): # Create the custom colours palette self.custom_boxs = [ ] - custom_grid = wx.GridSizer(2, 8) + custom_grid = wx.GridSizer(rows=2, cols=8, vgap=0, hgap=0) for wxcolour, slidepos in self.custom_colours: new_id = wx.NewId() custom = pycolourbox.PyColourBox(self, new_id) @@ -200,7 +201,7 @@ class PyColourChooser(wx.Panel): vlabel = wx.StaticText(self, -1, _("V:")) self.ventry = wx.TextCtrl(self, -1) self.ventry.SetSize((40, -1)) - hsvgrid = wx.FlexGridSizer(1, 6, 2, 2) + hsvgrid = wx.FlexGridSizer(rows=1, cols=6, vgap=2, hgap=2) hsvgrid.AddMany ([ (hlabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.hentry, 0, wx.FIXED_MINSIZE), (slabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.sentry, 0, wx.FIXED_MINSIZE), @@ -216,14 +217,14 @@ class PyColourChooser(wx.Panel): blabel = wx.StaticText(self, -1, _("B:")) self.bentry = wx.TextCtrl(self, -1) self.bentry.SetSize((40, -1)) - lgrid = wx.FlexGridSizer(1, 6, 2, 2) + lgrid = wx.FlexGridSizer(rows=1, cols=6, vgap=2, hgap=2) lgrid.AddMany([ (rlabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.rentry, 0, wx.FIXED_MINSIZE), (glabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.gentry, 0, wx.FIXED_MINSIZE), (blabel, 0, wx.ALIGN_CENTER_VERTICAL), (self.bentry, 0, wx.FIXED_MINSIZE), ]) - gsizer = wx.GridSizer(2, 1) + gsizer = wx.GridSizer(rows=2, cols=1, vgap=0, hgap=0) gsizer.SetVGap (10) gsizer.SetHGap (2) gsizer.Add(hsvgrid, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL) @@ -342,7 +343,7 @@ class PyColourChooser(wx.Panel): the selected colour values.""" self.mouse_down = True self.palette.ReDraw() - self.doPaletteClick(event.X, event.Y) + self.doPaletteClick(event.GetX(), event.GetY()) def onPaletteUp(self, event): """Stores state that the mouse is no longer depressed.""" @@ -352,7 +353,7 @@ class PyColourChooser(wx.Panel): """Updates the colour values during mouse motion while the mouse button is depressed.""" if self.mouse_down: - self.doPaletteClick(event.X, event.Y) + self.doPaletteClick(event.GetX(), event.GetY()) def doPaletteClick(self, m_x, m_y): """Updates the colour values based on the mouse location diff --git a/wx/lib/combotreebox.py b/wx/lib/combotreebox.py index 945401d3..d7f92bc8 100644 --- a/wx/lib/combotreebox.py +++ b/wx/lib/combotreebox.py @@ -1,3 +1,15 @@ +#---------------------------------------------------------------------------- +# Name: combotreebox.py +# Purpose: +# +# Author: Frank Niessink +# +# Created: +# Version: 1.1 +# Date: August 1, 2010 +# Licence: wxWidgets license +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ ComboTreeBox provides a ComboBox that pops up a tree instead of a list. @@ -447,7 +459,7 @@ class BaseComboTreeBox(object): y += comboBoxSize[1] width = comboBoxSize[0] height = 300 - self._popupFrame.SetDimensions(x, y, width, height) + self._popupFrame.SetSize(x, y, width, height) # On wxGTK, when the Combobox width has been increased a call # to SetMinSize is needed to force a resize of the popupFrame: self._popupFrame.SetMinSize((width, height)) @@ -529,7 +541,7 @@ class BaseComboTreeBox(object): if parent is None: parent = self._tree.GetRootItem() item = self._tree.AppendItem(parent, itemText, - data=wx.TreeItemData(clientData)) + data=clientData) if self._sort: self._tree.SortChildren(parent) return item @@ -837,7 +849,7 @@ class MSWComboTreeBox(NativeComboTreeBox): # result of GetLastPosition and the length of the value. If they # match, all is fine. If they don't match, we don't call SetMark. if self._text.GetLastPosition() == len(value): - self._text.SetMark(0, self._text.GetLastPosition()) + self._text.SetTextSelection(0, self._text.GetLastPosition()) def Popup(self, *args, **kwargs): """ diff --git a/wx/lib/dialogs.py b/wx/lib/dialogs.py index cb054c53..0d33fc22 100644 --- a/wx/lib/dialogs.py +++ b/wx/lib/dialogs.py @@ -8,7 +8,7 @@ # Created: 3-January-2002 # Copyright: (c) 2002 by Total Control Software # Licence: wxWindows license -# Tags: +# Tags: phoenix-port #---------------------------------------------------------------------- # 12/01/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -377,7 +377,7 @@ class MultiMessageDialog(wx.Dialog): if isinstance(icon, wx.Icon): bitmap = wx.BitmapFromIcon(icon) elif isinstance(icon, wx.Image): - bitmap = wx.BitmapFromImage(icon) + bitmap = wx.Bitmap(icon) else: assert isinstance(icon, wx.Bitmap) bitmap = icon @@ -429,7 +429,7 @@ class MultiMessageDialog(wx.Dialog): # with good maximums dc = wx.ClientDC(t) dc.SetFont(t.GetFont()) - w,h = dc.GetMultiLineTextExtent(msg2) + w,h = dc.GetFullMultiLineTextExtent(msg2) w = min(self.CONTENT_MAX_W, 10 + w + wx.SystemSettings.GetMetric(wx.SYS_VSCROLL_X)) h = min(self.CONTENT_MAX_H, 10 + h) t.SetMinSize((w,h)) @@ -508,4 +508,3 @@ if __name__ == '__main__': app = wx.App() MultiMessageBox("Hello World", "howdy", "This is a MultiMessageBox \ntest. With a multi-line message.") app.MainLoop() - \ No newline at end of file diff --git a/wx/lib/docview.py b/wx/lib/docview.py index 52b59a44..1e06a4dd 100644 --- a/wx/lib/docview.py +++ b/wx/lib/docview.py @@ -8,6 +8,7 @@ # CVS-ID: $Id$ # Copyright: (c) 2003-2006 ActiveGrid, Inc. (Port of wxWindows classes by Julian Smart et al) # License: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- @@ -1560,7 +1561,7 @@ class DocManager(wx.EvtHandler): data = wx.PrintDialogData(self.printData) # Pass two printout objects: for preview, and possible printing. preview = wx.PrintPreview(printout, view.OnCreatePrintout(), data) - if not preview.Ok(): + if not preview.IsOk(): wx.MessageBox(_("Unable to display print preview.")) return # wxWindows source doesn't use base frame's pos, size, and icon, but did it this way so it would work like MS Office etc. @@ -2141,7 +2142,7 @@ class DocManager(wx.EvtHandler): focus or if there is no current focus the application's top frame. """ parent = wx.GetApp().GetTopWindow() - focusWindow = wx.Window_FindFocus() + focusWindow = wx.Window.FindFocus() if focusWindow: while focusWindow and not isinstance(focusWindow, wx.Dialog) and not isinstance(focusWindow, wx.Frame): focusWindow = focusWindow.GetParent() diff --git a/wx/lib/embeddedimage.py b/wx/lib/embeddedimage.py index 6fb128b4..b6a9176d 100644 --- a/wx/lib/embeddedimage.py +++ b/wx/lib/embeddedimage.py @@ -38,7 +38,7 @@ class PyEmbeddedImage(object): from some other source at runtime, such as over the network or from a database. In this case pass False for isBase64 (unless the data actually is base64 encoded.) Any image type that - wx.ImageFromStream can handle should be okay. + wx.Image can handle should be okay. """ def __init__(self, data, isBase64=True): diff --git a/wx/lib/evtmgr.py b/wx/lib/evtmgr.py index 93fddf5c..d7dba8f0 100644 --- a/wx/lib/evtmgr.py +++ b/wx/lib/evtmgr.py @@ -10,6 +10,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2003 by db-X Corporation # Licence: wxWindows license +# Tags: phoenix-port #--------------------------------------------------------------------------- # 12/02/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -431,9 +432,9 @@ class EventAdapter: def Destroy(self): try: if not self.disconnect(): - print 'disconnect failed' - except wx.PyDeadObjectError: - print 'disconnect failed: dead object' ##???? + print('disconnect failed') + except RuntimeError: + print('disconnect failed: dead object') ##???? #--------------------------------------------------------------------------- @@ -485,7 +486,7 @@ eventManager = EventManager() if __name__ == '__main__': - app = wx.PySimpleApp() + app = wx.App() frame = wx.Frame(None, -1, 'Event Test', size=(300,300)) button = wx.ToggleButton(frame, -1, 'Listen for Mouse Events') sizer = wx.BoxSizer(wx.HORIZONTAL) @@ -499,16 +500,16 @@ if __name__ == '__main__': # def printEvent(event): - print 'Name:',event.GetClassName(),'Timestamp',event.GetTimestamp() + print('Name:',event.GetClassName(),'Timestamp',event.GetTimestamp()) def enableFrameEvents(event): # Turn the output of mouse events on and off if event.IsChecked(): - print '\nEnabling mouse events...' + print('\nEnabling mouse events...') eventManager.Register(printEvent, wx.EVT_MOTION, frame) eventManager.Register(printEvent, wx.EVT_LEFT_DOWN, frame) else: - print '\nDisabling mouse events...' + print('\nDisabling mouse events...') eventManager.DeregisterWindow(frame) # Send togglebutton events to both the on/off code as well diff --git a/wx/lib/fancytext.py b/wx/lib/fancytext.py index a6de5e99..9f839a3c 100644 --- a/wx/lib/fancytext.py +++ b/wx/lib/fancytext.py @@ -1,3 +1,15 @@ +#---------------------------------------------------------------------------- +# Name: fancytext.py +# Purpose: Methods for rendering XML specified text +# +# Author: +# +# Created: +# Version: +# Date: +# Licence: +# Tags: phoenix-port +#---------------------------------------------------------------------------- # 12/02/2003 - Jeff Grimmett (grimmtooth@softhome.net) # # o Updated for 2.5 compatability. @@ -354,9 +366,9 @@ def RenderToBitmap(str, background=None, enclose=1): dc = wx.MemoryDC() # Chicken and egg problem, we need a bitmap in the DC in order to # measure how big the bitmap should be... - dc.SelectObject(wx.EmptyBitmap(1,1)) + dc.SelectObject(wx.Bitmap(1,1)) width, height, dy = GetFullExtent(str, dc, enclose) - bmp = wx.EmptyBitmap(width, height) + bmp = wx.Bitmap(width, height) dc.SelectObject(bmp) if background is None: dc.SetBackground(wx.WHITE_BRUSH) @@ -443,7 +455,7 @@ We can use doctest/guitest to display this string in all its marked up glory. The End""" - app = wx.PySimpleApp() + app = wx.App() box = wx.BoxSizer(wx.VERTICAL) frame = wx.Frame(None, -1, "FancyText demo", wx.DefaultPosition) frame.SetBackgroundColour("light grey") diff --git a/wx/lib/filebrowsebutton.py b/wx/lib/filebrowsebutton.py index 51542834..ec714987 100644 --- a/wx/lib/filebrowsebutton.py +++ b/wx/lib/filebrowsebutton.py @@ -10,6 +10,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2000 by Total Control Software # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------- # 12/02/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -106,7 +107,7 @@ class FileBrowseButton(wx.Panel): self.Layout() if type( size ) == types.TupleType: size = apply( wx.Size, size) - self.SetDimensions(-1, -1, size.width, size.height, wx.SIZE_USE_EXISTING) + self.SetSize(-1, -1, size.width, size.height, wx.SIZE_USE_EXISTING) # if size.width != -1 or size.height != -1: # self.SetSize(size) @@ -374,7 +375,7 @@ if __name__ == "__main__": def __init__( self, tag ): self.tag = tag def __call__( self, event ): - print self.tag, event.GetString() + print(self.tag, event.GetString()) class DemoFrame( wx.Frame ): def __init__(self, parent): wx.Frame.__init__(self, parent, -1, "File entry with browse", size=(500,260)) @@ -453,7 +454,7 @@ if __name__ == "__main__": def test( ): app = DemoApp(0) app.MainLoop() - print 'Creating dialog' + print('Creating dialog') test( ) diff --git a/wx/lib/flashwin.py b/wx/lib/flashwin.py index 8d3009f0..ded61361 100644 --- a/wx/lib/flashwin.py +++ b/wx/lib/flashwin.py @@ -9,6 +9,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2008 by Total Control Software # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------- import wx diff --git a/wx/lib/floatbar.py b/wx/lib/floatbar.py index 2fef791b..f5629e29 100644 --- a/wx/lib/floatbar.py +++ b/wx/lib/floatbar.py @@ -5,6 +5,7 @@ # Author: Bryn Keller # # Created: 10/4/99 +# Tags: phoenix-port #---------------------------------------------------------------------------- # 12/02/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -132,7 +133,7 @@ else: def SetTitle(self, title): - print 'SetTitle', title + print('SetTitle', title) self.title = title if self.IsFloating(): self.floatframe.SetTitle(self.title) @@ -176,7 +177,7 @@ else: "Floats or docks the toolbar programmatically." if bool: self.parentframe = self.GetParent() - print self.title + print(self.title) if self.title: useStyle = wx.DEFAULT_FRAME_STYLE else: @@ -231,9 +232,9 @@ else: if (abs(homepos.x - floatpos.x) < _DOCKTHRESHOLD and abs(homepos.y - floatpos.y) < _DOCKTHRESHOLD): self.Float(0) - #homepos = self.parentframe.GetPositionTuple() + #homepos = self.parentframe.GetPosition() #homepos = homepos[0], homepos[1] + self.titleheight - #floatpos = self.floatframe.GetPositionTuple() + #floatpos = self.floatframe.GetPosition() #if abs(homepos[0] - floatpos[0]) < 35 and abs(homepos[1] - floatpos[1]) < 35: # self._SetFauxBarVisible(True) #else: @@ -283,23 +284,23 @@ else: if self.parentframe.GetToolBar() == None: if not hasattr(self, 'nullbar'): self.nullbar = wx.ToolBar(self.parentframe, -1) - print "Adding fauxbar." + print("Adding fauxbar.") self.nullbar.Reparent(self.parentframe) - print "Reparented." + print("Reparented.") self.parentframe.SetToolBar(self.nullbar) - print "Set toolbar" + print("Set toolbar") col = wx.NamedColour("GREY") self.nullbar.SetBackgroundColour(col) - print "Set color" + print("Set color") size = self.parentframe.GetSize() self.parentframe.SetSize((0,0)) self.parentframe.SetSize(size) - print "Set size" + print("Set size") else: - print self.parentframe.GetToolBar() + print(self.parentframe.GetToolBar()) else: if self.parentframe.GetToolBar() != None: - print "Removing fauxbar" + print("Removing fauxbar") self.nullbar.Reparent(self.floatframe) self.parentframe.SetToolBar(None) size = self.parentframe.GetSize() diff --git a/wx/lib/floatcanvas/FloatCanvas.py b/wx/lib/floatcanvas/FloatCanvas.py index 4b95448b..6ae599d5 100644 --- a/wx/lib/floatcanvas/FloatCanvas.py +++ b/wx/lib/floatcanvas/FloatCanvas.py @@ -1,4 +1,16 @@ #!/usr/bin/env python +#---------------------------------------------------------------------------- +# Name: FloatCanvas.py +# Purpose: +# +# Author: +# +# Created: +# Version: +# Date: +# Licence: +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ This is the main module of the floatcanvas package, it contains the :class:`~lib.floatcanvas.FloatCanvas.FloatCanvas` and all the all the different objects which are sub-classed from :class:`~lib.floatcanvas.FloatCanvas.DrawObject`. @@ -352,7 +364,7 @@ class DrawObject: self.Brush = self.BrushList.setdefault( (FillColor, FillStyle), wx.Brush(FillColor, self.FillStyleList[FillStyle])) - #print "Setting Brush, BrushList length:", len(self.BrushList) + #print("Setting Brush, BrushList length:", len(self.BrushList)) def SetPen(self, LineColor, LineStyle, LineWidth): """ @@ -2470,9 +2482,9 @@ class ScaledBitmap2(TextObjectMixin, DrawObject, ): ##fixme: should this have a y = -1 to shift to y-up? self.BmpScale = self.bmpWH / self.WH - #print "bmpWH:", self.bmpWH - #print "Width, Height:", self.WH - #print "self.BmpScale", self.BmpScale + #print("bmpWH:", self.bmpWH) + #print("Width, Height:", self.WH) + #print("self.BmpScale", self.BmpScale) self.ShiftFun = self.ShiftFunDict[Position] self.CalcBoundingBox() self.ScaledBitmap = None # cache of the last existing scaled bitmap @@ -2506,15 +2518,15 @@ class ScaledBitmap2(TextObjectMixin, DrawObject, ): if (self.ScaledBitmap is None) or (self.ScaledBitmap[0] != (0, 0, self.bmpWidth, self.bmpHeight, W, H) ): #if True: #fixme: (self.ScaledBitmap is None) or (H <> self.ScaledHeight) : self.ScaledHeight = H - #print "Scaling to:", W, H + #print("Scaling to:", W, H) Img = self.Image.Scale(W, H) bmp = wx.Bitmap(Img) self.ScaledBitmap = ((0, 0, self.bmpWidth, self.bmpHeight , W, H), bmp)# this defines the cached bitmap else: - #print "Using Cached bitmap" + #print("Using Cached bitmap") bmp = self.ScaledBitmap[1] XY = self.ShiftFun(XY[0], XY[1], W, H) - dc.DrawBitmapPoint(bmp, XY, True) + dc.DrawBitmap(bmp, XY, True) if HTdc and self.HitAble: HTdc.SetPen(self.HitPen) HTdc.SetBrush(self.HitBrush) @@ -2584,7 +2596,7 @@ class ScaledBitmap2(TextObjectMixin, DrawObject, ): ##fixme: The cached bitmap could be used if the one needed is the same scale, but ## a subset of the cached one. bmp = self.ScaledBitmap[1] - dc.DrawBitmapPoint(bmp, XYs, True) + dc.DrawBitmap(bmp, XYs, True) if HTdc and self.HitAble: HTdc.SetPen(self.HitPen) @@ -2595,15 +2607,15 @@ class ScaledBitmap2(TextObjectMixin, DrawObject, ): BBworld = BBox.asBBox(self._Canvas.ViewPortBB) ## first see if entire bitmap is displayed: if BBworld.Inside(self.BoundingBox): - #print "Drawing entire bitmap with old code" + #print("Drawing entire bitmap with old code") self._DrawEntireBitmap(dc , WorldToPixel, ScaleWorldToPixel, HTdc) return None elif BBworld.Overlaps(self.BoundingBox): #BBbitmap = BBox.fromPoints(self.WorldToBitmap(BBworld)) - #print "Drawing a sub-bitmap" + #print("Drawing a sub-bitmap") self._DrawSubBitmap(dc , WorldToPixel, ScaleWorldToPixel, HTdc) else: - #print "Not Drawing -- no part of image is showing" + #print("Not Drawing -- no part of image is showing") pass class DotGrid: @@ -3001,7 +3013,7 @@ class FloatCanvas(wx.Panel): if wx.__version__ >= "2.8": HitTestBitmapDepth = 32 - #print "Using hit test code for 2.8" + #print("Using hit test code for 2.8") def GetHitTestColor(self, xy): """ Get the hit test colour @@ -3019,7 +3031,7 @@ class FloatCanvas(wx.Panel): return pacc.Get()[:3] else: HitTestBitmapDepth = 24 - #print "using pre-2.8 hit test code" + #print("using pre-2.8 hit test code") def GetHitTestColor(self, xy ): """ Get the hit test colour @@ -3031,7 +3043,7 @@ class FloatCanvas(wx.Panel): dc.SelectObject(self._ForegroundHTBitmap) else: dc.SelectObject(self._HTBitmap) - hitcolor = dc.GetPixelPoint( xy ) + hitcolor = dc.GetPixel( xy ) return hitcolor.Get() def UnBindAll(self): @@ -3358,7 +3370,7 @@ class FloatCanvas(wx.Panel): self.GUIMode.UpdateScreen() if self.Debug: - print("Drawing took %f seconds of CPU time")%(clock()-start) + print("Drawing took %f seconds of CPU time"%(clock()-start)) if self._HTBitmap is not None: self._HTBitmap.SaveFile('junk.png', wx.BITMAP_TYPE_PNG) diff --git a/wx/lib/floatcanvas/GUIMode.py b/wx/lib/floatcanvas/GUIMode.py index fd28fbc7..b30332c9 100644 --- a/wx/lib/floatcanvas/GUIMode.py +++ b/wx/lib/floatcanvas/GUIMode.py @@ -1,4 +1,16 @@ #!/usr/bin/env python +#---------------------------------------------------------------------------- +# Name: GUIMode.py +# Purpose: +# +# Author: +# +# Created: +# Version: +# Date: +# Licence: +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ Module that holds the GUI modes used by FloatCanvas @@ -353,7 +365,7 @@ class GUIZoomIn(GUIBase): dc.SetPen(wx.Pen('WHITE', 2, wx.SHORT_DASH)) dc.SetBrush(wx.TRANSPARENT_BRUSH) dc.SetLogicalFunction(wx.XOR) - dc.DrawRectanglePointSize(*self.PrevRBBox) + dc.DrawRectangle(*self.PrevRBBox) def OnRightDown(self, event): self.Canvas.Zoom(1/1.5, event.GetPosition(), centerCoords="pixel") diff --git a/wx/lib/floatcanvas/Utilities/BBox.py b/wx/lib/floatcanvas/Utilities/BBox.py index c88fdfac..ea953a92 100755 --- a/wx/lib/floatcanvas/Utilities/BBox.py +++ b/wx/lib/floatcanvas/Utilities/BBox.py @@ -1,5 +1,16 @@ #!/usr/bin/env python - +#---------------------------------------------------------------------------- +# Name: BBox.py +# Purpose: +# +# Author: +# +# Created: +# Version: +# Date: +# Licence: +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ A Bounding Box object and assorted utilities , subclassed from a numpy array @@ -300,4 +311,3 @@ class RectBBox(BBox): return False return True - \ No newline at end of file diff --git a/wx/lib/floatcanvas/Utilities/BBoxTest.py b/wx/lib/floatcanvas/Utilities/BBoxTest.py index 958506ee..6b46bacd 100755 --- a/wx/lib/floatcanvas/Utilities/BBoxTest.py +++ b/wx/lib/floatcanvas/Utilities/BBoxTest.py @@ -1,5 +1,16 @@ #!/usr/bin/env python - +#---------------------------------------------------------------------------- +# Name: BBoxTest.py +# Purpose: Test code for the BBox Object +# +# Author: +# +# Created: +# Version: +# Date: +# Licence: +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ Test code for the BBox Object @@ -509,7 +520,7 @@ class testInfBBox(unittest.TestCase): self.failUnless( (self.B1 == self.B2) == True ) def testNotEquals(self): - print (self.B1 == self.B3) == False + print((self.B1 == self.B3) == False) self.failUnless ( (self.B1 == self.B3) == False, "NotEquals failed for\n%s,\n %s:%s"%(self.B1, self.B3, (self.B1 == self.B3)) ) diff --git a/wx/lib/graphics.py b/wx/lib/graphics.py index aef35b5f..fab806e8 100644 --- a/wx/lib/graphics.py +++ b/wx/lib/graphics.py @@ -8,6 +8,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2008 by Total Control Software # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------- """ @@ -1246,7 +1247,7 @@ class GraphicsContext(GraphicsObject): used. """ if isinstance(pen, wx.Pen): - if not pen.Ok() or pen.Style == wx.TRANSPARENT: + if not pen.IsOk() or pen.Style == wx.TRANSPARENT: pen = None else: pen = GraphicsPen.CreateFromPen(pen) @@ -1263,7 +1264,7 @@ class GraphicsContext(GraphicsObject): be used. """ if isinstance(brush, wx.Brush): - if not brush.Ok() or brush.Style == wx.TRANSPARENT: + if not brush.IsOk() or brush.Style == wx.TRANSPARENT: brush = None else: brush = GraphicsBrush.CreateFromBrush(brush) diff --git a/wx/lib/gridmovers.py b/wx/lib/gridmovers.py index f7248052..f771cf84 100644 --- a/wx/lib/gridmovers.py +++ b/wx/lib/gridmovers.py @@ -8,6 +8,7 @@ # Date: Nov 19, 2002 # RCS-ID: $Id$ # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- # 12/07/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -117,7 +118,7 @@ class ColDragWindow(wx.Window): self.Bind(wx.EVT_PAINT, self.OnPaint) def DisplayAt(self,pos,y): - x = self.GetPositionTuple()[0] + x = self.GetPosition()[0] if x == pos: self.Refresh() # Need to display insertion point else: @@ -276,8 +277,8 @@ class GridColMover(wx.EvtHandler): self.grid.Scroll(x,y) - x,y = self.lwin.ClientToScreenXY(evt.X,0) - x,y = self.grid.ScreenToClientXY(x,y) + x,y = self.lwin.ClientToScreen(evt.X,0) + x,y = self.grid.ScreenToClient(x,y) if not self.colWin.IsShown(): self.colWin.Show(True) @@ -298,8 +299,8 @@ class GridColMover(wx.EvtHandler): _rlSize = self.grid.GetRowLabelSize() sx = self.grid.GetViewStart()[0] * self.ux sx -= _rlSize - px,py = self.lwin.ClientToScreenXY(evt.X,evt.Y) - px,py = self.grid.ScreenToClientXY(px,py) + px,py = self.lwin.ClientToScreen(evt.X,evt.Y) + px,py = self.grid.ScreenToClient(px,py) if self.grid.XToEdgeOfCol(px + sx) != wx.NOT_FOUND: evt.Skip() @@ -327,8 +328,8 @@ class GridColMover(wx.EvtHandler): self.isDragging = False if not self.didMove: - px = self.lwin.ClientToScreenXY(self.startX,0)[0] - px = self.grid.ScreenToClientXY(px,0)[0] + px = self.lwin.ClientToScreen(self.startX,0)[0] + px = self.grid.ScreenToClient(px,0)[0] sx = self.grid.GetViewStart()[0] * self.ux sx -= self.grid.GetRowLabelSize() col = self.grid.XToCol(px+sx) @@ -347,7 +348,7 @@ class GridColMover(wx.EvtHandler): evt.Skip() def _CaptureImage(self,rect): - bmp = wx.EmptyBitmap(rect.width,rect.height) + bmp = wx.Bitmap(rect.width,rect.height) memdc = wx.MemoryDC() memdc.SelectObject(bmp) dc = wx.WindowDC(self.lwin) @@ -384,7 +385,7 @@ class GridRowMover(wx.EvtHandler): self.lastY = evt.Y self.didMove = True x,sy = self.grid.GetViewStart() - w,h = self.lwin.GetClientSizeTuple() + w,h = self.lwin.GetClientSize() y = sy * self.uy if (evt.Y + y) < y: @@ -403,8 +404,8 @@ class GridRowMover(wx.EvtHandler): self.grid.Scroll(x,y) - x,y = self.lwin.ClientToScreenXY(0,evt.Y) - x,y = self.grid.ScreenToClientXY(x,y) + x,y = self.lwin.ClientToScreen(0,evt.Y) + x,y = self.grid.ScreenToClient(x,y) if not self.rowWin.IsShown(): self.rowWin.Show(True) @@ -426,8 +427,8 @@ class GridRowMover(wx.EvtHandler): _clSize = self.grid.GetColLabelSize() sy = self.grid.GetViewStart()[1] * self.uy sy -= _clSize - px,py = self.lwin.ClientToScreenXY(evt.X,evt.Y) - px,py = self.grid.ScreenToClientXY(px,py) + px,py = self.lwin.ClientToScreen(evt.X,evt.Y) + px,py = self.grid.ScreenToClient(px,py) if self.grid.YToEdgeOfRow(py + sy) != wx.NOT_FOUND: evt.Skip() @@ -461,8 +462,8 @@ class GridRowMover(wx.EvtHandler): self.isDragging = False if not self.didMove: - py = self.lwin.ClientToScreenXY(0,self.startY)[1] - py = self.grid.ScreenToClientXY(0,py)[1] + py = self.lwin.ClientToScreen(0,self.startY)[1] + py = self.grid.ScreenToClient(0,py)[1] sy = self.grid.GetViewStart()[1] * self.uy sy -= self.grid.GetColLabelSize() row = self.grid.YToRow(py + sy) @@ -481,7 +482,7 @@ class GridRowMover(wx.EvtHandler): evt.Skip() def _CaptureImage(self,rect): - bmp = wx.EmptyBitmap(rect.width,rect.height) + bmp = wx.Bitmap(rect.width,rect.height) memdc = wx.MemoryDC() memdc.SelectObject(bmp) dc = wx.WindowDC(self.lwin) diff --git a/wx/lib/imagebrowser.py b/wx/lib/imagebrowser.py index 1ab3c511..c7e849d2 100644 --- a/wx/lib/imagebrowser.py +++ b/wx/lib/imagebrowser.py @@ -7,6 +7,7 @@ # Version: 2.0 # Date: June 16, 2007 # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- # 2.0 Release - Bill Baxter (wbaxter@gmail.com) # Date: June 16, 2007 @@ -66,9 +67,9 @@ A simple usage would be:: with ib.ImageDialog(None) as dlg: if dlg.ShowModal() == wx.ID_OK: # show the selected file - print "You Selected File: " + dlg.GetFile() + print("You Selected File: " + dlg.GetFile()) else: - print "You pressed Cancel\n" + print("You pressed Cancel\n") app.MainLoop() @@ -581,7 +582,7 @@ class ImageDialog(wx.Dialog): allTypes = self.fl_types[1:] for ftypes in allTypes: # get list of all filter = self.fl_ext_types[ftypes] - #print "filter = ", filter + #print("filter = ", filter) self.fl_val = FindFiles(self, self.set_dir, filter) all_files = all_files + self.fl_val.files # add to list of files diff --git a/wx/lib/intctrl.py b/wx/lib/intctrl.py index 1c3d88b2..3b7c6460 100644 --- a/wx/lib/intctrl.py +++ b/wx/lib/intctrl.py @@ -5,6 +5,7 @@ # Copyright: (c) 2003 by Will Sadkin # RCS-ID: $Id$ # License: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- # NOTE: # This was written to provide a standard integer edit control for wxPython. @@ -127,11 +128,11 @@ class IntValidator(wx.Validator): select_len = sel_to - sel_start # (Uncomment for debugging:) -## print 'keycode:', key -## print 'pos:', pos -## print 'sel_start, sel_to:', sel_start, sel_to -## print 'select_len:', select_len -## print 'textval:', textval +## print('keycode:', key) +## print('pos:', pos) +## print('sel_start, sel_to:', sel_start, sel_to) +## print('select_len:', select_len) +## print('textval:', textval) # set defaults for processing: allow_event = 1 @@ -299,16 +300,16 @@ class IntValidator(wx.Validator): # (Uncomment for debugging:) ## if allow_event: -## print 'new value:', new_value +## print('new value:', new_value) ## if paste: print 'paste' ## if set_to_none: print 'set_to_none' ## if set_to_zero: print 'set_to_zero' ## if set_to_minus_one: print 'set_to_minus_one' ## if internally_set: print 'internally_set' ## else: -## print 'new text:', new_text -## print 'disallowed' -## print +## print('new text:', new_text) +## print('disallowed') +## print() if allow_event: if set_to_none: @@ -886,7 +887,7 @@ if __name__ == '__main__': self.Bind(EVT_INT, self.OnInt, self.int_ctrl) def OnInt(self, event): - print 'int now', event.GetValue() + print('int now', event.GetValue()) class TestApp(wx.App): def OnInit(self): @@ -906,7 +907,7 @@ if __name__ == '__main__': dlg.int_ctrl.SetInsertionPoint(1) dlg.int_ctrl.SetSelection(1,2) rc = dlg.ShowModal() - print 'final value', dlg.int_ctrl.GetValue() + print('final value', dlg.int_ctrl.GetValue()) del dlg self.frame.Destroy() diff --git a/wx/lib/itemspicker.py b/wx/lib/itemspicker.py index 038489c7..7202eea3 100644 --- a/wx/lib/itemspicker.py +++ b/wx/lib/itemspicker.py @@ -1,3 +1,15 @@ +#---------------------------------------------------------------------------- +# Name: itemspicker.py +# Purpose: +# +# Author: Daphna Rosenbom, Gitty Zinger, Moshe Cohavi and Yoav Glazner +# +# Created: Oct 3, 2010 +# Version: +# Date: +# Licence: wxPython license +# Tags: phoenix-port +#---------------------------------------------------------------------------- ''' Created on Oct 3, 2010 @@ -219,7 +231,7 @@ class ItemsPicker(wx.Panel): if __name__ == '__main__': - test = wx.PySimpleApp(0) + test = wx.App(0) frame = wx.Frame(None, -1) d = wx.Dialog(frame, style = wx.RESIZE_BORDER|wx.DEFAULT_DIALOG_STYLE) @@ -234,7 +246,7 @@ if __name__ == '__main__': d.SetSizer(d.sizer) test.SetTopWindow(frame) def callback(e): - print 'selected items', e.GetItems() + print('selected items', e.GetItems()) d.Bind(EVT_IP_SELECTION_CHANGED, callback) d.ShowModal() d.Destroy() diff --git a/wx/lib/langlistctrl.py b/wx/lib/langlistctrl.py index cd345758..21cdafb2 100644 --- a/wx/lib/langlistctrl.py +++ b/wx/lib/langlistctrl.py @@ -8,6 +8,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2006 Riaan Booysen # License: wxPython +# Tags: phoenix-port #----------------------------------------------------------------------------- """ ListCtrl and functions to display languages and the flags of their countries """ @@ -296,7 +297,7 @@ def CreateLanguagesResourceLists(filter=LC_AVAILABLE, only=()): icons.Add(bmp) name = wx.Locale.GetLanguageName(wxli) if wxli == wx.LANGUAGE_DEFAULT: - #print cnt, name, lc, wxli + #print(cnt, name, lc, wxli) name = 'Default: '+name names.append(name) @@ -398,9 +399,9 @@ class LanguageListCtrl(wx.ListCtrl): if __name__ == '__main__': - a = wx.PySimpleApp() + a = wx.App() - print GetLanguageFlag(wx.LANGUAGE_AFRIKAANS) + print(GetLanguageFlag(wx.LANGUAGE_AFRIKAANS)) f=wx.Frame(None, -1) f.p=wx.Panel(f, -1) diff --git a/wx/lib/masked/combobox.py b/wx/lib/masked/combobox.py index 60ed67d3..f934ecd0 100644 --- a/wx/lib/masked/combobox.py +++ b/wx/lib/masked/combobox.py @@ -764,7 +764,7 @@ class BaseMaskedComboBox( wx.ComboBox, MaskedEditMixin ): # down is showing. Not all masked comboboxes require choices from an autocomplete list. self.replace_next_combobox_event = True self.correct_selection = self._GetValue() - event.m_keyCode = wx.WXK_TAB + event.KeyCode = wx.WXK_TAB event.Skip() ## dbg(indent=0) diff --git a/wx/lib/masked/timectrl.py b/wx/lib/masked/timectrl.py index 3e0b9b8c..bb2eaea0 100644 --- a/wx/lib/masked/timectrl.py +++ b/wx/lib/masked/timectrl.py @@ -1274,7 +1274,7 @@ class TimeCtrl(BaseMaskedTextCtrl): This is the key handler for '!' and 'c'; this allows the user to quickly set the value of the control to the current time. """ - self.SetValue(wx.DateTime_Now().FormatTime()) + self.SetValue(wx.DateTime.Now().FormatTime()) keep_processing = False return keep_processing diff --git a/wx/lib/mixins/listctrl.py b/wx/lib/mixins/listctrl.py index acc38e98..b6e24de3 100644 --- a/wx/lib/mixins/listctrl.py +++ b/wx/lib/mixins/listctrl.py @@ -613,7 +613,7 @@ class TextEditMixin: y0 = self.GetItemRect(row)[1] editor = self.editor - editor.SetDimensions(x0-scrolloffset,y0, x1,-1) + editor.SetSize(x0-scrolloffset,y0, x1,-1) editor.SetValue(self.GetItem(row, col).GetText()) editor.Show() @@ -678,7 +678,7 @@ class TextEditMixin: FILENAME: CheckListCtrlMixin.py AUTHOR: Bruce Who (bruce.who.hk at gmail.com) DATE: 2006-02-09 -$Revision$ +$Revision: 74209 $ DESCRIPTION: This script provide a mixin for ListCtrl which add a checkbox in the first column of each row. It is inspired by limodou's CheckList.py(which can be diff --git a/wx/lib/mixins/rubberband.py b/wx/lib/mixins/rubberband.py index 4320ff41..b11cb4ef 100644 --- a/wx/lib/mixins/rubberband.py +++ b/wx/lib/mixins/rubberband.py @@ -8,6 +8,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2002 by db-X Corporation # Licence: wxWindows license +# Tags: phoenix-port #--------------------------------------------------------------------------- # 12/14/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -142,7 +143,7 @@ class RubberBand: return self.__enabled def __handleOnPaint(self, event): - #print 'paint' + #print('paint') event.Skip() def __isMovingCursor(self): @@ -302,7 +303,7 @@ class RubberBand: """ if self.__currentCursor != id: # Avoid redundant calls if id: - self.drawingSurface.SetCursor(wx.StockCursor(id)) + self.drawingSurface.SetCursor(wx.Cursor(id)) else: self.drawingSurface.SetCursor(wx.NullCursor) self.__currentCursor = id @@ -333,20 +334,20 @@ class RubberBand: dc.SetLogicalFunction(wx.XOR) if boxToErase: r = wx.Rect(*boxToErase) - dc.DrawRectangleRect(r) + dc.DrawRectangle(r) r = wx.Rect(*boxToDraw) - dc.DrawRectangleRect(r) + dc.DrawRectangle(r) def __dumpMouseEvent(self, event): - print 'Moving: ',event.Moving() - print 'Dragging: ',event.Dragging() - print 'LeftDown: ',event.LeftDown() - print 'LeftisDown: ',event.LeftIsDown() - print 'LeftUp: ',event.LeftUp() - print 'Position: ',event.GetPosition() - print 'x,y: ',event.GetX(),event.GetY() - print + print('Moving: ',event.Moving()) + print('Dragging: ',event.Dragging()) + print('LeftDown: ',event.LeftDown()) + print('LeftisDown: ',event.LeftIsDown()) + print('LeftUp: ',event.LeftUp()) + print('Position: ',event.GetPosition()) + print('x,y: ',event.GetX(),event.GetY()) + print() # @@ -377,7 +378,7 @@ class RubberBand: if __name__ == '__main__': - app = wx.PySimpleApp() + app = wx.App() frame = wx.Frame(None, -1, title='RubberBand Test', size=(300,300)) # Add a panel that the rubberband will work on. diff --git a/wx/lib/mixins/treemixin.py b/wx/lib/mixins/treemixin.py index e057103d..41cab370 100644 --- a/wx/lib/mixins/treemixin.py +++ b/wx/lib/mixins/treemixin.py @@ -1,3 +1,18 @@ +#--------------------------------------------------------------------------- +# Name: treemixin.py +# Purpose: This module provides three mixin classes that can be used with tree +# controls +# +# Author: +# +# Created: +# RCS-ID: +# Date: 24 September 2007 +# Copyright: +# Version: 1.1 +# Licence: wxWidgets license +# Tags: phoenix-port +#--------------------------------------------------------------------------- """ treemixin.py @@ -554,10 +569,10 @@ class DragAndDrop(TreeAPIHarmonizer, TreeHelper): self.SelectItem(self._dragItem) def SetCursorToDragging(self): - self.GetMainWindow().SetCursor(wx.StockCursor(wx.CURSOR_HAND)) + self.GetMainWindow().SetCursor(wx.Cursor(wx.CURSOR_HAND)) def SetCursorToDroppingImpossible(self): - self.GetMainWindow().SetCursor(wx.StockCursor(wx.CURSOR_NO_ENTRY)) + self.GetMainWindow().SetCursor(wx.Cursor(wx.CURSOR_NO_ENTRY)) def ResetCursor(self): self.GetMainWindow().SetCursor(wx.NullCursor) diff --git a/wx/lib/nvdlg.py b/wx/lib/nvdlg.py index 2300df23..1bda8dfb 100644 --- a/wx/lib/nvdlg.py +++ b/wx/lib/nvdlg.py @@ -8,6 +8,7 @@ # RCS-ID: $Id: $ # Copyright: (c) 2009 by Total Control Software # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------- @@ -148,7 +149,7 @@ if __name__ == '__main__': captionTitle="Login", captionDescr="Enter your testing credentials") if dlg.ShowModal() == wx.ID_OK: - print dlg.username, dlg.passwd + print(dlg.username, dlg.passwd) dlg.Destroy() app.MainLoop() diff --git a/wx/lib/ogl/_bmpshape.py b/wx/lib/ogl/_bmpshape.py index 68e2e2e8..ad3991d0 100644 --- a/wx/lib/ogl/_bmpshape.py +++ b/wx/lib/ogl/_bmpshape.py @@ -9,6 +9,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2004 Pierre Hjälm - 1998 Julian Smart # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- from _basic import RectangleShape @@ -21,7 +22,7 @@ class BitmapShape(RectangleShape): self._filename = "" def OnDraw(self, dc): - if not self._bitmap.Ok(): + if not self._bitmap.IsOk(): return x = self._xpos - self._bitmap.GetWidth() / 2.0 @@ -29,7 +30,7 @@ class BitmapShape(RectangleShape): dc.DrawBitmap(self._bitmap, x, y, True) def SetSize(self, w, h, recursive = True): - if self._bitmap.Ok(): + if self._bitmap.IsOk(): w = self._bitmap.GetWidth() h = self._bitmap.GetHeight() @@ -52,7 +53,7 @@ class BitmapShape(RectangleShape): data. """ self._bitmap = bitmap - if self._bitmap.Ok(): + if self._bitmap.IsOk(): self.SetSize(self._bitmap.GetWidth(), self._bitmap.GetHeight()) def SetFilename(self, f): diff --git a/wx/lib/ogl/_composit.py b/wx/lib/ogl/_composit.py index 013e06c7..f6e698d2 100644 --- a/wx/lib/ogl/_composit.py +++ b/wx/lib/ogl/_composit.py @@ -9,6 +9,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2004 Pierre Hjälm - 1998 Julian Smart # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- import sys @@ -1414,7 +1415,7 @@ class DivisionShape(CompositeShape): return True def EditEdge(self, side): - print "EditEdge() not implemented." + print("EditEdge() not implemented.") def PopupMenu(self, x, y): menu = PopupDivisionMenu() diff --git a/wx/lib/ogl/_divided.py b/wx/lib/ogl/_divided.py index 27276389..68b4ad8c 100644 --- a/wx/lib/ogl/_divided.py +++ b/wx/lib/ogl/_divided.py @@ -9,6 +9,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2004 Pierre Hjälm - 1998 Julian Smart # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- import sys @@ -393,7 +394,7 @@ class DividedShape(RectangleShape): def EditRegions(self): """Edit the region colours and styles. Not implemented.""" - print "EditRegions() is unimplemented" + print("EditRegions() is unimplemented") def OnRightClick(self, x, y, keys = 0, attachment = 0): if keys & KEY_CTRL: diff --git a/wx/lib/ogl/_drawn.py b/wx/lib/ogl/_drawn.py index 5862b034..91df2060 100644 --- a/wx/lib/ogl/_drawn.py +++ b/wx/lib/ogl/_drawn.py @@ -9,6 +9,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2004 Pierre Hjälm - 1998 Julian Smart # License: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- import os.path @@ -408,7 +409,7 @@ class PseudoMetaFile(object): if not os.path.exist(filename): return False - print "LoadFromMetaFile not implemented yet." + print("LoadFromMetaFile not implemented yet.") return False # TODO # Scale to fit size diff --git a/wx/lib/ogl/_lines.py b/wx/lib/ogl/_lines.py index eeebf865..49e68619 100644 --- a/wx/lib/ogl/_lines.py +++ b/wx/lib/ogl/_lines.py @@ -9,6 +9,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2004 Pierre Hjälm - 1998 Julian Smart # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- import sys @@ -1208,7 +1209,7 @@ class LineShape(Shape): self.SetBrush(old_brush) if pt._type == CONTROL_POINT_ENDPOINT_FROM or pt._type == CONTROL_POINT_ENDPOINT_TO: - self._canvas.SetCursor(wx.StockCursor(wx.CURSOR_BULLSEYE)) + self._canvas.SetCursor(wx.Cursor(wx.CURSOR_BULLSEYE)) pt._oldCursor = wx.STANDARD_CURSOR def OnSizingEndDragLeft(self, pt, x, y, keys = 0, attachment = 0): diff --git a/wx/lib/pdfviewer/viewer.py b/wx/lib/pdfviewer/viewer.py index 59c1f232..61d97064 100644 --- a/wx/lib/pdfviewer/viewer.py +++ b/wx/lib/pdfviewer/viewer.py @@ -67,7 +67,7 @@ if USE_CAIRO and wx.VERSION_STRING > '2.8.10.1': # Cairo DrawBitmap bug fix from wx.lib.graphics import GraphicsContext FONTSCALE = 1.0 have_cairo = True - if VERBOSE: print 'Using Cairo' + if VERBOSE: print('Using Cairo') except ImportError: pass if not have_cairo: @@ -75,7 +75,7 @@ if not have_cairo: if wx.PlatformInfo[1] == 'wxMSW': # for Windows only FONTSCALE = 72.0 / 96.0 # wx.GraphicsContext fonts are too big in the ratio # of screen pixels per inch to points per inch - if VERBOSE: print 'Using wx.GraphicsContext' + if VERBOSE: print('Using wx.GraphicsContext') """ If reportlab is installed, use its stringWidth metric. For justifying text, where widths are cumulative, dc.GetTextExtent consistently underestimates, @@ -417,13 +417,13 @@ class pdfViewer(wx.ScrolledWindow): ttr = time.time()-t1 if CACHE_LATE_PAGES and ttr * 1000 > LATE_THRESHOLD: self.CachePage(pageno) # save page out of buffer - #print 'Page %d rendered in %.3f seconds' % (pageno+1, ttr) + #print('Page %d rendered in %.3f seconds' % (pageno+1, ttr)) gc.PushState() gc.Translate(0-self.x0, 0-self.page_y0) self.RenderPageBoundaries(gc) gc.PopState() self.Refresh(0) # Blit appropriate area of new or existing page buffer to screen - #print 'Cached pages:', self.cachedpages.keys() + #print('Cached pages:', self.cachedpages.keys()) #self.pagebuffer.SaveFile('pagemap.png', wx.BITMAP_TYPE_PNG) def RenderPage(self, gc, pagedrawings): @@ -530,8 +530,8 @@ class pdfViewer(wx.ScrolledWindow): self.page.extractOperators(), pdf_fonts) if rp: self.Progress('progress', numpages_generated) - ## print 'Pages %d to %d. %d pages created in %.2f seconds' % ( - ## frompage, topage, numpages_generated,(time.time()-t0)) + ## print('Pages %d to %d. %d pages created in %.2f seconds' % ( + ## frompage, topage, numpages_generated,(time.time()-t0))) if rp: self.Progress('end', None) self.GoPage(frompage) @@ -630,7 +630,7 @@ class pdfViewer(wx.ScrolledWindow): drawlist.extend(self.InlineImage(operand)) else: # report once if operator not in self.unimplemented: - if VERBOSE: print 'PDF operator %s is not implemented' % operator + if VERBOSE: print('PDF operator %s is not implemented' % operator) self.unimplemented[operator] = 1 # Fix bitmap transform. Remove the scaling from any transform matrix that precedes @@ -665,7 +665,7 @@ class pdfViewer(wx.ScrolledWindow): family = wx.FONTFAMILY_DEFAULT font = 'Wingdings' else: - if VERBOSE: print 'Unknown font %s' % pdfont + if VERBOSE: print('Unknown font %s' % pdfont) self.knownfont = False family = wx.FONTFAMILY_SWISS font = 'Arial' @@ -843,8 +843,8 @@ class pdfViewer(wx.ScrolledWindow): data = FlateDecode.decode(data, None) if '/DCT' in filters or '/DCTDecode' in filters: stream = cStringIO.StringIO(data) - image = wx.ImageFromStream(stream, wx.BITMAP_TYPE_JPEG) - bitmap = wx.BitmapFromImage(image) + image = wx.Image(stream, wx.BITMAP_TYPE_JPEG) + bitmap = wx.Bitmap(image) else: bitmap = wx.BitmapFromBuffer(width, height, data) return ['DrawBitmap', (bitmap, 0, 0-height, width, height), {}] @@ -1030,7 +1030,7 @@ def _AsciiBase85DecodePYTHON(input): stripped = stripped.replace('z','!!!!!') # special rules apply if not a multiple of five bytes. whole_word_count, remainder_size = divmod(len(stripped), 5) - #print '%d words, %d leftover' % (whole_word_count, remainder_size) + #print('%d words, %d leftover' % (whole_word_count, remainder_size)) #assert remainder_size <> 1, 'invalid Ascii 85 stream!' cut = 5 * whole_word_count body, lastbit = stripped[0:cut], stripped[cut:] @@ -1071,8 +1071,8 @@ def _AsciiBase85DecodePYTHON(input): temp, b3 = divmod(temp,256) b1, b2 = divmod(temp, 256) assert num == 16777216 * b1 + 65536 * b2 + 256 * b3 + b4, 'dodgy code!' - #print 'decoding: %d %d %d %d %d -> %d -> %d %d %d %d' % ( - # c1,c2,c3,c4,c5,num,b1,b2,b3,b4) + #print('decoding: %d %d %d %d %d -> %d -> %d %d %d %d' % ( + # c1,c2,c3,c4,c5,num,b1,b2,b3,b4)) #the last character needs 1 adding; the encoding loses #data by rounding the number to x bytes, and when diff --git a/wx/lib/platebtn.py b/wx/lib/platebtn.py index f08c1730..dd48c613 100644 --- a/wx/lib/platebtn.py +++ b/wx/lib/platebtn.py @@ -5,6 +5,7 @@ # Author: Cody Precord # # Copyright: (c) 2007 Cody Precord # # Licence: wxWindows Licence # +# Tags: phoenix-port ############################################################################### """ @@ -564,9 +565,9 @@ class PlateButton(wx.Control): if (self._style & PB_STYLE_TOGGLE): self._pressed = not self._pressed - pos = evt.GetPositionTuple() + pos = evt.GetPosition() self._SetState(PLATE_PRESSED) - size = self.GetSizeTuple() + size = self.GetSize() if pos[0] >= size[0] - 16: if self._menu is not None: self.ShowMenu() @@ -585,8 +586,8 @@ class PlateButton(wx.Control): """ if self._state['cur'] == PLATE_PRESSED: - pos = evt.GetPositionTuple() - size = self.GetSizeTuple() + pos = evt.GetPosition() + size = self.GetSize() if not (self._style & PB_STYLE_DROPARROW and pos[0] >= size[0] - 16): self.__PostEvent() @@ -746,7 +747,7 @@ class PlateButton(wx.Control): def ShowMenu(self): """Show the dropdown menu if one is associated with this control""" if self._menu is not None: - size = self.GetSizeTuple() + size = self.GetSize() adj = wx.Platform == '__WXMAC__' and 3 or 0 if self._style & PB_STYLE_SQUARE: diff --git a/wx/lib/plot.py b/wx/lib/plot.py index f1ac342f..9d4091fd 100644 --- a/wx/lib/plot.py +++ b/wx/lib/plot.py @@ -8,6 +8,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2002 # Licence: Use as you wish. +# Tags: phoenix-port #----------------------------------------------------------------------------- # 12/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -500,7 +501,7 @@ class PlotGraphics: o._pointSize = self._pointSize o.draw(dc, self.printerScale) #dt= _time.clock()-t - #print o, "time=", dt + #print(o, "time=", dt) def getSymExtent(self, printerScale): """Get max width and height of lines and markers symbols for legend""" @@ -775,7 +776,7 @@ class PlotCanvas(wx.Panel): printout = PlotPrintout(self) printout2 = PlotPrintout(self) self.preview = wx.PrintPreview(printout, printout2, self.print_data) - if not self.preview.Ok(): + if not self.preview.IsOk(): wx.MessageDialog(self, "Print Preview failed.\n" \ "Check that default printer is configured\n", \ "Print error", wx.OK|wx.CENTRE).ShowModal() @@ -1260,7 +1261,7 @@ class PlotCanvas(wx.Panel): # Draw the lines and markers #start = _time.clock() graphics.draw(dc) - # print "entire graphics drawing took: %f second"%(_time.clock() - start) + # print("entire graphics drawing took: %f second"%(_time.clock() - start)) # remove the clipping region dc.DestroyClippingRegion() @@ -1428,7 +1429,7 @@ class PlotCanvas(wx.Panel): # Give a little time for the click to be totally finished # before (possibly) removing the scrollbars and trigering # size events, etc. - wx.FutureCall(200,self.Reset) + wx.CallLater(200,self.Reset) def OnMouseRightDown(self,event): if self._zoomEnabled: @@ -1754,7 +1755,7 @@ class PlotCanvas(wx.Panel): def _logticks(self, lower, upper): #lower,upper = map(_Numeric.log10,[lower,upper]) - #print 'logticks',lower,upper + #print('logticks',lower,upper) ticks = [] mag = _Numeric.power(10,_Numeric.floor(lower)) if upper-lower > 6: @@ -1903,10 +1904,10 @@ class PlotPrintout(wx.Printout): def OnPrintPage(self, page): dc = self.GetDC() # allows using floats for certain functions -## print "PPI Printer",self.GetPPIPrinter() -## print "PPI Screen", self.GetPPIScreen() -## print "DC GetSize", dc.GetSize() -## print "GetPageSizePixels", self.GetPageSizePixels() +## print("PPI Printer",self.GetPPIPrinter()) +## print("PPI Screen", self.GetPPIScreen()) +## print("DC GetSize", dc.GetSize()) +## print("GetPageSizePixels", self.GetPageSizePixels()) # Note PPIScreen does not give the correct number # Calulate everything for printer and then scale for preview PPIPrinter= self.GetPPIPrinter() # printer dots/inch (w,h) @@ -2293,7 +2294,7 @@ class TestFrame(wx.Frame): ## start = _time.clock() ## for x in range(10): ## self.client.Draw(drawObj) -## print "10 plots of Draw4 took: %f sec."%(_time.clock() - start) +## print("10 plots of Draw4 took: %f sec."%(_time.clock() - start)) ## # profile end def OnPlotDraw5(self, event): diff --git a/wx/lib/popupctl.py b/wx/lib/popupctl.py index 198756e1..019e5010 100644 --- a/wx/lib/popupctl.py +++ b/wx/lib/popupctl.py @@ -8,6 +8,7 @@ # Version: 0.1 # RCS-ID: $Id$ # License: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------- # 11/24/2007 - Cody Precord # @@ -195,13 +196,13 @@ class PopupControl(wx.Control): self.pop = PopupDialog(self,self.content) del self.content else: - print 'No Content to pop' + print('No Content to pop') if self.pop: self.pop.Display() def Enable(self, flag): - wx.PyControl.Enable(self,flag) + wx.Control.Enable(self,flag) self.textCtrl.Enable(flag) self.bCtrl.Enable(flag) diff --git a/wx/lib/printout.py b/wx/lib/printout.py index 4877ea93..05aaf994 100644 --- a/wx/lib/printout.py +++ b/wx/lib/printout.py @@ -8,6 +8,7 @@ # Version 0.75 # Date: May 15, 2002 # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- # Release Notes @@ -320,16 +321,16 @@ class PrintTableDraw(wx.ScrolledWindow, PrintBase): self.column.append(pos_x) # position of each column if pos_x > self.page_width * self.pwidth: # check if it fits in page - print "Warning, Too Wide for Page" + print("Warning, Too Wide for Page") return if self.label != []: if len(self.column) -1 != len(self.label): - print "Column Settings Incorrect", "\nColumn Value: " + str(self.column), "\nLabel Value: " + str(self.label) + print("Column Settings Incorrect", "\nColumn Value: " + str(self.column), "\nLabel Value: " + str(self.label)) return if column_total != len(self.column) -1: - print "Cannot fit", first_value, 'in', len(self.column)-1, 'columns.' + print("Cannot fit", first_value, 'in', len(self.column)-1, 'columns.') return for col in range(column_total): @@ -1130,7 +1131,7 @@ class SetPrintout(wx.Printout): return True if __name__ == '__main__': - app = wx.PySimpleApp() + app = wx.App() frame = wx.Frame(None, -1, "Dummy wx frame for testing printout.py") frame.Show(True) ptbl = PrintTable(frame) diff --git a/wx/lib/pubsub/autosetuppubsubv1.py b/wx/lib/pubsub/autosetuppubsubv1.py index e68eadf1..16ef4b12 100644 --- a/wx/lib/pubsub/autosetuppubsubv1.py +++ b/wx/lib/pubsub/autosetuppubsubv1.py @@ -1,3 +1,8 @@ +#---------------------------------------------------------------------------- +# Name: autosetuppubsubv1.py +# +# Tags: phoenix-port +#---------------------------------------------------------------------------- ''' If this module is named autosetuppubsubv1, and it is in the pubsub package's folder, it will cause pubsub to default to "version 1" (v1) @@ -19,7 +24,7 @@ def testWxPython(): # this is not the pubsub in wxPython return - # print 'PubSub from wx.lib.pubsub' + # print('PubSub from wx.lib.pubsub') # if wx >= 2.9, use latest pubsub API ie kwargs # this is done by raising ImportError which will make @@ -30,8 +35,8 @@ def testWxPython(): raise ImportError if wx.MAJOR_VERSION == 2 and wx.MINOR_VERSION >= 9: raise ImportError - # print ' Found wx version < 2.9' + # print(' Found wx version < 2.9') testWxPython() -# print 'Using pubsub API v1' +# print('Using pubsub API v1') diff --git a/wx/lib/pubsub/core/__init__.py b/wx/lib/pubsub/core/__init__.py index d50a4e08..585eef3b 100644 --- a/wx/lib/pubsub/core/__init__.py +++ b/wx/lib/pubsub/core/__init__.py @@ -46,9 +46,9 @@ def setMsgDataArgName(stage, listenerArgName, senderArgNameAny=False): policies.senderKwargNameAny = senderArgNameAny policies.msgDataArgName = listenerArgName policies.msgProtocolTransStage = stage - #print `policies.msgProtocolTransStage`, `policies.msgDataProtocol`, \ - # `policies.senderKwargNameAny`, `policies.msgDataArgName` - #print 'override "arg1" protocol arg name:', argName + #print(`policies.msgProtocolTransStage`, `policies.msgDataProtocol`, \ + # `policies.senderKwargNameAny`, `policies.msgDataArgName`) + #print('override "arg1" protocol arg name:', argName) def _replaceModulePath0(dirname): diff --git a/wx/lib/pubsub/core/callables.py b/wx/lib/pubsub/core/callables.py index 2c3b6af2..cfc5bc87 100644 --- a/wx/lib/pubsub/core/callables.py +++ b/wx/lib/pubsub/core/callables.py @@ -1,3 +1,8 @@ +#---------------------------------------------------------------------------- +# Name: callables.py +# +# Tags: phoenix-port +#---------------------------------------------------------------------------- ''' Low level functions and classes related to callables. @@ -56,16 +61,16 @@ def getRawFunction(callable_): recognized type (function, method or has __call__ method).''' firstArg = 0 if isfunction(callable_): - #print 'Function', getID(callable_) + #print('Function', getID(callable_)) func = callable_ elif ismethod(callable_): - #print 'Method', getID(callable_) + #print('Method', getID(callable_)) func = callable_ if func.im_self is not None: # Method is bound, don't care about the self arg firstArg = 1 elif hasattr(callable_, '__call__'): - #print 'Functor', getID(callable_) + #print('Functor', getID(callable_)) func = callable_.__call__ firstArg = 1 # don't care about the self arg else: diff --git a/wx/lib/pubsub/core/datamsg.py b/wx/lib/pubsub/core/datamsg.py index ba65fc99..7f2cc689 100644 --- a/wx/lib/pubsub/core/datamsg.py +++ b/wx/lib/pubsub/core/datamsg.py @@ -1,3 +1,10 @@ +#---------------------------------------------------------------------- +# Name: datamsg.py +# +# Copyright: Copyright 2006-2009 by Oliver Schoenborn, all rights reserved. +# License: BSD, see LICENSE.txt for details. +# Tags: phoenix-port +#---------------------------------------------------------------------- ''' :copyright: Copyright 2006-2009 by Oliver Schoenborn, all rights reserved. @@ -13,9 +20,9 @@ class Message: via Message.data, while the topic name is available in Message.topic:: def listener(msg): - print "data is ", msg.data - print "topic name is ", msg.topic - print msg + print("data is ", msg.data) + print("topic name is ", msg.topic) + print(msg) The example shows how a message can be converted to string. """ diff --git a/wx/lib/pubsub/core/kwargs/publisher.py b/wx/lib/pubsub/core/kwargs/publisher.py index 62f0eced..2aeff9fa 100644 --- a/wx/lib/pubsub/core/kwargs/publisher.py +++ b/wx/lib/pubsub/core/kwargs/publisher.py @@ -1,3 +1,10 @@ +#---------------------------------------------------------------------- +# Name: publisher.py +# +# Copyright: Copyright 2006-2009 by Oliver Schoenborn, all rights reserved. +# License: BSD, see LICENSE.txt for details. +# Tags: phoenix-port +#---------------------------------------------------------------------- ''' Mixin for publishing messages to a topic's listeners. This will be mixed into topicobj.Topic so that a user can use a Topic object to @@ -76,6 +83,6 @@ if policies.msgProtocolTransStage is None: Publisher = PublisherKwargs else: Publisher = PublisherArg1Stage2 - #print 'Using protocol', Publisher + #print('Using protocol', Publisher) diff --git a/wx/lib/pubsub/core/topicobj.py b/wx/lib/pubsub/core/topicobj.py index 4ae08901..c16a4d0c 100644 --- a/wx/lib/pubsub/core/topicobj.py +++ b/wx/lib/pubsub/core/topicobj.py @@ -1,3 +1,10 @@ +#---------------------------------------------------------------------- +# Name: topicobj.py +# +# Copyright: Copyright 2006-2009 by Oliver Schoenborn, all rights reserved. +# License: BSD, see LICENSE.txt for details. +# Tags: phoenix-port +#---------------------------------------------------------------------- ''' Represent topics in pubsub. Topic objects contain all information about a topic, including documentation about the topic, the listener protocol @@ -370,7 +377,7 @@ class Topic(PublisherMixin): handler( listener.name(), topicObj ) self.__handlingUncaughtListenerExc = False except Exception, exc: - #print 'exception raised', exc + #print('exception raised', exc) self.__handlingUncaughtListenerExc = False raise ExcHandlerError(listener.name(), topicObj, exc) @@ -398,13 +405,13 @@ class Topic(PublisherMixin): '''Unsubscribe all our listeners, remove all subtopics from self, then detach from parent. Parent is not notified, because method assumes it has been called by parent''' - #print 'Remove %s listeners (%s)' % (self.getName(), self.getNumListeners()) + #print('Remove %s listeners (%s)' % (self.getName(), self.getNumListeners())) self.unsubscribeAllListeners() self.__parentTopic = None for subName, subObj in self.__subTopics.iteritems(): assert isinstance(subObj, Topic) - #print 'Unlinking %s from parent' % subObj.getName() + #print('Unlinking %s from parent' % subObj.getName()) subObj.__undefineBranch(topicsMap) self.__subTopics = {} diff --git a/wx/lib/pubsub/pubsub1/pub.py b/wx/lib/pubsub/pubsub1/pub.py index 8dd2736e..85e79808 100644 --- a/wx/lib/pubsub/pubsub1/pub.py +++ b/wx/lib/pubsub/pubsub1/pub.py @@ -1,5 +1,11 @@ - -#--------------------------------------------------------------------------- +#---------------------------------------------------------------------- +# Name: pub.py +# +# Author: Oliver Schoenborn +# Copyright: Copyright 2006 by Oliver Schoenborn, all rights reserved. +# License: BSD, see LICENSE.txt for details. +# Tags: phoenix-port +#---------------------------------------------------------------------- """ Provides "version 1" of pubsub's publish-subscribe API. @@ -12,7 +18,7 @@ parameter. Example use:: from pubsub import Publisher def aCallable(msg): - print 'data received', msg.data + print('data received', msg.data) Publisher.subscribe(aCallable, 'some_topic') Publisher.sendMessage('some_topic', data=123) // should see 'data received 123' @@ -323,7 +329,7 @@ class _TopicTreeNode: def __notifyDead(self, dead): """Gets called when a listener dies, thanks to WeakRef""" - #print 'TreeNODE', `self`, 'received death certificate for ', dead + #print('TreeNODE', `self`, 'received death certificate for ', dead) self.__cleanupDead() if self.__onDeadListenerWeakCB is not None: cb = self.__onDeadListenerWeakCB() @@ -484,7 +490,7 @@ class _TopicTreeRoot(_TopicTreeNode): callbackDeadLimit = 10 def __rootNotifyDead(self, dead): - #print 'TreeROOT received death certificate for ', dead + #print('TreeROOT received death certificate for ', dead) self.__callbackDictCleanup += 1 if self.__callbackDictCleanup > _TopicTreeRoot.callbackDeadLimit: self.__callbackDictCleanup = 0 diff --git a/wx/lib/pubsub/pubsub2/__init__.py b/wx/lib/pubsub/pubsub2/__init__.py index 8b137891..e69de29b 100644 --- a/wx/lib/pubsub/pubsub2/__init__.py +++ b/wx/lib/pubsub/pubsub2/__init__.py @@ -1 +0,0 @@ - diff --git a/wx/lib/pubsub/pubsub2/pub.py b/wx/lib/pubsub/pubsub2/pub.py index 78f5a576..f5174827 100644 --- a/wx/lib/pubsub/pubsub2/pub.py +++ b/wx/lib/pubsub/pubsub2/pub.py @@ -1,3 +1,12 @@ +#---------------------------------------------------------------------- +# Name: pub.py +# +# Author: Oliver Schoenborn +# Copyright: (c) 2007-2009 Oliver Schoenborn +# Version: 2.01 +# License: see LICENSE.txt +# Tags: phoenix-port +#---------------------------------------------------------------------- ''' This module provides publish-subscribe functions that allow your methods, functions, and any other callable object to subscribe to @@ -13,7 +22,7 @@ carrying data 'some data' (in this case, a string, but could be anything):: class MsgType(ps.Message): pass def listener(msg, data): - print 'got msg', data + print('got msg', data) ps.subscribe(listener, MsgType) ps.sendMessage(MsgType('some data')) diff --git a/wx/lib/pubsub/pubsubconf.py b/wx/lib/pubsub/pubsubconf.py index 4a6fd2bc..c0aae8c1 100644 --- a/wx/lib/pubsub/pubsubconf.py +++ b/wx/lib/pubsub/pubsubconf.py @@ -114,4 +114,3 @@ def pubModuleLoaded(): #global pubModuleInfo #pubModuleInfo = None - \ No newline at end of file diff --git a/wx/lib/pubsub/utils/misc.py b/wx/lib/pubsub/utils/misc.py index aafd46e5..7a023dbb 100644 --- a/wx/lib/pubsub/utils/misc.py +++ b/wx/lib/pubsub/utils/misc.py @@ -1,3 +1,11 @@ +#---------------------------------------------------------------------- +# Name: misc.py +# +# Author: Oliver Schoenborn +# Copyright: Copyright 2006-2009 by Oliver Schoenborn, all rights reserved. +# License: BSD, see LICENSE.txt for details. +# Tags: phoenix-port +#---------------------------------------------------------------------- """ Provides useful functions and classes. Most useful are probably printTreeDocs and printTreeSpec. @@ -16,7 +24,7 @@ def printImported(): import sys ll = [mod for mod in sys.modules.keys() if mod.find('pubsub') >= 0] ll.sort() - print '\n'.join(ll) + print('\n'.join(ll)) class StructMsg: diff --git a/wx/lib/pydocview.py b/wx/lib/pydocview.py index 4f0244e7..839e3f84 100644 --- a/wx/lib/pydocview.py +++ b/wx/lib/pydocview.py @@ -8,10 +8,12 @@ # CVS-ID: $Id$ # Copyright: (c) 2003-2006 ActiveGrid, Inc. # License: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- import wx +import wx.adv import wx.lib.docview import sys import getopt @@ -160,7 +162,7 @@ class DocFrameMixIn: Creates the default StatusBar. """ wx.Frame.CreateStatusBar(self) - self.GetStatusBar().Show(wx.ConfigBase_Get().ReadInt("ViewStatusBar", True)) + self.GetStatusBar().Show(wx.ConfigBase.Get().ReadInt("ViewStatusBar", True)) self.UpdateStatus() return self.GetStatusBar() @@ -184,7 +186,7 @@ class DocFrameMixIn: self._toolBar.AddSimpleTool(wx.ID_UNDO, Undo.GetBitmap(), _("Undo"), _("Reverses the last action")) self._toolBar.AddSimpleTool(wx.ID_REDO, Redo.GetBitmap(), _("Redo"), _("Reverses the last undo")) self._toolBar.Realize() - self._toolBar.Show(wx.ConfigBase_Get().ReadInt("ViewToolBar", True)) + self._toolBar.Show(wx.ConfigBase.Get().ReadInt("ViewToolBar", True)) return self._toolBar @@ -264,7 +266,7 @@ class DocMDIParentFrameMixIn: """ Adjusts the position and size of the frame using the saved config position and size. """ - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() if pos == wx.DefaultPosition and size == wx.DefaultSize and config.ReadInt("MDIFrameMaximized", False): pos = [0, 0] size = wx.DisplaySize() @@ -273,7 +275,7 @@ class DocMDIParentFrameMixIn: if pos == wx.DefaultPosition: pos = config.ReadInt("MDIFrameXLoc", -1), config.ReadInt("MDIFrameYLoc", -1) - if wx.Display_GetFromPoint(pos) == -1: # Check if the frame position is offscreen + if wx.Display.GetFromPoint(pos) == -1: # Check if the frame position is offscreen pos = wx.DefaultPosition if size == wx.DefaultSize: @@ -301,7 +303,7 @@ class DocMDIParentFrameMixIn: menuBar = self.CreateDefaultMenuBar() statusBar = self.CreateDefaultStatusBar() - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() if config.ReadInt("MDIFrameMaximized", False): # wxBug: On maximize, statusbar leaves a residual that needs to be refereshed, happens even when user does it self.Maximize() @@ -382,7 +384,7 @@ class DocMDIParentFrameMixIn: defaultHSize = max(minSize, int(frameSize[0] / 6)) defaultVSize = max(minSize, int(frameSize[1] / 7)) defaultSubVSize = int(frameSize[1] / 2) - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() if windows & (EMBEDDED_WINDOW_LEFT | EMBEDDED_WINDOW_TOPLEFT | EMBEDDED_WINDOW_BOTTOMLEFT): self._leftEmbWindow = self._CreateEmbeddedWindow(self, (max(minSize,config.ReadInt("MDIEmbedLeftSize", defaultHSize)), -1), wx.LAYOUT_VERTICAL, wx.LAYOUT_LEFT, visible = config.ReadInt("MDIEmbedLeftVisible", 1), sash = wx.SASH_RIGHT) else: @@ -421,12 +423,12 @@ class DocMDIParentFrameMixIn: """ Saves the sizes of the embedded windows. """ - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() if not self.IsMaximized(): - config.WriteInt("MDIFrameXLoc", self.GetPositionTuple()[0]) - config.WriteInt("MDIFrameYLoc", self.GetPositionTuple()[1]) - config.WriteInt("MDIFrameXSize", self.GetSizeTuple()[0]) - config.WriteInt("MDIFrameYSize", self.GetSizeTuple()[1]) + config.WriteInt("MDIFrameXLoc", self.GetPosition()[0]) + config.WriteInt("MDIFrameYLoc", self.GetPosition()[1]) + config.WriteInt("MDIFrameXSize", self.GetSize()[0]) + config.WriteInt("MDIFrameYSize", self.GetSize()[1]) config.WriteInt("MDIFrameMaximized", self.IsMaximized()) config.WriteInt("ViewToolBar", self._toolBar.IsShown()) config.WriteInt("ViewStatusBar", self.GetStatusBar().IsShown()) @@ -787,7 +789,7 @@ class DocTabbedParentFrame(wx.Frame, DocFrameMixIn, DocMDIParentFrameMixIn): """ Lays out the frame. """ - wx.LayoutAlgorithm().LayoutFrame(self, self._notebook) + wx.adv.LayoutAlgorithm().LayoutFrame(self, self._notebook) def CreateNotebook(self): @@ -821,7 +823,7 @@ class DocTabbedParentFrame(wx.Frame, DocFrameMixIn, DocMDIParentFrameMixIn): icon.SetHeight(16) icon.SetWidth(16) if wx.GetApp().GetDebug(): - print "Warning: icon for '%s' isn't 16x16, not crossplatform" % template._docTypeName + print("Warning: icon for '%s' isn't 16x16, not crossplatform" % template._docTypeName) iconIndex = iconList.AddIcon(icon) self._iconIndexLookup.append((template, iconIndex)) @@ -830,7 +832,7 @@ class DocTabbedParentFrame(wx.Frame, DocFrameMixIn, DocMDIParentFrameMixIn): icon.SetHeight(16) icon.SetWidth(16) if wx.GetApp().GetDebug(): - print "Warning: getBlankIcon isn't 16x16, not crossplatform" + print("Warning: getBlankIcon isn't 16x16, not crossplatform") self._blankIconIndex = iconList.AddIcon(icon) self._notebook.AssignImageList(iconList) @@ -1519,7 +1521,7 @@ class OptionsDialog(wx.Dialog): icon.SetHeight(16) icon.SetWidth(16) if wx.GetApp().GetDebug(): - print "Warning: icon for '%s' isn't 16x16, not crossplatform" % template._docTypeName + print("Warning: icon for '%s' isn't 16x16, not crossplatform" % template._docTypeName) iconIndex = iconList.AddIcon(icon) self._iconIndexLookup.append((optionsPanel, iconIndex)) @@ -1585,7 +1587,7 @@ class GeneralOptionsPanel(wx.Panel): wx.Panel.__init__(self, parent, id) SPACE = 10 HALF_SPACE = 5 - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() self._showTipsCheckBox = wx.CheckBox(self, -1, _("Show tips at start up")) self._showTipsCheckBox.SetValue(config.ReadInt("ShowTipAtStartup", True)) if self._AllowModeChanges(): @@ -1641,7 +1643,7 @@ class GeneralOptionsPanel(wx.Panel): """ Updates the config based on the selections in the options panel. """ - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() config.WriteInt("ShowTipAtStartup", self._showTipsCheckBox.GetValue()) if self._AllowModeChanges(): config.WriteInt("UseMDI", (self._documentRadioBox.GetStringSelection() == self._mdiChoice)) @@ -1790,7 +1792,7 @@ class DocApp(wx.PySimpleApp): DocApp's file history into the document manager. """ self._docManager = docManager - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() self.GetDocumentManager().FileHistoryLoad(config) @@ -1877,7 +1879,7 @@ class DocApp(wx.PySimpleApp): """ for service in self._services: service.OnExit() - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() self._docManager.FileHistorySave(config) if hasattr(self, "_singleInstanceChecker"): @@ -1888,7 +1890,7 @@ class DocApp(wx.PySimpleApp): """ Returns the default flags to use when creating the DocManager. """ - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() if config.ReadInt("UseMDI", True) or config.ReadInt("UseWinMDI", False): flags = wx.lib.docview.DOC_MDI | wx.lib.docview.DOC_OPEN_ONCE if config.ReadInt("UseWinMDI", False): @@ -1903,7 +1905,7 @@ class DocApp(wx.PySimpleApp): Shows the tip window, generally this is called when an application starts. A wx.TipProvider must be passed. """ - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() showTip = config.ReadInt("ShowTipAtStartup", 1) if showTip: index = config.ReadInt("TipIndex", 0) @@ -2011,7 +2013,7 @@ class DocApp(wx.PySimpleApp): maximize = False else: # get default setting from registry - maximize = wx.ConfigBase_Get().ReadInt("MDIChildFrameMaximized", False) + maximize = wx.ConfigBase.Get().ReadInt("MDIChildFrameMaximized", False) frame = wx.lib.docview.DocMDIChildFrame(doc, view, wx.GetApp().GetTopWindow(), id, title, pos, size, style) if maximize: # wxBug: Should already be maximizing new child frames if one is maximized but it's not so we have to force it to @@ -2031,7 +2033,7 @@ class DocApp(wx.PySimpleApp): Remember in the config whether the MDI Frame is maximized so that it can be restored on open. """ - config = wx.ConfigBase_Get() + config = wx.ConfigBase.Get() maximizeFlag = config.ReadInt("MDIChildFrameMaximized", False) if maximized != maximizeFlag: config.WriteInt("MDIChildFrameMaximized", maximized) @@ -2239,7 +2241,7 @@ class DocMDIParentFrame(wx.lib.docview.DocMDIParentFrame, DocFrameMixIn, DocMDIP """ Lays out the frame. """ - wx.LayoutAlgorithm().LayoutMDIFrame(self) + wx.adv.LayoutAlgorithm().LayoutMDIFrame(self) self.GetClientWindow().Refresh() @@ -2723,7 +2725,7 @@ class FilePropertiesDialog(wx.Dialog): sizer.Add(self.CreateButtonSizer(wx.OK), 0, wx.ALIGN_RIGHT | wx.RIGHT | wx.BOTTOM, HALF_SPACE) sizer.Fit(self) - self.SetDimensions(-1, -1, 310, -1, wx.SIZE_USE_EXISTING) + self.SetSize(-1, -1, 310, -1, wx.SIZE_USE_EXISTING) self.SetSizer(sizer) self.Layout() diff --git a/wx/lib/rpcMixin.py b/wx/lib/rpcMixin.py index 7a0c3420..db9d2cab 100644 --- a/wx/lib/rpcMixin.py +++ b/wx/lib/rpcMixin.py @@ -16,6 +16,7 @@ # # Copyright: (c) 2000, 2001 by Greg Landrum and Rational Discovery LLC # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------- # 12/11/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -415,7 +416,7 @@ if __name__ == '__main__': app.MainLoop() # give the threads time to shut down if threading.activeCount() > nT: - print 'waiting for all threads to terminate' + print('waiting for all threads to terminate') while threading.activeCount() > nT: time.sleep(0.5) diff --git a/wx/lib/scrolledpanel.py b/wx/lib/scrolledpanel.py index b3f3729e..995304bb 100644 --- a/wx/lib/scrolledpanel.py +++ b/wx/lib/scrolledpanel.py @@ -5,6 +5,7 @@ # Copyright: (c) 2003 by Will Sadkin # RCS-ID: $Id$ # License: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- # 12/11/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -219,5 +220,5 @@ class ScrolledPanel(wx.ScrolledWindow): # if we need to adjust if new_vs_x != -1 or new_vs_y != -1: - #print "%s: (%s, %s)" % (self.GetName(), new_vs_x, new_vs_y) + #print("%s: (%s, %s)" % (self.GetName(), new_vs_x, new_vs_y)) self.Scroll(new_vs_x, new_vs_y) diff --git a/wx/lib/sheet.py b/wx/lib/sheet.py index fe8e77d7..42ba07e5 100644 --- a/wx/lib/sheet.py +++ b/wx/lib/sheet.py @@ -2,6 +2,7 @@ # CSheet - A wxPython spreadsheet class. # This is free software. Feel free to adapt it as you like. # Author: Mark F. Russo (russomf@hotmail.com) 2002/01/31 +# Tags: phoenix-port #--------------------------------------------------------------------------- # 12/11/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -59,7 +60,7 @@ class CCellEditor(wx.grid.PyGridCellEditor): def SetSize(self, rect): """ Position/size the edit control within the cell rectangle. """ # Size text control to exactly overlay in-cell editing - self._tc.SetDimensions(rect.x+3, rect.y+3, rect.width-2, rect.height-2) + self._tc.SetSize(rect.x+3, rect.y+3, rect.width-2, rect.height-2) def Show(self, show, attr): """ Show or hide the edit control. Use the attr (if not None) diff --git a/wx/lib/sized_controls.py b/wx/lib/sized_controls.py index b9ac0352..642057b3 100644 --- a/wx/lib/sized_controls.py +++ b/wx/lib/sized_controls.py @@ -218,7 +218,7 @@ class TableSizer(wx.PySizer): print("cols %d, rows %d" % (self.cols, self.rows)) print("fixed_height %d, fixed_width %d" % (self.fixed_height, self.fixed_width)) - #print "self.GetSize() = " + `self.GetSize()` + #print("self.GetSize() = " + `self.GetSize()`) row_widths = [0 for x in range(0, numrows)] col_heights = [0 for x in range(0, numcols)] @@ -251,7 +251,7 @@ class TableSizer(wx.PySizer): # growable_width = self.GetSize()[0] - self.row_widths[currentRow] # growable_height = self.GetSize()[1] - self.col_heights[currentCol] - #print "grow_height %d, grow_width %d" % (growable_height, growable_width) + #print("grow_height %d, grow_width %d" % (growable_height, growable_width)) item_vgrow = 0 item_hgrow = 0 @@ -302,7 +302,7 @@ class TableSizer(wx.PySizer): colstart = itempos[1] for col in range(0, currentCol): - #print "numcols = %d, currentCol = %d, col = %d" % (numcols, currentCol, col) + #print("numcols = %d, currentCol = %d, col = %d" % (numcols, currentCol, col)) colstart += col_heights[col] itempos[0] += rowstart @@ -763,7 +763,7 @@ class SizedPanel(wx.Panel, SizedParent): if wx.VERSION < (2,8): wx.PyPanel.base_AddChild(self, child) else: - wx.PyPanel.AddChild(self, child) + wx.Panel.AddChild(self, child) SizedParent.AddChild(self, child) @@ -773,7 +773,10 @@ class SizedPanel(wx.Panel, SizedParent): to new sizer. """ props = self._DetachFromSizer(sizer) + if wx.VERSION < (2,8): wx.PyPanel.SetSizer(self, sizer) + else: + wx.Panel.SetSizer(self, sizer) self._AddToNewSizer(sizer, props) diff --git a/wx/lib/splitter.py b/wx/lib/splitter.py index 25ef369c..f3520279 100644 --- a/wx/lib/splitter.py +++ b/wx/lib/splitter.py @@ -9,6 +9,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2005 by Total Control Software # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------- """ This module provides the `MultiSplitterWindow` class, which is very @@ -112,7 +113,7 @@ class MultiSplitterWindow(wx.Panel): return self._orient def SetBackgroundColour(self,color): - wx.PyPanel.SetBackgroundColour(self,color) + wx.Panel.SetBackgroundColour(self,color) self._drawSashInBackgroundColour = True if wx.NullColour == color: self._drawSashInBackgroundColour = False @@ -646,8 +647,8 @@ class MultiSplitterWindow(wx.Panel): y1 = 0 y2 = 0 - x1, y1 = self.ClientToScreenXY(x1, y1) - x2, y2 = self.ClientToScreenXY(x2, y2) + x1, y1 = self.ClientToScreen(x1, y1) + x2, y2 = self.ClientToScreen(x2, y2) dc.SetLogicalFunction(wx.INVERT) dc.SetPen(self._sashTrackerPen) diff --git a/wx/lib/wordwrap.py b/wx/lib/wordwrap.py index d8aa81e4..26a2d69e 100644 --- a/wx/lib/wordwrap.py +++ b/wx/lib/wordwrap.py @@ -8,6 +8,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2006 by Total Control Software # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------- def wordwrap(text, width, dc, breakLongWords=True, margin=0): @@ -71,7 +72,7 @@ if __name__ == '__main__': def OnDoUpdate(self, evt): WIDTH = self.GetSize().width - 220 HEIGHT = 200 - bmp = wx.EmptyBitmap(WIDTH, HEIGHT) + bmp = wx.Bitmap(WIDTH, HEIGHT) mdc = wx.MemoryDC(bmp) mdc.SetBackground(wx.Brush("white")) mdc.Clear() @@ -80,7 +81,7 @@ if __name__ == '__main__': mdc.DrawRectangle(0,0, WIDTH, HEIGHT) text = wordwrap(self.tc.GetValue(), WIDTH-2, mdc, False) - #print repr(text) + #print(repr(text)) mdc.DrawLabel(text, (1,1, WIDTH-2, HEIGHT-2)) del mdc diff --git a/wx/py/PyWrap.py b/wx/py/PyWrap.py index 1b564295..ac43f8fb 100644 --- a/wx/py/PyWrap.py +++ b/wx/py/PyWrap.py @@ -1,4 +1,10 @@ #!/usr/bin/env python +#---------------------------------------------------------------------- +# Name: PyWrap.py +# Purpose: PyWrap is a command line utility that runs a wxPython program with +# additional runtime-tools, such as PyCrust. +# Tags: phoenix-port +#---------------------------------------------------------------------- """PyWrap is a command line utility that runs a wxPython program with additional runtime-tools, such as PyCrust.""" @@ -24,7 +30,7 @@ def main(modulename=None): sys.path.insert(0, os.curdir) if not modulename: if len(sys.argv) < 2: - print "Please specify a module name." + print("Please specify a module name.") raise SystemExit modulename = sys.argv[1] if modulename.endswith('.py'): @@ -40,7 +46,7 @@ def main(modulename=None): except (NameError, TypeError): pass if App is None: - print "No App class was found." + print("No App class was found.") raise SystemExit app = App() wrap(app) diff --git a/wx/py/editor.py b/wx/py/editor.py index d7cfe410..33cbf086 100644 --- a/wx/py/editor.py +++ b/wx/py/editor.py @@ -1,3 +1,8 @@ +#---------------------------------------------------------------------- +# Name: editor.py +# Author: Patrick K. O'Brien +# Tags: phoenix-port +#---------------------------------------------------------------------- """PyAlaCarte and PyAlaMode editors.""" __author__ = "Patrick K. O'Brien " @@ -335,7 +340,7 @@ class EditorNotebookFrame(EditorFrame): def bufferDestroy(self): """Destroy the current buffer.""" selection = self.notebook.GetSelection() -## print "Destroy Selection:", selection +## print("Destroy Selection:", selection) if selection > 0: # Don't destroy the PyCrust tab. if self.buffer: del self.buffers[self.buffer.id] @@ -480,7 +485,7 @@ class EditorShellNotebookFrame(EditorNotebookFrame): self.notebook = None else: selection = self.notebook.GetSelection() -## print "Destroy Selection:", selection +## print("Destroy Selection:", selection) self.notebook.DeletePage(selection) def bufferNew(self): diff --git a/wx/py/magic.py b/wx/py/magic.py index 85fe512f..fb51a32b 100644 --- a/wx/py/magic.py +++ b/wx/py/magic.py @@ -1,3 +1,9 @@ +#---------------------------------------------------------------------- +# Name: magic.py +# Author: David N. Mashburn +# Created: 07/01/2009 +# Tags: phoenix-port +#---------------------------------------------------------------------- """magic.py is a utility that allows a simple line from the interpreter be translated from a more bash-like form to a python form. For instance, 'plot a' is transformed to 'plot(a)' @@ -35,7 +41,7 @@ def magicSingle(command): elif command[:6] == 'alias ': c = command[6:].lstrip().split(' ') if len(c)<2: - #print 'Not enough arguments for alias!' + #print('Not enough arguments for alias!') command = '' else: n,v = c[0],' '.join(c[1:]) diff --git a/wx/py/parse.py b/wx/py/parse.py index bb6c8198..b89255d4 100644 --- a/wx/py/parse.py +++ b/wx/py/parse.py @@ -1,3 +1,9 @@ +#---------------------------------------------------------------------- +# Name: parse.py +# Author: David N. Mashburn +# Created: 12/20/2009 +# Tags: phoenix-port +#---------------------------------------------------------------------- """parse.py is a utility that allows simple checking for line continuations to give the shell information about where text is commented and where it is not and also how to appropriately break up a sequence of commands into @@ -56,7 +62,7 @@ def testForContinuations(codeBlock,ignoreErrors=False): while currentIndentation 0: searchText = searchText[:-numCharsAfterCursor] if not searchText: diff --git a/wx/tools/dbg.py b/wx/tools/dbg.py index e58be4cd..b9a1015f 100644 --- a/wx/tools/dbg.py +++ b/wx/tools/dbg.py @@ -6,6 +6,7 @@ # Created: 07/11/2002 # Copyright: (c) 2002 by Will Sadkin, 2002 # License: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------------- # 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) # @@ -231,7 +232,7 @@ if __name__ == "__main__": import sys import wx - wx.Log_SetActiveTarget( wx.LogStderr() ) + wx.Log.SetActiveTarget(wx.LogStderr()) logger = Logger('module') dbg = logger.dbg dbg(enable=1) diff --git a/wx/tools/genaxmodule.py b/wx/tools/genaxmodule.py index 31ede75f..fca6b6ac 100644 --- a/wx/tools/genaxmodule.py +++ b/wx/tools/genaxmodule.py @@ -1,3 +1,7 @@ +#---------------------------------------------------------------------------- +# Name: genaxmodule.py +# Tags: phoenix-port +#---------------------------------------------------------------------------- """ @@ -24,7 +28,7 @@ def main(args=None): args = sys.argv if len(args) < 3: - print __doc__ + print(__doc__) sys.exit(1) # unfortunatly we need to make an app, frame and an instance of diff --git a/wx/tools/img2img.py b/wx/tools/img2img.py index 47e3a0de..8a4b9ff5 100644 --- a/wx/tools/img2img.py +++ b/wx/tools/img2img.py @@ -28,7 +28,7 @@ def convert(file, maskClr, outputDir, outputName, outType, outExt): else: img = wx.Bitmap(file, wx.BITMAP_TYPE_ANY) - if not img.Ok(): + if not img.IsOk(): return 0, file + " failed to load!" else: if maskClr: diff --git a/wx/tools/pywxrc.py b/wx/tools/pywxrc.py index 9b1a9b6c..23e7a956 100644 --- a/wx/tools/pywxrc.py +++ b/wx/tools/pywxrc.py @@ -14,6 +14,7 @@ # RCS-ID: $Id$ # Copyright: (c) 2004 by Total Control Software, 2000 Vaclav Slavik # Licence: wxWindows license +# Tags: phoenix-port #---------------------------------------------------------------------- """ @@ -864,20 +865,20 @@ def main(args=None): "hpgevo:", "help python gettext embed novar output=".split()) except getopt.GetoptError, e: - print "\nError : %s\n" % str(e) - print __doc__ + print("\nError : %s\n" % str(e)) + print(__doc__) sys.exit(1) # If there is no input file argument, show help and exit if not args: - print __doc__ - print "No xrc input file was specified." + print(__doc__) + print("No xrc input file was specified.") sys.exit(1) # Parse options and arguments for opt, val in opts: if opt in ["-h", "--help"]: - print __doc__ + print(__doc__) sys.exit(1) if opt in ["-p", "--python"]: @@ -918,16 +919,16 @@ def main(args=None): comp.MakeGetTextOutput(inputFiles, outputFilename) else: - print __doc__ - print "One or both of -p, -g must be specified." + print(__doc__) + print("One or both of -p, -g must be specified.") sys.exit(1) except IOError, e: - print >>sys.stderr, "%s." % str(e) + print(>>sys.stderr, "%s." % str(e)) else: if outputFilename != "-": - print >>sys.stderr, "Resources written to %s." % outputFilename + print(>>sys.stderr, "Resources written to %s." % outputFilename) if __name__ == "__main__": main(sys.argv[1:])