From 051374d57c12c2b8c2edcad789ef2020bacc864b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 15 Jan 2018 13:33:37 -0800 Subject: [PATCH 01/14] Add new code snippet --- .../converted/wx.propgrid.PropertyGrid.MakeColumnEditable.1.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGrid.MakeColumnEditable.1.py diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGrid.MakeColumnEditable.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGrid.MakeColumnEditable.1.py new file mode 100644 index 00000000..2fd97ab0 --- /dev/null +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGrid.MakeColumnEditable.1.py @@ -0,0 +1,2 @@ + + property.ChangeFlag(wx.propgrid.PG_PROP_READONLY, True) From f0ddc9ddf5c4226e637ce42cb8ded67ddbcae8c7 Mon Sep 17 00:00:00 2001 From: Metallicow Date: Tue, 16 Jan 2018 03:58:21 -0600 Subject: [PATCH 02/14] Fix ToasterBox demo HyperlinkCtrl --- demo/agw/ToasterBox.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demo/agw/ToasterBox.py b/demo/agw/ToasterBox.py index e2cf1f97..a7b588d9 100644 --- a/demo/agw/ToasterBox.py +++ b/demo/agw/ToasterBox.py @@ -3,6 +3,7 @@ # Main ToasterBoxDemo import wx +import wx.adv import wx.lib.scrolledpanel as scrolled import os @@ -368,8 +369,8 @@ class ToasterBoxDemo(scrolled.ScrolledPanel): sttext = wx.StaticText(panel, -1, strs) horsizer1.Add(sttext, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 5) - hl = hyperlink.HyperLinkCtrl(panel, -1, "My Home Page", - URL="http://xoomer.alice.it/infinity77/") + hl = wx.adv.HyperlinkCtrl(panel, -1, label="My Home Page", + url="http://xoomer.alice.it/infinity77/") sizer.Add((0,5)) sizer.Add(horsizer1, 0, wx.EXPAND) From 6b41523cc0be7b5fc05fffeb3464a1a7b67d49d6 Mon Sep 17 00:00:00 2001 From: Metallicow Date: Tue, 16 Jan 2018 04:19:19 -0600 Subject: [PATCH 03/14] remove renamed import --- demo/agw/ToasterBox.py | 1 - 1 file changed, 1 deletion(-) diff --git a/demo/agw/ToasterBox.py b/demo/agw/ToasterBox.py index a7b588d9..54784c91 100644 --- a/demo/agw/ToasterBox.py +++ b/demo/agw/ToasterBox.py @@ -26,7 +26,6 @@ except ImportError: # if it's not there locally, try the wxPython lib. # In case of TB_COMPLEX style, create a panel that contains an image, some # text, an hyperlink and a ticker. -from wx.adv import HyperlinkCtrl as hyperlink from wx.lib.ticker import Ticker # ------------------------------------------------------------------------------ # From c76384d45802b1d0a013f7761f2c3922699b544f Mon Sep 17 00:00:00 2001 From: Metallicow Date: Tue, 16 Jan 2018 08:47:07 -0600 Subject: [PATCH 04/14] Trim trailing whitespace *.py files --- build.py | 2 +- demo/Simplebook.py | 6 +-- docs/sphinx/availability.py | 4 +- etg/busyinfo.py | 16 +++---- etg/colour.py | 2 +- etg/event.py | 4 +- etg/frame.py | 22 +++++----- etg/grid.py | 2 +- etg/image.py | 10 ++--- etg/propgrideditors.py | 4 +- etg/statusbar.py | 22 +++++----- etg/stockitem.py | 2 +- etg/window.py | 2 +- etg/wizard.py | 2 +- etgtools/tweaker_tools.py | 2 +- packaging/setup.py | 8 ++-- setup.py | 2 +- sphinxtools/postprocess.py | 6 +-- sphinxtools/utilities.py | 2 +- unittests/test_filesys.py | 6 +-- unittests/test_htmlcell.py | 2 +- wx/lib/agw/aui/auibook.py | 2 +- wx/lib/agw/aui/framemanager.py | 2 +- wx/lib/gizmos/dynamicsash.py | 52 +++++++++++------------ wx/lib/plot/examples/demo.py | 2 +- wx/lib/pubsub/examples/multithreadloop.py | 2 +- 26 files changed, 94 insertions(+), 94 deletions(-) diff --git a/build.py b/build.py index 06c9cbb8..60ffa6bc 100755 --- a/build.py +++ b/build.py @@ -133,7 +133,7 @@ Usage: ./build.py [command(s)] [options] install_py Install wxPython only sdist Build a tarball containing all source files - sdist_demo Build a tarball containing just the demo and samples folders + sdist_demo Build a tarball containing just the demo and samples folders bdist Create a binary tarball release of wxPython Phoenix bdist_docs Build a tarball containing the documentation bdist_egg Build a Python egg. Requires magic. diff --git a/demo/Simplebook.py b/demo/Simplebook.py index 1b867b77..faa38e85 100644 --- a/demo/Simplebook.py +++ b/demo/Simplebook.py @@ -186,9 +186,9 @@ def runTest(frame, nb, log): overview = """

Simplebook

-A wx.Simplebook is a notebook-like control that has no tabs or -any other way for the user to be able to select which page is to -be shown. Page selection is totally controlled by the application. +A wx.Simplebook is a notebook-like control that has no tabs or +any other way for the user to be able to select which page is to +be shown. Page selection is totally controlled by the application. """ diff --git a/docs/sphinx/availability.py b/docs/sphinx/availability.py index d732083e..7f27e1de 100644 --- a/docs/sphinx/availability.py +++ b/docs/sphinx/availability.py @@ -36,7 +36,7 @@ class Availability(Directive): # ----------------------------------------------------------------------- # - + def run(self): env = self.state.document.settings.env targetid = 'index-%s' % env.new_serialno('index') @@ -182,7 +182,7 @@ def setup(app): app.add_javascript('javascript/jquery.collapse.js') app.add_javascript('javascript/jquery.cookie.js') app.add_javascript('javascript/toggle_visibility.js') - + app.add_config_value('availability_include_availabilities', False, False) app.add_node(availabilitylist) diff --git a/etg/busyinfo.py b/etg/busyinfo.py index 1fc68a43..42a9da4a 100644 --- a/etg/busyinfo.py +++ b/etg/busyinfo.py @@ -10,27 +10,27 @@ import etgtools import etgtools.tweaker_tools as tools -PACKAGE = "wx" +PACKAGE = "wx" MODULE = "_core" NAME = "busyinfo" # Base name of the file to generate to for this script DOCSTRING = "" # The classes and/or the basename of the Doxygen XML files to be processed by -# this script. +# this script. ITEMS = [ "wxBusyInfo", - ] - + ] + #--------------------------------------------------------------------------- def run(): # Parse the XML file(s) building a collection of Extractor objects module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) etgtools.parseDoxyXML(module, ITEMS) - + #----------------------------------------------------------------- # Tweak the parsed meta objects in the module object as needed for # customizing the generated code and docstrings. - + c = module.find('wxBusyInfo') assert isinstance(c, etgtools.ClassDef) c.mustHaveApp() @@ -44,8 +44,8 @@ def run(): #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) - - + + #--------------------------------------------------------------------------- if __name__ == '__main__': run() diff --git a/etg/colour.py b/etg/colour.py index 8433d2d0..6d50ada4 100644 --- a/etg/colour.py +++ b/etg/colour.py @@ -259,7 +259,7 @@ def run(): PyObject* o4 = PySequence_ITEM(sipPy, 3); *sipCppPtr = new wxColour(wxPyInt_AsLong(o1), wxPyInt_AsLong(o2), wxPyInt_AsLong(o3), wxPyInt_AsLong(o4)); - Py_DECREF(o4); + Py_DECREF(o4); } Py_DECREF(o1); Py_DECREF(o2); diff --git a/etg/event.py b/etg/event.py index dd355715..e20085f4 100644 --- a/etg/event.py +++ b/etg/event.py @@ -233,8 +233,8 @@ def run(): { wxPyThreadBlocker block; wxPyCallback *cb = (wxPyCallback*)entry->m_callbackUserData; - // NOTE: Just comparing PyObject pointers is not enough, as bound - // methods can result in different PyObjects each time obj.Method + // NOTE: Just comparing PyObject pointers is not enough, as bound + // methods can result in different PyObjects each time obj.Method // is evaluated. (!!!) if (PyObject_RichCompareBool(cb->m_func, func, Py_EQ) == 1) { delete cb; diff --git a/etg/frame.py b/etg/frame.py index 8e96591b..643a3ad6 100644 --- a/etg/frame.py +++ b/etg/frame.py @@ -10,15 +10,15 @@ import etgtools import etgtools.tweaker_tools as tools -PACKAGE = "wx" +PACKAGE = "wx" MODULE = "_core" NAME = "frame" # Base name of the file to generate to for this script DOCSTRING = "" # The classes and/or the basename of the Doxygen XML files to be processed by -# this script. +# this script. ITEMS = [ 'wxFrame' ] - + #--------------------------------------------------------------------------- def run(): @@ -34,10 +34,10 @@ def run(): assert isinstance(c, etgtools.ClassDef) c.find('wxFrame.title').default = 'wxEmptyString' - c.find('Create.title').default = 'wxEmptyString' - + c.find('Create.title').default = 'wxEmptyString' + c.find('SetMenuBar.menuBar').transfer = True - + # We already have a MappedType for wxArrayInt, so just tweak the # interface to use that instead of an array size and a const int pointer. tools.fixSetStatusWidths(c.find('SetStatusWidths')) @@ -46,20 +46,20 @@ def run(): c.addProperty('StatusBar GetStatusBar SetStatusBar') c.addProperty('StatusBarPane GetStatusBarPane SetStatusBarPane') c.addProperty('ToolBar GetToolBar SetToolBar') - + tools.fixTopLevelWindowClass(c) # Add back the virtual flag for these methods. # TODO: maybe these should go into a tools.addFrameVirtuals function? c.find('OnCreateStatusBar').isVirtual = True c.find('OnCreateToolBar').isVirtual = True - - + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) - - + + #--------------------------------------------------------------------------- if __name__ == '__main__': run() diff --git a/etg/grid.py b/etg/grid.py index c4e19109..47c1e0ce 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -393,7 +393,7 @@ def run(): # modifications above, so for now, at least, let.s just ignore them. c.find('GetValueAsCustom').ignore() c.find('SetValueAsCustom').ignore() - + #----------------------------------------------------------------- diff --git a/etg/image.py b/etg/image.py index 76a4249f..4129a352 100644 --- a/etg/image.py +++ b/etg/image.py @@ -608,8 +608,8 @@ def run(): #------------------------------------------------------- # tweak for IFFHandler c = module.find('wxIFFHandler') - c.find('DoCanRead').ignore(False) - + c.find('DoCanRead').ignore(False) + #------------------------------------------------------- # tweak for JPEGHandler c = module.find('wxJPEGHandler') @@ -637,9 +637,9 @@ def run(): #------------------------------------------------------- # tweak for TIFFHandler - c = module.find('wxTIFFHandler') - c.find('GetLibraryVersionInfo').ignore() - c.find('DoCanRead').ignore(False) + c = module.find('wxTIFFHandler') + c.find('GetLibraryVersionInfo').ignore() + c.find('DoCanRead').ignore(False) #------------------------------------------------------- # tweak for XPMHandler diff --git a/etg/propgrideditors.py b/etg/propgrideditors.py index 88263b77..75e9abf0 100644 --- a/etg/propgrideditors.py +++ b/etg/propgrideditors.py @@ -54,8 +54,8 @@ def run(): # an out parameter. m.cppSignature = 'bool (wxVariant& variant, wxPGProperty* property, wxWindow* ctrl)' m.virtualCatcherCode = """\ - PyObject *sipResObj = sipCallMethod(0, sipMethod, "DDD", - property, sipType_wxPGProperty, NULL, + PyObject *sipResObj = sipCallMethod(0, sipMethod, "DDD", + property, sipType_wxPGProperty, NULL, ctrl, sipType_wxWindow, NULL); if (sipResObj == Py_None) { sipRes = false; diff --git a/etg/statusbar.py b/etg/statusbar.py index 30bfbdf4..797e7a00 100644 --- a/etg/statusbar.py +++ b/etg/statusbar.py @@ -17,20 +17,20 @@ NAME = "statusbar" # Base name of the file to generate to for this script DOCSTRING = "" # The classes and/or the basename of the Doxygen XML files to be processed by -# this script. -ITEMS = [ 'wxStatusBar', 'wxStatusBarPane', ] - +# this script. +ITEMS = [ 'wxStatusBar', 'wxStatusBarPane', ] + #--------------------------------------------------------------------------- def run(): # Parse the XML file(s) building a collection of Extractor objects module = etgtools.ModuleDef(PACKAGE, MODULE, NAME, DOCSTRING) etgtools.parseDoxyXML(module, ITEMS) - + #----------------------------------------------------------------- # Tweak the parsed meta objects in the module object as needed for # customizing the generated code and docstrings. - + c = module.find('wxStatusBar') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c) @@ -49,7 +49,7 @@ def run(): const int* ptr = &styles->front(); self->SetStatusStyles(styles->size(), ptr); """) - + # For SetFieldsCount just accept the number arg, and let the user set the # widths with SetStatusWidths like in Classic # TODO: @@ -67,7 +67,7 @@ def run(): self->SetFieldsCount(number); } """) - + # Change GetFieldRect to return the rectangle (for Pythonicity and Classic compatibility) c.find('GetFieldRect').ignore() c.addCppMethod('wxRect*', 'GetFieldRect', '(int i)', @@ -77,13 +77,13 @@ def run(): self->GetFieldRect(i, *r); return r; """) - - + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) - - + + #--------------------------------------------------------------------------- if __name__ == '__main__': run() diff --git a/etg/stockitem.py b/etg/stockitem.py index 165b6784..3cefede6 100644 --- a/etg/stockitem.py +++ b/etg/stockitem.py @@ -16,7 +16,7 @@ NAME = "stockitem" # Base name of the file to generate to for this script DOCSTRING = "" # The classes and/or the basename of the Doxygen XML files to be processed by -# this script. +# this script. ITEMS = [ 'stockitem_8h.xml', ] diff --git a/etg/window.py b/etg/window.py index 25701eed..be481ae6 100644 --- a/etg/window.py +++ b/etg/window.py @@ -371,7 +371,7 @@ def run(): def DLG_UNIT(win, dlg_unit, val2=None): """ Convenience function for converting a wx.Point, wx.Size or - (x,y) in dialog units to pixels, using the given window as a + (x,y) in dialog units to pixels, using the given window as a reference. """ if val2 is not None: diff --git a/etg/wizard.py b/etg/wizard.py index 74b3d82e..97eb0fbb 100644 --- a/etg/wizard.py +++ b/etg/wizard.py @@ -17,7 +17,7 @@ NAME = "wizard" # Base name of the file to generate to for this script DOCSTRING = "" # The classes and/or the basename of the Doxygen XML files to be processed by -# this script. +# this script. ITEMS = [ "wxWizardPage", "wxWizardPageSimple", "wxWizard", diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index 6659fad3..af522e47 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -652,7 +652,7 @@ def addGetIMMethodTemplate(module, klass, fields): klass.addPyMethod('GetIM', '(self)', doc="""\ Returns an immutable representation of the ``wx.{name}`` object, based on ``namedtuple``. - + This new object is hashable and can be used as a dictionary key, be added to sets, etc. It can be converted back into a real ``wx.{name}`` with a simple statement like this: ``obj = wx.{name}(imObj)``. diff --git a/packaging/setup.py b/packaging/setup.py index 8416d124..e23269a1 100644 --- a/packaging/setup.py +++ b/packaging/setup.py @@ -9,12 +9,12 @@ # License: wxWindows License #---------------------------------------------------------------------- #--------------------------------------------------------------------------- -# This setup file is placed in the root folder of the source dist tarball, -# and will be used to help do automated builds from tools like easy_install -# or pip. These tools expect to find at least the setup.py in the root +# This setup file is placed in the root folder of the source dist tarball, +# and will be used to help do automated builds from tools like easy_install +# or pip. These tools expect to find at least the setup.py in the root # folder, so let's accommodate them... #--------------------------------------------------------------------------- - + import sys, os, glob # Restructure the content of the tarball so things like pip or easy_install diff --git a/setup.py b/setup.py index bad064a2..2599f9fa 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,7 @@ samples, and also a set of MSVC .pdb files for Windows are available The utility tools wxdocs and wxdemo will download the appropriate files with wxget, (if necessary), unpack them, (if necessary) and launch the appropriate version of -the respective items. (Documents are launched in the default browser and demo is started +the respective items. (Documents are launched in the default browser and demo is started with python). """.format(version=cfg.VERSION, docs_base=DOCS_BASE) diff --git a/sphinxtools/postprocess.py b/sphinxtools/postprocess.py index 7313da2e..8a2fbbef 100644 --- a/sphinxtools/postprocess.py +++ b/sphinxtools/postprocess.py @@ -449,7 +449,7 @@ def makeModuleIndex(sphinxDir, file): lower_to_name = {} for name in names: lower_to_name[name.lower()] = name - + text = '' if module: text += '\n\n.. module:: %s\n\n' % module @@ -462,7 +462,7 @@ def makeModuleIndex(sphinxDir, file): lower_names = list(lower_to_name.keys()) lower_names.sort() - + for lower in lower_names: cls = lower_to_name[lower] out = classes[cls] @@ -758,7 +758,7 @@ def changeWelcomeText(text, options): welcomeText = """ Welcome! This is the API documentation for the wxPython Phoenix pre-release snapshot build {version}, last updated {today} - from git revision: + from git revision: {revhash}. """.format(version=cfg.VERSION, today=TODAY, revhash=revhash) text = text.replace('!WELCOME!', welcomeText) diff --git a/sphinxtools/utilities.py b/sphinxtools/utilities.py index fedff86d..18248e63 100644 --- a/sphinxtools/utilities.py +++ b/sphinxtools/utilities.py @@ -171,7 +171,7 @@ def replaceCppItems(line): """ items = RE_KEEP_SPACES.split(line) - + # This should get rid of substitutions like "float buffered"... no_conversion = ['click', 'buffer', 'precision'] newstr = [] diff --git a/unittests/test_filesys.py b/unittests/test_filesys.py index ad727b0a..c350513b 100644 --- a/unittests/test_filesys.py +++ b/unittests/test_filesys.py @@ -9,7 +9,7 @@ import os class filesys_Tests(wtc.WidgetTestCase): def test_filesysClasses(self): - # For now just test that the expected classes exist. + # For now just test that the expected classes exist. wx.FileSystem wx.FSFile wx.FileSystemHandler @@ -21,7 +21,7 @@ class filesys_Tests(wtc.WidgetTestCase): def test_filesys02(self): wx.FileSystem.AddHandler(wx.ArchiveFSHandler()) - + def test_filesys03(self): wx.FileSystem.AddHandler(wx.InternetFSHandler()) @@ -34,7 +34,7 @@ class filesys_Tests(wtc.WidgetTestCase): self.assertTrue(memoryFS.FindFirst('test.txt') == 'test.txt') # TODO: Add more tests. - + #--------------------------------------------------------------------------- diff --git a/unittests/test_htmlcell.py b/unittests/test_htmlcell.py index 45b53dec..ff4d1ca6 100644 --- a/unittests/test_htmlcell.py +++ b/unittests/test_htmlcell.py @@ -37,7 +37,7 @@ class htmlcell_Tests(wtc.WidgetTestCase): c = wx.html.HtmlCell() c.FindCellByPos - + #--------------------------------------------------------------------------- if __name__ == '__main__': diff --git a/wx/lib/agw/aui/auibook.py b/wx/lib/agw/aui/auibook.py index b2b2fccd..2151293d 100644 --- a/wx/lib/agw/aui/auibook.py +++ b/wx/lib/agw/aui/auibook.py @@ -2025,7 +2025,7 @@ class AuiTabCtrl(wx.Control, AuiTabContainer): del self._drag_image self._drag_image = None self.GetParent().Refresh() - + if self.HasCapture(): self.ReleaseMouse() diff --git a/wx/lib/agw/aui/framemanager.py b/wx/lib/agw/aui/framemanager.py index 5d44aba4..a8461ee0 100644 --- a/wx/lib/agw/aui/framemanager.py +++ b/wx/lib/agw/aui/framemanager.py @@ -7447,7 +7447,7 @@ class AuiManager(wx.EvtHandler): # Close/update asynchronously, because # the notebook which generated the event # (and triggered this method call) will - # be deleted. + # be deleted. def close(): self.ClosePane(p) self.Update() diff --git a/wx/lib/gizmos/dynamicsash.py b/wx/lib/gizmos/dynamicsash.py index 45f3e898..03b2aebf 100644 --- a/wx/lib/gizmos/dynamicsash.py +++ b/wx/lib/gizmos/dynamicsash.py @@ -468,7 +468,7 @@ class _DynamicSashWindowImpl(wx.EvtHandler): def Split(self, px, py): self.m_add_child_target = None - + self.m_child[0] = _DynamicSashWindowImpl(self.m_window) self.m_child[0].m_container = wx.Window(self.m_container) self.m_child[0].m_parent = self @@ -483,15 +483,15 @@ class _DynamicSashWindowImpl(wx.EvtHandler): self.m_child[1].m_parent = self self.m_child[1].m_top = self.m_top self.m_child[1].Create() - + self.m_split = self.m_dragging self.ConstrainChildren(px, py) - + self.m_top.m_add_child_target = self.m_child[1] split = DynamicSashSplitEvent(self.m_child[0].m_leaf.m_child) self.m_child[0].m_leaf._checkPendingChild() self.m_child[0].m_leaf.m_child.GetEventHandler().ProcessEvent(split) - + self.m_child[0].m_leaf.m_vscroll.SetScrollbar(self.m_leaf.m_vscroll.GetThumbPosition(), self.m_leaf.m_vscroll.GetThumbSize(), self.m_leaf.m_vscroll.GetRange(), @@ -510,7 +510,7 @@ class _DynamicSashWindowImpl(wx.EvtHandler): self.m_leaf.m_hscroll.GetPageSize()) self.m_leaf.Destroy() self.m_leaf = None - + self.m_container.Layout() @@ -581,18 +581,18 @@ class _DynamicSashWindowImpl(wx.EvtHandler): h_unify = -1 v_unify = -1 frame = self.FindFrame() - + if x < 0: x = 0 if y < 0: y = 0 - + if h_parent: _, y = self.m_container.ClientToScreen(0, y) _, y = h_parent.m_container.ScreenToClient(0, y) - + py = int((y * 100.0) / h_parent.m_container.GetSize().GetHeight() + 0.5) - + if py < 10: ho_parent = self.FindParent(_DSR_TOP_EDGE) if ho_parent: @@ -604,7 +604,7 @@ class _DynamicSashWindowImpl(wx.EvtHandler): / h_parent.m_container.GetSize().GetHeight() + 0.5) h_parent.m_child[0].m_container.GetConstraints().height.PercentOf( h_parent.m_container, wx.Height, py) - + h_parent = ho_parent h_unify = 0 else: @@ -623,7 +623,7 @@ class _DynamicSashWindowImpl(wx.EvtHandler): py = int((y * 100.0) / (h_parent.m_container.GetSize().GetHeight() + y - self.m_container.GetSize().GetHeight()) + 0.5) - + if py < 10: h_unify = 0 elif y < 64: @@ -636,9 +636,9 @@ class _DynamicSashWindowImpl(wx.EvtHandler): if v_parent: x, _ = self.m_container.ClientToScreen(x, 0) x, _ = v_parent.m_container.ScreenToClient(x, 0) - + px = int((x * 100.0) / v_parent.m_container.GetSize().GetWidth() + 0.5) - + if px < 10: vo_parent = self.FindParent(_DSR_LEFT_EDGE) if vo_parent: @@ -649,7 +649,7 @@ class _DynamicSashWindowImpl(wx.EvtHandler): / v_parent.m_container.GetSize().GetWidth() + 0.5) v_parent.m_child[0].m_container.GetConstraints().width.PercentOf( v_parent.m_container, wx.Width, px) - + v_parent = vo_parent v_unify = 0 else: @@ -668,12 +668,12 @@ class _DynamicSashWindowImpl(wx.EvtHandler): px = int((x * 100.0) / (v_parent.m_container.GetSize().GetWidth() + x - self.m_container.GetSize().GetWidth()) + 0.5) - + if px < 10: v_unify = 0 elif x < 64: do_resize = 0 - + if do_resize: size = frame.GetSize() frame.SetSize(size.GetWidth() + x - self.m_container.GetSize().GetWidth(), size.GetHeight()) @@ -973,7 +973,7 @@ class _DynamicSashWindowLeaf(wx.EvtHandler): sh = size.GetHeight() size = self.m_vscroll.GetSize() sw = size.GetWidth() - + if x >= w - sw - 3 and x < w and y >= h - sh - 3 and y < h: return _DSR_CORNER if x >= 3 and x < 10 and y >= h - sh - 3 and y < h - 2: @@ -988,7 +988,7 @@ class _DynamicSashWindowLeaf(wx.EvtHandler): return _DSR_RIGHT_EDGE if y >= h - 2: return _DSR_BOTTOM_EDGE - + return _DSR_NONE @@ -1002,10 +1002,10 @@ class _DynamicSashWindowLeaf(wx.EvtHandler): if best_size.GetHeight() < size.GetHeight(): best_size.SetHeight(size.GetHeight()) self.m_child.SetSize(best_size) - + hpos = self.m_hscroll.GetThumbPosition() vpos = self.m_vscroll.GetThumbPosition() - + if hpos < 0: hpos = 0 if vpos < 0: @@ -1014,17 +1014,17 @@ class _DynamicSashWindowLeaf(wx.EvtHandler): hpos = best_size.GetWidth() - size.GetWidth() if vpos > best_size.GetHeight() - size.GetHeight(): vpos = best_size.GetHeight() - size.GetHeight() - + self.m_hscroll.SetScrollbar(hpos, size.GetWidth(), best_size.GetWidth(), size.GetWidth()) self.m_vscroll.SetScrollbar(vpos, size.GetHeight(), best_size.GetHeight(), size.GetHeight()) - + # Umm, the scrollbars are doing something insane under GTK+ and subtracting # one from the position I pass in. This works around that. self.m_hscroll.SetThumbPosition(hpos + hpos - self.m_hscroll.GetThumbPosition()) self.m_vscroll.SetThumbPosition(vpos + vpos - self.m_vscroll.GetThumbPosition()) - + pos = self.m_child.GetPosition() self.m_viewport.ScrollWindow(-hpos - pos.x, -vpos - pos.y) @@ -1086,7 +1086,7 @@ class _DynamicSashWindowLeaf(wx.EvtHandler): dc.SetPen(black) dc.DrawLine(w - 4, 3, w - 4, 9) dc.DrawLine(w - 4, 9, w - sw - 3, 9) - + dc.SetPen(highlight) dc.DrawLine(4, h - 5, 4, h - sh - 2) dc.DrawLine(4, h - sh - 2, 8, h - sh - 2) @@ -1136,9 +1136,9 @@ class _DynamicSashWindowLeaf(wx.EvtHandler): def OnMouseMove(self, event): if self.m_impl.m_dragging: return - + region = self.GetRegion(event.x, event.y) - + cursor = wx.Cursor(wx.CURSOR_ARROW) if region == _DSR_HORIZONTAL_TAB: cursor = wx.Cursor(wx.CURSOR_SIZENS) diff --git a/wx/lib/plot/examples/demo.py b/wx/lib/plot/examples/demo.py index 1279642f..222b525d 100644 --- a/wx/lib/plot/examples/demo.py +++ b/wx/lib/plot/examples/demo.py @@ -28,7 +28,7 @@ except ImportError: imported. It probably is not installed (it's not part of the standard Python distribution). See the Numeric Python site (http://numpy.scipy.org) for information on downloading source or - binaries, or just try `pip install numpy` and it will probably + binaries, or just try `pip install numpy` and it will probably work.""" raise ImportError("NumPy not found.\n" + msg) diff --git a/wx/lib/pubsub/examples/multithreadloop.py b/wx/lib/pubsub/examples/multithreadloop.py index 64829151..203accbd 100644 --- a/wx/lib/pubsub/examples/multithreadloop.py +++ b/wx/lib/pubsub/examples/multithreadloop.py @@ -87,7 +87,7 @@ class ParaFunction(threading.Thread): def transferData(self): """Send data from aux thread to main thread. The data was put in self.queue by the aux thread, and this queue is a Queue.Queue which - is a synchronized queue for inter-thread communication. + is a synchronized queue for inter-thread communication. Note: This method must be called from main thread.""" self.transfer += 1 while not self.queue.empty(): From e9f8f7d4df9c823579599a96185594a6c8578fed Mon Sep 17 00:00:00 2001 From: Metallicow Date: Tue, 16 Jan 2018 08:52:28 -0600 Subject: [PATCH 05/14] Trim trailing whitespace docs/sphinx/_downloads/*.py --- .../_downloads/ArtProvider.GetBitmap.1.py | 4 +- docs/sphinx/_downloads/CloseEvent.Veto.1.py | 4 +- docs/sphinx/_downloads/EvtHandler.Bind.1.py | 2 +- .../_downloads/Frame.SetStatusWidths.1.py | 4 +- docs/sphinx/_downloads/MoveEvent.1.py | 16 ++++---- docs/sphinx/_downloads/Notebook.1.py | 10 ++--- docs/sphinx/_downloads/PaintDC.1.py | 8 ++-- docs/sphinx/_downloads/Process.1.py | 2 +- docs/sphinx/_downloads/SplitterWindow.1.py | 4 +- .../_downloads/StatusBar.SetStatusWidths.1.py | 4 +- docs/sphinx/_downloads/TreeCtrl.1.py | 10 ++--- .../_downloads/TreeCtrl.OnCompareItems.1.py | 2 +- docs/sphinx/_downloads/functions.Execute.1.py | 2 +- docs/sphinx/_downloads/i18nwxapp/app_base.py | 24 ++++++------ docs/sphinx/_downloads/i18nwxapp/geni18n.py | 2 +- docs/sphinx/_downloads/i18nwxapp/sampleapp.py | 38 +++++++++---------- 16 files changed, 68 insertions(+), 68 deletions(-) diff --git a/docs/sphinx/_downloads/ArtProvider.GetBitmap.1.py b/docs/sphinx/_downloads/ArtProvider.GetBitmap.1.py index 1b7aea11..d9d140ca 100644 --- a/docs/sphinx/_downloads/ArtProvider.GetBitmap.1.py +++ b/docs/sphinx/_downloads/ArtProvider.GetBitmap.1.py @@ -1,7 +1,7 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample shows how to retrieve default platform's +# This sample shows how to retrieve default platform's # bitmaps using wx.ArtProvider import wx @@ -18,7 +18,7 @@ class BitmapFrame(wx.Frame): bitmap_sizer = wx.BoxSizer(wx.HORIZONTAL) bitmap_sizer.Add((0, 0), 1, wx.EXPAND) - + # Show a few bitmaps retrieved via wx.ArtProvider for kind in [wx.ART_INFORMATION, wx.ART_WARNING, wx.ART_CDROM, wx.ART_CUT]: bmp = wx.ArtProvider.GetBitmap(kind, wx.ART_OTHER, (32, 32)) diff --git a/docs/sphinx/_downloads/CloseEvent.Veto.1.py b/docs/sphinx/_downloads/CloseEvent.Veto.1.py index c7e8cb84..308c317d 100644 --- a/docs/sphinx/_downloads/CloseEvent.Veto.1.py +++ b/docs/sphinx/_downloads/CloseEvent.Veto.1.py @@ -1,7 +1,7 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample makes the main frame "immortal", i.e., non-closable +# This sample makes the main frame "immortal", i.e., non-closable # by the user. The main window can not be close by pressing Alt+F4 # or by clicking on the "X" button in the titlebar @@ -19,7 +19,7 @@ class MainWindow(wx.Frame): self.Show() self.close_attempts = 0 - + def OnClose(self, event): # Veto the event the user can not close the main diff --git a/docs/sphinx/_downloads/EvtHandler.Bind.1.py b/docs/sphinx/_downloads/EvtHandler.Bind.1.py index e9073b4f..eee3493d 100644 --- a/docs/sphinx/_downloads/EvtHandler.Bind.1.py +++ b/docs/sphinx/_downloads/EvtHandler.Bind.1.py @@ -17,7 +17,7 @@ class MainWindow(wx.Frame): self.Show() - + def OnClose(self, event): # This displays a message box asking the user to confirm diff --git a/docs/sphinx/_downloads/Frame.SetStatusWidths.1.py b/docs/sphinx/_downloads/Frame.SetStatusWidths.1.py index fe3ac595..fc828ad2 100644 --- a/docs/sphinx/_downloads/Frame.SetStatusWidths.1.py +++ b/docs/sphinx/_downloads/Frame.SetStatusWidths.1.py @@ -1,8 +1,8 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample shows how to create a wx.StatusBar with 2 fields, -# set the second field to have double width with respect to the +# This sample shows how to create a wx.StatusBar with 2 fields, +# set the second field to have double width with respect to the # first and and display the date of today in the second field. import wx diff --git a/docs/sphinx/_downloads/MoveEvent.1.py b/docs/sphinx/_downloads/MoveEvent.1.py index 3251ae86..40d513ea 100644 --- a/docs/sphinx/_downloads/MoveEvent.1.py +++ b/docs/sphinx/_downloads/MoveEvent.1.py @@ -1,36 +1,36 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample shows how to listen to a move change event for a +# This sample shows how to listen to a move change event for a # top-level window (wx.Frame, wx.Dialog). This is MSW-specific import wx class MovingFrame(wx.Frame): - + def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title) - + wx.StaticText(self, label='x:', pos=(10, 10)) wx.StaticText(self, label='y:', pos=(10, 30)) - + self.st1 = wx.StaticText(self, label='', pos=(30, 10)) self.st2 = wx.StaticText(self, label='', pos=(30, 30)) self.Bind(wx.EVT_MOVE, self.OnMove) - self.Show() - + self.Show() + def OnMove(self, event): - + # Capture the mouse position (in screen coordinates) and # assign its x, y values to the statictexts x, y = event.GetPosition() self.st1.SetLabel('%d'%x) self.st2.SetLabel('%d'%y) - + app = wx.App(False) frame = MovingFrame(None, 'MoveEvent example') app.MainLoop() diff --git a/docs/sphinx/_downloads/Notebook.1.py b/docs/sphinx/_downloads/Notebook.1.py index e8e37507..2c96a0c6 100644 --- a/docs/sphinx/_downloads/Notebook.1.py +++ b/docs/sphinx/_downloads/Notebook.1.py @@ -14,7 +14,7 @@ class NotebookFrame(wx.Frame): wx.Frame.__init__(self, parent, title=title) - # Create the notebook + # Create the notebook self.notebook = wx.Notebook(self, style=wx.NB_BOTTOM) # Setting up the menu @@ -30,7 +30,7 @@ class NotebookFrame(wx.Frame): # Adding the 'file_menu' to the menu bar menu_bar.Append(file_menu, '&File') - + # Adding the menu bar to the frame content self.SetMenuBar(menu_bar) @@ -42,11 +42,11 @@ class NotebookFrame(wx.Frame): # This is how you pre-establish a file filter so that the dialog # only shows the extension(s) you want it to. wildcard = 'Python source (*.py)|*.py' - - dlg = wx.FileDialog(None, message="Choose a Python file", defaultDir=os.getcwd(), + + dlg = wx.FileDialog(None, message="Choose a Python file", defaultDir=os.getcwd(), defaultFile="", wildcard=wildcard, style=wx.FD_OPEN) - # Show the dialog and retrieve the user response. If it is the OK response, + # Show the dialog and retrieve the user response. If it is the OK response, # process the data. if dlg.ShowModal() == wx.ID_OK: # This returns the file that was selected diff --git a/docs/sphinx/_downloads/PaintDC.1.py b/docs/sphinx/_downloads/PaintDC.1.py index 2833c4d5..1e9ac64e 100644 --- a/docs/sphinx/_downloads/PaintDC.1.py +++ b/docs/sphinx/_downloads/PaintDC.1.py @@ -21,16 +21,16 @@ class PaintFrame(wx.Frame): def OnPaint(self, event): - dc = wx.PaintDC(self) + dc = wx.PaintDC(self) w, h = self.GetClientSize() # Use a blue pen, for example... dc.SetPen(wx.Pen('BLUE')) - + # Remember the signature of wx.DC.DrawLine: # DrawLine(x1, y1, x2, y2) - + for i in range(100): x1 = random.randint(1, w-1) y1 = random.randint(1, h-1) @@ -38,7 +38,7 @@ class PaintFrame(wx.Frame): y2 = random.randint(1, h-1) dc.DrawLine(x1, y1, x2, y2) - + app = wx.App(False) frame = PaintFrame(None, 'PaintDC example') app.MainLoop() \ No newline at end of file diff --git a/docs/sphinx/_downloads/Process.1.py b/docs/sphinx/_downloads/Process.1.py index bc24996a..0903a6f8 100644 --- a/docs/sphinx/_downloads/Process.1.py +++ b/docs/sphinx/_downloads/Process.1.py @@ -26,7 +26,7 @@ class ProcessFrame(wx.Frame): self.Bind(wx.EVT_IDLE, self.OnIdle) self.Bind(wx.EVT_END_PROCESS, self.OnProcessEnded) - + def OnButton(self, event): self.btn.Enable(False) self.label.SetValue('') diff --git a/docs/sphinx/_downloads/SplitterWindow.1.py b/docs/sphinx/_downloads/SplitterWindow.1.py index b24dc057..575b6571 100644 --- a/docs/sphinx/_downloads/SplitterWindow.1.py +++ b/docs/sphinx/_downloads/SplitterWindow.1.py @@ -15,7 +15,7 @@ class SplitterFrame(wx.Frame): # Create the main splitter window (to be split vertically) splitter = wx.SplitterWindow(self, -1, style=wx.SP_LIVE_UPDATE) splitter.SetMinimumPaneSize(100) - + panel1 = wx.Panel(splitter, -1) static = wx.StaticText(panel1, -1, 'Hello World', pos=(10, 100)) @@ -24,7 +24,7 @@ class SplitterFrame(wx.Frame): # Create the second splitter window (to be split horizontally) splitter2 = wx.SplitterWindow(splitter, -1, style=wx.SP_LIVE_UPDATE) splitter2.SetMinimumPaneSize(100) - + panel2 = wx.Panel(splitter2, -1) panel2.SetBackgroundColour(wx.BLUE) diff --git a/docs/sphinx/_downloads/StatusBar.SetStatusWidths.1.py b/docs/sphinx/_downloads/StatusBar.SetStatusWidths.1.py index fe3ac595..fc828ad2 100644 --- a/docs/sphinx/_downloads/StatusBar.SetStatusWidths.1.py +++ b/docs/sphinx/_downloads/StatusBar.SetStatusWidths.1.py @@ -1,8 +1,8 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample shows how to create a wx.StatusBar with 2 fields, -# set the second field to have double width with respect to the +# This sample shows how to create a wx.StatusBar with 2 fields, +# set the second field to have double width with respect to the # first and and display the date of today in the second field. import wx diff --git a/docs/sphinx/_downloads/TreeCtrl.1.py b/docs/sphinx/_downloads/TreeCtrl.1.py index a5dc6658..cc06bb08 100644 --- a/docs/sphinx/_downloads/TreeCtrl.1.py +++ b/docs/sphinx/_downloads/TreeCtrl.1.py @@ -1,10 +1,10 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample classifies the Python keywords alphabetically, using the -# first letter of the keyword (i.e., ``and`` goes into ``a``, ``for`` +# This sample classifies the Python keywords alphabetically, using the +# first letter of the keyword (i.e., ``and`` goes into ``a``, ``for`` # goes into ``f`` and so on): -# +# # * For each letter, adds a child to the treectrl root # * In each child of the root item, adds its corresponding keyword(s) # @@ -27,7 +27,7 @@ class TreeFrame(wx.Frame): root = tree_ctrl.AddRoot('Python keywords') letters = [] - + for kwd in keyword.kwlist: first = kwd[0] if first not in letters: @@ -39,7 +39,7 @@ class TreeFrame(wx.Frame): first = kwd[0] if first == letter: sub_item = tree_ctrl.AppendItem(item, kwd) - + tree_ctrl.ExpandAll() self.Centre() diff --git a/docs/sphinx/_downloads/TreeCtrl.OnCompareItems.1.py b/docs/sphinx/_downloads/TreeCtrl.OnCompareItems.1.py index 31d7fdba..5d13dd76 100644 --- a/docs/sphinx/_downloads/TreeCtrl.OnCompareItems.1.py +++ b/docs/sphinx/_downloads/TreeCtrl.OnCompareItems.1.py @@ -6,7 +6,7 @@ def OnCompareItems(self, item1, item2): """Changes the sort order of the items in the tree control. """ - + t1 = self.GetItemText(item1) t2 = self.GetItemText(item2) diff --git a/docs/sphinx/_downloads/functions.Execute.1.py b/docs/sphinx/_downloads/functions.Execute.1.py index bc24996a..0903a6f8 100644 --- a/docs/sphinx/_downloads/functions.Execute.1.py +++ b/docs/sphinx/_downloads/functions.Execute.1.py @@ -26,7 +26,7 @@ class ProcessFrame(wx.Frame): self.Bind(wx.EVT_IDLE, self.OnIdle) self.Bind(wx.EVT_END_PROCESS, self.OnProcessEnded) - + def OnButton(self, event): self.btn.Enable(False) self.label.SetValue('') diff --git a/docs/sphinx/_downloads/i18nwxapp/app_base.py b/docs/sphinx/_downloads/i18nwxapp/app_base.py index 270c5595..9599bb29 100644 --- a/docs/sphinx/_downloads/i18nwxapp/app_base.py +++ b/docs/sphinx/_downloads/i18nwxapp/app_base.py @@ -3,7 +3,7 @@ # Author: Werner F. Bruhin # Purpose: how to I18N enable an application # -# Inspired by the I18N wxPython demo and the Internationalization page on +# Inspired by the I18N wxPython demo and the Internationalization page on # the wxPython wiki. # @@ -34,11 +34,11 @@ class BaseApp(wx.App, InspectionMixin): self.Init() # InspectionMixin # work around for Python stealing "_" sys.displayhook = _displayHook - + self.appName = "I18N sample application" - + self.doConfig() - + self.locale = None wx.Locale.AddCatalogLookupPathPrefix('locale') self.updateLanguage(self.appConfig.Read(u"Language")) @@ -62,40 +62,40 @@ class BaseApp(wx.App, InspectionMixin): vendorName=u'who you wish', localFilename=os.path.join( self.configLoc, "AppConfig")) - + if not self.appConfig.HasEntry(u'Language'): # on first run we default to German self.appConfig.Write(key=u'Language', value=u'de') - + self.appConfig.Flush() def updateLanguage(self, lang): """ Update the language to the requested one. - + Make *sure* any existing locale is deleted before the new one is created. The old C++ object needs to be deleted before the new one is created, and if we just assign a new instance to the old Python variable, the old C++ locale will not be destroyed soon enough, likely causing a crash. - + :param string `lang`: one of the supported language codes - + """ # if an unsupported language is requested default to English if lang in appC.supLang: selLang = appC.supLang[lang] else: selLang = wx.LANGUAGE_ENGLISH - + if self.locale: assert sys.getrefcount(self.locale) <= 2 del self.locale - + # create a locale object for this language self.locale = wx.Locale(selLang) if self.locale.IsOk(): self.locale.AddCatalog(appC.langDomain) else: self.locale = None - + diff --git a/docs/sphinx/_downloads/i18nwxapp/geni18n.py b/docs/sphinx/_downloads/i18nwxapp/geni18n.py index f7d6ab0b..031de25e 100644 --- a/docs/sphinx/_downloads/i18nwxapp/geni18n.py +++ b/docs/sphinx/_downloads/i18nwxapp/geni18n.py @@ -58,7 +58,7 @@ for tLang in supportedLang: langDir = os.path.join(appFolder, ('locale\%s\LC_MESSAGES' % tLang)) poFile = os.path.join(langDir, appC.langDomain + '.po') tCmd = pyExe + ' ' + pyMsgfmt + ' ' + poFile - + print "Generating the .mo file" print "cmd: %s" % tCmd rCode = subprocess.call(tCmd) diff --git a/docs/sphinx/_downloads/i18nwxapp/sampleapp.py b/docs/sphinx/_downloads/i18nwxapp/sampleapp.py index dc97e209..8e7bc39f 100644 --- a/docs/sphinx/_downloads/i18nwxapp/sampleapp.py +++ b/docs/sphinx/_downloads/i18nwxapp/sampleapp.py @@ -15,13 +15,13 @@ class AppI18N(sc.SizedFrame): """ super(AppI18N, self).__init__(parent, **kwds) self.SetTitle(_(u"The I18N sample application")) - + self.createMenu() self.createOtherCtrls() - + def createMenu(self): menubar = wx.MenuBar() - + # file menu fileMenu = wx.Menu() closeMenuItem = fileMenu.Append(wx.NewId(), @@ -29,16 +29,16 @@ class AppI18N(sc.SizedFrame): _(u"Close the application")) self.Bind(wx.EVT_MENU, self.onClose, closeMenuItem) menubar.Append(fileMenu, _(u"&File")) - + # edit menu manageMenu = wx.Menu() manageSomethingMenuItem = manageMenu.Append(wx.NewId(), _(u"Edit something"), _(u"Edit an entry of something")) self.Bind(wx.EVT_MENU, self.doEditSomething, manageSomethingMenuItem) - + menubar.Append(manageMenu, _(u"&Edit")) - + # help menu helpMenu = wx.Menu() aboutMenuItem = helpMenu.Append(wx.NewId(), @@ -46,59 +46,59 @@ class AppI18N(sc.SizedFrame): _(u"About the program")) self.Bind(wx.EVT_MENU, self.doAboutBox, aboutMenuItem) menubar.Append(helpMenu, _(u"&Help")) - + self.SetMenuBar(menubar) - + def createOtherCtrls(self): pane = self.GetContentsPane() - + cPane = sc.SizedPanel(pane) cPane.SetSizerType("grid", options={"cols": 2}) st = wx.StaticText(cPane, wx.ID_ANY, _(u"A nice label for the TextCtrl")) st.SetSizerProps(valign='center') tc = wx.TextCtrl(cPane, wx.ID_ANY) - + searchSt = wx.StaticText(cPane, wx.ID_ANY, _(u"a search control")) searchSt.SetSizerProps(valign='center') searchC = wx.SearchCtrl(cPane, wx.ID_ANY) - + sline = wx.StaticLine(pane, wx.ID_ANY) sline.SetSizerProps(expand=True) bPane = sc.SizedPanel(pane) fB = wx.Button(bPane, wx.ID_ANY, _(u"Open a file dialog")) fB.SetSizerProps(align="center") fB.Bind(wx.EVT_BUTTON, self.onFbButton) - + def onFbButton(self, event): wildcard = "Python source (*.py)|*.py|" \ "Compiled Python (*.pyc)|*.pyc|" \ "SPAM files (*.spam)|*.spam|" \ "Egg file (*.egg)|*.egg|" \ "All files (*.*)|*.*" - + with wx.FileDialog( self, message=_(u"Choose a file"), - defaultDir=os.getcwd(), + defaultDir=os.getcwd(), defaultFile="", wildcard=wildcard, style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR ) as dlg: - # Show the dialog and retrieve the user response. If it is the - # OK response, + # Show the dialog and retrieve the user response. If it is the + # OK response, # process the data. if dlg.ShowModal() == wx.ID_OK: # This returns a Python list of files that were selected. paths = dlg.GetPaths() - + def onClose(self, event): event.Skip() - + def doEditSomething(self, event): event.Skip() - + def doAboutBox(self, event): event.Skip() From 1257f421899427a922d86254ec0c5b6e29aeef51 Mon Sep 17 00:00:00 2001 From: Metallicow Date: Tue, 16 Jan 2018 09:02:20 -0600 Subject: [PATCH 06/14] :interrobang: Trim trailing whitespace docs/sphinx/rest_substitutions/*.py :interrobang: Not sure if the generated .rst stuff is intended to have whitespace like this in it or not, so seperating this from the other commits, so easy to revert if necessary. --- .../python/contrib/ArtProvider.GetBitmap.1.py | 4 +- .../python/contrib/CloseEvent.Veto.1.py | 4 +- .../python/contrib/EvtHandler.Bind.1.py | 2 +- .../python/contrib/Frame.SetStatusWidths.1.py | 4 +- .../snippets/python/contrib/MoveEvent.1.py | 16 ++++---- .../snippets/python/contrib/Notebook.1.py | 10 ++--- .../snippets/python/contrib/PaintDC.1.py | 8 ++-- .../snippets/python/contrib/Process.1.py | 2 +- .../python/contrib/SplitterWindow.1.py | 4 +- .../contrib/StatusBar.SetStatusWidths.1.py | 4 +- .../snippets/python/contrib/TreeCtrl.1.py | 10 ++--- .../contrib/TreeCtrl.OnCompareItems.1.py | 2 +- .../python/contrib/functions.Execute.1.py | 2 +- .../python/converted/wx.AcceleratorTable.1.py | 2 +- .../converted/wx.AffineMatrix2D.Concat.1.py | 2 +- .../converted/wx.AffineMatrix2D.Invert.1.py | 2 +- .../converted/wx.AffineMatrix2D.Rotate.1.py | 2 +- .../converted/wx.AffineMatrix2D.Scale.1.py | 2 +- .../wx.AffineMatrix2D.TransformDistance.1.py | 2 +- .../wx.AffineMatrix2D.TransformDistance.2.py | 2 +- .../wx.AffineMatrix2D.TransformPoint.1.py | 2 +- .../wx.AffineMatrix2D.TransformPoint.2.py | 2 +- .../wx.AffineMatrix2D.Translate.1.py | 2 +- .../wx.AffineMatrix2DBase.Concat.1.py | 2 +- .../wx.AffineMatrix2DBase.Invert.1.py | 2 +- .../python/converted/wx.App.SetTopWindow.1.py | 4 +- .../converted/wx.AppConsole.SetCLocale.1.py | 2 +- .../python/converted/wx.ArtProvider.1.py | 8 ++-- .../python/converted/wx.ArtProvider.2.py | 2 +- .../converted/wx.Bitmap.NewFromPNGData.2.py | 2 +- .../python/converted/wx.Bitmap.__init__.1.py | 2 +- .../converted/wx.BoxSizer.AddSpacer.1.py | 10 ++--- .../python/converted/wx.BusyCursor.1.py | 6 +-- .../python/converted/wx.BusyInfo.1.py | 4 +- .../python/converted/wx.BusyInfo.2.py | 8 ++-- .../python/converted/wx.CloseEvent.1.py | 12 +++--- .../python/converted/wx.CollapsiblePane.1.py | 6 +-- .../python/converted/wx.ComboCtrl.1.py | 9 ++--- .../python/converted/wx.ComboCtrl.2.py | 8 ++-- .../wx.ComboCtrl.SetTextCtrlStyle.1.py | 6 +-- .../python/converted/wx.ConfigBase.1.py | 9 ++--- .../python/converted/wx.ConfigBase.2.py | 14 +++---- .../python/converted/wx.ConfigBase.3.py | 10 ++--- .../python/converted/wx.ConfigBase.4.py | 8 ++-- .../python/converted/wx.ConfigBase.5.py | 18 ++++----- .../converted/wx.ConfigPathChanger.1.py | 14 +++---- .../wx.ConfigPathChanger.__init__.1.py | 2 +- .../wx.ConfigPathChanger.__init__.2.py | 2 +- .../python/converted/wx.ContextHelp.1.py | 2 +- .../wx.Control.GetSizeFromTextSize.1.py | 4 +- .../wx.Control.GetSizeFromTextSize.2.py | 4 +- .../converted/wx.Control.SetLabelMarkup.1.py | 4 +- .../snippets/python/converted/wx.Cursor.1.py | 14 +++---- .../python/converted/wx.Cursor.__init__.1.py | 2 +- .../python/converted/wx.DCClipper.1.py | 12 +++--- .../converted/wx.DataObjectComposite.1.py | 8 ++-- .../wx.DateTime.ConvertYearToBC.1.py | 2 +- .../python/converted/wx.DateTime.Now.1.py | 2 +- .../converted/wx.DateTime.SetTimeT.1.py | 4 +- .../python/converted/wx.DirDialog.1.py | 4 +- .../python/converted/wx.Event.Clone.1.py | 4 +- .../python/converted/wx.EventBlocker.1.py | 8 ++-- .../python/converted/wx.EventFilter.1.py | 36 +++++++++--------- .../converted/wx.EventLoopActivator.1.py | 10 ++--- .../converted/wx.EventLoopBase.Dispatch.1.py | 2 +- .../converted/wx.EvtHandler.QueueEvent.1.py | 10 ++--- .../converted/wx.EvtHandler.QueueEvent.2.py | 8 ++-- .../wx.EvtHandler.SetNextHandler.1.py | 2 +- .../converted/wx.EvtHandler.TryAfter.1.py | 8 ++-- .../converted/wx.EvtHandler.TryBefore.1.py | 8 ++-- .../python/converted/wx.FSFile.__init__.1.py | 8 ++-- .../python/converted/wx.FileDialog.3.py | 2 +- .../converted/wx.FileSystem.AddHandler.1.py | 2 +- .../converted/wx.FileSystem.ChangePathTo.1.py | 2 +- .../converted/wx.FileSystem.ChangePathTo.2.py | 2 +- .../wx.FileSystemHandler.CanOpen.1.py | 6 +-- .../wx.FileSystemHandler.GetAnchor.1.py | 6 +-- .../wx.FileSystemHandler.GetLeftLocation.1.py | 4 +- .../wx.FileSystemHandler.GetProtocol.1.py | 2 +- ...wx.FileSystemHandler.GetRightLocation.1.py | 2 +- .../python/converted/wx.FileType.1.py | 4 +- .../python/converted/wx.FileType.2.py | 8 ++-- .../python/converted/wx.FontInfo.1.py | 2 +- .../python/converted/wx.FontMapper.1.py | 4 +- .../snippets/python/converted/wx.Frame.1.py | 2 +- .../python/converted/wx.GraphicsContext.1.py | 16 ++++---- .../python/converted/wx.GraphicsRenderer.1.py | 2 +- .../converted/wx.HeaderColumnSimple.1.py | 2 +- .../wx.HeaderCtrl.AddColumnsItems.1.py | 6 +-- .../converted/wx.HeaderCtrl.Create.1.py | 4 +- .../wx.HeaderCtrl.UpdateColumnWidthToFit.1.py | 18 ++++----- .../wx.HeaderCtrlSimple.HideColumn.1.py | 4 +- .../wx.HelpControllerBase.SetViewer.1.py | 2 +- .../converted/wx.IconBundle.GetIcon.1.py | 4 +- .../python/converted/wx.Image.AddHandler.1.py | 2 +- .../converted/wx.Image.ComputeHistogram.1.py | 6 +-- .../wx.Image.GetImageExtWildcard.1.py | 2 +- .../python/converted/wx.Image.LoadFile.1.py | 2 +- .../python/converted/wx.Image.LoadFile.2.py | 2 +- .../python/converted/wx.Image.SaveFile.1.py | 2 +- .../python/converted/wx.Image.SaveFile.2.py | 2 +- .../python/converted/wx.Image.Scale.1.py | 10 ++--- .../python/converted/wx.Image.__init__.1.py | 2 +- .../snippets/python/converted/wx.InfoBar.1.py | 18 ++++----- .../converted/wx.KeyEvent.GetKeyCode.1.py | 20 +++++----- .../wx.KeyboardState.GetModifiers.1.py | 4 +- .../wx.KeyboardState.GetModifiers.2.py | 2 +- .../converted/wx.ListCtrl.GetNextItem.1.py | 10 ++--- .../wx.ListCtrl.SetColumnsOrder.1.py | 6 +-- .../converted/wx.ListCtrl.SetItemState.1.py | 2 +- .../converted/wx.ListCtrl.SetItemState.2.py | 2 +- .../converted/wx.ListCtrl.SortItems.1.py | 4 +- .../python/converted/wx.Log.LogRecord.1.py | 8 ++-- .../converted/wx.Log.SetComponentLevel.1.py | 2 +- .../python/converted/wx.LogChain.1.py | 6 +-- .../python/converted/wx.LogFormatter.1.py | 6 +-- .../python/converted/wx.LogFormatter.2.py | 2 +- .../snippets/python/converted/wx.LogNull.1.py | 2 +- .../snippets/python/converted/wx.LogNull.2.py | 2 +- .../wx.MDIParentFrame.OnCreateClient.1.py | 2 +- .../python/converted/wx.MemoryDC.1.py | 4 +- .../python/converted/wx.MemoryDC.2.py | 2 +- .../python/converted/wx.MemoryFSHandler.1.py | 14 +++---- .../python/converted/wx.Menu.Append.1.py | 2 +- .../python/converted/wx.Menu.Append.2.py | 2 +- .../python/converted/wx.Menu.Append.3.py | 2 +- .../python/converted/wx.Menu.Append.4.py | 2 +- .../converted/wx.MenuItem.GetLabelText.1.py | 2 +- .../converted/wx.MenuItem.SetItemLabel.1.py | 2 +- .../converted/wx.MenuItem.__init__.1.py | 6 +-- .../wx.MessageDialog.SetYesNoLabels.1.py | 2 +- .../wx.MessageDialog.SetYesNoLabels.2.py | 2 +- .../python/converted/wx.ModalDialogHook.1.py | 37 +++++++++---------- .../converted/wx.NonOwnedWindow.SetShape.1.py | 4 +- .../python/converted/wx.Notebook.1.py | 2 +- .../python/converted/wx.Notebook.2.py | 8 ++-- .../python/converted/wx.PaintEvent.1.py | 6 +-- .../python/converted/wx.PaintEvent.2.py | 10 ++--- .../wx.PickerBase.GetPickerCtrl.1.py | 6 +-- .../converted/wx.PlatformInformation.1.py | 2 +- .../converted/wx.Point.SetDefaults.1.py | 4 +- .../python/converted/wx.Point.__init__.1.py | 4 +- .../python/converted/wx.RearrangeDialog.1.py | 4 +- .../wx.RearrangeDialog.AddExtraControls.1.py | 6 +-- .../python/converted/wx.RearrangeList.1.py | 2 +- .../converted/wx.RichMessageDialog.1.py | 8 ++-- .../converted/wx.ScrollBar.SetScrollbar.1.py | 2 +- .../converted/wx.Scrolled.DoPrepareDC.1.py | 12 +++--- .../converted/wx.Scrolled.SetScrollbars.1.py | 2 +- .../python/converted/wx.SearchCtrl.1.py | 4 +- .../converted/wx.SingleInstanceChecker.1.py | 8 ++-- .../python/converted/wx.Size.SetDefaults.1.py | 6 +-- .../python/converted/wx.Sizer.AddSpacer.1.py | 2 +- .../converted/wx.Sizer.AddStretchSpacer.1.py | 2 +- .../python/converted/wx.SizerFlags.1.py | 2 +- .../python/converted/wx.SizerFlags.2.py | 2 +- .../python/converted/wx.SizerFlags.3.py | 4 +- .../wx.StandardPaths.MSWGetShellDir.1.py | 4 +- .../wx.StandardPaths.UseAppInfo.1.py | 4 +- .../python/converted/wx.StaticBox.1.py | 8 ++-- .../python/converted/wx.StaticBox.2.py | 6 +-- .../python/converted/wx.StaticBoxSizer.1.py | 8 ++-- .../python/converted/wx.StopWatch.1.py | 2 +- .../converted/wx.TextCompleterSimple.1.py | 22 +++++------ .../python/converted/wx.TextCtrl.1.py | 2 +- .../python/converted/wx.TextCtrl.2.py | 2 +- .../python/converted/wx.TextCtrl.3.py | 2 +- .../python/converted/wx.TextCtrl.4.py | 2 +- .../python/converted/wx.TextCtrl.5.py | 2 +- .../wx.TextEntry.GetInsertionPoint.1.py | 8 ++-- .../converted/wx.TextUrlEvent.Clone.1.py | 6 +-- .../python/converted/wx.TimerEvent.1.py | 16 ++++---- .../snippets/python/converted/wx.ToolBar.1.py | 2 +- .../snippets/python/converted/wx.ToolBar.2.py | 2 +- .../python/converted/wx.Trackable.1.py | 2 +- .../python/converted/wx.URLDataObject.1.py | 2 +- .../wx.VListBox.GetFirstSelected.1.py | 4 +- .../converted/wx.Validator.SetWindow.1.py | 2 +- .../wx.Window.ConvertDialogToPixels.1.py | 2 +- .../converted/wx.Window.DoUpdateWindowUI.1.py | 12 +++--- .../python/converted/wx.Window.Fit.1.py | 2 +- .../wx.Window.HandleWindowEvent.1.py | 2 +- .../python/converted/wx.Window.Move.1.py | 2 +- .../python/converted/wx.Window.Move.2.py | 2 +- .../python/converted/wx.Window.Move.3.py | 2 +- .../converted/wx.Window.ProcessEvent.1.py | 4 +- .../wx.Window.ProcessWindowEvent.1.py | 2 +- .../converted/wx.Window.PushEventHandler.1.py | 2 +- .../wx.Window.SetBackgroundStyle.1.py | 12 +++--- .../converted/wx.Window.SetMaxClientSize.1.py | 2 +- .../converted/wx.Window.SetMinClientSize.1.py | 2 +- .../converted/wx.Window.SetScrollbar.1.py | 2 +- .../converted/wx.Window.UpdateWindowUI.1.py | 6 +-- .../wx.WindowModalDialogEvent.Clone.1.py | 4 +- .../converted/wx.adv.AboutDialogInfo.1.py | 8 ++-- .../python/converted/wx.adv.BannerWindow.1.py | 2 +- .../python/converted/wx.adv.RichToolTip.1.py | 2 +- .../python/converted/wx.adv.Sound.Play.1.py | 2 +- .../converted/wx.adv.Sound.PlaySound.1.py | 2 +- .../python/converted/wx.adv.SplashScreen.1.py | 2 +- .../wx.adv.TreeListCtrl.GetNextItem.1.py | 4 +- .../wx.adv.WizardPageSimple.Chain.1.py | 4 +- .../wx.adv.WizardPageSimple.Chain.2.py | 2 +- .../wx.adv.WizardPageSimple.Chain.3.py | 4 +- .../converted/wx.adv.functions.AboutBox.1.py | 8 ++-- .../python/converted/wx.aui.AuiManager.1.py | 2 +- .../python/converted/wx.aui.AuiManager.2.py | 2 +- ...taViewCustomRenderer.CreateEditorCtrl.1.py | 4 +- ...CustomRenderer.GetValueFromEditorCtrl.1.py | 4 +- .../wx.dataview.DataViewListCtrl.1.py | 8 ++-- .../converted/wx.dataview.DataViewModel.1.py | 4 +- .../converted/wx.dataview.DataViewModel.2.py | 4 +- ...iew.DataViewRenderer.DisableEllipsize.1.py | 4 +- .../wx.dataview.TreeListCtrl.GetNextItem.1.py | 2 +- .../converted/wx.functions.DirSelector.1.py | 4 +- .../converted/wx.functions.FileSelector.1.py | 2 +- .../converted/wx.functions.FileSelector.2.py | 6 +-- .../python/converted/wx.functions.Kill.1.py | 16 ++++---- .../python/converted/wx.functions.Kill.2.py | 6 +-- .../converted/wx.functions.MessageBox.1.py | 2 +- .../converted/wx.grid.Grid.GetCellSize.1.py | 2 +- .../converted/wx.grid.Grid.GetCellSize.2.py | 2 +- .../wx.grid.Grid.GetRowGridLinePen.1.py | 4 +- ...d.GridCellAttr.GetNonDefaultAlignment.1.py | 2 +- .../converted/wx.grid.GridUpdateLocker.1.py | 8 ++-- .../wx.html.HtmlCell.AdjustPagebreak.1.py | 2 +- .../converted/wx.html.HtmlCell.Draw.1.py | 4 +- .../wx.html.HtmlCell.DrawInvisible.1.py | 2 +- ....html.HtmlContainerCell.SetWidthFloat.1.py | 4 +- ....html.HtmlContainerCell.SetWidthFloat.2.py | 4 +- .../converted/wx.html.HtmlFilter.CanRead.1.py | 6 +-- .../wx.html.HtmlFilter.ReadFile.1.py | 4 +- .../wx.html.HtmlHelpController.AddBook.1.py | 2 +- .../wx.html.HtmlHelpController.AddBook.2.py | 2 +- .../converted/wx.html.HtmlModalHelp.1.py | 2 +- .../converted/wx.html.HtmlParser.GetFS.1.py | 2 +- .../wx.html.HtmlParser.PushTagHandler.1.py | 4 +- .../wx.html.HtmlParser.PushTagHandler.2.py | 4 +- .../wx.html.HtmlTag.GetBeginPos.1.py | 2 +- .../converted/wx.html.HtmlTag.GetEndPos1.1.py | 2 +- .../converted/wx.html.HtmlTag.GetEndPos2.1.py | 2 +- .../converted/wx.html.HtmlTag.GetParam.1.py | 4 +- .../converted/wx.html.HtmlTag.HasEnding.1.py | 2 +- .../wx.html.HtmlTagHandler.HandleTag.1.py | 4 +- .../wx.html.HtmlTagHandler.ParseInner.1.py | 2 +- .../wx.html.HtmlWinParser.GetContainer.1.py | 2 +- .../converted/wx.html.HtmlWindow.SetPage.1.py | 2 +- .../python/converted/wx.media.MediaCtrl.1.py | 6 +-- .../wx.msw.Metafile.SetClipboard.1.py | 4 +- ...x.propgrid.DirProperty.DoGetValidator.1.py | 6 +-- ....propgrid.FileProperty.DoGetValidator.1.py | 2 +- ...x.propgrid.FlagsProperty.ChildChanged.1.py | 2 +- ...propgrid.FloatProperty.DoGetValidator.1.py | 2 +- .../converted/wx.propgrid.PGEditor.1.py | 2 +- .../converted/wx.propgrid.PGProperty.1.py | 2 +- .../converted/wx.propgrid.PGProperty.3.py | 2 +- ...wx.propgrid.PGProperty.DoGetValidator.1.py | 2 +- ...x.propgrid.PGProperty.SetDefaultValue.1.py | 2 +- ...ropgrid.PropertyGrid.AddActionTrigger.1.py | 2 +- ...propgrid.PropertyGridInterface.Insert.1.py | 8 ++-- ...propgrid.PropertyGridInterface.Insert.2.py | 8 ++-- ...PropertyGridInterface.ReplaceProperty.1.py | 2 +- .../wx.propgrid.PropertyGridManager.1.py | 8 ++-- ....propgrid.UIntProperty.DoGetValidator.1.py | 2 +- .../wx.richtext.RichTextEvent.Clone.1.py | 6 +-- .../wx.richtext.RichTextFormattingDialog.1.py | 4 +- ...ichTextHTMLHandler.SetFontSizeMapping.1.py | 4 +- .../wx.richtext.SymbolPickerDialog.1.py | 26 ++++++------- ....stc.StyledTextCtrl.GetInsertionPoint.1.py | 8 ++-- .../python/converted/wx.xml.XmlDocument.1.py | 4 +- .../python/converted/wx.xml.XmlDocument.2.py | 4 +- .../python/converted/wx.xml.XmlDocument.3.py | 2 +- .../wx.xml.XmlNode.GetNodeContent.1.py | 2 +- .../wx.xml.XmlNode.GetNodeContent.2.py | 2 +- .../converted/wx.xrc.XmlResource.Load.1.py | 2 +- .../wx.xrc.XmlResource.LoadDialog.1.py | 2 +- 276 files changed, 669 insertions(+), 672 deletions(-) diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/ArtProvider.GetBitmap.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/ArtProvider.GetBitmap.1.py index 1b7aea11..d9d140ca 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/ArtProvider.GetBitmap.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/ArtProvider.GetBitmap.1.py @@ -1,7 +1,7 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample shows how to retrieve default platform's +# This sample shows how to retrieve default platform's # bitmaps using wx.ArtProvider import wx @@ -18,7 +18,7 @@ class BitmapFrame(wx.Frame): bitmap_sizer = wx.BoxSizer(wx.HORIZONTAL) bitmap_sizer.Add((0, 0), 1, wx.EXPAND) - + # Show a few bitmaps retrieved via wx.ArtProvider for kind in [wx.ART_INFORMATION, wx.ART_WARNING, wx.ART_CDROM, wx.ART_CUT]: bmp = wx.ArtProvider.GetBitmap(kind, wx.ART_OTHER, (32, 32)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/CloseEvent.Veto.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/CloseEvent.Veto.1.py index c7e8cb84..308c317d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/CloseEvent.Veto.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/CloseEvent.Veto.1.py @@ -1,7 +1,7 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample makes the main frame "immortal", i.e., non-closable +# This sample makes the main frame "immortal", i.e., non-closable # by the user. The main window can not be close by pressing Alt+F4 # or by clicking on the "X" button in the titlebar @@ -19,7 +19,7 @@ class MainWindow(wx.Frame): self.Show() self.close_attempts = 0 - + def OnClose(self, event): # Veto the event the user can not close the main diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/EvtHandler.Bind.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/EvtHandler.Bind.1.py index e9073b4f..eee3493d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/EvtHandler.Bind.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/EvtHandler.Bind.1.py @@ -17,7 +17,7 @@ class MainWindow(wx.Frame): self.Show() - + def OnClose(self, event): # This displays a message box asking the user to confirm diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/Frame.SetStatusWidths.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/Frame.SetStatusWidths.1.py index fe3ac595..fc828ad2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/Frame.SetStatusWidths.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/Frame.SetStatusWidths.1.py @@ -1,8 +1,8 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample shows how to create a wx.StatusBar with 2 fields, -# set the second field to have double width with respect to the +# This sample shows how to create a wx.StatusBar with 2 fields, +# set the second field to have double width with respect to the # first and and display the date of today in the second field. import wx diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/MoveEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/MoveEvent.1.py index 3251ae86..40d513ea 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/MoveEvent.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/MoveEvent.1.py @@ -1,36 +1,36 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample shows how to listen to a move change event for a +# This sample shows how to listen to a move change event for a # top-level window (wx.Frame, wx.Dialog). This is MSW-specific import wx class MovingFrame(wx.Frame): - + def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title) - + wx.StaticText(self, label='x:', pos=(10, 10)) wx.StaticText(self, label='y:', pos=(10, 30)) - + self.st1 = wx.StaticText(self, label='', pos=(30, 10)) self.st2 = wx.StaticText(self, label='', pos=(30, 30)) self.Bind(wx.EVT_MOVE, self.OnMove) - self.Show() - + self.Show() + def OnMove(self, event): - + # Capture the mouse position (in screen coordinates) and # assign its x, y values to the statictexts x, y = event.GetPosition() self.st1.SetLabel('%d'%x) self.st2.SetLabel('%d'%y) - + app = wx.App(False) frame = MovingFrame(None, 'MoveEvent example') app.MainLoop() diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/Notebook.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/Notebook.1.py index e8e37507..2c96a0c6 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/Notebook.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/Notebook.1.py @@ -14,7 +14,7 @@ class NotebookFrame(wx.Frame): wx.Frame.__init__(self, parent, title=title) - # Create the notebook + # Create the notebook self.notebook = wx.Notebook(self, style=wx.NB_BOTTOM) # Setting up the menu @@ -30,7 +30,7 @@ class NotebookFrame(wx.Frame): # Adding the 'file_menu' to the menu bar menu_bar.Append(file_menu, '&File') - + # Adding the menu bar to the frame content self.SetMenuBar(menu_bar) @@ -42,11 +42,11 @@ class NotebookFrame(wx.Frame): # This is how you pre-establish a file filter so that the dialog # only shows the extension(s) you want it to. wildcard = 'Python source (*.py)|*.py' - - dlg = wx.FileDialog(None, message="Choose a Python file", defaultDir=os.getcwd(), + + dlg = wx.FileDialog(None, message="Choose a Python file", defaultDir=os.getcwd(), defaultFile="", wildcard=wildcard, style=wx.FD_OPEN) - # Show the dialog and retrieve the user response. If it is the OK response, + # Show the dialog and retrieve the user response. If it is the OK response, # process the data. if dlg.ShowModal() == wx.ID_OK: # This returns the file that was selected diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/PaintDC.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/PaintDC.1.py index 2833c4d5..1e9ac64e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/PaintDC.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/PaintDC.1.py @@ -21,16 +21,16 @@ class PaintFrame(wx.Frame): def OnPaint(self, event): - dc = wx.PaintDC(self) + dc = wx.PaintDC(self) w, h = self.GetClientSize() # Use a blue pen, for example... dc.SetPen(wx.Pen('BLUE')) - + # Remember the signature of wx.DC.DrawLine: # DrawLine(x1, y1, x2, y2) - + for i in range(100): x1 = random.randint(1, w-1) y1 = random.randint(1, h-1) @@ -38,7 +38,7 @@ class PaintFrame(wx.Frame): y2 = random.randint(1, h-1) dc.DrawLine(x1, y1, x2, y2) - + app = wx.App(False) frame = PaintFrame(None, 'PaintDC example') app.MainLoop() \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/Process.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/Process.1.py index bc24996a..0903a6f8 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/Process.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/Process.1.py @@ -26,7 +26,7 @@ class ProcessFrame(wx.Frame): self.Bind(wx.EVT_IDLE, self.OnIdle) self.Bind(wx.EVT_END_PROCESS, self.OnProcessEnded) - + def OnButton(self, event): self.btn.Enable(False) self.label.SetValue('') diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/SplitterWindow.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/SplitterWindow.1.py index b24dc057..575b6571 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/SplitterWindow.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/SplitterWindow.1.py @@ -15,7 +15,7 @@ class SplitterFrame(wx.Frame): # Create the main splitter window (to be split vertically) splitter = wx.SplitterWindow(self, -1, style=wx.SP_LIVE_UPDATE) splitter.SetMinimumPaneSize(100) - + panel1 = wx.Panel(splitter, -1) static = wx.StaticText(panel1, -1, 'Hello World', pos=(10, 100)) @@ -24,7 +24,7 @@ class SplitterFrame(wx.Frame): # Create the second splitter window (to be split horizontally) splitter2 = wx.SplitterWindow(splitter, -1, style=wx.SP_LIVE_UPDATE) splitter2.SetMinimumPaneSize(100) - + panel2 = wx.Panel(splitter2, -1) panel2.SetBackgroundColour(wx.BLUE) diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/StatusBar.SetStatusWidths.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/StatusBar.SetStatusWidths.1.py index fe3ac595..fc828ad2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/StatusBar.SetStatusWidths.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/StatusBar.SetStatusWidths.1.py @@ -1,8 +1,8 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample shows how to create a wx.StatusBar with 2 fields, -# set the second field to have double width with respect to the +# This sample shows how to create a wx.StatusBar with 2 fields, +# set the second field to have double width with respect to the # first and and display the date of today in the second field. import wx diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/TreeCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/TreeCtrl.1.py index a5dc6658..cc06bb08 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/TreeCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/TreeCtrl.1.py @@ -1,10 +1,10 @@ ##Andrea Gavana #!/usr/bin/env python -# This sample classifies the Python keywords alphabetically, using the -# first letter of the keyword (i.e., ``and`` goes into ``a``, ``for`` +# This sample classifies the Python keywords alphabetically, using the +# first letter of the keyword (i.e., ``and`` goes into ``a``, ``for`` # goes into ``f`` and so on): -# +# # * For each letter, adds a child to the treectrl root # * In each child of the root item, adds its corresponding keyword(s) # @@ -27,7 +27,7 @@ class TreeFrame(wx.Frame): root = tree_ctrl.AddRoot('Python keywords') letters = [] - + for kwd in keyword.kwlist: first = kwd[0] if first not in letters: @@ -39,7 +39,7 @@ class TreeFrame(wx.Frame): first = kwd[0] if first == letter: sub_item = tree_ctrl.AppendItem(item, kwd) - + tree_ctrl.ExpandAll() self.Centre() diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/TreeCtrl.OnCompareItems.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/TreeCtrl.OnCompareItems.1.py index 31d7fdba..5d13dd76 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/TreeCtrl.OnCompareItems.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/TreeCtrl.OnCompareItems.1.py @@ -6,7 +6,7 @@ def OnCompareItems(self, item1, item2): """Changes the sort order of the items in the tree control. """ - + t1 = self.GetItemText(item1) t2 = self.GetItemText(item2) diff --git a/docs/sphinx/rest_substitutions/snippets/python/contrib/functions.Execute.1.py b/docs/sphinx/rest_substitutions/snippets/python/contrib/functions.Execute.1.py index bc24996a..0903a6f8 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/contrib/functions.Execute.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/contrib/functions.Execute.1.py @@ -26,7 +26,7 @@ class ProcessFrame(wx.Frame): self.Bind(wx.EVT_IDLE, self.OnIdle) self.Bind(wx.EVT_END_PROCESS, self.OnProcessEnded) - + def OnButton(self, event): self.btn.Enable(False) self.label.SetValue('') diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AcceleratorTable.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AcceleratorTable.1.py index 11b6c9e2..cd58d0e7 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AcceleratorTable.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AcceleratorTable.1.py @@ -1,6 +1,6 @@ entries = [wx.AcceleratorEntry() for i in xrange(4)] - + entries[0].Set(wx.ACCEL_CTRL, ord('N'), ID_NEW_WINDOW) entries[1].Set(wx.ACCEL_CTRL, ord('X'), wx.ID_EXIT) entries[2].Set(wx.ACCEL_SHIFT, ord('A'), ID_ABOUT) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Concat.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Concat.1.py index 1750e3a3..8e545a33 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Concat.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Concat.1.py @@ -1,4 +1,4 @@ - + # | t.m_11 t.m_12 0 | | m_11 m_12 0 | # matrix' = | t.m_21 t.m_22 0 | x | m_21 m_22 0 | # | t.m_tx t.m_ty 1 | | m_tx m_ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Invert.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Invert.1.py index 2b1555e1..ac207249 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Invert.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Invert.1.py @@ -1,4 +1,4 @@ - + # | m_11 m_12 0 | # Invert | m_21 m_22 0 | # | m_tx m_ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Rotate.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Rotate.1.py index 4cd06d1e..114910f1 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Rotate.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Rotate.1.py @@ -1,4 +1,4 @@ - + # | cos sin 0 | | self.11 self.12 0 | # matrix' = | -sin cos 0 | x | self.21 self.22 0 | # | 0 0 1 | | self.tx self.ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Scale.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Scale.1.py index 27c009d3..dd075a48 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Scale.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Scale.1.py @@ -1,4 +1,4 @@ - + # | xScale 0 0 | | self.11 self.12 0 | # matrix' = | 0 yScale 0 | x | self.21 self.22 0 | # | 0 0 1 | | self.tx self.ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformDistance.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformDistance.1.py index 81191fbe..7de473a4 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformDistance.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformDistance.1.py @@ -1,4 +1,4 @@ - + # | self.11 self.12 0 | # dist' = | src.self.x src._my 0 | x | self.21 self.22 0 | # | self.tx self.ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformDistance.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformDistance.2.py index 81191fbe..7de473a4 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformDistance.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformDistance.2.py @@ -1,4 +1,4 @@ - + # | self.11 self.12 0 | # dist' = | src.self.x src._my 0 | x | self.21 self.22 0 | # | self.tx self.ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformPoint.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformPoint.1.py index 4420d28a..38073847 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformPoint.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformPoint.1.py @@ -1,4 +1,4 @@ - + # | self.11 self.12 0 | # point' = | src.self.x src._my 1 | x | self.21 self.22 0 | # | self.tx self.ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformPoint.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformPoint.2.py index 4420d28a..38073847 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformPoint.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.TransformPoint.2.py @@ -1,4 +1,4 @@ - + # | self.11 self.12 0 | # point' = | src.self.x src._my 1 | x | self.21 self.22 0 | # | self.tx self.ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Translate.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Translate.1.py index afaf37ee..c8a17a30 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Translate.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2D.Translate.1.py @@ -1,4 +1,4 @@ - + # | 1 0 0 | | self.11 self.12 0 | # matrix' = | 0 1 0 | x | self.21 self.22 0 | # | dx dy 1 | | self.tx self.ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2DBase.Concat.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2DBase.Concat.1.py index 1750e3a3..8e545a33 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2DBase.Concat.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2DBase.Concat.1.py @@ -1,4 +1,4 @@ - + # | t.m_11 t.m_12 0 | | m_11 m_12 0 | # matrix' = | t.m_21 t.m_22 0 | x | m_21 m_22 0 | # | t.m_tx t.m_ty 1 | | m_tx m_ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2DBase.Invert.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2DBase.Invert.1.py index 2b1555e1..ac207249 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2DBase.Invert.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AffineMatrix2DBase.Invert.1.py @@ -1,4 +1,4 @@ - + # | m_11 m_12 0 | # Invert | m_21 m_22 0 | # | m_tx m_ty 1 | diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.App.SetTopWindow.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.App.SetTopWindow.1.py index 8db8f874..6fd4c1de 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.App.SetTopWindow.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.App.SetTopWindow.1.py @@ -1,2 +1,2 @@ - - wx.App.SetTopWindow(None) + + wx.App.SetTopWindow(None) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AppConsole.SetCLocale.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AppConsole.SetCLocale.1.py index 7d2135a5..2613e271 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AppConsole.SetCLocale.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.AppConsole.SetCLocale.1.py @@ -1,2 +1,2 @@ - + setlocale(LC_ALL, "") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ArtProvider.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ArtProvider.1.py index d514966c..58e1ef13 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ArtProvider.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ArtProvider.1.py @@ -1,18 +1,18 @@ - + class MyProvider(wx.ArtProvider): def CreateBitmap(self, id, client, size): # Your implementation of CreateBitmap here pass - - + + # optionally override this one as well def CreateIconBundle(self, id, client): # Your implementation of CreateIconBundle here pass - + # Later on... wx.ArtProvider.Push(MyProvider()) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ArtProvider.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ArtProvider.2.py index 78186c29..be548cac 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ArtProvider.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ArtProvider.2.py @@ -1,4 +1,4 @@ - + if wx.Platform == '__WXGTK__': bmp = wx.ArtProvider.GetBitmap("gtk-cdrom", wx.ART_MENU) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Bitmap.NewFromPNGData.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Bitmap.NewFromPNGData.2.py index 1a9388d0..fa8bf1e4 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Bitmap.NewFromPNGData.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Bitmap.NewFromPNGData.2.py @@ -1,2 +1,2 @@ - + wx.Image.AddHandler(wx.PNGHandler) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Bitmap.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Bitmap.__init__.1.py index 7ba169a0..24dc6158 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Bitmap.__init__.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Bitmap.__init__.1.py @@ -1,3 +1,3 @@ - + newBitmap = oldBitmap.GetSubBitmap( wx.Rect(0, 0, oldBitmap.GetWidth(), oldBitmap.GetHeight())) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BoxSizer.AddSpacer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BoxSizer.AddSpacer.1.py index 83b0b7fe..53780f14 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BoxSizer.AddSpacer.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BoxSizer.AddSpacer.1.py @@ -1,9 +1,9 @@ - + if boxSizer.IsVertical(): - + boxSizer.Add(0, size, 0) - + else: - + boxSizer.Add(size, 0, 0) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyCursor.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyCursor.1.py index d88a47d6..181f59d2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyCursor.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyCursor.1.py @@ -1,7 +1,7 @@ - + wait = wx.BusyCursor() - + for i in xrange(10000): DoACalculation() - del wait + del wait diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyInfo.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyInfo.1.py index 7f7ac166..93c347c3 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyInfo.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyInfo.1.py @@ -1,6 +1,6 @@ - + wait = wx.BusyInfo("Please wait, working...") - + for i in xrange(10000): DoACalculation() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyInfo.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyInfo.2.py index 1a1487bc..8d6d985d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyInfo.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.BusyInfo.2.py @@ -1,11 +1,11 @@ - + disableAll = wx.WindowDisabler() wait = wx.BusyInfo("Please wait, working...") - + for i in xrange(10000): DoACalculation() - + if i % 1000 == 0: wx.GetApp().Yield() - + del wait diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.CloseEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.CloseEvent.1.py index 87d30dc7..92c5e80f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.CloseEvent.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.CloseEvent.1.py @@ -1,15 +1,15 @@ - + def OnClose(self, event): - + if event.CanVeto() and self.fileNotSaved: - + if wx.MessageBox("The file has not been saved... continue closing?", "Please confirm", wx.ICON_QUESTION | wx.YES_NO) != wx.YES: - + event.Veto() return - + self.Destroy() # you may also do: event.Skip() # since the default event handler does call Destroy(), too - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.CollapsiblePane.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.CollapsiblePane.1.py index cef33f08..471db2b7 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.CollapsiblePane.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.CollapsiblePane.1.py @@ -1,9 +1,9 @@ - + collpane = wx.CollapsiblePane(self, wx.ID_ANY, "Details:") - + # add the pane with a zero proportion value to the 'sz' sizer which contains it sz.Add(collpane, 0, wx.GROW | wx.ALL, 5) - + # now add a test label in the collapsible pane using a sizer to layout it: win = collpane.GetPane() paneSz = wx.BoxSizer(wx.VERTICAL) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.1.py index 045a6228..d38130a8 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.1.py @@ -6,14 +6,14 @@ #---------------------------------------------------------------------- # This class is used to provide an interface between a ComboCtrl and the - # ListCtrl that is used as the popoup for the combo widget. + # ListCtrl that is used as the popoup for the combo widget. class ListCtrlComboPopup(wx.ComboPopup): - + def __init__(self): wx.ComboPopup.__init__(self) self.lc = None - + def AddItem(self, txt): self.lc.InsertItem(self.lc.GetItemCount(), txt) @@ -97,11 +97,10 @@ # Return true if you want delay the call to Create until the popup # is shown for the first time. It is more efficient, but note that # it is often more convenient to have the control created - # immediately. + # immediately. # Default returns false. def LazyCreate(self): return wx.ComboPopup.LazyCreate(self) - \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.2.py index 159b4bec..d0a2d635 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.2.py @@ -1,11 +1,11 @@ - + comboCtrl = wx.ComboCtrl(self, wx.ID_ANY, "") - + popupCtrl = ListViewComboPopup() - + # It is important to call SetPopupControl() as soon as possible comboCtrl.SetPopupControl(popupCtrl) - + # Populate using wx.ListView methods popupCtrl.InsertItem(popupCtrl.GetItemCount(), "First Item") popupCtrl.InsertItem(popupCtrl.GetItemCount(), "Second Item") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.SetTextCtrlStyle.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.SetTextCtrlStyle.1.py index f31ca550..f3c9de03 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.SetTextCtrlStyle.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ComboCtrl.SetTextCtrlStyle.1.py @@ -1,7 +1,7 @@ - + comboCtrl = wx.ComboCtrl() - + # Let's make the text right-aligned comboCtrl.SetTextCtrlStyle(wx.TE_RIGHT) - + comboCtrl.Create(parent, wx.ID_ANY, "") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.1.py index b8bb54fe..b6ab6140 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.1.py @@ -1,14 +1,13 @@ - + # using wx.Config instead of writing wx.FileConfig or wx.RegConfig enhances # portability of the code - config = wx.Config("MyAppName") + config = wx.Config("MyAppName") strs = config.Read("LastPrompt") - + # another example: using default values and the full path instead of just # key name: if the key is not found , the value 17 is returned value = config.ReadInt("/LastRun/CalculatedValues/MaxValue", 17) - + # at the end of the program we would save everything back config.Write("LastPrompt", strs) config.Write("/LastRun/CalculatedValues/MaxValue", value) - \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.2.py index dfbdb071..8a47d7b1 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.2.py @@ -1,22 +1,22 @@ - + config = wx.Config("FooBarApp") - + # right now the current path is '/' conf.Write("RootEntry", 1) - + # go to some other place: if the group(s) don't exist, they will be created conf.SetPath("/Group/Subgroup") - + # create an entry in subgroup conf.Write("SubgroupEntry", 3) - + # '..' is understood conf.Write("../GroupEntry", 2) conf.SetPath("..") - + if conf.ReadInt("Subgroup/SubgroupEntry", 0) != 3: raise Exception('Invalid SubgroupEntry') - + # use absolute path: it is allowed, too if conf.ReadInt("/RootEntry", 0) != 1: raise Exception('Invalid RootEntry') diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.3.py index 93950934..564b7095 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.3.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.3.py @@ -1,10 +1,10 @@ - + def foo(config): - + oldPath = config.GetPath() - + config.SetPath("/Foo/Data") # ... - + config.SetPath(oldPath) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.4.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.4.py index 58238ade..ec0bd0bb 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.4.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.4.py @@ -1,10 +1,10 @@ - + def bar(config): - + config.Write("Test", 17) - + foo(config) - + # we're reading "/Foo/Data/Test" here! -1 will probably be returned... if config.ReadInt("Test", -1) != 17: raise Exception('Invalid Test') diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.5.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.5.py index b6991df1..5b8dd495 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.5.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigBase.5.py @@ -1,21 +1,21 @@ - - config = wx.Config("MyAppName") + + config = wx.Config("MyAppName") names = [] - + # first enum all entries more, value, index = config.GetFirstEntry() - + while more: names.append(value) more, value, index = config.GetNextEntry(index) - + # ... we have all entry names in names... - + # now all groups... more, value, index = config.GetFirstGroup() - + while more: - names.append(value) + names.append(value) more, value, index = config.GetNextGroup(index) - + # ... we have all group (and entry) names in names... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.1.py index 3b538812..d828a205 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.1.py @@ -1,8 +1,8 @@ - + # this function loads somes settings from the given wx.Config object # the path selected inside it is left unchanged def LoadMySettings(config): - + changer = wx.ConfigPathChanger(config, "/Foo/Data/SomeString") strs = config.Read("SomeString") @@ -10,12 +10,12 @@ if not strs: wx.LogError("Couldn't read SomeString!") return False - + # NOTE: without wx.ConfigPathChanger it would be easy to forget to # set the old path back into the wx.Config object before this return! - - + + # do something useful with SomeString... - + return True # again: wx.ConfigPathChanger dtor will restore the original wx.Config path - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.__init__.1.py index 36c7f1ed..191f5ef8 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.__init__.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.__init__.1.py @@ -1,2 +1,2 @@ - + wx.ConfigPathChanger(wx.ConfigBase.Get(), "/MyProgram/SomeKeyName") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.__init__.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.__init__.2.py index 5e85316d..8c6fc4c6 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.__init__.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ConfigPathChanger.__init__.2.py @@ -1,2 +1,2 @@ - + wx.ConfigPathChanger(wx.ConfigBase.Get(), "/MyProgram/") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ContextHelp.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ContextHelp.1.py index 7d13f552..cb5877a0 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ContextHelp.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ContextHelp.1.py @@ -1,2 +1,2 @@ - + contextHelp = wx.ContextHelp(myWindow) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromTextSize.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromTextSize.1.py index e4448974..b30baa38 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromTextSize.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromTextSize.1.py @@ -1,7 +1,7 @@ - + # Create a control for post code entry. postcode = wx.TextCtrl(self, -1, "") - + # And set its initial and minimal size to be big enough for # entering 5 digits. postcode.SetInitialSize( diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromTextSize.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromTextSize.2.py index e4448974..b30baa38 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromTextSize.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.GetSizeFromTextSize.2.py @@ -1,7 +1,7 @@ - + # Create a control for post code entry. postcode = wx.TextCtrl(self, -1, "") - + # And set its initial and minimal size to be big enough for # entering 5 digits. postcode.SetInitialSize( diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.SetLabelMarkup.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.SetLabelMarkup.1.py index 8829a3cb..bcf0b5de 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.SetLabelMarkup.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Control.SetLabelMarkup.1.py @@ -1,6 +1,6 @@ - + text = wx.StaticText(self, -1, 'Hello world!') - + # Some more code... text.SetLabelMarkup("&Bed &mp " "breakfast " diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Cursor.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Cursor.1.py index 0f1601e0..e21c80bd 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Cursor.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Cursor.1.py @@ -1,4 +1,4 @@ - + down_bits = [255, 255, 255, 255, 31, 255, 255, 255, 31, 255, 255, 255, 31, 255, 255, 255, 31, 255, 255, 255, 31, 255, 255, 255, 31, 255, 255, @@ -12,7 +12,7 @@ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255] - + down_mask = [240, 1, 0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 240, 1, 0, 0, 255, 31, 0, 0, 255, @@ -22,19 +22,19 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - + if wx.Platform == '__WXMSW__': - + down_bitmap = wx.BitmapFromBits(down_bits, 32, 32) down_mask_bitmap = wx.BitmapFromBits(down_mask, 32, 32) - + down_bitmap.SetMask(wx.Mask(down_mask_bitmap)) down_image = down_bitmap.ConvertToImage() down_image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 6) down_image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 14) down_cursor = wx.Cursor(down_image) - + elif wx.Platform == '__WXGTK__': - + down_cursor = wx.Cursor(down_bits, 32, 32, 6, 14, down_mask, wx.WHITE, wx.BLACK) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Cursor.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Cursor.__init__.1.py index 37f2a65d..d4cc1f03 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Cursor.__init__.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Cursor.__init__.1.py @@ -1,3 +1,3 @@ - + image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX) image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, hotSpotY) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DCClipper.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DCClipper.1.py index 2d45b0e5..f6da9602 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DCClipper.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DCClipper.1.py @@ -1,13 +1,13 @@ - + def MyFunction(dc): - + clip = wx.DCClipper(dc, rect) # ... drawing functions here are affected by clipping rect ... - - + + def OtherFunction(): - + dc = wx.DC() MyFunction(dc) # ... drawing functions here are not affected by clipping rect ... - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DataObjectComposite.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DataObjectComposite.1.py index 288e6c8a..ac53aeba 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DataObjectComposite.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DataObjectComposite.1.py @@ -10,7 +10,7 @@ def OnData(self, x, y, defaultDragResult): dragResult = wx.DropTarget.OnData(x, y, defaultDragResult) - + if dragResult == defaultDragResult: dataobjComp = self.GetDataObject() @@ -20,14 +20,14 @@ if format.GetType() == wx.DF_BITMAP: dataobjBitmap = dataobj # ... use dataobj.GetBitmap() ... - + elif format.GetType() == wx.DF_FILENAME: dataobjFile = dataobj # ... use dataobj.GetFilenames() ... - + else: raise Exception("unexpected data object format") - + return dragResult diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.ConvertYearToBC.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.ConvertYearToBC.1.py index 5018ed25..6673845b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.ConvertYearToBC.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.ConvertYearToBC.1.py @@ -1,4 +1,4 @@ - + dt = wx.DateTimeFromDMY(8, 5, 1977) y = dt.GetYear() epoch = (y > 0 and ["AD"] or ["BC"])[0] diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.Now.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.Now.1.py index fe32b99c..5e2ac212 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.Now.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.Now.1.py @@ -1,3 +1,3 @@ - + now = wx.DateTime.Now() print "Current time in Paris:\t%s\n"%(now.Format("%c", wx.DateTime.CET)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.SetTimeT.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.SetTimeT.1.py index 5e3af31b..e29da9e5 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.SetTimeT.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DateTime.SetTimeT.1.py @@ -1,2 +1,2 @@ - - -1 + + -1 diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DirDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DirDialog.1.py index 37ae0bd0..0fa9bbf5 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DirDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.DirDialog.1.py @@ -1,4 +1,4 @@ - + dlg = wx.DirDialog (None, "Choose input directory", "", wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Event.Clone.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Event.Clone.1.py index 60d64704..1cef0dcd 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Event.Clone.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Event.Clone.1.py @@ -1,4 +1,4 @@ - + def Clone(self): - return MyEvent() + return MyEvent() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventBlocker.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventBlocker.1.py index 109c6aef..adcb1d6a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventBlocker.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventBlocker.1.py @@ -1,4 +1,4 @@ - + def DoSomething(self): # block all events directed to this window while # we do the 1000 FunctionWhichSendsEvents() calls @@ -6,9 +6,9 @@ for i in xrange(1000): FunctionWhichSendsEvents(i) - + # wx.EventBlocker destructor called, old event handler is restored - + # the event generated by this call will be processed: FunctionWhichSendsEvents(0) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventFilter.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventFilter.1.py index bd97e120..31fe03d7 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventFilter.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventFilter.1.py @@ -1,43 +1,43 @@ - + # This class allows to determine the last time the user has worked with # this application: class LastActivityTimeDetector(wx.EventFilter): - + def __init__(self): wx.EventFilter.__init__(self) - + wx.EvtHandler.AddFilter(self) - + self.last = wx.DateTime.Now() - + def __del__(self): - + wx.EvtHandler.RemoveFilter(self) - - + + def FilterEvent(self, event): - + # Update the last user activity t = event.GetEventType() - + if t == wx.EVT_KEY_DOWN.typeId or t == wx.EVT_MOTION.typeId or \ t == wx.EVT_LEFT_DOWN.typeId or t == wx.EVT_RIGHT_DOWN.typeId or \ t == wx.EVT_MIDDLE_DOWN.typeId: - + self.last = wx.DateTime.Now() - - + + # Continue processing the event normally as well. return self.Event_Skip - - + + # This function could be called periodically from some timer to # do something (e.g. hide sensitive data or log out from remote # server) if the user has been inactive for some time period. def IsInactiveFor(self, diff): - + return wx.DateTime.Now() - diff > self.last - - + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventLoopActivator.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventLoopActivator.1.py index abf5de22..8fc0d68b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventLoopActivator.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventLoopActivator.1.py @@ -1,11 +1,11 @@ - + class MyEventLoop(wx.EventLoopBase): - + def RunMyLoop(self): - + loop = MyEventLoop() activate = wx.EventLoopActivator(loop) - + # other code... - + # the previously active event loop restored here diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventLoopBase.Dispatch.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventLoopBase.Dispatch.1.py index 7f916734..bb15bdd4 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventLoopBase.Dispatch.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EventLoopBase.Dispatch.1.py @@ -1,3 +1,3 @@ - + while evtloop.Pending(): evtloop.Dispatch() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.QueueEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.QueueEvent.1.py index 234c0204..9a7ecce2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.QueueEvent.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.QueueEvent.1.py @@ -1,10 +1,10 @@ - + def FunctionInAWorkerThread(strs): - + evt = wx.CommandEvent() - + # NOT evt.SetString(strs) as this would be a shallow copy evt.SetString(strs[:]) # make a deep copy - + wx.TheApp.QueueEvent(evt) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.QueueEvent.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.QueueEvent.2.py index 14c1e6a6..847f73b2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.QueueEvent.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.QueueEvent.2.py @@ -1,10 +1,10 @@ - + def FunctionInAWorkerThread(strs): - + evt = wx.ThreadEvent() evt.SetString(strs) - + # wx.ThreadEvent.Clone() makes sure that the internal wx.String # member is not shared by other string instances: wx.TheApp.QueueEvent(evt.Clone()) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.SetNextHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.SetNextHandler.1.py index 3375fa40..b09aabb5 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.SetNextHandler.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.SetNextHandler.1.py @@ -1,3 +1,3 @@ - + handlerA.SetNextHandler(handlerB) handlerB.SetPreviousHandler(handlerA) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryAfter.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryAfter.1.py index 675de7bc..567435be 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryAfter.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryAfter.1.py @@ -1,10 +1,10 @@ - + class MyClass(public BaseClass): # something inheriting from wx.EvtHandler - + ... def TryAfter(self, event): if (BaseClass.TryAfter(self, event)) return True - + return self.MyPostProcess(event) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryBefore.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryBefore.1.py index 9d12ac3c..f200600d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryBefore.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.EvtHandler.TryBefore.1.py @@ -1,10 +1,10 @@ - + class MyClass(BaseClass): # something inheriting from wx.EvtHandler - + ... def TryBefore(self, event): if (self.MyPreProcess(event)): return True - + return BaseClass.TryBefore(self, event) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FSFile.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FSFile.__init__.1.py index 4a96db44..5560016f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FSFile.__init__.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FSFile.__init__.1.py @@ -1,8 +1,8 @@ - + class MyFSFile(wx.FSFile): def __init__(self): - wx.FSFile.__init__(self) - - + wx.FSFile.__init__(self) + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileDialog.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileDialog.3.py index 2fdfd56a..6217f979 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileDialog.3.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileDialog.3.py @@ -1,2 +1,2 @@ - + wildcard = "BMP and GIF files (*.bmp;*.gif)|*.bmp;*.gif|PNG files (*.png)|*.png" diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.AddHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.AddHandler.1.py index 0f3871d1..af6888e4 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.AddHandler.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.AddHandler.1.py @@ -1,2 +1,2 @@ - + wx.FileSystem.AddHandler(My_FS_Handler) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.ChangePathTo.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.ChangePathTo.1.py index 00cf0a75..d06e450a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.ChangePathTo.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.ChangePathTo.1.py @@ -1,4 +1,4 @@ - + ChangePathTo("dir/subdir/xh.htm") ChangePathTo("dir/subdir", True) ChangePathTo("dir/subdir/", True) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.ChangePathTo.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.ChangePathTo.2.py index 085f50ee..998eb14a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.ChangePathTo.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystem.ChangePathTo.2.py @@ -1,4 +1,4 @@ - + f = fs.OpenFile("hello.htm") # opens file 'hello.htm' fs.ChangePathTo("subdir/folder", True) f = fs.OpenFile("hello.htm") # opens file 'subdir/folder/hello.htm' !! diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.CanOpen.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.CanOpen.1.py index c4958699..d1fe999a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.CanOpen.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.CanOpen.1.py @@ -1,5 +1,5 @@ - + def CanOpen(self, location): - + return self.GetProtocol(location) == "http" - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetAnchor.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetAnchor.1.py index 6cd937fb..0ff3e266 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetAnchor.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetAnchor.1.py @@ -1,5 +1,5 @@ - + if self.GetAnchor("index.htm#chapter2") == "chapter2": DoSomething() - - + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetLeftLocation.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetLeftLocation.1.py index 0379eae3..db839cbe 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetLeftLocation.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetLeftLocation.1.py @@ -1,4 +1,4 @@ - + if self.GetLeftLocation("file:myzipfile.zip#zip:index.htm") == "file:myzipfile.zip": DoSomething() - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetProtocol.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetProtocol.1.py index c71d4964..eb38e1cc 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetProtocol.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetProtocol.1.py @@ -1,3 +1,3 @@ - + if self.GetProtocol("file:myzipfile.zip#zip:index.htm") == "zip": UnzipFile(filename) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetRightLocation.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetRightLocation.1.py index 0f962834..c838a23e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetRightLocation.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileSystemHandler.GetRightLocation.1.py @@ -1,3 +1,3 @@ - + if self.GetRightLocation("file:myzipfile.zip#zip:index.htm") == "index.htm": ReadHTML(filename) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileType.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileType.1.py index f2a2c4e9..90672e6a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileType.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileType.1.py @@ -8,11 +8,11 @@ def GetParamValue(self, name): - + # parameter names are not case-sensitive if name.lower() == "charset": return "US-ASCII" else: return wx.MessageParameters.GetParamValue(name) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileType.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileType.2.py index eb3e851b..371a4154 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileType.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FileType.2.py @@ -1,11 +1,11 @@ - + if filetype.GetOpenCommand(MailMessageParameters("foo.txt", "text/plain")): - + # the full command for opening the text documents is in 'command' # (it might be "notepad foo.txt" under Windows or "cat foo.txt" under Unix) HandleCommand() - + else: - + # we don't know how to handle such files... pass diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FontInfo.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FontInfo.1.py index 710ab065..246734ce 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FontInfo.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FontInfo.1.py @@ -1,2 +1,2 @@ - + font = wx.Font(wx.FontInfo(12).FaceName("Helvetica").Italic()) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FontMapper.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FontMapper.1.py index 8f648ac3..6b447882 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FontMapper.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.FontMapper.1.py @@ -5,9 +5,9 @@ convFrom = wx.FontMapper.Get().GetEncodingName(enc) convTo = wx.FontMapper.Get().GetEncodingName(alt) text = text.decode(convFrom).encode(convTo) - + else: # ...failure (or we may try iso8859-1/7bit ASCII)... pass - + # ...display text... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Frame.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Frame.1.py index c980105b..b9a0194f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Frame.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Frame.1.py @@ -1,2 +1,2 @@ - + style = wx.DEFAULT_FRAME_STYLE & ~(wx.RESIZE_BORDER | wx.MAXIMIZE_BOX) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.GraphicsContext.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.GraphicsContext.1.py index ae227319..5b1b4faf 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.GraphicsContext.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.GraphicsContext.1.py @@ -1,14 +1,14 @@ - + def OnPaint(self, event): - + # Create paint DC dc = wx.PaintDC(self) - + # Create graphics context from it gc = wx.GraphicsContext.Create(dc) - + if gc: - + # make a path that contains a circle and some lines gc.SetPen(wx.RED_PEN) path = gc.CreatePath() @@ -19,7 +19,7 @@ path.AddLineToPoint(50.0, 100.0) path.CloseSubpath() path.AddRectangle(25.0, 25.0, 50.0, 50.0) - + gc.StrokePath(path) - - + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.GraphicsRenderer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.GraphicsRenderer.1.py index b80fb200..c7440f47 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.GraphicsRenderer.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.GraphicsRenderer.1.py @@ -1,3 +1,3 @@ - + path = wx.GraphicsPath() # from somewhere brush = path.GetRenderer().CreateBrush(wx.BLACK_BRUSH) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderColumnSimple.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderColumnSimple.1.py index 4c591b35..e9bbd450 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderColumnSimple.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderColumnSimple.1.py @@ -1,4 +1,4 @@ - + header = wx.HeaderCtrlSimple() # Fill in the constructor col = wx.HeaderColumnSimple("Title") col.SetWidth(100) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.AddColumnsItems.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.AddColumnsItems.1.py index 8da5d12a..0b22bcdd 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.AddColumnsItems.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.AddColumnsItems.1.py @@ -1,13 +1,13 @@ def ColumnItems(self): - + menu = wx.Menu() menu.Append(100, "Some custom command") menu.AppendSeparator() self.AddColumnsItems(menu, 200) rc = self.GetPopupMenuSelectionFromUser(menu, pt) - + if rc >= 200: # ... toggle visibility of the column rc-200 ... ToggleVisibility() - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.Create.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.Create.1.py index 13800295..4e5b58f8 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.Create.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.Create.1.py @@ -1,2 +1,2 @@ - - wx.HD_DEFAULT_STYLE & ~wx.HD_ALLOW_REORDER + + wx.HD_DEFAULT_STYLE & ~wx.HD_ALLOW_REORDER diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.UpdateColumnWidthToFit.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.UpdateColumnWidthToFit.1.py index 4469053e..c4284fb4 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.UpdateColumnWidthToFit.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrl.UpdateColumnWidthToFit.1.py @@ -7,13 +7,13 @@ def SetWidth(self, width): - - self.width = width + + self.width = width def GetWidth(self): - return self.width + return self.width class MyHeaderCtrl(wx.HeaderCtrl): @@ -22,19 +22,19 @@ wx.HeaderCtrl.__init__(self, parent) self.cols = [] - + def GetColumn(idx): - + return self.cols[idx] - + def UpdateColumnWidthToFit(self, idx, widthTitle): # ... compute minimal width for column idx ... widthContents = self.CalculateMinWidth(idx) self.cols[idx].SetWidth(max(widthContents, widthTitle)) - - return True - + + return True + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrlSimple.HideColumn.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrlSimple.HideColumn.1.py index 853cd378..e695ccc3 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrlSimple.HideColumn.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HeaderCtrlSimple.HideColumn.1.py @@ -1,2 +1,2 @@ - - self.ShowColumn(idx, False) + + self.ShowColumn(idx, False) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HelpControllerBase.SetViewer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HelpControllerBase.SetViewer.1.py index 20f21136..f354c6bf 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HelpControllerBase.SetViewer.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.HelpControllerBase.SetViewer.1.py @@ -1,4 +1,4 @@ - + self.help.SetViewer("kdehelp") self.help.SetViewer("gnome-help-browser") self.help.SetViewer("netscape", wx.HELP_NETSCAPE) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.IconBundle.GetIcon.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.IconBundle.GetIcon.1.py index c536b4dd..c485200b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.IconBundle.GetIcon.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.IconBundle.GetIcon.1.py @@ -1,2 +1,2 @@ - - GetIcon(wx.Size(size, size)) + + GetIcon(wx.Size(size, size)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.AddHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.AddHandler.1.py index 1a9388d0..fa8bf1e4 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.AddHandler.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.AddHandler.1.py @@ -1,2 +1,2 @@ - + wx.Image.AddHandler(wx.PNGHandler) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.ComputeHistogram.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.ComputeHistogram.1.py index 2aa686e9..6b4c556d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.ComputeHistogram.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.ComputeHistogram.1.py @@ -2,9 +2,9 @@ # This is a raw translation of the ImageHistogramEntry # code in C++, not a real Python class class ImageHistogramEntry(object): - + def __init__(self): - + self.index = 0 self.value = 0 - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.GetImageExtWildcard.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.GetImageExtWildcard.1.py index 76c9339d..9754fa22 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.GetImageExtWildcard.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.GetImageExtWildcard.1.py @@ -1,4 +1,4 @@ - + FileDlg = wx.FileDialog(self, "Choose Image", os.getcwd(), "", "Image Files " + wx.Image.GetImageExtWildcard(), wx.FD_OPEN) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.LoadFile.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.LoadFile.1.py index ac785f20..04304345 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.LoadFile.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.LoadFile.1.py @@ -1,3 +1,3 @@ - + hotspot_x = image.GetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X) hotspot_y = image.GetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.LoadFile.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.LoadFile.2.py index ac785f20..04304345 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.LoadFile.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.LoadFile.2.py @@ -1,3 +1,3 @@ - + hotspot_x = image.GetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X) hotspot_y = image.GetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.SaveFile.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.SaveFile.1.py index 3fd4cac4..8b2906db 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.SaveFile.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.SaveFile.1.py @@ -1,3 +1,3 @@ - + image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, hotspotX) image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, hotspotY) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.SaveFile.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.SaveFile.2.py index 3fd4cac4..8b2906db 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.SaveFile.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.SaveFile.2.py @@ -1,3 +1,3 @@ - + image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, hotspotX) image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, hotspotY) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.Scale.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.Scale.1.py index 573a820d..2ded7d96 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.Scale.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.Scale.1.py @@ -1,14 +1,14 @@ - + # get the bitmap from somewhere bmp = wx.Bitmap('my_png.png', wx.BITMAP_TYPE_PNG) - + # rescale it to have size of 32*32 if bmp.GetWidth() != 32 or bmp.GetHeight() != 32: - + image = bmp.ConvertToImage() bmp = wx.Bitmap(image.Scale(32, 32)) - + # another possibility: image.Rescale(32, 32) bmp = wx.Bitmap(image) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.__init__.1.py index ac785f20..04304345 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.__init__.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Image.__init__.1.py @@ -1,3 +1,3 @@ - + hotspot_x = image.GetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_X) hotspot_y = image.GetOptionInt(wx.IMAGE_OPTION_CUR_HOTSPOT_Y) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.InfoBar.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.InfoBar.1.py index f828ae2b..8364758d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.InfoBar.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.InfoBar.1.py @@ -1,20 +1,20 @@ - + class MyFrame(wx.Frame): def __init__(self, parent): - wx.Frame.__init__(self, parent, title='InfoBar!') - + wx.Frame.__init__(self, parent, title='InfoBar!') + self.infoBar = wx.InfoBar(self) - + sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.infoBar, wx.SizerFlags().Expand()) - + # ... add other frame controls to the sizer ... self.SetSizer(sizer) - - + + def SomeMethod(self): - + self.infoBar.ShowMessage("Something happened", wx.ICON_INFORMATION) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyEvent.GetKeyCode.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyEvent.GetKeyCode.1.py index 5bbe79ae..0dd0be32 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyEvent.GetKeyCode.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyEvent.GetKeyCode.1.py @@ -1,24 +1,24 @@ - + def OnChar(self, event): keycode = event.GetUnicodeKey() - + if keycode != wx.WXK_NONE: - + # It's a printable character wx.LogMessage("You pressed '%c'"%keycode) - + else: - + # It's a special key, deal with all the known ones: if keycode in [wx.WXK_LEFT, wx.WXK_RIGHT]: # move cursor ... MoveCursor() - + elif keycode == wx.WXK_F1: # give help ... GiveHelp() - - - - + + + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyboardState.GetModifiers.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyboardState.GetModifiers.1.py index 09d0b5d4..88ba0d69 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyboardState.GetModifiers.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyboardState.GetModifiers.1.py @@ -1,5 +1,5 @@ - + if ControlDown() and not AltDown() and not ShiftDown() and not MetaDown(): # handle Ctrl-XXX ... HandleControl() - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyboardState.GetModifiers.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyboardState.GetModifiers.2.py index b039d0e7..b7c6d24b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyboardState.GetModifiers.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.KeyboardState.GetModifiers.2.py @@ -1,4 +1,4 @@ - + if GetModifiers() == wx.MOD_CONTROL: # handle Ctrl-XXX ... HandleControl() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.GetNextItem.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.GetNextItem.1.py index c49c8ab4..cd5c85dc 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.GetNextItem.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.GetNextItem.1.py @@ -1,13 +1,13 @@ - + item = -1 - - while 1: + + while 1: item = listctrl.GetNextItem(item, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED) if item == -1: break - + # This item is selected - do whatever is needed with it wx.LogMessage("Item %ld is selected"%item) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetColumnsOrder.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetColumnsOrder.1.py index a871d61d..2f08fc83 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetColumnsOrder.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetColumnsOrder.1.py @@ -1,12 +1,12 @@ - + listCtrl = wx.ListCtrl(parent, style=wx.LC_REPORT) - + for i in range(3): listCtrl.InsertColumn(i, "Column %d"%i) order = [2, 0, 1] listCtrl.SetColumnsOrder(order) - + # now listCtrl.GetColumnsOrder() will return order and # listCtrl.GetColumnIndexFromOrder(n) will return order[n] and # listCtrl.GetColumnOrder() will return 1, 2 and 0 for the column 0, diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetItemState.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetItemState.1.py index 8605487a..c2d99c3f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetItemState.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetItemState.1.py @@ -1,2 +1,2 @@ - + listCtrl.SetItemState(item, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetItemState.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetItemState.2.py index da7026d2..fc765e93 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetItemState.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SetItemState.2.py @@ -1,2 +1,2 @@ - + listCtrl.SetItemState(item, 0, wx.LIST_STATE_SELECTED) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SortItems.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SortItems.1.py index e3fcdb2c..89ef5f93 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SortItems.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ListCtrl.SortItems.1.py @@ -1,6 +1,6 @@ - + def ListCompareFunction(self, item1, item2): pass - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Log.LogRecord.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Log.LogRecord.1.py index 518c1018..cfd3f784 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Log.LogRecord.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Log.LogRecord.1.py @@ -1,11 +1,11 @@ - + def DoLogRecord(self, level, msg, info): - + # let the previous logger show it if self.logOld and IsPassingMessages(): self.logOld.LogRecord(level, msg, info) - + # and also send it to the one if self.logNew and self.logNew != self: self.logNew.LogRecord(level, msg, info) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Log.SetComponentLevel.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Log.SetComponentLevel.1.py index 7917be5f..7fa7de84 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Log.SetComponentLevel.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Log.SetComponentLevel.1.py @@ -1,2 +1,2 @@ - + wx.Log.SetComponentLevel("wx./net", wx.LOG_Error) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogChain.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogChain.1.py index 3ec3467c..4a3d828d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogChain.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogChain.1.py @@ -1,7 +1,7 @@ - + logChain = wx.LogChain(wx.LogStderr) - + # all the log messages are sent to stderr and also processed as usually - + # don't delete logChain directly as this would leave a dangling # pointer as active log target, use SetActiveTarget() instead diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogFormatter.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogFormatter.1.py index 0876df80..58de7a6b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogFormatter.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogFormatter.1.py @@ -1,7 +1,7 @@ - + class LogFormatterWithThread(wx.LogFormatter): def Format(level, msg, info): return "[%d] %s(%d) : %s" % \ (info.threadId, info.filename, info.line, msg) - - + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogFormatter.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogFormatter.2.py index fc40ca78..cd46344a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogFormatter.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogFormatter.2.py @@ -1,2 +1,2 @@ - + wx.LogMessage("*** Application started ***") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogNull.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogNull.1.py index 05d5311b..cd25d7c2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogNull.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogNull.1.py @@ -1,4 +1,4 @@ - + # There will normally be a log message if a non-existant file is # loaded into a wx.Bitmap. It can be suppressed with wx.LogNull noLog = wx.LogNull() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogNull.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogNull.2.py index d0e05cbc..23b807d0 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogNull.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.LogNull.2.py @@ -1,4 +1,4 @@ - + # Don't try to load the image if it doesn't exist. This avoids the # log messages without blocking all the others. if os.path.exists('bogus.png'): diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MDIParentFrame.OnCreateClient.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MDIParentFrame.OnCreateClient.1.py index 0237faff..e2055105 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MDIParentFrame.OnCreateClient.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MDIParentFrame.OnCreateClient.1.py @@ -1,3 +1,3 @@ - + frame = MyParentFrame() frame.Create(parent, myParentFrameId, "My Parent Frame") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryDC.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryDC.1.py index 81fb5b73..c4a783bc 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryDC.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryDC.1.py @@ -1,8 +1,8 @@ - + # Create a memory DC temp_dc = wx.MemoryDC() temp_dc.SelectObject(test_bitmap) - + # We can now draw into the memory DC... # Copy from this DC to another DC. old_dc.Blit(250, 50, BITMAP_WIDTH, BITMAP_HEIGHT, temp_dc, 0, 0) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryDC.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryDC.2.py index 9f354df7..05acf3b5 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryDC.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryDC.2.py @@ -1,2 +1,2 @@ - + temp_dc.SelectObject(wx.NullBitmap) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryFSHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryFSHandler.1.py index 95757721..6ad3ee12 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryFSHandler.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MemoryFSHandler.1.py @@ -1,18 +1,18 @@ def OnAbout(self, event): - + bcur = wx.BeginBusyCursor() - + wx.FileSystem.AddHandler(wx.MemoryFSHandler) wx.MemoryFSHandler.AddFile("logo.pcx", wx.Bitmap("logo.pcx", wx.BITMAP_TYPE_PCX)) wx.MemoryFSHandler.AddFile("about.htm", "About: " "") - + dlg = wx.Dialog(self, -1, _("About")) topsizer = wx.BoxSizer(wx.VERTICAL) - + html = wx.html.HtmlWindow(dlg, size=wx.Size(380, 160), style=wx.HW_SCROLLBAR_NEVER) html.SetBorders(0) html.LoadPage("memory:about.htm") @@ -23,13 +23,13 @@ topsizer.Add(wx.StaticLine(dlg, -1), 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 10) topsizer.Add(wx.Button(dlg, wx.ID_OK, "Ok"), 0, wx.ALL | wx.ALIGN_RIGHT, 15) - + dlg.SetAutoLayout(True) dlg.SetSizer(topsizer) topsizer.Fit(dlg) dlg.Centre() dlg.ShowModal() - + wx.MemoryFSHandler.RemoveFile("logo.pcx") wx.MemoryFSHandler.RemoveFile("about.htm") - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.1.py index ee06dc71..ce0b9526 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.1.py @@ -1,2 +1,2 @@ - + self.fileMenu.Append(ID_NEW_FILE, "&New file\tCTRL+N", "Creates a XYZ document") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.2.py index 4735ae8a..3d3cac2f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.2.py @@ -1,2 +1,2 @@ - + self.fileMenu.Append(wx.ID_NEW, "", "Creates a XYZ document") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.3.py index ee06dc71..ce0b9526 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.3.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.3.py @@ -1,2 +1,2 @@ - + self.fileMenu.Append(ID_NEW_FILE, "&New file\tCTRL+N", "Creates a XYZ document") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.4.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.4.py index 4735ae8a..3d3cac2f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.4.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Menu.Append.4.py @@ -1,2 +1,2 @@ - + self.fileMenu.Append(wx.ID_NEW, "", "Creates a XYZ document") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.GetLabelText.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.GetLabelText.1.py index ae0d5784..66730283 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.GetLabelText.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.GetLabelText.1.py @@ -1,2 +1,2 @@ - + wx.MenuItem.GetLabelfromText("&Hello\tCtrl-h") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.SetItemLabel.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.SetItemLabel.1.py index 98c38e8b..c07d4ab1 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.SetItemLabel.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.SetItemLabel.1.py @@ -1,4 +1,4 @@ - + self.myMenuItem.SetItemLabel("My &item\tCTRL+I") self.myMenuItem2.SetItemLabel("Clean and build\tF7") self.myMenuItem3.SetItemLabel("Simple item") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.__init__.1.py index 5684bc19..ce3772b9 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.__init__.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MenuItem.__init__.1.py @@ -1,10 +1,10 @@ - + # use all stock properties: helpMenu.Append(wx.ID_ABOUT) - + # use the stock label and the stock accelerator but not the stock help string: helpMenu.Append(wx.ID_ABOUT, "", "My custom help string") - + # use all stock properties except for the bitmap: mymenu = wx.MenuItem(helpMenu, wx.ID_ABOUT) mymenu.SetBitmap(wx.ArtProvider.GetBitmap(wx.ART_WARNING)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MessageDialog.SetYesNoLabels.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MessageDialog.SetYesNoLabels.1.py index 28a1b30a..e8aa0d15 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MessageDialog.SetYesNoLabels.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MessageDialog.SetYesNoLabels.1.py @@ -1,3 +1,3 @@ - + dlg = wx.MessageDialog(parent, message, caption) dlg.SetYesNoLabels(wx.ID_SAVE, "&Don't save") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MessageDialog.SetYesNoLabels.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MessageDialog.SetYesNoLabels.2.py index b45b2acd..5666d6c5 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MessageDialog.SetYesNoLabels.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.MessageDialog.SetYesNoLabels.2.py @@ -1,4 +1,4 @@ - + dlg = wx.MessageDialog(parent, message, caption) if dlg.SetYesNoLabels("&Quit", "&Don't quit"): dlg.SetMessage("What do you want to do?") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ModalDialogHook.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ModalDialogHook.1.py index 3811c10b..1554139e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ModalDialogHook.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ModalDialogHook.1.py @@ -1,34 +1,34 @@ - + class MyModalDialogHook(wx.ModalDialogHook): - + def __init__(self, parent): - + wx.ModalDialogHook.__init__(self, parent) - - + + def Enter(self, dialog): - + # Just for demonstration purposes, intercept all uses of # wx.FileDialog. Notice that self doesn't provide any real # sandboxing, of course, the program can still read and write # files by not using wx.FileDialog to ask the user for their # names. if isinstance(dialog, wx.FileDialog): - + wx.LogError("Access to file system disallowed.") - + # Skip showing the file dialog entirely. return wx.ID_CANCEL - - + + self.lastEnter = wx.DateTime.Now() - + # Allow the dialog to be shown as usual. return wx.ID_NONE - - + + def Exit(self, dialog): - + # Again, just for demonstration purposes, show how long did # the user take to dismiss the dialog. Notice that we # shouldn't use wx.LogMessage() here as self would result in @@ -37,13 +37,12 @@ wx.LogDebug("%s dialog took %s to be dismissed", dialog.GetClassInfo().GetClassName(), (wx.DateTime.Now() - self.lastEnter).Format()) - - - + + + if __name__ == '__main__': - + app = wx.App(0) self.myHook = MyModalDialogHook(None) self.myHook.Register() app.MainLoop() - \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.NonOwnedWindow.SetShape.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.NonOwnedWindow.SetShape.1.py index f9854f95..c9c89164 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.NonOwnedWindow.SetShape.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.NonOwnedWindow.SetShape.1.py @@ -1,7 +1,7 @@ - + size = self.GetSize() path = wx.GraphicsRenderer.GetDefaultRenderer().CreatePath() path.AddCircle(size.x/2, size.y/2, 30) - + self.SetShape(path) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Notebook.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Notebook.1.py index b96935af..2a90a856 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Notebook.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Notebook.1.py @@ -1,2 +1,2 @@ - + wx.SystemOptions.SetOption("msw.notebook.themed-background", 0) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Notebook.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Notebook.2.py index 5c2c296c..0ab52bf9 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Notebook.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Notebook.2.py @@ -1,6 +1,6 @@ - + col = notebook.GetThemeBackgroundColour() - - if col.IsOk(): + + if col.IsOk(): page.SetBackgroundColour(col) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PaintEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PaintEvent.1.py index 95c42957..8a3300ef 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PaintEvent.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PaintEvent.1.py @@ -1,6 +1,6 @@ - + def OnPaint(self, event): - + dc = wx.PaintDC(self) DrawMyDocument(dc) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PaintEvent.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PaintEvent.2.py index 8b6def7e..a76f257d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PaintEvent.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PaintEvent.2.py @@ -1,9 +1,9 @@ - + # Called when window needs to be repainted. def OnPaint(self, event): - + dc = wx.PaintDC(self) - + # Find out where the window is scrolled to vbX, vbY = self.GetViewStart() @@ -17,5 +17,5 @@ # Repaint this rectangle PaintRectangle(rect, dc) - upd.Next() - + upd.Next() + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PickerBase.GetPickerCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PickerBase.GetPickerCtrl.1.py index a1e839a5..cc8a0970 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PickerBase.GetPickerCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PickerBase.GetPickerCtrl.1.py @@ -1,10 +1,10 @@ - + if wx.Platform == '__WXMSW__': # wxMSW is one of the platforms where the generic implementation # of wx.FilePickerCtrl is used... - + pButt = myFilePickerCtrl.GetPickerCtrl() - + if pButt is not None: pButt.SetLabel('Custom browse string') diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PlatformInformation.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PlatformInformation.1.py index aeb3a15f..a5d5b550 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PlatformInformation.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.PlatformInformation.1.py @@ -1,2 +1,2 @@ - + wx.LogMessage("This application is running under %s." % wx.PlatformInformation.Get().GetOperatingSystemIdName()) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Point.SetDefaults.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Point.SetDefaults.1.py index f9dfecc8..09ef5da9 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Point.SetDefaults.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Point.SetDefaults.1.py @@ -1,5 +1,5 @@ - + if not pos.IsFullySpecified(): pos.SetDefaults(GetDefaultPosition()) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Point.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Point.__init__.1.py index 1a0d1d4b..14157411 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Point.__init__.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Point.__init__.1.py @@ -1,3 +1,3 @@ - - rp = wx.RealPoint(10.3, 20.8) + + rp = wx.RealPoint(10.3, 20.8) p = wx.Point(int(round(rp.x)), int(round(rp.y))) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeDialog.1.py index b5868ac2..5270d7d3 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeDialog.1.py @@ -14,6 +14,6 @@ if n >= 0: wx.LogMessage("Your most preferred item is \"%s\""%n) break - - + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeDialog.AddExtraControls.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeDialog.AddExtraControls.1.py index 8fda359e..9cb9e64d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeDialog.AddExtraControls.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeDialog.AddExtraControls.1.py @@ -1,10 +1,10 @@ class MyRearrangeDialog(wx.RearrangeDialog): - def __init__(self, parent): + def __init__(self, parent): wx.RearrangeDialog.__init__(self, parent) - + panel = wx.Panel(self) sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(wx.StaticText(panel, wx.ID_ANY, @@ -12,7 +12,7 @@ sizer.Add(wx.TextCtrl(panel, wx.ID_ANY, "")) panel.SetSizer(sizer) self.AddExtraControls(panel) - + # ... code to update the text control with the currently selected # item width and to react to its changes omitted ... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeList.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeList.1.py index b1dbdf0d..9a16defa 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeList.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RearrangeList.1.py @@ -1,2 +1,2 @@ - + order = [0] # checked item #0 diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RichMessageDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RichMessageDialog.1.py index a221a13d..31d94a0b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RichMessageDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.RichMessageDialog.1.py @@ -1,13 +1,13 @@ - + def ShowDialog(self): - + if dont_show: return - + dlg = wx.RichMessageDialog(self, "Welcome to my wonderful program!") dlg.ShowCheckBox("Don't show welcome dialog again") dlg.ShowModal() # return value ignored as we have "Ok" only anyhow - + if dlg.IsCheckBoxChecked(): # ... make sure we won't show it again the next time ... dont_show = True diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ScrollBar.SetScrollbar.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ScrollBar.SetScrollbar.1.py index ffc4dfa7..49b44c50 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ScrollBar.SetScrollbar.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ScrollBar.SetScrollbar.1.py @@ -1,2 +1,2 @@ - + scrollbar.SetScrollbar(0, 16, 50, 15) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Scrolled.DoPrepareDC.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Scrolled.DoPrepareDC.1.py index 07fbab82..fe9862e8 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Scrolled.DoPrepareDC.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Scrolled.DoPrepareDC.1.py @@ -1,16 +1,16 @@ - + def OnEvent(self, event): - + dc = wx.ClientDC(self) self.DoPrepareDC(dc) - + dc.SetPen(wx.BLACK_PEN) x, y = event.GetPosition() - + if (xpos > -1 and ypos > -1 and event.Dragging()): dc.DrawLine(xpos, ypos, x, y) - + xpos = x ypos = y - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Scrolled.SetScrollbars.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Scrolled.SetScrollbars.1.py index 2c167c0c..6bb89e2c 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Scrolled.SetScrollbars.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Scrolled.SetScrollbars.1.py @@ -1,2 +1,2 @@ - + window.SetScrollbars(20, 20, 50, 50) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SearchCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SearchCtrl.1.py index c912e6f7..59e84357 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SearchCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SearchCtrl.1.py @@ -1,2 +1,2 @@ - - event.GetString() + + event.GetString() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SingleInstanceChecker.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SingleInstanceChecker.1.py index 8a246444..0a1ee2d3 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SingleInstanceChecker.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SingleInstanceChecker.1.py @@ -1,6 +1,6 @@ - + def OnInit(self): - + self.name = "SingleApp-%s" % wx.GetUserId() self.instance = wx.SingleInstanceChecker(self.name) @@ -10,5 +10,5 @@ frame = SingleAppFrame(None, "SingleApp") frame.Show() - return True - + return True + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Size.SetDefaults.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Size.SetDefaults.1.py index 70ffaa51..e0095493 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Size.SetDefaults.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Size.SetDefaults.1.py @@ -1,5 +1,5 @@ - + if not size.IsFullySpecified(): - + size.SetDefaults(GetDefaultSize()) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Sizer.AddSpacer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Sizer.AddSpacer.1.py index 38e02726..ac5ee16f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Sizer.AddSpacer.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Sizer.AddSpacer.1.py @@ -1,2 +1,2 @@ - + wx.Sizer.Add(size, size, 0) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Sizer.AddStretchSpacer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Sizer.AddStretchSpacer.1.py index 0b28bdb9..9c486f24 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Sizer.AddStretchSpacer.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Sizer.AddStretchSpacer.1.py @@ -1,2 +1,2 @@ - + wx.Sizer.Add(0, 0, proportion) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.1.py index 6fa76186..a986df62 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.1.py @@ -1,2 +1,2 @@ - + sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.2.py index 39f54cbd..490d2b5a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.2.py @@ -1,2 +1,2 @@ - + sizer.Add(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.3.py index 9a0867b0..1ba1e65d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.3.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.SizerFlags.3.py @@ -1,6 +1,6 @@ - + flagsExpand = wx.SizerFlags(1) flagsExpand.Expand().Border(wx.ALL, 10) - + sizer.Add(ctrl1, flagsExpand) sizer.Add(ctrl2, flagsExpand) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StandardPaths.MSWGetShellDir.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StandardPaths.MSWGetShellDir.1.py index 5a266e4a..971abc23 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StandardPaths.MSWGetShellDir.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StandardPaths.MSWGetShellDir.1.py @@ -1,6 +1,6 @@ - + if wx.Platform == '__WXMSW__': # get the location of files waiting to be burned on a CD cdburnArea = wx.StandardPaths.MSWGetShellDir(CSIDL_CDBURN_AREA) - + # endif __WXMSW__ diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StandardPaths.UseAppInfo.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StandardPaths.UseAppInfo.1.py index 96464831..785508cb 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StandardPaths.UseAppInfo.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StandardPaths.UseAppInfo.1.py @@ -1,2 +1,2 @@ - - info = AppInfo_AppName | AppInfo_VendorName + + info = AppInfo_AppName | AppInfo_VendorName diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBox.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBox.1.py index 9478f589..49a55e90 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBox.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBox.1.py @@ -1,9 +1,9 @@ - + def CreateControls(self): - + panel = wx.Panel(self) box = wx.StaticBox(panel, wx.ID_ANY, "StaticBox") - + text = wx.StaticText(box, wx.ID_ANY, "This window is a child of the staticbox") - # Other code... + # Other code... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBox.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBox.2.py index 711523a8..1dd8d951 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBox.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBox.2.py @@ -1,6 +1,6 @@ - + box = wx.StaticBox(panel, wx.ID_ANY, "StaticBox") - + text = wx.StaticText(panel, wx.ID_ANY, "This window is a child of the panel") - # Other code... + # Other code... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBoxSizer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBoxSizer.1.py index 33f9b748..0c9447c2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBoxSizer.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StaticBoxSizer.1.py @@ -1,12 +1,12 @@ - + def CreateControls(self): - + panel = wx.Panel(self) # Other controls here... - + sz = wx.StaticBoxSizer(wx.VERTICAL, panel, "Box") sz.Add(wx.StaticText(sz.GetStaticBox(), wx.ID_ANY, "This window is a child of the staticbox")) # Other code... - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StopWatch.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StopWatch.1.py index eabe244f..f25a8b96 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StopWatch.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.StopWatch.1.py @@ -1,4 +1,4 @@ - + sw = wx.StopWatch() CallLongRunningFunction() wx.LogMessage("The long running function took %dms to execute", sw.Time()) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCompleterSimple.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCompleterSimple.1.py index 1feee512..bb38ad32 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCompleterSimple.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCompleterSimple.1.py @@ -1,28 +1,28 @@ - + class MyTextCompleter(wx.TextCompleterSimple): def __init__(self): - wx.TextCompleterSimple.__init__(self) - + wx.TextCompleterSimple.__init__(self) + def GetCompletions(self, prefix, res): - + firstWord = prefix.split()[0] - - if firstWord == "white": + + if firstWord == "white": res.append("white pawn") res.append("white rook") - - elif firstWord == "black": + + elif firstWord == "black": res.append("black king") res.append("black queen") - - else: + + else: res.append("white") res.append("black") - + # Later on... text = wx.TextCtrl(parent, wx.ID_ANY, 'My Text') text.AutoComplete(MyTextCompleter()) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.1.py index 64cfc9ea..52ef5429 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.1.py @@ -1,4 +1,4 @@ - + text.SetDefaultStyle(wx.TextAttr(wx.RED)) text.AppendText("Red text\n") text.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.2.py index e526ba75..763e8fc2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.2.py @@ -1,2 +1,2 @@ - + # C++-style stream support is not implemented for Python. diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.3.py index e526ba75..763e8fc2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.3.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.3.py @@ -1,2 +1,2 @@ - + # C++-style stream support is not implemented for Python. diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.4.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.4.py index e526ba75..763e8fc2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.4.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.4.py @@ -1,2 +1,2 @@ - + # C++-style stream support is not implemented for Python. diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.5.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.5.py index e526ba75..763e8fc2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.5.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextCtrl.5.py @@ -1,2 +1,2 @@ - + # C++-style stream support is not implemented for Python. diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextEntry.GetInsertionPoint.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextEntry.GetInsertionPoint.1.py index 1cfa1779..c007558e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextEntry.GetInsertionPoint.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextEntry.GetInsertionPoint.1.py @@ -1,10 +1,10 @@ - + def GetCurrentChar(textCtrl): pos = textCtrl.GetInsertionPoint() - + if pos == textCtrl.GetLastPosition(): return '' - + return textCtrl.GetValue()[pos] - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextUrlEvent.Clone.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextUrlEvent.Clone.1.py index bb6a8bc8..53d2cc77 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextUrlEvent.Clone.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TextUrlEvent.Clone.1.py @@ -1,4 +1,4 @@ - + def Clone(self): - - return MyEvent() + + return MyEvent() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TimerEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TimerEvent.1.py index c97c80a2..fa0c2f61 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TimerEvent.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.TimerEvent.1.py @@ -1,19 +1,19 @@ - + class MyFrame(wx.Frame): def __init__(self, parent): - wx.Frame.__init__(self, parent) + wx.Frame.__init__(self, parent) self.timer = wx.Timer(self, TIMER_ID) self.Bind(wx.EVT_TIMER, self.OnTimer) - + self.timer.Start(1000) # 1 second interval - - + + def OnTimer(self, event): - + # do whatever you want to do every second here print('Hello') - - + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ToolBar.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ToolBar.1.py index e1c06334..63d0dac6 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ToolBar.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ToolBar.1.py @@ -1,2 +1,2 @@ - + wx.SystemOptions.SetOption("msw.remap", 0) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ToolBar.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ToolBar.2.py index fd396376..7030759b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ToolBar.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.ToolBar.2.py @@ -1,2 +1,2 @@ - + wx.SystemOptions.SetOption("msw.remap", 2) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Trackable.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Trackable.1.py index 598c0848..4f7c20fa 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Trackable.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Trackable.1.py @@ -1,2 +1,2 @@ - + # This class is not expected to be used from Python. diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.URLDataObject.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.URLDataObject.1.py index b897db2c..a1fdd476 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.URLDataObject.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.URLDataObject.1.py @@ -1,2 +1,2 @@ - + wx.TheClipboard.SetData(wx.URLDataObject(url)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.VListBox.GetFirstSelected.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.VListBox.GetFirstSelected.1.py index 369f7381..43a49d3b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.VListBox.GetFirstSelected.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.VListBox.GetFirstSelected.1.py @@ -1,6 +1,6 @@ - + item, cookie = vlbox.GetFirstSelected() while item != wx.NOT_FOUND: # ... process item ... item, cookie = vlbox.GetNextSelected(cookie) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Validator.SetWindow.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Validator.SetWindow.1.py index 2bc9051e..b04f94c0 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Validator.SetWindow.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Validator.SetWindow.1.py @@ -1,3 +1,3 @@ - + wx.TextCtrl(self, wx.ID_ANY, u'', wx.DefaultPosition, wx.DefaultSize, 0, validator=MyValidator()) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ConvertDialogToPixels.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ConvertDialogToPixels.1.py index 3be6157b..f7805661 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ConvertDialogToPixels.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ConvertDialogToPixels.1.py @@ -1,4 +1,4 @@ - + # The C++ convenience macro does not apply for Python, however you can # accomplish something similar with a function like this def DLG_UNIT(parent, point): diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.DoUpdateWindowUI.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.DoUpdateWindowUI.1.py index f1b3ec93..7bb590ca 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.DoUpdateWindowUI.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.DoUpdateWindowUI.1.py @@ -1,13 +1,13 @@ - + # do the window-specific processing after processing the update event def DoUpdateWindowUI(self, event): - + if event.GetSetEnabled(): self.Enable(event.GetEnabled()) - + if event.GetSetText(): - + if event.GetText() != self.GetTitle(): self.SetTitle(event.GetText()) - - + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Fit.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Fit.1.py index 073042e4..a5544b32 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Fit.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Fit.1.py @@ -1,2 +1,2 @@ - + window.SetClientSize(child.GetSize()) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.HandleWindowEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.HandleWindowEvent.1.py index 3d3d8f58..b746886e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.HandleWindowEvent.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.HandleWindowEvent.1.py @@ -1,2 +1,2 @@ - + GetEventHandler().SafelyProcessEvent(event) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.1.py index fedbbbad..61431d06 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.1.py @@ -1,2 +1,2 @@ - + self.SetSize(x, y, -1, -1, wx.SIZE_USE_EXISTING) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.2.py index fedbbbad..61431d06 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.2.py @@ -1,2 +1,2 @@ - + self.SetSize(x, y, -1, -1, wx.SIZE_USE_EXISTING) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.3.py index fedbbbad..61431d06 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.3.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.Move.3.py @@ -1,2 +1,2 @@ - + self.SetSize(x, y, -1, -1, wx.SIZE_USE_EXISTING) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ProcessEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ProcessEvent.1.py index 57b81dbb..a29a5053 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ProcessEvent.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ProcessEvent.1.py @@ -1,2 +1,2 @@ - - self.GetEventHandler().ProcessEvent() + + self.GetEventHandler().ProcessEvent() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ProcessWindowEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ProcessWindowEvent.1.py index 89a2697b..b6d8973b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ProcessWindowEvent.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.ProcessWindowEvent.1.py @@ -1,2 +1,2 @@ - + self.GetEventHandler().ProcessEvent(event) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.PushEventHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.PushEventHandler.1.py index 0da1720c..71e27500 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.PushEventHandler.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.PushEventHandler.1.py @@ -1,3 +1,3 @@ - + W.PushEventHandler(A) W.PushEventHandler(B) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetBackgroundStyle.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetBackgroundStyle.1.py index c1b4f18d..4414eefa 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetBackgroundStyle.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetBackgroundStyle.1.py @@ -1,16 +1,16 @@ - + class MyWidget(wx.Window): - def __init__(self, parent): + def __init__(self, parent): wx.Window.__init__(self) # Use default constructor here! - + # Do this first: self.SetBackgroundStyle(wx.BG_STYLE_TRANSPARENT) # And really create the window afterwards: self.Create(parent) - - - + + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetMaxClientSize.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetMaxClientSize.1.py index 0dd86184..c7cdd109 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetMaxClientSize.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetMaxClientSize.1.py @@ -1,2 +1,2 @@ - + self.SetMaxSize(self.ClientToWindowSize(size)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetMinClientSize.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetMinClientSize.1.py index d71497d6..22ad8de4 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetMinClientSize.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetMinClientSize.1.py @@ -1,2 +1,2 @@ - + self.SetMinSize(self.ClientToWindowSize(size)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetScrollbar.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetScrollbar.1.py index 40cac0bf..073d0115 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetScrollbar.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.SetScrollbar.1.py @@ -1,2 +1,2 @@ - + self.SetScrollbar(wx.VERTICAL, 0, 16, 50) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.UpdateWindowUI.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.UpdateWindowUI.1.py index b6b29039..65457b32 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.UpdateWindowUI.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Window.UpdateWindowUI.1.py @@ -1,6 +1,6 @@ - + def OnInternalIdle(self): - + if wx.UpdateUIEvent.CanUpdate(self): self.UpdateWindowUI(wx.UPDATE_UI_FROMIDLE) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.WindowModalDialogEvent.Clone.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.WindowModalDialogEvent.Clone.1.py index 60d64704..1cef0dcd 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.WindowModalDialogEvent.Clone.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.WindowModalDialogEvent.Clone.1.py @@ -1,4 +1,4 @@ - + def Clone(self): - return MyEvent() + return MyEvent() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.AboutDialogInfo.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.AboutDialogInfo.1.py index ec4fe085..577eb88e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.AboutDialogInfo.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.AboutDialogInfo.1.py @@ -1,6 +1,6 @@ - + def OnAbout(self, event): - + aboutInfo = wx.adv.AboutDialogInfo() aboutInfo.SetName("MyApp") aboutInfo.SetVersion(MY_APP_VERSION_STRING) @@ -8,6 +8,6 @@ aboutInfo.SetCopyright("(C) 1992-2012") aboutInfo.SetWebSite("http:#myapp.org") aboutInfo.AddDeveloper("My Self") - + wx.adv.AboutBox(aboutInfo) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.BannerWindow.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.BannerWindow.1.py index 93d0d2a5..1c01d910 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.BannerWindow.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.BannerWindow.1.py @@ -5,7 +5,7 @@ # ... create the frame itself ... wx.Frame.__init__(self, parent) - + # Create and initialize the banner. banner = wx.adv.BannerWindow(self, wx.TOP) banner.SetText("Welcome to my wonderful program", diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.RichToolTip.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.RichToolTip.1.py index 62e0b936..c468c64c 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.RichToolTip.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.RichToolTip.1.py @@ -1,4 +1,4 @@ - + password = wx.TextCtrl(parent, style=wx.TE_PASSWORD) # Later on... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.Sound.Play.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.Sound.Play.1.py index 564d6247..abc4bb61 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.Sound.Play.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.Sound.Play.1.py @@ -1,2 +1,2 @@ - + wx.adv.Sound(filename).Play(flags) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.Sound.PlaySound.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.Sound.PlaySound.1.py index 564d6247..abc4bb61 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.Sound.PlaySound.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.Sound.PlaySound.1.py @@ -1,2 +1,2 @@ - + wx.adv.Sound(filename).Play(flags) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.SplashScreen.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.SplashScreen.1.py index 65b887d9..168103cd 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.SplashScreen.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.SplashScreen.1.py @@ -1,4 +1,4 @@ - + bitmap = wx.Bitmap('splash16.png', wx.BITMAP_TYPE_PNG) splash = wx.adv.SplashScreen(bitmap, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT, diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.TreeListCtrl.GetNextItem.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.TreeListCtrl.GetNextItem.1.py index 7e4d0f94..4776590d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.TreeListCtrl.GetNextItem.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.TreeListCtrl.GetNextItem.1.py @@ -4,6 +4,6 @@ while item: ok = item.IsOk() item = tree.GetNextItem(item) - + # Do something with every tree item ... - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.1.py index 6aa99eb4..16fd03b5 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.1.py @@ -1,5 +1,5 @@ - + page3 = wx.RadioboxPage(wizard) page4 = wx.ValidationPage(wizard) - + wx.adv.WizardPageSimple.Chain(page3, page4) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.2.py index 18ee5a60..c3d13ed8 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.2.py @@ -1,4 +1,4 @@ - + # FirstPage is an instance of wx.adv.WizardPageSimple firstPage = FirstPage(self) firstPage.Chain(SecondPage).Chain(ThirdPage).Chain(LastPage) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.3.py index 0b5d9814..ac439cea 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.3.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.WizardPageSimple.Chain.3.py @@ -1,5 +1,5 @@ - + page3 = RadioBoxPage(wizard) page4 = ValidationPage(wizard) - + wx.adv.WizardPageSimple.Chain(page3, page4) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.functions.AboutBox.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.functions.AboutBox.1.py index 694dbf84..0fdff41f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.functions.AboutBox.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.adv.functions.AboutBox.1.py @@ -1,11 +1,11 @@ - + def ShowSimpleAboutDialog(self, event): - + info = wx.adv.AboutDialogInfo() info.SetName(_("My Program")) info.SetVersion(_("1.2.3 Beta")) info.SetDescription(_("This program does something great.")) info.SetCopyright(wx.T("(C) 2007 Me ")) - + wx.adv.AboutBox(info) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.1.py index f03094b9..085fe764 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.1.py @@ -1,4 +1,4 @@ - + text1 = wx.TextCtrl(self) text2 = wx.TextCtrl(self) self.mgr.AddPane(text1, wx.LEFT, "Pane Caption") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.2.py index d2d8bfdd..7346d131 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.aui.AuiManager.2.py @@ -1,2 +1,2 @@ - + self.mgr.GetPane(text1).Float() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py index 96dcfaea..2b62a38a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py @@ -1,6 +1,6 @@ - - # Some integer... + + # Some integer... l = value return wx.SpinCtrl(parent, wx.ID_ANY, "", labelRect.GetTopLeft(), labelRect.GetSize(), 0, 0, 100, l) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py index c410bbeb..5f46f3a3 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py @@ -1,6 +1,6 @@ - - # sc is a wx.SpinCtrl + + # sc is a wx.SpinCtrl l = sc.GetValue() value = l return True diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewListCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewListCtrl.1.py index c9abaa19..5e761e2c 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewListCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewListCtrl.1.py @@ -1,11 +1,11 @@ - + listctrl = wx.dataview.DataViewListCtrl(parent, wx.ID_ANY) - + listctrl.AppendToggleColumn("Toggle") listctrl.AppendTextColumn("Text") - + data = [True, "row 1"] listctrl.AppendItem(data) - + data = [False, "row 3"] listctrl.AppendItem(data) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewModel.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewModel.1.py index cf817fab..a8ee5fa5 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewModel.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewModel.1.py @@ -1,7 +1,7 @@ - + musicCtrl = wx.dataview.DataViewCtrl(self, wx.ID_ANY) musicModel = MyMusicModel() musicCtrl.AssociateModel(musicModel) musicModel.DecRef() # avoid memory leak !! - + # add columns now diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewModel.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewModel.2.py index 026b3713..f41b8742 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewModel.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewModel.2.py @@ -1,6 +1,6 @@ - + musicCtrl = wx.dataview.DataViewCtrl(self, wx.ID_ANY) musicModel = MyMusicModel() musicCtrl.AssociateModel(musicModel.get()) - + # add columns now diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewRenderer.DisableEllipsize.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewRenderer.DisableEllipsize.1.py index 7c44e76c..6b77d71d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewRenderer.DisableEllipsize.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.DataViewRenderer.DisableEllipsize.1.py @@ -1,2 +1,2 @@ - - EnableEllipsize(wx.ELLIPSIZE_NONE) + + EnableEllipsize(wx.ELLIPSIZE_NONE) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.TreeListCtrl.GetNextItem.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.TreeListCtrl.GetNextItem.1.py index 9090a175..9251709c 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.TreeListCtrl.GetNextItem.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.dataview.TreeListCtrl.GetNextItem.1.py @@ -1,7 +1,7 @@ item = tree.GetFirstItem() while item.IsOk(): - item = tree.GetNextItem(item) + item = tree.GetNextItem(item) # Do something with every tree item ... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.DirSelector.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.DirSelector.1.py index 07cd5f74..20c567ad 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.DirSelector.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.DirSelector.1.py @@ -1,6 +1,6 @@ - + selector = wx.DirSelector("Choose a folder") if selector.strip(): # Do something with the folder name print selector - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.FileSelector.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.FileSelector.1.py index c97f3ab2..4ee841d7 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.FileSelector.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.FileSelector.1.py @@ -1,2 +1,2 @@ - + wildcard = "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif" diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.FileSelector.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.FileSelector.2.py index 1dcbc369..f94cded9 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.FileSelector.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.FileSelector.2.py @@ -1,8 +1,8 @@ - + filename = wx.FileSelector("Choose a file to open") - + if filename.strip(): # work with the file print filename - + # else: cancelled by user diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.Kill.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.Kill.1.py index b1b9afcd..55664113 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.Kill.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.Kill.1.py @@ -1,12 +1,12 @@ - + # Signal enumeration - + wx.SIGNONE # verify if the process exists under Unix - wx.SIGHUP - wx.SIGINT - wx.SIGQUIT - wx.SIGILL - wx.SIGTRAP + wx.SIGHUP + wx.SIGINT + wx.SIGQUIT + wx.SIGILL + wx.SIGTRAP wx.SIGABRT wx.SIGEMT wx.SIGFPE @@ -17,4 +17,4 @@ wx.SIGPIPE wx.SIGALRM wx.SIGTERM # terminate the process gently - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.Kill.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.Kill.2.py index ebc61616..5eaae897 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.Kill.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.Kill.2.py @@ -1,9 +1,9 @@ - + # KillError enumeration - + wx.KILL_OK # no error wx.KILL_BAD_SIGNAL # no such signal wx.KILL_ACCESS_DENIED # permission denied wx.KILL_NO_PROCESS # no such process wx.KILL_ERROR # another, unspecified error - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.MessageBox.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.MessageBox.1.py index ed1e974f..395adefb 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.MessageBox.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.functions.MessageBox.1.py @@ -1,4 +1,4 @@ - + answer = wx.MessageBox("Quit program?", "Confirm", wx.YES_NO | wx.CANCEL, main_frame) if answer == wx.YES: diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetCellSize.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetCellSize.1.py index a93719e7..8949b078 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetCellSize.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetCellSize.1.py @@ -1,5 +1,5 @@ # .. code-block:: text - + +----+----+----+ | | | | +----+----+----+ diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetCellSize.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetCellSize.2.py index a93719e7..8949b078 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetCellSize.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetCellSize.2.py @@ -1,5 +1,5 @@ # .. code-block:: text - + +----+----+----+ | | | | +----+----+----+ diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetRowGridLinePen.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetRowGridLinePen.1.py index c76b39ac..d8d47cea 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetRowGridLinePen.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.Grid.GetRowGridLinePen.1.py @@ -1,8 +1,8 @@ - + # in a grid displaying music notation, use a solid black pen between # octaves (C0=row 127, C1=row 115 etc.) def GetRowGridLinePen(self, row): - + if row % 12 == 7: return wx.Pen(wx.BLACK, 1, wx.SOLID) else: diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.GridCellAttr.GetNonDefaultAlignment.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.GridCellAttr.GetNonDefaultAlignment.1.py index aa16a22c..f1ffbf24 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.GridCellAttr.GetNonDefaultAlignment.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.GridCellAttr.GetNonDefaultAlignment.1.py @@ -1,4 +1,4 @@ - + hAlign = wx.ALIGN_RIGHT vAlign = wx.ALIGN_INVALID diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.GridUpdateLocker.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.GridUpdateLocker.1.py index 6cfc2e33..d05b7220 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.GridUpdateLocker.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.grid.GridUpdateLocker.1.py @@ -1,11 +1,11 @@ - + def GridLocker(self): - + self.grid = wx.grid.Grid(self, -1) - + noUpdates = wx.grid.GridUpdateLocker(self.grid) self.grid.AppendColumn() # ... many other operations with self.grid ... self.grid.AppendRow() - + # destructor called, grid refreshed diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.AdjustPagebreak.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.AdjustPagebreak.1.py index edc6dab7..d4c5cf01 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.AdjustPagebreak.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.AdjustPagebreak.1.py @@ -1,4 +1,4 @@ - + ret_value, kp = container.AdjustPagebreak(p, kp, ph) while ret_value: ret_value, kp = container.AdjustPagebreak(p, kp, ph) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.Draw.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.Draw.1.py index 7d3c1f7e..2a4e3ef3 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.Draw.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.Draw.1.py @@ -1,3 +1,3 @@ - - + + dc.DrawText("hello", x + cell.PosX, y + cell.PosY) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.DrawInvisible.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.DrawInvisible.1.py index 4051f4be..2a4e3ef3 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.DrawInvisible.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlCell.DrawInvisible.1.py @@ -1,3 +1,3 @@ - + dc.DrawText("hello", x + cell.PosX, y + cell.PosY) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlContainerCell.SetWidthFloat.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlContainerCell.SetWidthFloat.1.py index 49559212..4522bc4b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlContainerCell.SetWidthFloat.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlContainerCell.SetWidthFloat.1.py @@ -1,2 +1,2 @@ - - SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) + + SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlContainerCell.SetWidthFloat.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlContainerCell.SetWidthFloat.2.py index 49559212..4522bc4b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlContainerCell.SetWidthFloat.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlContainerCell.SetWidthFloat.2.py @@ -1,2 +1,2 @@ - - SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) + + SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlFilter.CanRead.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlFilter.CanRead.1.py index 2d99d163..dcd5bf89 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlFilter.CanRead.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlFilter.CanRead.1.py @@ -1,7 +1,7 @@ - + def CanRead(file): - # file is a wx.FSFile in this case... + # file is a wx.FSFile in this case... return (file.GetMimeType() == "application/x-ugh") - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlFilter.ReadFile.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlFilter.ReadFile.1.py index b21e96bc..25032521 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlFilter.ReadFile.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlFilter.ReadFile.1.py @@ -1,6 +1,6 @@ - + def ReadFile(file): - # file is a wx.FSFile in this case... + # file is a wx.FSFile in this case... return "" diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlHelpController.AddBook.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlHelpController.AddBook.1.py index 6564248a..359134fe 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlHelpController.AddBook.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlHelpController.AddBook.1.py @@ -1,2 +1,2 @@ - + AddBook("help.zip") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlHelpController.AddBook.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlHelpController.AddBook.2.py index 6564248a..359134fe 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlHelpController.AddBook.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlHelpController.AddBook.2.py @@ -1,2 +1,2 @@ - + AddBook("help.zip") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlModalHelp.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlModalHelp.1.py index c08f3d0b..3a4e2433 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlModalHelp.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlModalHelp.1.py @@ -1,4 +1,4 @@ - + # The help can be browsed during the lifetime of self object when the # user quits the help, program execution will continue. help = wx.html.HtmlModalHelp(parent, "help", "My topic") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.GetFS.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.GetFS.1.py index a06985f5..921b8f94 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.GetFS.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.GetFS.1.py @@ -1,2 +1,2 @@ - + f = self.Parser.GetFS().OpenFile("image.jpg") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.1.py index 38e51f32..b7f00764 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.1.py @@ -1,10 +1,10 @@ # .. code-block:: xml - + - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.2.py index e10a6161..29d07e53 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlParser.PushTagHandler.2.py @@ -1,9 +1,9 @@ - + # some code in HandleTag for "MYITEMS"... self.Parser.PushTagHandler(self, "PARAM") self.ParseInner(tag) self.Parser.PopTagHandler() - + # back to working on "MYITEMS"... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetBeginPos.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetBeginPos.1.py index bf2d9369..f06f9224 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetBeginPos.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetBeginPos.1.py @@ -1,4 +1,4 @@ # .. code-block:: text - + bla bla bla bla bla internal text bla bla | \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetEndPos1.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetEndPos1.1.py index 114329a4..40f2622b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetEndPos1.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetEndPos1.1.py @@ -1,4 +1,4 @@ # .. code-block:: text - + bla bla bla bla bla internal text bla bla | \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetEndPos2.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetEndPos2.1.py index 2e457203..0d8e33da 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetEndPos2.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetEndPos2.1.py @@ -1,4 +1,4 @@ # .. code-block:: text - + bla bla bla bla bla internal text bla bla | \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetParam.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetParam.1.py index c144cae9..780cad3b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetParam.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.GetParam.1.py @@ -1,6 +1,6 @@ - + # ... Some code here... - + # you have wx.HtmlTag variable tag which is equal to the # HTML tag dummy = tag.GetParam("SIZE") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.HasEnding.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.HasEnding.1.py index 4721f5e7..f7f4c203 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.HasEnding.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTag.HasEnding.1.py @@ -1,5 +1,5 @@ # .. code-block:: html - + Hello

How are you? diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTagHandler.HandleTag.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTagHandler.HandleTag.1.py index d05e6665..4d3095b3 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTagHandler.HandleTag.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTagHandler.HandleTag.1.py @@ -1,6 +1,6 @@ - + def HandleTag(self, tag): - + # change state of parser (e.g. set bold face) self.ParseInner(tag) # ... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTagHandler.ParseInner.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTagHandler.ParseInner.1.py index 2a4e4824..ee7b3528 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTagHandler.ParseInner.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlTagHandler.ParseInner.1.py @@ -1,3 +1,3 @@ # .. code-block:: html - + Hello, world! diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlWinParser.GetContainer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlWinParser.GetContainer.1.py index e55289bc..4c802951 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlWinParser.GetContainer.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlWinParser.GetContainer.1.py @@ -1,2 +1,2 @@ - + self.WParser.GetContainer().InsertCell(html_cell) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlWindow.SetPage.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlWindow.SetPage.1.py index 0169dc2a..0d77cb73 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlWindow.SetPage.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.html.HtmlWindow.SetPage.1.py @@ -1,2 +1,2 @@ - + htmlwin.SetPage("Hello, world!") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.media.MediaCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.media.MediaCtrl.1.py index b86fb912..e338f522 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.media.MediaCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.media.MediaCtrl.1.py @@ -1,10 +1,10 @@ - + # connect to the media event self.Bind(wx.media.EVT_MEDIA_STOP, self.OnMediaStop, self.mediactrl) - + # ... def OnMediaStop(self, evt): if self.userWantsToSeek: self.mediactrl.SetPosition(someOtherPosition) evt.Veto() - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.msw.Metafile.SetClipboard.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.msw.Metafile.SetClipboard.1.py index da609372..5db5fb0f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.msw.Metafile.SetClipboard.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.msw.Metafile.SetClipboard.1.py @@ -1,4 +1,4 @@ - + dc = wx.MetafileDC() if dc.IsOk(): self.DoDrawing(dc) @@ -6,4 +6,4 @@ if metafile: success = metafile.SetClipboard(dc.MaxX() + 10, dc.MaxY() + 10) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.DirProperty.DoGetValidator.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.DirProperty.DoGetValidator.1.py index 3524723d..cf1dc194 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.DirProperty.DoGetValidator.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.DirProperty.DoGetValidator.1.py @@ -1,9 +1,9 @@ - + class MyPropertyClass(wx.propgrid.DirProperty): ... def DoGetValidator(self): validator = MyValidator(...) - + ... prepare validator... - + return validator diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FileProperty.DoGetValidator.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FileProperty.DoGetValidator.1.py index 88c226a3..9522fe5f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FileProperty.DoGetValidator.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FileProperty.DoGetValidator.1.py @@ -1,4 +1,4 @@ - + class MyPropertyClass(wx.propgrid.FileProperty): ... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FlagsProperty.ChildChanged.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FlagsProperty.ChildChanged.1.py index 761304db..33564ae1 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FlagsProperty.ChildChanged.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FlagsProperty.ChildChanged.1.py @@ -1,2 +1,2 @@ - + # TBW \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FloatProperty.DoGetValidator.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FloatProperty.DoGetValidator.1.py index add1f7a7..bdb3f49d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FloatProperty.DoGetValidator.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.FloatProperty.DoGetValidator.1.py @@ -1,4 +1,4 @@ - + class MyPropertyClass(wx.propgrid.FloatProperty): ... def DoGetValidator(self): diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGEditor.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGEditor.1.py index ec281fb1..979ed2e1 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGEditor.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGEditor.1.py @@ -1,2 +1,2 @@ - + editorPointer = wx.propgrid.PropertyGrid.RegisterEditorClass(MyEditorClass(), "MyEditor") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.1.py index 6fab1f80..811f7b1c 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.1.py @@ -1,2 +1,2 @@ - + # Thanks to the magic of Python nothing extra needs to be done here. diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.3.py index 1c79ca1f..b7f0f65a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.3.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.3.py @@ -1,2 +1,2 @@ - + self.SetFlag(wx.propgrid.PG_PROP_NO_ESCAPE) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.DoGetValidator.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.DoGetValidator.1.py index a9b7ead6..5dc0879d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.DoGetValidator.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.DoGetValidator.1.py @@ -1,4 +1,4 @@ - + class MyPropertyClass(wx.propgrid.PGProperty): ... diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.SetDefaultValue.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.SetDefaultValue.1.py index a63d6165..c08d97ff 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.SetDefaultValue.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PGProperty.SetDefaultValue.1.py @@ -1,2 +1,2 @@ - + theProperty.SetAttribute("DefaultValue", value) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGrid.AddActionTrigger.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGrid.AddActionTrigger.1.py index 22da0f9c..4ed75519 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGrid.AddActionTrigger.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGrid.AddActionTrigger.1.py @@ -1,4 +1,4 @@ - + propGrid.AddActionTrigger(wx.propgrid.PG_ACTION_NEXT_PROPERTY, wx.WXK_RETURN) propGrid.DedicateKey(wx.WXK_RETURN) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.Insert.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.Insert.1.py index 310c07bd..59d4831f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.Insert.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.Insert.1.py @@ -1,11 +1,11 @@ - + # append category my_cat_id = thePropGrid.Append(wx.propgrid.PropertyCategory("My Category")) - + ... - + # insert into category - using second variant my_item_id1 = thePropGrid.Insert(my_cat_id, 0, wx.propgrid.StringProperty("My String 1")) - + # insert before to first item - using first variant my_item_id2 = thePropGrid.Insert(my_item_id, wx.propgrid.StringProperty("My String 2")) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.Insert.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.Insert.2.py index 34237558..44514837 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.Insert.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.Insert.2.py @@ -1,11 +1,11 @@ - + # append category my_cat_id = thePropGrid.Append(wx.propgrid.PropertyCategory("My Category")) - + ... - + # insert into category - using second variant my_item_id1 = thePropGrid.Insert(my_cat_id, 0, wx.propgrid.StringProperty("My String 1")) - + # insert before the first item - using first variant my_item_id2 = thePropGrid.Insert(my_item_id, wx.propgrid.StringProperty("My String 2")) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.ReplaceProperty.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.ReplaceProperty.1.py index 97741d77..6522ad96 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.ReplaceProperty.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridInterface.ReplaceProperty.1.py @@ -1,3 +1,3 @@ - + pg.ReplaceProperty("Flags", wx.propgrid.FlagsProperty("Flags", wx.propgrid.PG_LABEL, newItems)) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridManager.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridManager.1.py index 4553094e..34392711 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridManager.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.PropertyGridManager.1.py @@ -1,4 +1,4 @@ - + pgMan = wx.propgrid.PropertyGridManager( parent, PGID, @@ -14,15 +14,15 @@ # Plus defaults. wx.PGMAN_DEFAULT_STYLE ) - + page = pgMan.AddPage("First Page") page.Append(wx.propgrid.PropertyCategory("Category A1")) page.Append(wx.propgrid.IntProperty("Number", wx.propgrid.PG_LABEL, 1)) page.Append(wx.propgrid.ColourProperty("Colour",wx.propgrid.PG_LABEL, wx.WHITE)) - + page = pgMan.AddPage("Second Page") page.Append("Text", wx.propgrid.PG_LABEL, "(no text)") page.Append(wx.propgrid.FontProperty("Font",wx.propgrid.PG_LABEL)) - + # Display a header above the grid pgMan.ShowHeader() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.UIntProperty.DoGetValidator.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.UIntProperty.DoGetValidator.1.py index 28028362..d142cc83 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.UIntProperty.DoGetValidator.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.propgrid.UIntProperty.DoGetValidator.1.py @@ -1,4 +1,4 @@ - + class MyPropertyClass(wx.propgrid.UIntProperty): ... def DoGetValidator(self): diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextEvent.Clone.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextEvent.Clone.1.py index bb6a8bc8..53d2cc77 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextEvent.Clone.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextEvent.Clone.1.py @@ -1,4 +1,4 @@ - + def Clone(self): - - return MyEvent() + + return MyEvent() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextFormattingDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextFormattingDialog.1.py index 3266a74c..3b53cf4f 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextFormattingDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextFormattingDialog.1.py @@ -4,12 +4,12 @@ range = self.richTextCtrl.GetSelectionRange() else: range = wx.RichTextRange(0, self.richTextCtrl.GetLastPosition()+1) - + pages = wx.richtext.RICHTEXT_FORMAT_FONT \ | wx.richtext.RICHTEXT_FORMAT_INDENTS_SPACING \ | wx.richtext.RICHTEXT_FORMAT_TABS \ | wx.richtext.RICHTEXT_FORMAT_BULLETS - + with wx.richtext.RichTextFormattingDialog(pages, self) as dlg: dlg.GetStyle(self.richTextCtrl, range) if dlg.ShowModal() == wx.ID_OK: diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextHTMLHandler.SetFontSizeMapping.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextHTMLHandler.SetFontSizeMapping.1.py index e67db67e..099e12da 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextHTMLHandler.SetFontSizeMapping.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.RichTextHTMLHandler.SetFontSizeMapping.1.py @@ -1,3 +1,3 @@ - - fontSizeMapping = [7, 9, 11, 12, 14, 22, 100] + + fontSizeMapping = [7, 9, 11, 12, 14, 22, 100] htmlHandler.SetFontSizeMapping(fontSizeMapping) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.SymbolPickerDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.SymbolPickerDialog.1.py index 0abcbf6b..fa96d8b8 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.SymbolPickerDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.richtext.SymbolPickerDialog.1.py @@ -1,33 +1,33 @@ - + ctrl = self.FindWindow(ID_RICHTEXT_CTRL) - + attr = wx.TextAttr() attr.SetFlags(wx.TEXT_ATTR_FONT) ctrl.GetStyle(ctrl.GetInsertionPoint(), attr) - + currentFontName = '' if (attr.HasFont() and attr.GetFont().IsOk()): currentFontName = attr.GetFont().GetFaceName() - + # Don't set the initial font in the dialog (so the user is choosing # 'normal text', i.e. the current font) but do tell the dialog # what 'normal text' is. - + dlg = wx.richtext.SymbolPickerDialog("*", '', currentFontName, self) - + if dlg.ShowModal() == wx.ID_OK: - + if dlg.HasSelection(): - + insertionPoint = ctrl.GetInsertionPoint() - + ctrl.WriteText(dlg.GetSymbol()) - + if not dlg.UseNormalFont(): - + font = attr.GetFont() font.SetFaceName(dlg.GetFontName()) attr.SetFont(font) ctrl.SetStyle(insertionPoint, insertionPoint+1, attr) - - + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.stc.StyledTextCtrl.GetInsertionPoint.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.stc.StyledTextCtrl.GetInsertionPoint.1.py index 96e8137d..2e907fdc 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.stc.StyledTextCtrl.GetInsertionPoint.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.stc.StyledTextCtrl.GetInsertionPoint.1.py @@ -1,9 +1,9 @@ - + def GetCurrentChar(self, text_ctrl): - + pos = text_ctrl.GetInsertionPoint() if pos == text_ctrl.GetLastPosition(): return '' - + return text_ctrl.GetRange(pos, pos + 1) - + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.1.py index 2cd68128..66bd0b43 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.1.py @@ -1,6 +1,6 @@ def ScanDocument(): - + doc = wx.xml.XmlDocument() if not doc.Load("myfile.xml"): return False @@ -38,7 +38,7 @@ # process tag2 ... attrvalue3 = child.GetAttribute("attr3", "default-value") - + child = child.GetNext() diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.2.py index dca363e1..0b737758 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.2.py @@ -1,6 +1,6 @@ - + doc = wx.xml.XmlDocument() doc.Load("myfile.xml", "UTF-8", wx.xml.XMLDOC_KEEP_WHITESPACE_NODES) - + # myfile2.xml will be identical to myfile.xml saving it self way: doc.Save("myfile2.xml", wx.xml.XML_NO_INDENTATION) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.3.py index 79803699..f3f6b7a8 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.3.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlDocument.3.py @@ -1,4 +1,4 @@ - + doc = wx.xml.XmlDocument() doc.Load("myfile.xml") doc.Save("myfile2.xml") # myfile2.xml != myfile.xml diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlNode.GetNodeContent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlNode.GetNodeContent.1.py index 533da658..fb7caa44 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlNode.GetNodeContent.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlNode.GetNodeContent.1.py @@ -1,4 +1,4 @@ # .. code-block:: text - + XML_ELEMENT_NODE name="tagname", content="" |-- XML_TEXT_NODE name="", content="tagcontent" diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlNode.GetNodeContent.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlNode.GetNodeContent.2.py index b0a38387..f29f11cf 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlNode.GetNodeContent.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xml.XmlNode.GetNodeContent.2.py @@ -1,4 +1,4 @@ # .. code-block:: text - + XML_ELEMENT_NODE name="tagname", content="" |-- XML_CDATA_SECTION_NODE name="", content="tagcontent" diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.Load.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.Load.1.py index 3370aca3..af19d2d6 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.Load.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.Load.1.py @@ -1,3 +1,3 @@ - + if not wx.xml.XmlResource.Get().Load("rc/*.xrc"): wx.LogError("Couldn't load resources!") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.LoadDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.LoadDialog.1.py index 0038aae6..8711b7e8 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.LoadDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/wx.xrc.XmlResource.LoadDialog.1.py @@ -1,3 +1,3 @@ - + dlg = wx.xml.XmlResource.Get().LoadDialog(mainFrame, "my_dialog") dlg.ShowModal() From 936d722cd8ebef255b83f7ce61a13a8eab70337b Mon Sep 17 00:00:00 2001 From: Metallicow Date: Tue, 16 Jan 2018 09:24:16 -0600 Subject: [PATCH 07/14] :interrobang: Trim trailing whitespace *.md; *.rst :interrobang: Not sure if the generated *.rst stuff is intended to have whitespace or not, so seperating this from the other commits, so easy to revert if necessary. --- .github/issue_template.md | 6 +- .github/pull_request_template.md | 6 +- CHANGES.rst | 2 +- docs/MigrationGuide.rst | 54 +-- .../overviews/DocstringsGuidelines.rst | 26 +- .../overviews/bitmap_overview.rst | 2 +- .../overviews/bookctrl_overview.rst | 2 +- .../overviews/command_overview.rst | 2 +- .../overviews/common_dialogs_overview.rst | 6 +- .../overviews/datetime_overview.rst | 4 +- .../overviews/dialog_overview.rst | 8 +- .../overviews/dnd_overview.rst | 34 +- .../overviews/events_overview.rst | 22 +- .../overviews/filesystem_overview.rst | 4 +- .../overviews/font_overview.rst | 8 +- .../overviews/grid_overview.rst | 10 +- .../overviews/html_overview.rst | 6 +- .../overviews/internationalization.rst | 4 +- .../overviews/log_classes_overview.rst | 16 +- .../overviews/richtextctrl_overview.rst | 392 +++++++++--------- .../overviews/scrolling_overview.rst | 4 +- .../overviews/sizers_overview.rst | 104 ++--- .../overviews/splitterwindow_overview.rst | 10 +- .../overviews/standard_event_identifiers.rst | 6 +- .../overviews/tipprovider_overview.rst | 4 +- .../overviews/treectrl_overview.rst | 2 +- .../overviews/validator_overview.rst | 10 +- .../overviews/window_ids_overview.rst | 12 +- .../overviews/window_styles_overview.rst | 4 +- .../writing_non_english_applications.rst | 2 +- .../tables/wx.ArtProvider.1.rst | 34 +- .../tables/wx.VScrolledWindow.1.rst | 28 +- 32 files changed, 417 insertions(+), 417 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index 06dcbaf3..6edb8980 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,6 +1,6 @@ - diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 96d2e16d..e2ca6a05 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,8 +1,8 @@ Fixes #NNNN diff --git a/CHANGES.rst b/CHANGES.rst index 081f2978..8d81807a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -51,7 +51,7 @@ Changes in this release include the following: * Fixed wx.richtext.RichTextBuffer.GetExtWildcard to return a tuple of 2 values, as was done in Classic. (#594) -* Various fixes in UltimateListCtrl, HyperTreeList and CheckListCtrlMixin. +* Various fixes in UltimateListCtrl, HyperTreeList and CheckListCtrlMixin. (#592, #349, #612) * Fixes in TextEditMixin to ensure that the new value is passed in the diff --git a/docs/MigrationGuide.rst b/docs/MigrationGuide.rst index 36620e90..a8f6516c 100644 --- a/docs/MigrationGuide.rst +++ b/docs/MigrationGuide.rst @@ -116,8 +116,8 @@ available in Phoenix:: -Static Methods --------------- +Static Methods +-------------- In the distant past when SWIG was generating wrapper code for C++ static methods it would create a standalone function named ``ClassName_MethodName`` @@ -130,7 +130,7 @@ the problem simply change the underscore to a dot, for example you should change this:: c = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUTEXT) - + to this:: c = wx.SystemSettings.GetColour(wx.SYS_COLOUR_MENUTEXT) @@ -199,28 +199,28 @@ that is using the old names to use the new ones instead:: wx.NORMAL = wx.FONTWEIGHT_NORMAL wx.LIGHT = wx.FONTWEIGHT_LIGHT wx.BOLD = wx.FONTWEIGHT_BOLD - + wx.NORMAL = wx.FONTSTYLE_NORMAL wx.ITALIC = wx.FONTSTYLE_ITALIC wx.SLANT = wx.FONTSTYLE_SLANT - - wx.SOLID = wx.PENSTYLE_SOLID - wx.DOT = wx.PENSTYLE_DOT - wx.LONG_DASH = wx.PENSTYLE_LONG_DASH - wx.SHORT_DASH = wx.PENSTYLE_SHORT_DASH - wx.DOT_DASH = wx.PENSTYLE_DOT_DASH - wx.USER_DASH = wx.PENSTYLE_USER_DASH - wx.TRANSPARENT = wx.PENSTYLE_TRANSPARENT - wx.STIPPLE_MASK_OPAQUE = wx.BRUSHSTYLE_STIPPLE_MASK_OPAQUE - wx.STIPPLE_MASK = wx.BRUSHSTYLE_STIPPLE_MASK - wx.STIPPLE = wx.BRUSHSTYLE_STIPPLE - wx.BDIAGONAL_HATCH = wx.BRUSHSTYLE_BDIAGONAL_HATCH - wx.CROSSDIAG_HATCH = wx.BRUSHSTYLE_CROSSDIAG_HATCH - wx.FDIAGONAL_HATCH = wx.BRUSHSTYLE_FDIAGONAL_HATCH - wx.CROSS_HATCH = wx.BRUSHSTYLE_CROSS_HATCH - wx.HORIZONTAL_HATCH = wx.BRUSHSTYLE_HORIZONTAL_HATCH - wx.VERTICAL_HATCH = wx.BRUSHSTYLE_VERTICAL_HATCH + wx.SOLID = wx.PENSTYLE_SOLID + wx.DOT = wx.PENSTYLE_DOT + wx.LONG_DASH = wx.PENSTYLE_LONG_DASH + wx.SHORT_DASH = wx.PENSTYLE_SHORT_DASH + wx.DOT_DASH = wx.PENSTYLE_DOT_DASH + wx.USER_DASH = wx.PENSTYLE_USER_DASH + wx.TRANSPARENT = wx.PENSTYLE_TRANSPARENT + + wx.STIPPLE_MASK_OPAQUE = wx.BRUSHSTYLE_STIPPLE_MASK_OPAQUE + wx.STIPPLE_MASK = wx.BRUSHSTYLE_STIPPLE_MASK + wx.STIPPLE = wx.BRUSHSTYLE_STIPPLE + wx.BDIAGONAL_HATCH = wx.BRUSHSTYLE_BDIAGONAL_HATCH + wx.CROSSDIAG_HATCH = wx.BRUSHSTYLE_CROSSDIAG_HATCH + wx.FDIAGONAL_HATCH = wx.BRUSHSTYLE_FDIAGONAL_HATCH + wx.CROSS_HATCH = wx.BRUSHSTYLE_CROSS_HATCH + wx.HORIZONTAL_HATCH = wx.BRUSHSTYLE_HORIZONTAL_HATCH + wx.VERTICAL_HATCH = wx.BRUSHSTYLE_VERTICAL_HATCH @@ -238,9 +238,9 @@ or other conditional statement to see if it is safe to use, like this:: if someWindow: someWindow.doSomething() - - - + + + wx.PyAssertionError --> wx.wxAssertionError ------------------------------------------- @@ -412,16 +412,16 @@ where the data object should fetch from or copy to a specific memory location. wx.DataObjectSimple.__init__(self) self.SetFormat(wx.DataFormat("my data format")) self.myData = bytes(value) - + def GetDataSize(self): return len(self.myData) - + def GetDataHere(self, buf): # copy our local data value to buf assert isinstance(buf, memoryview) buf[:] = self.myData return True - + def SetData(self, buf): # copy from buf to our local data value assert isinstance(buf, memoryview) diff --git a/docs/sphinx/rest_substitutions/overviews/DocstringsGuidelines.rst b/docs/sphinx/rest_substitutions/overviews/DocstringsGuidelines.rst index 8650d8d0..51a8ff3b 100644 --- a/docs/sphinx/rest_substitutions/overviews/DocstringsGuidelines.rst +++ b/docs/sphinx/rest_substitutions/overviews/DocstringsGuidelines.rst @@ -45,12 +45,12 @@ these fields are recognized and formatted nicely: * ``param``, ``parameter``, ``arg``, ``argument``, ``key``, ``keyword``: Description of a parameter. - + * ``type``: Type of a parameter. * ``raises``, ``raise``, ``except``, ``exception``: That (and when) a specific exception is raised. - + * ``var``, ``ivar``, ``cvar``: Description of a variable. * ``returns``, ``return``: Description of the return value. @@ -168,19 +168,19 @@ admonitions: a severe limitation of a method, class or function. In the Phoenix world, this may also indicate that a particular widget is not supported under one or more platforms; - + 3. ``.. deprecated::`` : used to mark deprecated methods, classes or functions; 4. ``.. availability::`` : normally employed to make the user understand on which platform(s) a particular functionality is supported/available; - + 5. ``.. seealso::`` or ``:see:`` : added primarily to facilitate the browsing of the docs, this admonition should be employed every time you think a user may be interested in seeing a related/similar method or a function providing an alternative implementation; - + 6. ``.. todo::`` : used to mark incomplete methods/functions, or simply as a remainder for the user and the developer that some more functionality needs to be added. @@ -196,7 +196,7 @@ this:: - The note contains all indented body elements following. - It includes this bullet list. - + | @@ -244,21 +244,21 @@ documentation, please follow these conventions: 2. At the very top of the snippet file (on the first line), put your name, or your alias, or anything you use as internet name preceeded by a double-hash, i.e.: - + ``##Andrea Gavana`` - - + + So that your source code looks more or less like this:: - + ##Chris Barker #!/usr/bin/env python """ A simple test of the GridBagSizer http://wiki.wxpython.org/index.cgi/WriteItYourself """ - + # Whatever code here... - def SendSizeEvent(self): + def SendSizeEvent(self): self.AdjustMySize() @@ -293,7 +293,7 @@ especially on Linux/Mac platforms. If you wish to contribute a screenshot of a widget to be included in the documentation, please follow these conventions: -- If the widget is a class belonging to the main `wx` namespace, +- If the widget is a class belonging to the main `wx` namespace, use the full class name in lower case (i.e., `wx.Frame` ==> `wx.frame.png`); diff --git a/docs/sphinx/rest_substitutions/overviews/bitmap_overview.rst b/docs/sphinx/rest_substitutions/overviews/bitmap_overview.rst index 66244f4f..b61f3314 100644 --- a/docs/sphinx/rest_substitutions/overviews/bitmap_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/bitmap_overview.rst @@ -21,7 +21,7 @@ using :meth:`wx.DC.Blit`(), or to be used as a drawing surface. .. seealso:: :ref:`wx.MemoryDC` for an example of drawing onto a bitmap. -All wxPython platforms support XPMs for small bitmaps and icons. +All wxPython platforms support XPMs for small bitmaps and icons. diff --git a/docs/sphinx/rest_substitutions/overviews/bookctrl_overview.rst b/docs/sphinx/rest_substitutions/overviews/bookctrl_overview.rst index 4ffd11a3..008e1f9d 100644 --- a/docs/sphinx/rest_substitutions/overviews/bookctrl_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/bookctrl_overview.rst @@ -11,7 +11,7 @@ Introduction ------------ -A book control is a convenient way of displaying multiple pages of information, displayed one page at a time. +A book control is a convenient way of displaying multiple pages of information, displayed one page at a time. wxPython has five variants of this control: - :ref:`wx.Choicebook`: controlled by a :ref:`wx.Choice` diff --git a/docs/sphinx/rest_substitutions/overviews/command_overview.rst b/docs/sphinx/rest_substitutions/overviews/command_overview.rst index 884c4496..13af56d3 100644 --- a/docs/sphinx/rest_substitutions/overviews/command_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/command_overview.rst @@ -61,7 +61,7 @@ By calling :meth:`wx.FileHistory.UseMenu` you can associate a file menu with the file history. The menu will then be used for appending filenames that are added to the history. -.. note:: +.. note:: Please notice that currently if the history already contained filenames when UseMenu() is called (e.g. when initializing a second diff --git a/docs/sphinx/rest_substitutions/overviews/common_dialogs_overview.rst b/docs/sphinx/rest_substitutions/overviews/common_dialogs_overview.rst index 6b0a85de..efdee569 100644 --- a/docs/sphinx/rest_substitutions/overviews/common_dialogs_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/common_dialogs_overview.rst @@ -72,7 +72,7 @@ background of a window:: data = wx.ColourData() data.SetChooseFull(True) - + for i in xrange(16): colour = wx.Colour(i*16, i*16, i*16) data.SetCustomColour(i, colour) @@ -186,14 +186,14 @@ The wildcard may be a specification for multiple types of file with a description for each, such as:: wildcard = "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif" - + .. _dirdialog overview: DirDialog Overview ------------------- - + This dialog shows a directory selector dialog, allowing the user to select a single directory. diff --git a/docs/sphinx/rest_substitutions/overviews/datetime_overview.rst b/docs/sphinx/rest_substitutions/overviews/datetime_overview.rst index bdb56655..0bdce512 100644 --- a/docs/sphinx/rest_substitutions/overviews/datetime_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/datetime_overview.rst @@ -124,11 +124,11 @@ Here is what can be done: :ref:`wx.DateTime` resulting in a new :ref:`wx.DateTime` object and also 2 objects of the same span class can be added together giving another object of the same class. - + * **Subtraction**: the same types of operations as above are allowed and, additionally, a difference between two :ref:`wx.DateTime` objects can be taken and this will yield :ref:`wx.TimeSpan`. - + * **Multiplication**: a :ref:`wx.TimeSpan` or :ref:`wx.DateSpan` object can be multiplied by an integer number resulting in an object of the same type. diff --git a/docs/sphinx/rest_substitutions/overviews/dialog_overview.rst b/docs/sphinx/rest_substitutions/overviews/dialog_overview.rst index f282ba8e..764f1f02 100644 --- a/docs/sphinx/rest_substitutions/overviews/dialog_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/dialog_overview.rst @@ -80,8 +80,8 @@ bottom of the dialog. This is done as follows, in new :ref:`wx.ScrolledWindow` object, using the old top-level sizer for the scrolled window and creating a new top-level sizer to lay out the scrolled window and standard button sizer. - - + + .. _layout adaptation code: Customising scrolling adaptation @@ -134,8 +134,8 @@ not fool-proof, and may fail in the following situations: - The dialog makes assumptions about the sizer hierarchy, for example to show or hide children of the top-level sizer. However, the original sizer hierarchy will still hold until `Show` or `ShowModal` - is called. - + is called. + You can help make sure that your dialogs will continue to function after adaptation by: diff --git a/docs/sphinx/rest_substitutions/overviews/dnd_overview.rst b/docs/sphinx/rest_substitutions/overviews/dnd_overview.rst index a0eb3d64..433f9f4b 100644 --- a/docs/sphinx/rest_substitutions/overviews/dnd_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/dnd_overview.rst @@ -21,19 +21,19 @@ by the user elsewhere, you should implement the following steps: initialized with the data you wish to drag. For example:: my_data = wx.TextDataObject("This text will be dragged.") - - - + + + - **Drag start**: To start the dragging process (typically in response to a mouse click) you must call :meth:`wx.DropSource.DoDragDrop` like this:: - + dragSource = wx.DropSource(self) dragSource.SetData(my_data) result = dragSource.DoDragDrop(True) - - - + + + - **Dragging**: The call to `DoDragDrop()` blocks the program until the user releases the mouse button (unless you override the :meth:`wx.DropSource.GiveFeedback` function to do something @@ -42,23 +42,23 @@ by the user elsewhere, you should implement the following steps: Windows or any program supporting the XDnD protocol under X Windows), the corresponding :ref:`wx.DropTarget` methods are called - see below. - + - **Processing the result**: `DoDragDrop()` returns an effect code which is one of the values of :ref:`wx.DragResult`:: if result == wx.DragCopy: # Copy the data CopyMyData() - + elif result == wx.DragMove: # Move the data MoveMyData() - + else: # Default, do nothing - pass - - + pass + + To be a `drop` target, i.e. to receive the data dropped by the user you should follow the instructions below: @@ -70,7 +70,7 @@ you should follow the instructions below: methods. Alternatively, you may derive from :ref:`wx.TextDropTarget` or :ref:`wx.FileDropTarget` and override their `OnDropText()` or `OnDropFiles()` method. - + - **Drop**: When the user releases the mouse over a window, wxPython asks the associated :ref:`wx.DropTarget` object if it accepts the data. For this, a :ref:`wx.DataObject` must be associated with the @@ -79,11 +79,11 @@ you should follow the instructions below: well, then :meth:`wx.DropTarget.OnData` will get called and the :ref:`wx.DataObject` belonging to the drop target can get filled with data. - + - **The end**: After processing the data, `DoDragDrop()` returns either ``wx.DragCopy`` or ``wx.DragMove`` depending on the state of the keys ``Ctrl``, ``Shift`` and ``Alt`` at the moment of the drop. There is currently no way for the drop target to change this return code. - - + + diff --git a/docs/sphinx/rest_substitutions/overviews/events_overview.rst b/docs/sphinx/rest_substitutions/overviews/events_overview.rst index 75732073..7e09b1aa 100644 --- a/docs/sphinx/rest_substitutions/overviews/events_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/events_overview.rst @@ -49,7 +49,7 @@ To be more precise, each event is described by: several buttons, all generating the same button click event), checking the event source object or its id allows to distinguish between them. - + .. _event handling: @@ -82,7 +82,7 @@ usually in the code of the class defining the handler itself, call its wx.Frame.__init__(self, parent) # Other initialization code... - + self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT) @@ -123,7 +123,7 @@ event handler:: wx.Frame.__init__(self, parent) # Other initialization code... - + self.Bind(wx.EVT_MENU, OnFrameExit, id=wx.ID_EXIT) @@ -189,8 +189,8 @@ having handled the event and the search continues): 8. Finally, i.e., if the event is still not processed, the :ref:`wx.App` object itself (which derives from :ref:`wx.EvtHandler`) gets a last chance to process it. - - + + **Please pay close attention to step 6!** People often overlook or get confused by this powerful feature of the wxPython event processing system. The details of event propagation up the window hierarchy are @@ -313,8 +313,8 @@ You can bind the events normally via either binding syntax:: self.Bind(EVT_SOME_NEW_EVENT, self.handler) EVT_SOME_NEW_EVENT(self, self.handler) - - + + You can also attach arbitrary data to the event during its creation, then post it to whatever window you choose:: @@ -322,8 +322,8 @@ then post it to whatever window you choose:: evt = SomeNewEvent(attr1="hello", attr2=654) # Post the event wx.PostEvent(target, evt) - - + + When handling events with such arbitrary data, you can fetch the data via attributes, named the same as the names passed in during the event instance creation. That is, given the two keyword arguments passed to @@ -334,8 +334,8 @@ instance creation. That is, given the two keyword arguments passed to # Given the above constructed event, the following is true evt.attr1 == "hello" evt.attr2 == 654 - - + + Miscellaneous Notes diff --git a/docs/sphinx/rest_substitutions/overviews/filesystem_overview.rst b/docs/sphinx/rest_substitutions/overviews/filesystem_overview.rst index f7b4a463..57f9bc62 100644 --- a/docs/sphinx/rest_substitutions/overviews/filesystem_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/filesystem_overview.rst @@ -73,7 +73,7 @@ It is not used by global protocols like HTTP but it becomes handy when nesting protocols - for example you may want to access files in a ZIP archive: -``file:archives/cpp_doc.zip#zip:reference/fopen.htm#syntax`` +``file:archives/cpp_doc.zip#zip:reference/fopen.htm#syntax`` In this example, the protocol is ``"zip"``, right location is ``"reference/fopen.htm"``, anchor is ``"syntax"`` and left location is @@ -103,7 +103,7 @@ The following virtual file system handlers are part of wxPython so far: stored in memory (such as bitmaps) as if they were regular files. See :ref:`wx.MemoryFSHandler` for details. URL is prefixed with memory:, e.g. ``"memory:myfile.htm"``. - + In addition, :ref:`FileSystem` itself can access local files. diff --git a/docs/sphinx/rest_substitutions/overviews/font_overview.rst b/docs/sphinx/rest_substitutions/overviews/font_overview.rst index 306884ac..48413343 100644 --- a/docs/sphinx/rest_substitutions/overviews/font_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/font_overview.rst @@ -42,12 +42,12 @@ be transported to a different Windows machine or other platform. .. note:: There is currently a difference between the appearance of fonts on the two platforms, if the mapping mode is anything other than ``MM_TEXT``. Under X, font size is always specified in - points. Under MS Windows, the unit for text is points but + points. Under MS Windows, the unit for text is points but the text is scaled according to the current mapping mode. However, user scaling on a device context will also scale fonts under both environments. - - + + Native font information ----------------------- @@ -70,4 +70,4 @@ font. implemented for Windows and Unix (GTK+ and Motif) ports only, all the methods are available for all the ports and should be used to make your program work correctly when they are implemented later. - + diff --git a/docs/sphinx/rest_substitutions/overviews/grid_overview.rst b/docs/sphinx/rest_substitutions/overviews/grid_overview.rst index 143efb9c..75a328d6 100644 --- a/docs/sphinx/rest_substitutions/overviews/grid_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/grid_overview.rst @@ -34,7 +34,7 @@ some of the formatting functions:: class GridFrame(wx.Frame): def __init__(self, parent): wx.Frame.__init__(self, parent) - + # Create a wxGrid object grid = wx.grid.Grid(self, -1) @@ -70,7 +70,7 @@ some of the formatting functions:: if __name__ == '__main__': - + app = wx.App(0) frame = GridFrame(None) app.MainLoop() @@ -80,10 +80,10 @@ Here is a list of classes related to :class:`~wx.grid.Grid`: - :class:`~wx.grid.Grid`: The main grid control class itself. - :class:`~wx.grid.GridTableBase`: The base class for grid data provider. -- :class:`~wx.grid.GridStringTable`: Simple :class:`~wx.grid.GridTableBase` implementation - supporting only string data items and storing them all in memory (hence suitable +- :class:`~wx.grid.GridStringTable`: Simple :class:`~wx.grid.GridTableBase` implementation + supporting only string data items and storing them all in memory (hence suitable for not too large grids only). -- :class:`~wx.grid.GridCellAttr`: A cell attribute, allowing to customize its appearance +- :class:`~wx.grid.GridCellAttr`: A cell attribute, allowing to customize its appearance as well as the renderer and editor used for displaying and editing it. - :class:`~wx.grid.GridCellAttrProvider`: The object responsible for storing and retrieving the cell attributes. - :class:`~wx.grid.GridColLabelWindow`: The window showing the grid columns labels. diff --git a/docs/sphinx/rest_substitutions/overviews/html_overview.rst b/docs/sphinx/rest_substitutions/overviews/html_overview.rst index 525fb15e..9cdb576a 100644 --- a/docs/sphinx/rest_substitutions/overviews/html_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/html_overview.rst @@ -156,7 +156,7 @@ lines which are ignored):: All filenames (including the Default topic) are relative to the location of the ``".hhp"`` file. -.. note:: +.. note:: For localization, in addition the ``".hhp"`` file may contain the line:: @@ -165,7 +165,7 @@ the ``".hhp"`` file. which specifies what charset (e.g. "iso8859_1") was used in contents and index files. Please note that this line is incompatible with MS HTML Help Workshop and it would either silently remove it or complain with some error. - + Contents file (.hhc) ~~~~~~~~~~~~~~~~~~~~~ @@ -334,7 +334,7 @@ containers unmodified (in other words, number of OpenContainer and CloseContainer calls should be same within :meth:`~wx.html.HtmlTagHandler.HandleTag` 's body). -.. note:: +.. note:: Notice that it would be usually better to use :meth:`~wx.html.HtmlContainerCell.InsertCell` instead of adding text to the parser diff --git a/docs/sphinx/rest_substitutions/overviews/internationalization.rst b/docs/sphinx/rest_substitutions/overviews/internationalization.rst index f3be5fcb..be395a19 100644 --- a/docs/sphinx/rest_substitutions/overviews/internationalization.rst +++ b/docs/sphinx/rest_substitutions/overviews/internationalization.rst @@ -13,7 +13,7 @@ "Internationalization" (often referred to as i18n) is the process to change an application so that all user visible texts are translated to the user selected -language and that things like dates, money amounts and numbers in general are +language and that things like dates, money amounts and numbers in general are shown in a format the user is familiar with/or used to. The easiest way to show what is needed is by using a little code sample. @@ -26,7 +26,7 @@ Prepare the source code ----------------------- Text translation in Python is done using gettext [1]_ , to ensure that all -wxPython labels are also translated we will use :class:`wx.Locale` and +wxPython labels are also translated we will use :class:`wx.Locale` and :func:`wx.GetTranslation` . How to prepare your source code to enable translation of texts:: diff --git a/docs/sphinx/rest_substitutions/overviews/log_classes_overview.rst b/docs/sphinx/rest_substitutions/overviews/log_classes_overview.rst index 2200f981..f49813b6 100644 --- a/docs/sphinx/rest_substitutions/overviews/log_classes_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/log_classes_overview.rst @@ -108,9 +108,9 @@ Some of advantages in using wxPython log functions are: :func:`wx.LogError` in this situation, the exact error code (and the corresponding error message) will be given to the user together with "high level" message about data file writing error. - - + + .. _log messages selection: Log Messages Selection @@ -222,8 +222,8 @@ of course, may also be used without any change. There are: - :ref:`wx.LogNull`: The last log class is quite particular: it doesn't do anything. The objects of this class may be instantiated to (temporarily) suppress output of `LogXXX` functions. - - + + The log targets can also be combined: for example you may wish to redirect the messages somewhere else (for example, to a log file) but also process them as normally. For this the :ref:`wx.LogChain`, @@ -338,13 +338,13 @@ nothing happens. For example:: wx.LogTrace(wx.TRACE_OleCalls, "Foo.Bar() called") - - + + will log the message if it was preceded by:: wx.Log.AddTraceMask(wx.TRACE_OleCalls) - - + + The standard trace masks are given in the :func:`wx.LogTrace` documentation. diff --git a/docs/sphinx/rest_substitutions/overviews/richtextctrl_overview.rst b/docs/sphinx/rest_substitutions/overviews/richtextctrl_overview.rst index 2c3cb836..84c49628 100644 --- a/docs/sphinx/rest_substitutions/overviews/richtextctrl_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/richtextctrl_overview.rst @@ -103,63 +103,63 @@ This is taken from the wxPython demo:: import wx import wx.richtext as rt import images - + #---------------------------------------------------------------------- - + class RichTextFrame(wx.Frame): - + def __init__(self, *args, **kw): - + wx.Frame.__init__(self, *args, **kw) - + self.MakeMenuBar() self.MakeToolBar() self.CreateStatusBar() self.SetStatusText("Welcome to wx.richtext.RichTextCtrl!") - + self.rtc = rt.RichTextCtrl(self, style=wx.VSCROLL|wx.HSCROLL|wx.NO_BORDER); wx.CallAfter(self.rtc.SetFocus) - + self.rtc.Freeze() self.rtc.BeginSuppressUndo() - + self.rtc.BeginParagraphSpacing(0, 20) - + self.rtc.BeginAlignment(rt.TEXT_ALIGNMENT_CENTRE) self.rtc.BeginBold() - + self.rtc.BeginFontSize(14) self.rtc.WriteText("Welcome to wxRichTextCtrl, a wxWidgets control for editing and presenting " \ "styled text and images") self.rtc.EndFontSize() self.rtc.Newline() - + self.rtc.BeginItalic() self.rtc.WriteText("by Julian Smart") self.rtc.EndItalic() - + self.rtc.EndBold() - + self.rtc.Newline() self.rtc.WriteImage(images._rt_zebra.GetImage()) - + self.rtc.EndAlignment() - + self.rtc.Newline() self.rtc.Newline() - + self.rtc.WriteText("What can you do with this thing? ") self.rtc.WriteImage(images._rt_smiley.GetImage()) self.rtc.WriteText(" Well, you can change text ") - + self.rtc.BeginTextColour((255, 0, 0)) self.rtc.WriteText("colour, like this red bit.") self.rtc.EndTextColour() - + self.rtc.BeginTextColour((0, 0, 255)) self.rtc.WriteText(" And this blue bit.") self.rtc.EndTextColour() - + self.rtc.WriteText(" Naturally you can make things ") self.rtc.BeginBold() self.rtc.WriteText("bold ") @@ -170,121 +170,121 @@ This is taken from the wxPython demo:: self.rtc.BeginUnderline() self.rtc.WriteText("or underlined.") self.rtc.EndUnderline() - + self.rtc.BeginFontSize(14) self.rtc.WriteText(" Different font sizes on the same line is allowed, too.") self.rtc.EndFontSize() - + self.rtc.WriteText(" Next we'll show an indented paragraph.") - + self.rtc.BeginLeftIndent(60) self.rtc.Newline() - + self.rtc.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. " \ "An attractive woman came into the cafe, which is nothing remarkable.") self.rtc.EndLeftIndent() - + self.rtc.Newline() - + self.rtc.WriteText("Next, we'll show a first-line indent, achieved using BeginLeftIndent(100, -40).") - + self.rtc.BeginLeftIndent(100, -40) self.rtc.Newline() - + self.rtc.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. " \ "An attractive woman came into the cafe, which is nothing remarkable.") self.rtc.EndLeftIndent() - + self.rtc.Newline() - + self.rtc.WriteText("Numbered bullets are possible, again using sub-indents:") - + self.rtc.BeginNumberedBullet(1, 100, 60) self.rtc.Newline() - + self.rtc.WriteText("This is my first item. Note that wxRichTextCtrl doesn't automatically do numbering, " \ "but this will be added later.") - + self.rtc.EndNumberedBullet() - + self.rtc.BeginNumberedBullet(2, 100, 60) self.rtc.Newline() - + self.rtc.WriteText("This is my second item.") self.rtc.EndNumberedBullet() - + self.rtc.Newline() - + self.rtc.WriteText("The following paragraph is right-indented:") - + self.rtc.BeginRightIndent(200) self.rtc.Newline() - + self.rtc.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. " \ "An attractive woman came into the cafe, which is nothing remarkable.") self.rtc.EndRightIndent() - + self.rtc.Newline() - + self.rtc.WriteText("The following paragraph is right-aligned with 1.5 line spacing:") - + self.rtc.BeginAlignment(rt.TEXT_ALIGNMENT_RIGHT) self.rtc.BeginLineSpacing(rt.TEXT_ATTR_LINE_SPACING_HALF) self.rtc.Newline() - + self.rtc.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. " \ "An attractive woman came into the cafe, which is nothing remarkable.") self.rtc.EndLineSpacing() self.rtc.EndAlignment() - + self.rtc.Newline() self.rtc.WriteText("Other notable features of wxRichTextCtrl include:") - + self.rtc.BeginSymbolBullet('*', 100, 60) self.rtc.Newline() self.rtc.WriteText("Compatibility with wxTextCtrl API") self.rtc.EndSymbolBullet() - + self.rtc.BeginSymbolBullet('*', 100, 60) self.rtc.Newline() self.rtc.WriteText("Easy stack-based BeginXXX()...EndXXX() style setting in addition to SetStyle()") self.rtc.EndSymbolBullet() - + self.rtc.BeginSymbolBullet('*', 100, 60) self.rtc.Newline() self.rtc.WriteText("XML loading and saving") self.rtc.EndSymbolBullet() - + self.rtc.BeginSymbolBullet('*', 100, 60) self.rtc.Newline() self.rtc.WriteText("Undo/Redo, with batching option and Undo suppressing") self.rtc.EndSymbolBullet() - + self.rtc.BeginSymbolBullet('*', 100, 60) self.rtc.Newline() self.rtc.WriteText("Clipboard copy and paste") self.rtc.EndSymbolBullet() - + self.rtc.BeginSymbolBullet('*', 100, 60) self.rtc.Newline() self.rtc.WriteText("wxRichTextStyleSheet with named character and paragraph styles, and control for " \ "applying named styles") self.rtc.EndSymbolBullet() - + self.rtc.BeginSymbolBullet('*', 100, 60) self.rtc.Newline() self.rtc.WriteText("A design that can easily be extended to other content types, ultimately with text " \ "boxes, tables, controls, and so on") self.rtc.EndSymbolBullet() - + self.rtc.BeginSymbolBullet('*', 100, 60) self.rtc.Newline() - + # Make a style suitable for showing a URL urlStyle = rt.TextAttrEx() urlStyle.SetTextColour(wx.BLUE) urlStyle.SetFontUnderlined(True) - + self.rtc.WriteText("RichTextCtrl can also display URLs, such as this one: ") self.rtc.BeginStyle(urlStyle) self.rtc.BeginURL("http://wxPython.org/") @@ -292,27 +292,27 @@ This is taken from the wxPython demo:: self.rtc.EndURL(); self.rtc.EndStyle(); self.rtc.WriteText(". Click on the URL to generate an event.") - + self.rtc.Bind(wx.EVT_TEXT_URL, self.OnURL) - + self.rtc.Newline() self.rtc.WriteText("Note: this sample content was generated programmatically from within the " \ "MyFrame constructor " \ "in the demo. The images were loaded from inline XPMs. Enjoy wxRichTextCtrl!") - + self.rtc.EndParagraphSpacing() - + self.rtc.EndSuppressUndo() self.rtc.Thaw() - - + + def OnURL(self, evt): - + wx.MessageBox(evt.GetString(), "URL Clicked") - - + + def OnFileOpen(self, evt): - + # This gives us a string suitable for the file dialog based on # the file handlers that are loaded wildcard, types = rt.RichTextBuffer.GetExtWildcard(save=False) @@ -325,25 +325,25 @@ This is taken from the wxPython demo:: fileType = types[dlg.GetFilterIndex()] self.rtc.LoadFile(path, fileType) dlg.Destroy() - - + + def OnFileSave(self, evt): - + if not self.rtc.GetFilename(): self.OnFileSaveAs(evt) return - + self.rtc.SaveFile() - - + + def OnFileSaveAs(self, evt): - + wildcard, types = rt.RichTextBuffer.GetExtWildcard(save=True) - + dlg = wx.FileDialog(self, "Choose a filename", wildcard=wildcard, style=wx.SAVE) - + if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() if path: @@ -352,24 +352,24 @@ This is taken from the wxPython demo:: if not path.endswith(ext): path += '.' + ext self.rtc.SaveFile(path, fileType) - + dlg.Destroy() - - + + def OnFileViewHTML(self, evt): - + # Get an instance of the html file handler, use it to save the # document to a StringIO stream, and then display the # resulting html text in a dialog with a HtmlWindow. handler = rt.RichTextHTMLHandler() handler.SetFlags(rt.RICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY) handler.SetFontSizeMapping([7,9,11,12,14,22,100]) - + import cStringIO stream = cStringIO.StringIO() if not handler.SaveStream(self.rtc.GetBuffer(), stream): return - + import wx.html dlg = wx.Dialog(self, title="HTML", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) html = wx.html.HtmlWindow(dlg, size=(500,400), style=wx.BORDER_SUNKEN) @@ -380,49 +380,49 @@ This is taken from the wxPython demo:: sizer.Add(btn, 0, wx.ALL|wx.CENTER, 10) dlg.SetSizer(sizer) sizer.Fit(dlg) - + dlg.ShowModal() - + handler.DeleteTemporaryImages() - - + + def OnFileExit(self, evt): - + self.Close(True) - - + + def OnBold(self, evt): - + self.rtc.ApplyBoldToSelection() - - + + def OnItalic(self, evt): - + self.rtc.ApplyItalicToSelection() - - + + def OnUnderline(self, evt): - + self.rtc.ApplyUnderlineToSelection() - - + + def OnAlignLeft(self, evt): - + self.rtc.ApplyAlignmentToSelection(rt.TEXT_ALIGNMENT_LEFT) - - + + def OnAlignRight(self, evt): - + self.rtc.ApplyAlignmentToSelection(rt.TEXT_ALIGNMENT_RIGHT) - - + + def OnAlignCenter(self, evt): - + self.rtc.ApplyAlignmentToSelection(rt.TEXT_ALIGNMENT_CENTRE) - - + + def OnIndentMore(self, evt): - + attr = rt.TextAttrEx() attr.SetFlags(rt.TEXT_ATTR_LEFT_INDENT) ip = self.rtc.GetInsertionPoint() @@ -430,14 +430,14 @@ This is taken from the wxPython demo:: r = rt.RichTextRange(ip, ip) if self.rtc.HasSelection(): r = self.rtc.GetSelectionRange() - + attr.SetLeftIndent(attr.GetLeftIndent() + 100) attr.SetFlags(rt.TEXT_ATTR_LEFT_INDENT) self.rtc.SetStyle(r, attr) - - + + def OnIndentLess(self, evt): - + attr = rt.TextAttrEx() attr.SetFlags(rt.TEXT_ATTR_LEFT_INDENT) ip = self.rtc.GetInsertionPoint() @@ -445,15 +445,15 @@ This is taken from the wxPython demo:: r = rt.RichTextRange(ip, ip) if self.rtc.HasSelection(): r = self.rtc.GetSelectionRange() - + if attr.GetLeftIndent() >= 100: attr.SetLeftIndent(attr.GetLeftIndent() - 100) attr.SetFlags(rt.TEXT_ATTR_LEFT_INDENT) self.rtc.SetStyle(r, attr) - - + + def OnParagraphSpacingMore(self, evt): - + attr = rt.TextAttrEx() attr.SetFlags(rt.TEXT_ATTR_PARA_SPACING_AFTER) ip = self.rtc.GetInsertionPoint() @@ -461,14 +461,14 @@ This is taken from the wxPython demo:: r = rt.RichTextRange(ip, ip) if self.rtc.HasSelection(): r = self.rtc.GetSelectionRange() - + attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() + 20); attr.SetFlags(rt.TEXT_ATTR_PARA_SPACING_AFTER) self.rtc.SetStyle(r, attr) - - + + def OnParagraphSpacingLess(self, evt): - + attr = rt.TextAttrEx() attr.SetFlags(rt.TEXT_ATTR_PARA_SPACING_AFTER) ip = self.rtc.GetInsertionPoint() @@ -476,15 +476,15 @@ This is taken from the wxPython demo:: r = rt.RichTextRange(ip, ip) if self.rtc.HasSelection(): r = self.rtc.GetSelectionRange() - + if attr.GetParagraphSpacingAfter() >= 20: attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() - 20); attr.SetFlags(rt.TEXT_ATTR_PARA_SPACING_AFTER) self.rtc.SetStyle(r, attr) - - + + def OnLineSpacingSingle(self, evt): - + attr = rt.TextAttrEx() attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING) ip = self.rtc.GetInsertionPoint() @@ -492,14 +492,14 @@ This is taken from the wxPython demo:: r = rt.RichTextRange(ip, ip) if self.rtc.HasSelection(): r = self.rtc.GetSelectionRange() - + attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING) attr.SetLineSpacing(10) self.rtc.SetStyle(r, attr) - - + + def OnLineSpacingHalf(self, evt): - + attr = rt.TextAttrEx() attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING) ip = self.rtc.GetInsertionPoint() @@ -507,14 +507,14 @@ This is taken from the wxPython demo:: r = rt.RichTextRange(ip, ip) if self.rtc.HasSelection(): r = self.rtc.GetSelectionRange() - + attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING) attr.SetLineSpacing(15) self.rtc.SetStyle(r, attr) - - + + def OnLineSpacingDouble(self, evt): - + attr = rt.TextAttrEx() attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING) ip = self.rtc.GetInsertionPoint() @@ -522,17 +522,17 @@ This is taken from the wxPython demo:: r = rt.RichTextRange(ip, ip) if self.rtc.HasSelection(): r = self.rtc.GetSelectionRange() - + attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING) attr.SetLineSpacing(20) self.rtc.SetStyle(r, attr) - - + + def OnFont(self, evt): - + if not self.rtc.HasSelection(): return - + r = self.rtc.GetSelectionRange() fontData = wx.FontData() fontData.EnableEffects(False) @@ -540,7 +540,7 @@ This is taken from the wxPython demo:: attr.SetFlags(rt.TEXT_ATTR_FONT) if self.rtc.GetStyle(self.rtc.GetInsertionPoint(), attr): fontData.SetInitialFont(attr.GetFont()) - + dlg = wx.FontDialog(self, fontData) if dlg.ShowModal() == wx.ID_OK: fontData = dlg.GetFontData() @@ -550,16 +550,16 @@ This is taken from the wxPython demo:: attr.SetFont(font) self.rtc.SetStyle(r, attr) dlg.Destroy() - - + + def OnColour(self, evt): - + colourData = wx.ColourData() attr = rt.TextAttrEx() attr.SetFlags(rt.TEXT_ATTR_TEXT_COLOUR) if self.rtc.GetStyle(self.rtc.GetInsertionPoint(), attr): colourData.SetColour(attr.GetTextColour()) - + dlg = wx.ColourDialog(self, colourData) if dlg.ShowModal() == wx.ID_OK: colourData = dlg.GetColourData() @@ -573,55 +573,55 @@ This is taken from the wxPython demo:: attr.SetTextColour(colour) self.rtc.SetStyle(r, attr) dlg.Destroy() - - - + + + def OnUpdateBold(self, evt): - + evt.Check(self.rtc.IsSelectionBold()) - - + + def OnUpdateItalic(self, evt): - + evt.Check(self.rtc.IsSelectionItalics()) - - + + def OnUpdateUnderline(self, evt): - + evt.Check(self.rtc.IsSelectionUnderlined()) - - + + def OnUpdateAlignLeft(self, evt): - + evt.Check(self.rtc.IsSelectionAligned(rt.TEXT_ALIGNMENT_LEFT)) - - + + def OnUpdateAlignCenter(self, evt): - + evt.Check(self.rtc.IsSelectionAligned(rt.TEXT_ALIGNMENT_CENTRE)) - - + + def OnUpdateAlignRight(self, evt): - + evt.Check(self.rtc.IsSelectionAligned(rt.TEXT_ALIGNMENT_RIGHT)) - - + + def ForwardEvent(self, evt): - + # The RichTextCtrl can handle menu and update events for undo, # redo, cut, copy, paste, delete, and select all, so just # forward the event to it. self.rtc.ProcessEvent(evt) - - + + def MakeMenuBar(self): - + def doBind(item, handler, updateUI=None): - + self.Bind(wx.EVT_MENU, handler, item) if updateUI is not None: self.Bind(wx.EVT_UPDATE_UI, updateUI, item) - + fileMenu = wx.Menu() doBind( fileMenu.Append(-1, "&Open\tCtrl+O", "Open a file"), self.OnFileOpen ) @@ -635,7 +635,7 @@ This is taken from the wxPython demo:: fileMenu.AppendSeparator() doBind( fileMenu.Append(-1, "E&xit\tCtrl+Q", "Quit this program"), self.OnFileExit ) - + editMenu = wx.Menu() doBind( editMenu.Append(wx.ID_UNDO, "&Undo\tCtrl+Z"), self.ForwardEvent, self.ForwardEvent) @@ -653,7 +653,7 @@ This is taken from the wxPython demo:: editMenu.AppendSeparator() doBind( editMenu.Append(wx.ID_SELECTALL, "Select A&ll\tCtrl+A"), self.ForwardEvent, self.ForwardEvent ) - + formatMenu = wx.Menu() doBind( formatMenu.AppendCheckItem(-1, "&Bold\tCtrl+B"), self.OnBold, self.OnUpdateBold) @@ -680,22 +680,22 @@ This is taken from the wxPython demo:: doBind( formatMenu.Append(-1, "Double Line Spacing"), self.OnLineSpacingDouble) formatMenu.AppendSeparator() doBind( formatMenu.Append(-1, "&Font..."), self.OnFont) - + mb = wx.MenuBar() mb.Append(fileMenu, "&File") mb.Append(editMenu, "&Edit") mb.Append(formatMenu, "F&ormat") self.SetMenuBar(mb) - - + + def MakeToolBar(self): - + def doBind(item, handler, updateUI=None): - + self.Bind(wx.EVT_TOOL, handler, item) if updateUI is not None: self.Bind(wx.EVT_UPDATE_UI, updateUI, item) - + tbar = self.CreateToolBar() doBind( tbar.AddTool(-1, images._rt_open.GetBitmap(), shortHelpString="Open"), self.OnFileOpen) @@ -737,65 +737,65 @@ This is taken from the wxPython demo:: shortHelpString="Font"), self.OnFont) doBind( tbar.AddTool(-1, images._rt_colour.GetBitmap(), shortHelpString="Font Colour"), self.OnColour) - + tbar.Realize() - - + + #---------------------------------------------------------------------- - + class TestPanel(wx.Panel): - + def __init__(self, parent): - + wx.Panel.__init__(self, parent, -1) - + b = wx.Button(self, -1, "Show the RichTextCtrl sample", (50,50)) self.Bind(wx.EVT_BUTTON, self.OnButton, b) - + self.AddRTCHandlers() - - + + def AddRTCHandlers(self): - + # make sure we haven't already added them. if rt.RichTextBuffer.FindHandlerByType(rt.RICHTEXT_TYPE_HTML) is not None: return - + # This would normally go in your app's OnInit method. I'm # not sure why these file handlers are not loaded by # default by the C++ richtext code, I guess it's so you # can change the name or extension if you wanted... rt.RichTextBuffer.AddHandler(rt.RichTextHTMLHandler()) rt.RichTextBuffer.AddHandler(rt.RichTextXMLHandler()) - + # ...like this rt.RichTextBuffer.AddHandler(rt.RichTextXMLHandler(name="Other XML", ext="ox", type=99)) - + # This is needed for the view as HTML option since we tell it # to store the images in the memory file system. wx.FileSystem.AddHandler(wx.MemoryFSHandler()) - - + + def OnButton(self, evt): - + win = RichTextFrame(self, -1, "wx.richtext.RichTextCtrl", size=(700, 500), style = wx.DEFAULT_FRAME_STYLE) win.Show(True) - + # give easy access to the demo's PyShell if it's running self.rtfrm = win self.rtc = win.rtc - - + + app = wx.App(0) - + frame = wx.Frame(None) panel = TestPanel(frame) frame.Show() - + app.MainLoop() @@ -826,7 +826,7 @@ There are four main notions of style within a control: :meth:`~wx.richtext.RichTextCtrl.SetFont` changes the font for the basic style. The basic style is set with :meth:`~wx.richtext.RichTextCtrl.SetBasicStyle`. - + + **Paragraph style**: Each paragraph has attributes that are set independently from other paragraphs and independently from the content within the paragraph. Normally, these attributes are diff --git a/docs/sphinx/rest_substitutions/overviews/scrolling_overview.rst b/docs/sphinx/rest_substitutions/overviews/scrolling_overview.rst index 441d1c44..6e94ca86 100644 --- a/docs/sphinx/rest_substitutions/overviews/scrolling_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/scrolling_overview.rst @@ -80,8 +80,8 @@ font. The window is sized so that you can only see 16 lines at a time. You would use:: SetScrollbar(wx.VERTICAL, 0, 16, 50) - - + + .. note:: Note that with the window at this size, the thumb position can never go above 50 minus 16, or 34. You can determine how many lines are currently visible by dividing the current view size by diff --git a/docs/sphinx/rest_substitutions/overviews/sizers_overview.rst b/docs/sphinx/rest_substitutions/overviews/sizers_overview.rst index 9e842596..4b88b963 100644 --- a/docs/sphinx/rest_substitutions/overviews/sizers_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/sizers_overview.rst @@ -160,20 +160,20 @@ looking at the :meth:`wx.BoxSizer.Add` signature: Appends a child to the sizer. - :param `window`: a window, a spacer or another sizer to be added to the sizer. Its initial size - (either set explicitly by the user or calculated internally) is interpreted as the minimal and + :param `window`: a window, a spacer or another sizer to be added to the sizer. Its initial size + (either set explicitly by the user or calculated internally) is interpreted as the minimal and in many cases also the initial size. - :param int proportion: this parameter is used in :class:`wx.BoxSizer` to indicate if a child of a sizer - can change its size in the main orientation of the :class:`wx.BoxSizer` - where 0 stands for not changeable - and a value of more than zero is interpreted relative to the value of other children of the same - :class:`wx.BoxSizer`. For example, you might have a horizontal :class:`wx.BoxSizer` with three children, two - of which are supposed to change their size with the sizer. Then the two stretchable windows would + :param int proportion: this parameter is used in :class:`wx.BoxSizer` to indicate if a child of a sizer + can change its size in the main orientation of the :class:`wx.BoxSizer` - where 0 stands for not changeable + and a value of more than zero is interpreted relative to the value of other children of the same + :class:`wx.BoxSizer`. For example, you might have a horizontal :class:`wx.BoxSizer` with three children, two + of which are supposed to change their size with the sizer. Then the two stretchable windows would get a value of 1 each to make them grow and shrink equally with the sizer's horizontal dimension. :param int flag: OR-combination of flags affecting sizer's behaviour. :param int border: determines the border width, if the flag parameter is set to include any border flag. - :param object userData: allows an extra object to be attached to the sizer item, for use in derived + :param object userData: allows an extra object to be attached to the sizer item, for use in derived classes when sizing information is more complex than the proportion and flag will allow for. - + :rtype: :class:`wx.SizerItem` @@ -191,19 +191,19 @@ set to 0; we'll worry about them later. sizer.Add(wx.Button(self, -1, 'An extremely long button text'), 0, 0, 0) sizer.Add(wx.Button(self, -1, 'Small button'), 0, 0, 0) self.SetSizer(sizer) - + You'll notice a couple of things about this: * The buttons are just big enough to accommodate the text in them. In fact, any control placed into a sizer this way will appear at its minimum size unless we change the parameters. - + * The window size is not changed to fit the sizer. This results in a lot of ugly empty space. -Let's worry about the second issue first. To make the window size more appropriate, we can set +Let's worry about the second issue first. To make the window size more appropriate, we can set the size hints to tell the enclosing window to adjust to the size of the sizer: .. figure:: _static/images/overviews/boxsizer2.png @@ -233,15 +233,15 @@ are in relation to each other. In a vertical sizer, this changes the height; in a horizontal sizer, this changes the width. Here are some examples: -.. list-table:: +.. list-table:: :header-rows: 1 :widths: 40 10 :class: centertable * - Code - + - Resulting Image - + * - .. code-block:: python :emphasize-lines: 3,4 @@ -273,22 +273,22 @@ examples: - .. figure:: _static/images/overviews/boxsizer32.png :align: left - + | If one of the `proportion` parameters is 0, that :class:`wx.Window` will be the minimum size, and the others will resize proportionally: -.. list-table:: +.. list-table:: :header-rows: 1 :widths: 40 10 :class: centertable * - Code - + - Resulting Image - + * - .. code-block:: python :emphasize-lines: 4,5 @@ -303,7 +303,7 @@ will be the minimum size, and the others will resize proportionally: - .. figure:: _static/images/overviews/boxsizer33.png :align: left - * - Same code as above, with window resized. The top button (proportion 0) is still the minimum height, + * - Same code as above, with window resized. The top button (proportion 0) is still the minimum height, and the third button is still twice the height of the second. - .. figure:: _static/images/overviews/boxsizer34.png @@ -338,15 +338,15 @@ specific kind of sizer used. Let's start with the simplest case: the alignment flags. These are pretty self-explanatory. -.. list-table:: +.. list-table:: :header-rows: 1 :widths: 40 10 :class: centertable * - Code - + - Resulting Image - + * - .. code-block:: python :emphasize-lines: 4 @@ -380,15 +380,15 @@ pretty self-explanatory. Next is the ``wx.EXPAND`` flag. This is synonymous with ``wx.GROW``. -.. list-table:: +.. list-table:: :header-rows: 1 :widths: 40 10 :class: centertable * - Code - + - Resulting Image - + * - .. code-block:: python :emphasize-lines: 4 @@ -405,24 +405,24 @@ Next is the ``wx.EXPAND`` flag. This is synonymous with ``wx.GROW``. -You can see that the first button takes its minimum size, and the second one grows to match it. This affects -controls in the opposite manner of the second parameter; ``wx.EXPAND`` in a vertical sizer causes horizontal +You can see that the first button takes its minimum size, and the second one grows to match it. This affects +controls in the opposite manner of the second parameter; ``wx.EXPAND`` in a vertical sizer causes horizontal expansion, and in a horizontal sizer it causes vertical expansion. -Next is ``wx.SHAPED``. This flag ensures that the width and height of the object stay proportional to each other. -It doesn't make much sense for buttons, but can be excellent for bitmaps, which would be contorted or clipped +Next is ``wx.SHAPED``. This flag ensures that the width and height of the object stay proportional to each other. +It doesn't make much sense for buttons, but can be excellent for bitmaps, which would be contorted or clipped if not scaled proportionally. -.. list-table:: +.. list-table:: :header-rows: 1 :widths: 30 10 :class: centertable * - Code - + - Resulting Image - + * - .. code-block:: python :emphasize-lines: 4 @@ -452,15 +452,15 @@ control on which the border should appear. In order to demonstrate this most clearly, we'll keep the ``wx.EXPAND`` flag. -.. list-table:: +.. list-table:: :header-rows: 1 :widths: 40 10 :class: centertable * - Code - + - Resulting Image - + * - .. code-block:: python :emphasize-lines: 4 @@ -470,11 +470,11 @@ this most clearly, we'll keep the ``wx.EXPAND`` flag. sizer.Add(wx.Button(self, -1, "Small Button"), 0, wx.EXPAND | wx.LEFT, 20) sizer.SetSizeHints(self) self.SetSizer(sizer) - - + + - .. figure:: _static/images/overviews/boxsizer53.png :align: left - + * - .. code-block:: python :emphasize-lines: 4 @@ -485,11 +485,11 @@ this most clearly, we'll keep the ``wx.EXPAND`` flag. sizer.Add(wx.Button(self, -1, "Small Button"), 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 20) sizer.SetSizeHints(self) self.SetSizer(sizer) - - + + - .. figure:: _static/images/overviews/boxsizer54.png :align: left - + * - .. code-block:: python :emphasize-lines: 4 @@ -500,8 +500,8 @@ this most clearly, we'll keep the ``wx.EXPAND`` flag. sizer.Add(wx.Button(self, -1, "Small Button"), 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 20) sizer.SetSizeHints(self) self.SetSizer(sizer) - - + + - .. figure:: _static/images/overviews/boxsizer55.png :align: left @@ -514,8 +514,8 @@ this most clearly, we'll keep the ``wx.EXPAND`` flag. sizer.Add(wx.Button(self, -1, "Small Button"), 0, wx.EXPAND | wx.ALL, 20) sizer.SetSizeHints(self) self.SetSizer(sizer) - - + + - .. figure:: _static/images/overviews/boxsizer56.png :align: left @@ -675,9 +675,9 @@ Example:: # has a text ctrl at the top and two buttons at the bottom. class MyDialog(wx.Dialog): - + def __init__(self, parent, id, title): - + wx.Dialog(parent, id, title, wx.DefaultPosition, wx.DefaultSize, wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) @@ -711,7 +711,7 @@ Example:: self.SetSizerAndFit(topsizer) # use the sizer for layout and size window # accordingly and prevent it from being resized # to smaller size - + Note that the new way of specifying flags to :ref:`wx.Sizer` is via @@ -725,9 +725,9 @@ Here's how you'd do the previous example with :ref:`wx.SizerFlags`:: # has a text ctrl at the top and two buttons at the bottom. class MyDialog(wx.Dialog): - + def __init__(self, parent, id, title): - + wx.Dialog(parent, id, title, wx.DefaultPosition, wx.DefaultSize, wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) @@ -742,7 +742,7 @@ Here's how you'd do the previous example with :ref:`wx.SizerFlags`:: button_sizer.Add( wx.Button(self, wx.ID_OK, "OK"), wx.SizerFlags(0).Align().Border(wx.ALL, 10)) - + button_sizer.Add( wx.Button(self, wx.ID_CANCEL, "Cancel"), wx.SizerFlags(0).Align().Border(wx.ALL, 10)) diff --git a/docs/sphinx/rest_substitutions/overviews/splitterwindow_overview.rst b/docs/sphinx/rest_substitutions/overviews/splitterwindow_overview.rst index ee22fd6e..85e59692 100644 --- a/docs/sphinx/rest_substitutions/overviews/splitterwindow_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/splitterwindow_overview.rst @@ -15,7 +15,7 @@ The style ``wx.SP_3D`` has been used to show a 3D border and 3D sash. .. figure:: _static/images/overviews/overview_splitter_3d.png :align: center - + Example @@ -47,7 +47,7 @@ after creation:: if splitter.IsSplit(): splitter.Unsplit() - + leftWindow.Show(True) rightWindow.Show(True) splitter.SplitVertically(leftWindow, rightWindow) @@ -57,7 +57,7 @@ after creation:: if splitter.IsSplit(): splitter.Unsplit() - + leftWindow.Show(True) rightWindow.Show(True) splitter.SplitHorizontally(leftWindow, rightWindow) @@ -67,6 +67,6 @@ after creation:: if splitter.IsSplit(): splitter.Unsplit() - - + + diff --git a/docs/sphinx/rest_substitutions/overviews/standard_event_identifiers.rst b/docs/sphinx/rest_substitutions/overviews/standard_event_identifiers.rst index 65ad800f..7eba2141 100644 --- a/docs/sphinx/rest_substitutions/overviews/standard_event_identifiers.rst +++ b/docs/sphinx/rest_substitutions/overviews/standard_event_identifiers.rst @@ -12,12 +12,12 @@ used in the following two situations: - When creating a new window you may specify ``wx.ID_ANY`` to let wxPython assign an unused identifier to it automatically - + - When installing an event handler using :meth:`EvtHandler.Bind`, you may use it to indicate that you want to handle the events coming from any control, regardless of its identifier - - + + Another standard special identifier value is ``wx.ID_NONE``: this is a value which is not matched by any other id. diff --git a/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst b/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst index 031e2a08..aa61b2fd 100644 --- a/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst @@ -64,8 +64,8 @@ searches for translatable strings. The tips will thus get included into your generated .po file catalog and be translated at runtime along with the rest of your application's translatable strings. -.. note:: - +.. note:: + Each line in the `tips.txt` file needs to strictly begin with exactly the 3 characters of underscore-parenthesis-doublequote, and end with doublequote-parenthesis, as shown above. Also, remember to diff --git a/docs/sphinx/rest_substitutions/overviews/treectrl_overview.rst b/docs/sphinx/rest_substitutions/overviews/treectrl_overview.rst index 5ea54f36..1faf2255 100644 --- a/docs/sphinx/rest_substitutions/overviews/treectrl_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/treectrl_overview.rst @@ -68,7 +68,7 @@ remember is that the `cookie` passed to :meth:`wx.TreeCtrl.GetNextChild` should be the same variable (and that nothing should be done with it by the user code). -Among other features of the tree control are: +Among other features of the tree control are: * Item Sorting with :meth:`wx.TreeCtrl.SortChildren` which uses the user-defined comparison function `OnCompareItems` (by default the diff --git a/docs/sphinx/rest_substitutions/overviews/validator_overview.rst b/docs/sphinx/rest_substitutions/overviews/validator_overview.rst index b976a58e..2472e63e 100644 --- a/docs/sphinx/rest_substitutions/overviews/validator_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/validator_overview.rst @@ -28,19 +28,19 @@ your own sub-class of :ref:`wx.Validator` (neither `TextValidator` nor then associated with your input field by calling:: myInputField.SetValidator(myValidator) - - + + .. note:: Your :ref:`wx.Validator` sub-class must implement the :meth:`wx.Validator.Clone` method. -.. note:: +.. note:: Note that any :ref:`wx.Window` may have a validator; using the ``WS_EX_VALIDATE_RECURSIVELY`` style (see :ref:`Window extended styles `) you can also implement recursive validation. - + .. _anatomy of a validator: @@ -105,7 +105,7 @@ being shown. .. note:: If you are using a window or panel instead of a dialog, you will need to call :meth:`wx.Window.InitDialog` explicitly before showing the window. - + When the user clicks on a button, for example the ``OK`` button, the application should first call :meth:`wx.Window.Validate`, which diff --git a/docs/sphinx/rest_substitutions/overviews/window_ids_overview.rst b/docs/sphinx/rest_substitutions/overviews/window_ids_overview.rst index 4838c283..3f660e96 100644 --- a/docs/sphinx/rest_substitutions/overviews/window_ids_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/window_ids_overview.rst @@ -15,17 +15,17 @@ unimportant and is created automatically by calling :meth:`wx.Window.NewControlId` or by passing ``wx.ID_ANY`` as the ID of an object. -There are two ways to generate an ID. One way is to start at a negative number, and for each new ID, return the -next smallest number. This is fine for systems that can use the full range of negative numbers for IDs, as -this provides more than enough IDs and it would take a very very long time to run out and wrap around. +There are two ways to generate an ID. One way is to start at a negative number, and for each new ID, return the +next smallest number. This is fine for systems that can use the full range of negative numbers for IDs, as +this provides more than enough IDs and it would take a very very long time to run out and wrap around. However, some systems cannot use the full range of the ID value. Windows, for example, can only use 16 bit -IDs, and only has about 32000 possible automatic IDs that can be generated by :meth:`wx.Window.NewControlId`. +IDs, and only has about 32000 possible automatic IDs that can be generated by :meth:`wx.Window.NewControlId`. If the program runs long enough, depending on the program itself, using this first method would cause the IDs to wrap around into the positive ID range and cause possible clashes with any directly specified ID values. The other way is to keep track of the IDs returned by :meth:`wx.Window.NewControlId` and don't return them again -until the ID is completely free and not being used by any other objects. This will make sure that the ID values -do not clash with one another. This is accomplished by keeping a reference count for each of the IDs that can +until the ID is completely free and not being used by any other objects. This will make sure that the ID values +do not clash with one another. This is accomplished by keeping a reference count for each of the IDs that can possibly be returned by :meth:`wx.Window.NewControlId`. Other IDs are not reference counted. diff --git a/docs/sphinx/rest_substitutions/overviews/window_styles_overview.rst b/docs/sphinx/rest_substitutions/overviews/window_styles_overview.rst index dda68d9b..21e6cf3f 100644 --- a/docs/sphinx/rest_substitutions/overviews/window_styles_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/window_styles_overview.rst @@ -17,8 +17,8 @@ The symbols are defined in such a way that they can be combined in a For example:: style = wx.CAPTION | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER - - + + For the window styles specific to each window class, please see the documentation for the window. diff --git a/docs/sphinx/rest_substitutions/overviews/writing_non_english_applications.rst b/docs/sphinx/rest_substitutions/overviews/writing_non_english_applications.rst index 43852beb..d439ae62 100644 --- a/docs/sphinx/rest_substitutions/overviews/writing_non_english_applications.rst +++ b/docs/sphinx/rest_substitutions/overviews/writing_non_english_applications.rst @@ -19,7 +19,7 @@ many identical, only differently encoded, packages with your application this mechanism you can, for example, distribute only iso8859-13 data and it will be handled transparently under all systems. -Please read the :ref:`Internationalization ` page which +Please read the :ref:`Internationalization ` page which describes the locales concept. .. todo:: to be written (do we want to write it?!?!) diff --git a/docs/sphinx/rest_substitutions/tables/wx.ArtProvider.1.rst b/docs/sphinx/rest_substitutions/tables/wx.ArtProvider.1.rst index 3377758c..f4d0c2b1 100644 --- a/docs/sphinx/rest_substitutions/tables/wx.ArtProvider.1.rst +++ b/docs/sphinx/rest_substitutions/tables/wx.ArtProvider.1.rst @@ -1,22 +1,22 @@ ========================================= ======================================== ================================== - ``wx.ART_ERROR`` - ``wx.ART_GOTO_LAST`` (since 2.9.2) - ``wx.ART_FILE_SAVE_AS`` -- ``wx.ART_QUESTION`` - ``wx.ART_PRINT`` - ``wx.ART_DELETE`` -- ``wx.ART_WARNING`` - ``wx.ART_HELP`` - ``wx.ART_COPY`` -- ``wx.ART_INFORMATION`` - ``wx.ART_TIP`` - ``wx.ART_CUT`` -- ``wx.ART_ADD_BOOKMARK`` - ``wx.ART_REPORT_VIEW`` - ``wx.ART_PASTE`` -- ``wx.ART_DEL_BOOKMARK`` - ``wx.ART_LIST_VIEW`` - ``wx.ART_UNDO`` -- ``wx.ART_HELP_SIDE_PANEL`` - ``wx.ART_NEW_DIR`` - ``wx.ART_REDO`` -- ``wx.ART_HELP_SETTINGS`` - ``wx.ART_FOLDER`` - ``wx.ART_PLUS`` (since 2.9.2) -- ``wx.ART_HELP_BOOK`` - ``wx.ART_FOLDER_OPEN`` - ``wx.ART_MINUS`` (since 2.9.2) -- ``wx.ART_HELP_FOLDER`` - ``wx.ART_GO_DIR_UP`` - ``wx.ART_CLOSE`` -- ``wx.ART_HELP_PAGE`` - ``wx.ART_EXECUTABLE_FILE`` - ``wx.ART_QUIT`` -- ``wx.ART_GO_BACK`` - ``wx.ART_NORMAL_FILE`` - ``wx.ART_FIND`` -- ``wx.ART_GO_FORWARD`` - ``wx.ART_TICK_MARK`` - ``wx.ART_FIND_AND_REPLACE`` -- ``wx.ART_GO_UP`` - ``wx.ART_CROSS_MARK`` - ``wx.ART_HARDDISK`` -- ``wx.ART_GO_DOWN`` - ``wx.ART_MISSING_IMAGE`` - ``wx.ART_FLOPPY`` -- ``wx.ART_GO_TO_PARENT`` - ``wx.ART_NEW`` - ``wx.ART_CDROM`` -- ``wx.ART_GO_HOME`` - ``wx.ART_FILE_OPEN`` -- ``wx.ART_GOTO_FIRST`` (since 2.9.2) - ``wx.ART_FILE_SAVE`` +- ``wx.ART_QUESTION`` - ``wx.ART_PRINT`` - ``wx.ART_DELETE`` +- ``wx.ART_WARNING`` - ``wx.ART_HELP`` - ``wx.ART_COPY`` +- ``wx.ART_INFORMATION`` - ``wx.ART_TIP`` - ``wx.ART_CUT`` +- ``wx.ART_ADD_BOOKMARK`` - ``wx.ART_REPORT_VIEW`` - ``wx.ART_PASTE`` +- ``wx.ART_DEL_BOOKMARK`` - ``wx.ART_LIST_VIEW`` - ``wx.ART_UNDO`` +- ``wx.ART_HELP_SIDE_PANEL`` - ``wx.ART_NEW_DIR`` - ``wx.ART_REDO`` +- ``wx.ART_HELP_SETTINGS`` - ``wx.ART_FOLDER`` - ``wx.ART_PLUS`` (since 2.9.2) +- ``wx.ART_HELP_BOOK`` - ``wx.ART_FOLDER_OPEN`` - ``wx.ART_MINUS`` (since 2.9.2) +- ``wx.ART_HELP_FOLDER`` - ``wx.ART_GO_DIR_UP`` - ``wx.ART_CLOSE`` +- ``wx.ART_HELP_PAGE`` - ``wx.ART_EXECUTABLE_FILE`` - ``wx.ART_QUIT`` +- ``wx.ART_GO_BACK`` - ``wx.ART_NORMAL_FILE`` - ``wx.ART_FIND`` +- ``wx.ART_GO_FORWARD`` - ``wx.ART_TICK_MARK`` - ``wx.ART_FIND_AND_REPLACE`` +- ``wx.ART_GO_UP`` - ``wx.ART_CROSS_MARK`` - ``wx.ART_HARDDISK`` +- ``wx.ART_GO_DOWN`` - ``wx.ART_MISSING_IMAGE`` - ``wx.ART_FLOPPY`` +- ``wx.ART_GO_TO_PARENT`` - ``wx.ART_NEW`` - ``wx.ART_CDROM`` +- ``wx.ART_GO_HOME`` - ``wx.ART_FILE_OPEN`` +- ``wx.ART_GOTO_FIRST`` (since 2.9.2) - ``wx.ART_FILE_SAVE`` ========================================= ======================================== ================================== | diff --git a/docs/sphinx/rest_substitutions/tables/wx.VScrolledWindow.1.rst b/docs/sphinx/rest_substitutions/tables/wx.VScrolledWindow.1.rst index 071fd6b3..ad36dbaf 100644 --- a/docs/sphinx/rest_substitutions/tables/wx.VScrolledWindow.1.rst +++ b/docs/sphinx/rest_substitutions/tables/wx.VScrolledWindow.1.rst @@ -1,18 +1,18 @@ -======================================= ============================================================================================================================================================================================================================================================================== -`GetFirstVisibleLine()` Deprecated for :meth:`~wx.VarVScrollHelper.GetVisibleRowsBegin` -`GetLastVisibleLine()` Deprecated for :meth:`~wx.VarVScrollHelper.GetVisibleRowsEnd` This function originally had a slight design flaw in that it was possible to return ``sys.maxint-1`` (ie: a large positive number) if the scroll position was 0 and the first line wasn't completely visible. -`GetLineCount()` Deprecated for :meth:`~wx.VarVScrollHelper.GetRowCount` +======================================= ============================================================================================================================================================================================================================================================================== +`GetFirstVisibleLine()` Deprecated for :meth:`~wx.VarVScrollHelper.GetVisibleRowsBegin` +`GetLastVisibleLine()` Deprecated for :meth:`~wx.VarVScrollHelper.GetVisibleRowsEnd` This function originally had a slight design flaw in that it was possible to return ``sys.maxint-1`` (ie: a large positive number) if the scroll position was 0 and the first line wasn't completely visible. +`GetLineCount()` Deprecated for :meth:`~wx.VarVScrollHelper.GetRowCount` `HitTest(x, y)` -`HitTest(pt)` Deprecated for :meth:`~wx.VarScrollHelperBase.VirtualHitTest`. -`OnGetLineHeight(line)` Deprecated for :meth:`~wx.VarVScrollHelper.OnGetRowHeight` -`OnGetLinesHint(lineMin, lineMax)` Deprecated for :meth:`~wx.VarVScrollHelper.OnGetRowsHeightHint` -`RefreshLine(line)` Deprecated for :meth:`~wx.VarVScrollHelper.RefreshRow` -`RefreshLines(from_, to_)` Deprecated for :meth:`~wx.VarVScrollHelper.RefreshRows` -`ScrollLines(lines)` Deprecated for :meth:`~wx.VarVScrollHelper.ScrollRows` -`ScrollPages(pages)` Deprecated for :meth:`~wx.VarVScrollHelper.ScrollRowPages` -`ScrollToLine(line)` Deprecated for :meth:`~wx.VarVScrollHelper.ScrollToRow` -`SetLineCount(count)` Deprecated for :meth:`~wx.VarVScrollHelper.SetRowCount` -======================================= ============================================================================================================================================================================================================================================================================== +`HitTest(pt)` Deprecated for :meth:`~wx.VarScrollHelperBase.VirtualHitTest`. +`OnGetLineHeight(line)` Deprecated for :meth:`~wx.VarVScrollHelper.OnGetRowHeight` +`OnGetLinesHint(lineMin, lineMax)` Deprecated for :meth:`~wx.VarVScrollHelper.OnGetRowsHeightHint` +`RefreshLine(line)` Deprecated for :meth:`~wx.VarVScrollHelper.RefreshRow` +`RefreshLines(from_, to_)` Deprecated for :meth:`~wx.VarVScrollHelper.RefreshRows` +`ScrollLines(lines)` Deprecated for :meth:`~wx.VarVScrollHelper.ScrollRows` +`ScrollPages(pages)` Deprecated for :meth:`~wx.VarVScrollHelper.ScrollRowPages` +`ScrollToLine(line)` Deprecated for :meth:`~wx.VarVScrollHelper.ScrollToRow` +`SetLineCount(count)` Deprecated for :meth:`~wx.VarVScrollHelper.SetRowCount` +======================================= ============================================================================================================================================================================================================================================================================== | From 99834ab3ec82b66a2b4f443ab60641978a2dd21b Mon Sep 17 00:00:00 2001 From: Metallicow Date: Tue, 16 Jan 2018 09:37:04 -0600 Subject: [PATCH 08/14] :interrobang: Trim trailing whitespace misc files All these files seem like legit trailing whitespace that can be removed. --- .travis.yml | 4 +- MANIFEST.in | 4 +- demo/data/imagemap.htm | 4 +- demo/data/proclamation.txt | 144 +++++++++--------- demo/data/tips.txt | 2 +- docs/sphinx/_static/css/phoenix.css | 62 ++++---- .../_static/javascript/jquery.collapse.js | 26 ++-- .../_static/javascript/toggle_visibility.js | 10 +- docs/sphinx/_templates/layout.html | 2 +- ext/README.txt | 2 +- packaging/README-bdist.txt | 2 +- packaging/cairo-msw/include/cairo/cairo.h | 2 +- sip/siplib/README.txt | 2 +- sip/siplib/siplib.c | 34 ++--- unittests/helpfiles/another.htm | 2 +- wx/lib/editor/README.txt | 4 +- wx/lib/myole4ax.idl | 12 +- wx/lib/pdfviewer/bitmaps/ReadMe.txt | 28 ++-- wx/lib/pubsub/LICENSE_BSD_Simple.txt | 6 +- wx/lib/pubsub/README.txt | 2 +- wx/lib/pubsub/README_WxPython.txt | 4 +- wx/lib/pubsub/RELEASE_NOTES.txt | 44 +++--- wx/lib/pubsub/examples/advanced/README.txt | 2 +- wx/lib/pubsub/examples/runall.bat | 4 +- wx/py/CHANGES.txt | 6 +- 25 files changed, 207 insertions(+), 207 deletions(-) diff --git a/.travis.yml b/.travis.yml index 051aa567..21c5510a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ # language: python - + matrix: include: - os: linux @@ -40,7 +40,7 @@ matrix: # redundant specification of `sudo` and `python` because of travis-ci.org's way of parsing `.travis.yml` - + # Available build steps: # 1. before_install # 2. install diff --git a/MANIFEST.in b/MANIFEST.in index 7c5cad2c..e5f14b44 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ # -# Although we don't use this template to make source distributions, it is -# still an easy way to specify what data files (non *.py files) should be +# Although we don't use this template to make source distributions, it is +# still an easy way to specify what data files (non *.py files) should be # included in the package dirs. # # See cmd_sdist() in build.py for the actual building of the source dist. diff --git a/demo/data/imagemap.htm b/demo/data/imagemap.htm index edebd33b..6dd62ca2 100644 --- a/demo/data/imagemap.htm +++ b/demo/data/imagemap.htm @@ -6,7 +6,7 @@ This is test. - + @@ -14,7 +14,7 @@ This is test. - + diff --git a/demo/data/proclamation.txt b/demo/data/proclamation.txt index 5d305e49..1723e23e 100644 --- a/demo/data/proclamation.txt +++ b/demo/data/proclamation.txt @@ -2,106 +2,106 @@ EMANCIPATION PROCLAMATION: By the President of the United States of America: A PROCLAMATION - Whereas on the 22nd day of September, A.D. 1862, a proclamation -was issued by the President of the United States, containing, + Whereas on the 22nd day of September, A.D. 1862, a proclamation +was issued by the President of the United States, containing, among other things, the following, to wit: - "That on the 1st day of January, A.D. 1863, all persons held as -slaves within any State or designated part of a State the people -whereof shall then be in rebellion against the United States shall -be then, thenceforward, and forever free; and the executive -government of the United States, including the military and naval -authority thereof, will recognize and maintain the freedom of such -persons and will do no act or acts to repress such persons, or any + "That on the 1st day of January, A.D. 1863, all persons held as +slaves within any State or designated part of a State the people +whereof shall then be in rebellion against the United States shall +be then, thenceforward, and forever free; and the executive +government of the United States, including the military and naval +authority thereof, will recognize and maintain the freedom of such +persons and will do no act or acts to repress such persons, or any of them, in any efforts they may make for their actual freedom. - "That the executive will on the 1st day of January aforesaid, -by proclamation, designate the States and parts of States, if any, -in which the people thereof, respectively, shall then be in -rebellion against the United States; and the fact that any State -or the people thereof shall on that day be in good faith -represented in the Congress of the United States by members -chosen thereto at elections wherein a majority of the qualified -voters of such States shall have participated shall, in the -absence of strong countervailing testimony, be deemed conclusive -evidence that such State and the people thereof are not then + "That the executive will on the 1st day of January aforesaid, +by proclamation, designate the States and parts of States, if any, +in which the people thereof, respectively, shall then be in +rebellion against the United States; and the fact that any State +or the people thereof shall on that day be in good faith +represented in the Congress of the United States by members +chosen thereto at elections wherein a majority of the qualified +voters of such States shall have participated shall, in the +absence of strong countervailing testimony, be deemed conclusive +evidence that such State and the people thereof are not then in rebellion against the United States." - Now, therefore, I, Abraham Lincoln, President of the United -States, by virtue of the power in me vested as Commander-In-Chief -of the Army and Navy of the United States in time of actual armed -rebellion against the authority and government of the United States, -and as a fit and necessary war measure for supressing said -rebellion, do, on this 1st day of January, A.D. 1863, and in -accordance with my purpose so to do, publicly proclaimed for the -full period of one hundred days from the first day above mentioned, -order and designate as the States and parts of States wherein the -people thereof, respectively, are this day in rebellion against + Now, therefore, I, Abraham Lincoln, President of the United +States, by virtue of the power in me vested as Commander-In-Chief +of the Army and Navy of the United States in time of actual armed +rebellion against the authority and government of the United States, +and as a fit and necessary war measure for supressing said +rebellion, do, on this 1st day of January, A.D. 1863, and in +accordance with my purpose so to do, publicly proclaimed for the +full period of one hundred days from the first day above mentioned, +order and designate as the States and parts of States wherein the +people thereof, respectively, are this day in rebellion against the United States the following, to wit: - Arkansas, Texas, Louisiana (except the parishes of St. Bernard, -Palquemines, Jefferson, St. John, St. Charles, St. James, Ascension, -Assumption, Terrebone, Lafourche, St. Mary, St. Martin, and Orleans, -including the city of New Orleans), Mississippi, Alabama, Florida, -Georgia, South Carolina, North Carolina, and Virginia (except the -forty-eight counties designated as West Virginia, and also the -counties of Berkeley, Accomac, Morthhampton, Elizabeth City, York, -Princess Anne, and Norfolk, including the cities of Norfolk and -Portsmouth), and which excepted parts are for the present left + Arkansas, Texas, Louisiana (except the parishes of St. Bernard, +Palquemines, Jefferson, St. John, St. Charles, St. James, Ascension, +Assumption, Terrebone, Lafourche, St. Mary, St. Martin, and Orleans, +including the city of New Orleans), Mississippi, Alabama, Florida, +Georgia, South Carolina, North Carolina, and Virginia (except the +forty-eight counties designated as West Virginia, and also the +counties of Berkeley, Accomac, Morthhampton, Elizabeth City, York, +Princess Anne, and Norfolk, including the cities of Norfolk and +Portsmouth), and which excepted parts are for the present left precisely as if this proclamation were not issued. - And by virtue of the power and for the purpose aforesaid, I do -order and declare that all persons held as slaves within said -designated States and parts of States are, and henceforward shall -be, free; and that the Executive Government of the United States, -including the military and naval authorities thereof, will + And by virtue of the power and for the purpose aforesaid, I do +order and declare that all persons held as slaves within said +designated States and parts of States are, and henceforward shall +be, free; and that the Executive Government of the United States, +including the military and naval authorities thereof, will recognize and maintain the freedom of said persons. - And I hereby enjoin upon the people so declared to be free to -abstain from all violence, unless in necessary self-defence; and -I recommend to them that, in all case when allowed, they labor + And I hereby enjoin upon the people so declared to be free to +abstain from all violence, unless in necessary self-defence; and +I recommend to them that, in all case when allowed, they labor faithfully for reasonable wages. - And I further declare and make known that such persons of -suitable condition will be received into the armed service of -the United States to garrison forts, positions, stations, and + And I further declare and make known that such persons of +suitable condition will be received into the armed service of +the United States to garrison forts, positions, stations, and other places, and to man vessels of all sorts in said service. - And upon this act, sincerely believed to be an act of justice, -warranted by the Constitution upon military necessity, I invoke -the considerate judgment of mankind and the gracious favor + And upon this act, sincerely believed to be an act of justice, +warranted by the Constitution upon military necessity, I invoke +the considerate judgment of mankind and the gracious favor of Almighty God. (signed) ABRAHAM LINCOLN ------------------------------------- -On Jan. 1, 1863, U.S. President Abraham Lincoln declared free -all slaves residing in territory in rebellion against the federal -government. This Emancipation Proclamation actually freed few -people. It did not apply to slaves in border states fighting on -the Union side; nor did it affect slaves in southern areas already -under Union control. Naturally, the states in rebellion did not +On Jan. 1, 1863, U.S. President Abraham Lincoln declared free +all slaves residing in territory in rebellion against the federal +government. This Emancipation Proclamation actually freed few +people. It did not apply to slaves in border states fighting on +the Union side; nor did it affect slaves in southern areas already +under Union control. Naturally, the states in rebellion did not act on Lincoln's order. But the proclamation did show Americans-- and the world--that the civil war was now being fought to end slavery. -Lincoln had been reluctant to come to this position. A believer -in white supremacy, he initially viewed the war only in terms of -preserving the Union. As pressure for abolition mounted in -Congress and the country, however, Lincoln became more sympathetic -to the idea. On Sept. 22, 1862, he issued a preliminary proclamation -announcing that emancipation would become effective on Jan. 1, 1863, -in those states still in rebellion. Although the Emancipation -Proclamation did not end slavery in America--this was achieved -by the passage of the 13TH Amendment to the Constitution on Dec. -18, 1865--it did make that accomplishment a basic war goal and -a virtual certainty. +Lincoln had been reluctant to come to this position. A believer +in white supremacy, he initially viewed the war only in terms of +preserving the Union. As pressure for abolition mounted in +Congress and the country, however, Lincoln became more sympathetic +to the idea. On Sept. 22, 1862, he issued a preliminary proclamation +announcing that emancipation would become effective on Jan. 1, 1863, +in those states still in rebellion. Although the Emancipation +Proclamation did not end slavery in America--this was achieved +by the passage of the 13TH Amendment to the Constitution on Dec. +18, 1865--it did make that accomplishment a basic war goal and +a virtual certainty. DOUGLAS T. MILLER -Bibliography: Commager, Henry Steele, The Great Proclamation -(1960); Donovan, Frank, Mr. Lincoln's Proclamation (1964); -Franklin, John Hope, ed., The Emancipation Proclamation (1964). +Bibliography: Commager, Henry Steele, The Great Proclamation +(1960); Donovan, Frank, Mr. Lincoln's Proclamation (1964); +Franklin, John Hope, ed., The Emancipation Proclamation (1964). ------------------------------------- diff --git a/demo/data/tips.txt b/demo/data/tips.txt index 669f4a9b..3433e83a 100644 --- a/demo/data/tips.txt +++ b/demo/data/tips.txt @@ -56,7 +56,7 @@ Your ignorance cramps my conversation. The brain is a wonderful organ; it starts working the moment you get up in the morning and does not stop until you get into the office. -- Robert Frost By working faithfully eight hours a day, you may get to be a boss and work twelve hours a day. -- Robert Frost In three words I can sum up everything I've learned about life: it goes on. -- Robert Frost -If we get involved in a nuclear war, would the electromagnetic pulses from exploding bombs damage my videotapes? +If we get involved in a nuclear war, would the electromagnetic pulses from exploding bombs damage my videotapes? The earth? Oh the earth will be gone in a few seconds...I'm going to blow it up. It's obstructing my view of Venus. -- Marvin the Martian There's that word again, 'heavy'. Why are things so heavy in the future? Is there a problem with the earth's gravitational pull? -- Dr Emmet Brown, "Back To The Future" I'm Luke Skywalker, I'm here to rescue you. diff --git a/docs/sphinx/_static/css/phoenix.css b/docs/sphinx/_static/css/phoenix.css index 0086a0f6..eab1e03e 100644 --- a/docs/sphinx/_static/css/phoenix.css +++ b/docs/sphinx/_static/css/phoenix.css @@ -16,7 +16,7 @@ div.body p, div.body dd, div.body li { text-align: left; } -ul.simple { +ul.simple { margin-top: 0; margin-bottom: 0; padding-top: 0; @@ -50,22 +50,22 @@ div.quotebar { } /** - * Hide dummy toctrees + * Hide dummy toctrees */ -ul { +ul { padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; } -ul li { +ul li { padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; } -ul li a.reference { +ul li a.reference { padding-top: 0; padding-bottom: 0; margin-top: 0; @@ -75,20 +75,20 @@ ul li a.reference { /** * Make high-level subsections easier to distinguish from top-level ones */ -div.body h3 { +div.body h3 { background-color: transparent; } -div.body h4 { +div.body h4 { border: none; background-color: transparent; } -/** +/** * Scipy colors */ -body { +body { background-color: rgb(230,230,230); font-size: 0.90em; } @@ -101,7 +101,7 @@ div.headerimage-noshow { display:none; } -div.document { +div.document { background-color: rgb(230,230,230); position: relative; margin-left: 240px; @@ -121,7 +121,7 @@ div.sphinxsidebar { z-index: 1; left: 0; top: 30px; - bottom: 0; + bottom: 0; } div#searchbox { @@ -129,7 +129,7 @@ div#searchbox { } div#sourcelink { - position: absolute; + position: absolute; bottom: 0; font-style: italic; font-size: small; @@ -249,7 +249,7 @@ div.footer { float:left; text-align:center; } - + .floatcenter { position:relative; float:none; @@ -272,8 +272,8 @@ div.headerfix :target { margin-top: -{{ 30 }}; } -/** - * Extra admonitions +/** + * Extra admonitions */ div.return { @@ -290,18 +290,18 @@ div.availability { border: 1px solid #adff2f; } -div.plot-output { +div.plot-output { clear-after: both; } -div.plot-output .figure { +div.plot-output .figure { float: center; text-align: center; margin-bottom: 0; padding-bottom: 0; } -div.plot-output .caption { +div.plot-output .caption { margin-top: 2; padding-top: 0; } @@ -310,11 +310,11 @@ div.plot-output p.admonition-title { display: none; } -div.plot-output:after { - content: ""; - display: block; - height: 0; - clear: both; +div.plot-output:after { + content: ""; + display: block; + height: 0; + clear: both; } .doctodo { @@ -369,7 +369,7 @@ div.admonition { text-align: left; background-image: url('../images/sphinxdocs/todo.png'); background-repeat: no-repeat; - background-position: 5px 5px; + background-position: 5px 5px; padding-left: 33px; } @@ -383,7 +383,7 @@ div.seealso { text-align: left; background-image: url('../images/sphinxdocs/seealso.png'); background-repeat: no-repeat; - background-position: 5px 5px; + background-position: 5px 5px; padding-left: 33px; } @@ -397,7 +397,7 @@ div.warning { text-align: left; background-image: url('../images/sphinxdocs/warning.png'); background-repeat: no-repeat; - background-position: 5px 5px; + background-position: 5px 5px; padding-left: 33px; } @@ -411,7 +411,7 @@ div.todo { text-align: left; background-image: url('../images/sphinxdocs/todo.png'); background-repeat: no-repeat; - background-position: 5px 5px; + background-position: 5px 5px; padding-left: 33px; } @@ -456,7 +456,7 @@ div.note { text-align: left; background-image: url('../images/sphinxdocs/info.png'); background-repeat: no-repeat; - background-position: 5px 5px; + background-position: 5px 5px; padding-left: 33px; } @@ -470,7 +470,7 @@ div.availability { text-align: left; background-image: url('../images/sphinxdocs/available.png'); background-repeat: no-repeat; - background-position: 5px 5px; + background-position: 5px 5px; padding-left: 33px; } @@ -502,12 +502,12 @@ table.field-list th { padding-left: 5px; } -table.field-list { +table.field-list { border-collapse: separate; border-spacing: 10px; } -/** +/** * Styling for footnotes */ diff --git a/docs/sphinx/_static/javascript/jquery.collapse.js b/docs/sphinx/_static/javascript/jquery.collapse.js index c0776d12..96b13a2e 100644 --- a/docs/sphinx/_static/javascript/jquery.collapse.js +++ b/docs/sphinx/_static/javascript/jquery.collapse.js @@ -5,40 +5,40 @@ * @author Daniel Stocks (http://webcloud.se) * @version 0.9.1 * @updated 17-AUG-2010 - * + * * Copyright 2010, Daniel Stocks * Released under the MIT, BSD, and GPL Licenses. */ - + (function($) { - + // Use a cookie counter to allow multiple instances of the plugin var cookieCounter = 0; - + $.fn.extend({ collapse: function(options) { - + var defaults = { head : "h3", group : "div, ul", cookieName : "collapse", // Default function for showing content - show: function() { + show: function() { this.show(); }, // Default function for hiding content - hide: function() { + hide: function() { this.hide(); } }; var op = $.extend(defaults, options); - + // Default CSS classes var active = "myactive", inactive = "myinactive"; - + return this.each(function() { - + // Increment coookie counter to ensure cookie name integrity cookieCounter++; var obj = $(this), @@ -54,7 +54,7 @@ } return head.next(op.group)[0]; }); - + // Bind event for showing content obj.bind("show", function(e, bypass) { var obj = $(e.target); @@ -84,7 +84,7 @@ op.hide.call(obj); } }); - + // Look for existing cookies if(cookieSupport) { for (var c=0;c<=l;c++) { @@ -98,7 +98,7 @@ } } } - + // Delegate click event to show/hide content. obj.bind("click", function(e) { var t = $(e.target); diff --git a/docs/sphinx/_static/javascript/toggle_visibility.js b/docs/sphinx/_static/javascript/toggle_visibility.js index b3ee2aae..9b5c2b80 100644 --- a/docs/sphinx/_static/javascript/toggle_visibility.js +++ b/docs/sphinx/_static/javascript/toggle_visibility.js @@ -2,13 +2,13 @@ * toggle_visibility.js * -------------------- * - * These functions enable the user to toggle the visibility of a block of + * These functions enable the user to toggle the visibility of a block of * the document, which is delimited by a

tag with an expected id - * attribute. The magic happens via using the id of the object passed to - * toggle visibility to make the id's used to find the other elements that - * will be operated upon. + * attribute. The magic happens via using the id of the object passed to + * toggle visibility to make the id's used to find the other elements that + * will be operated upon. */ - + function hasClass(ele,cls) { return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); } diff --git a/docs/sphinx/_templates/layout.html b/docs/sphinx/_templates/layout.html index 76db1973..7605dc6c 100644 --- a/docs/sphinx/_templates/layout.html +++ b/docs/sphinx/_templates/layout.html @@ -60,7 +60,7 @@
Phoenix Logo
- + {% block body %} {% endblock %} {%- if theme_disqus_comments|tobool %}
diff --git a/ext/README.txt b/ext/README.txt index 70054ba6..fb37a1e4 100644 --- a/ext/README.txt +++ b/ext/README.txt @@ -18,7 +18,7 @@ To learn more about git submodules, please see the following: http://git-scm.com/book/en/v2/Git-Tools-Submodules http://blogs.atlassian.com/2013/03/git-submodules-workflows-tips/ http://www.speirs.org/blog/2009/5/11/understanding-git-submodules.html - + Notes to self ============= diff --git a/packaging/README-bdist.txt b/packaging/README-bdist.txt index 8b202c67..67efe49b 100644 --- a/packaging/README-bdist.txt +++ b/packaging/README-bdist.txt @@ -42,7 +42,7 @@ The Phoenix extension modules need to load the dynamic libraries that contain the wxWidgets code for the platform. In most cases the extension modules in this snapshot already know to look in the same folder for the wxWidgets shared libraries. This will work for Windows and Mac, and should also work -for any unix-like system based on ELF binaries, and if the expected objdump +for any unix-like system based on ELF binaries, and if the expected objdump utility was found on the build system. For those cases where the build was not able to perform the neccesary magic diff --git a/packaging/cairo-msw/include/cairo/cairo.h b/packaging/cairo-msw/include/cairo/cairo.h index 136c5dbf..efe3112b 100644 --- a/packaging/cairo-msw/include/cairo/cairo.h +++ b/packaging/cairo-msw/include/cairo/cairo.h @@ -868,7 +868,7 @@ typedef struct _cairo_rectangle { * @status: Error status of the rectangle list * @rectangles: Array containing the rectangles * @num_rectangles: Number of rectangles in this list - * + * * A data structure for holding a dynamically allocated * array of rectangles. * diff --git a/sip/siplib/README.txt b/sip/siplib/README.txt index 3af64a87..b745de83 100644 --- a/sip/siplib/README.txt +++ b/sip/siplib/README.txt @@ -1,7 +1,7 @@ This folder contains a copy of the SIP runtime library code. It is here so we can make it part of the wxPython build instead of needing to have a dependency upon SIP already being installed on user -machines. +machines. 3rd party extension modules that need to use or interact with wxPython types or other items will need to ensure that they #include the sip.h diff --git a/sip/siplib/siplib.c b/sip/siplib/siplib.c index a309761a..eb1797ab 100644 --- a/sip/siplib/siplib.c +++ b/sip/siplib/siplib.c @@ -4579,7 +4579,7 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, case 'F': { /* Python callable object. */ - + PyObject **p = va_arg(va, PyObject **); if (arg != NULL) @@ -4595,14 +4595,14 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, Py_INCREF(arg); } } - + break; } case 'H': { /* Python callable object or None. */ - + PyObject **p = va_arg(va, PyObject **); if (arg != NULL) @@ -4618,14 +4618,14 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, Py_INCREF(arg); } } - + break; } case '!': { /* Python object that implements the buffer protocol. */ - + PyObject **p = va_arg(va, PyObject **); if (arg != NULL) @@ -4647,7 +4647,7 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, Py_INCREF(arg); } } - + break; } @@ -4656,7 +4656,7 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, /* * Python object that implements the buffer protocol or None. */ - + PyObject **p = va_arg(va, PyObject **); if (arg != NULL) @@ -4678,7 +4678,7 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp, Py_INCREF(arg); } } - + break; } @@ -7124,7 +7124,7 @@ static int isNonlazyMethod(PyMethodDef *pmd) "__aexit__", #endif NULL - }; + }; const char **l; @@ -9659,11 +9659,11 @@ void sipSaveMethod(sipPyMethod *pm, PyObject *meth) static void sip_api_call_hook(const char *hookname) { PyObject *dictofmods, *mod, *dict, *hook, *res; - + /* Get the dictionary of modules. */ if ((dictofmods = PyImport_GetModuleDict()) == NULL) return; - + #if PY_MAJOR_VERSION >= 3 /* Get the builtins module. */ if ((mod = PyDict_GetItemString(dictofmods, "builtins")) == NULL) @@ -9673,18 +9673,18 @@ static void sip_api_call_hook(const char *hookname) if ((mod = PyDict_GetItemString(dictofmods, "__builtin__")) == NULL) return; #endif - + /* Get it's dictionary. */ if ((dict = PyModule_GetDict(mod)) == NULL) return; - + /* Get the function hook. */ if ((hook = PyDict_GetItemString(dict, hookname)) == NULL) return; - + /* Call the hook and discard any result. */ res = PyObject_Call(hook, empty_tuple, NULL); - + Py_XDECREF(res); } @@ -10522,7 +10522,7 @@ static int sipSimpleWrapper_init(sipSimpleWrapper *self, PyObject *args, */ new_unused_p = &new_unused; } - + if (final_func((PyObject *)self, sipNew, unused, new_unused_p) < 0) { Py_XDECREF(unused); @@ -11315,7 +11315,7 @@ static int sipSimpleWrapper_set_dict(sipSimpleWrapper *sw, PyObject *value, } Py_XDECREF(sw->dict); - + Py_XINCREF(value); sw->dict = value; diff --git a/unittests/helpfiles/another.htm b/unittests/helpfiles/another.htm index 4532dc8c..77e97df3 100644 --- a/unittests/helpfiles/another.htm +++ b/unittests/helpfiles/another.htm @@ -14,7 +14,7 @@ a contents (.hhc) file. You must always supply a contents file because
  • Contents trees rule :-) -
  • The search algorithm uses the contents tree to find out which pages are +
  • The search algorithm uses the contents tree to find out which pages are available.
Wanna know what a contents file looks like? Click here diff --git a/wx/lib/editor/README.txt b/wx/lib/editor/README.txt index 6bf61637..107af2d6 100644 --- a/wx/lib/editor/README.txt +++ b/wx/lib/editor/README.txt @@ -3,7 +3,7 @@ wxEditor component The wxEditor class implements a simple text editor using wxPython. You can create a custom editor by subclassing wxEditor. Even though much of -the editor is implemented in Python, it runs surprisingly smoothly on +the editor is implemented in Python, it runs surprisingly smoothly on normal hardware with small files. @@ -16,7 +16,7 @@ Cursor movement: Arrow keys Beginning of line: Home End of line: End Beginning of buffer: Control-Home -End of the buffer: Control-End +End of the buffer: Control-End Select text: Hold down Shift while moving the cursor Copy: Shift-Insert, Control-C Cut: Shift-Delete, Control-X diff --git a/wx/lib/myole4ax.idl b/wx/lib/myole4ax.idl index 92adc063..6dce9470 100644 --- a/wx/lib/myole4ax.idl +++ b/wx/lib/myole4ax.idl @@ -5,10 +5,10 @@ helpstring("My Ole Guid and interface definitions"), lcid(0x0), version(1.0) - ] + ] library myole4ax -{ +{ importlib("stdole2.tlb"); interface IOleInPlaceUIWindow; @@ -60,7 +60,7 @@ library myole4ax LONG cAccelEntries; } OLEINPLACEFRAMEINFO; - + // [ // uuid(00000000-0000-0000-C000-000000000046), // odl, @@ -71,9 +71,9 @@ library myole4ax // long QueryInterface([in] long priid, [out,in] long* pvObj); // long AddRef(); // long Release(); -// }; +// }; + - [ uuid(00000114-0000-0000-C000-000000000046), odl @@ -127,7 +127,7 @@ library myole4ax long TranslateAccelerator([in] long lpmsg); long OnFrameWindowActivate([in] long fActivate); long OnDocWindowActivate([in] long fActivate); - long ResizeBorder([in] StructPtr prcBorder, + long ResizeBorder([in] StructPtr prcBorder, [in] IOleInPlaceUIWindow* pUIWindow, [in] long fFrameWindow); long EnableModeless([in] long fEnable); diff --git a/wx/lib/pdfviewer/bitmaps/ReadMe.txt b/wx/lib/pdfviewer/bitmaps/ReadMe.txt index e934d2da..2096108b 100644 --- a/wx/lib/pdfviewer/bitmaps/ReadMe.txt +++ b/wx/lib/pdfviewer/bitmaps/ReadMe.txt @@ -1,28 +1,28 @@ -Free Icons by Axialis Software -http://www.axialis.com +Free Icons by Axialis Software +http://www.axialis.com -Here is a library of icons that you can freely use in your projects. All -the icons are licensed under the Creative Commons Attribution License -(http://creativecommons.org/licenses/by/2.5/). It means that you can use -them in any project or website, commercially or not. +Here is a library of icons that you can freely use in your projects. All +the icons are licensed under the Creative Commons Attribution License +(http://creativecommons.org/licenses/by/2.5/). It means that you can use +them in any project or website, commercially or not. The icons have been created by Axialis IconWorkshop, the professional icon authoring tool for Windows. For more info visit this page: http://www.axialis.com/iconworkshop TERMS OF USE -The only restrictions are: (a) you must keep the credits of the authors: -"Axialis Team", even if you modify them; (b) link to us if you use them -on your website (see below). +The only restrictions are: (a) you must keep the credits of the authors: +"Axialis Team", even if you modify them; (b) link to us if you use them +on your website (see below). LINK TO US -If you use the icons in your website, you must add the following link on -EACH PAGE containing the icons (at the bottom of the page for example). +If you use the icons in your website, you must add the following link on +EACH PAGE containing the icons (at the bottom of the page for example). The HTML code for this link is: Icons by Axialis Team - - - + + + diff --git a/wx/lib/pubsub/LICENSE_BSD_Simple.txt b/wx/lib/pubsub/LICENSE_BSD_Simple.txt index 9a7ace03..7e2e402d 100644 --- a/wx/lib/pubsub/LICENSE_BSD_Simple.txt +++ b/wx/lib/pubsub/LICENSE_BSD_Simple.txt @@ -2,13 +2,13 @@ Copyright (c) since 2006, Oliver Schoenborn All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. + list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED diff --git a/wx/lib/pubsub/README.txt b/wx/lib/pubsub/README.txt index 99de95ff..0ad681a8 100644 --- a/wx/lib/pubsub/README.txt +++ b/wx/lib/pubsub/README.txt @@ -2,7 +2,7 @@ Release Notes ============= * cleanup low-level API: exception classes, moved some out of pub module that did not - belong there (clutter), move couple modules, + belong there (clutter), move couple modules, * completed the reference documentation * support installation via pip * follow some guidelines in some PEPs such as PEP 396 and PEP 8 diff --git a/wx/lib/pubsub/README_WxPython.txt b/wx/lib/pubsub/README_WxPython.txt index 8fcf8dd7..a96fe49b 100644 --- a/wx/lib/pubsub/README_WxPython.txt +++ b/wx/lib/pubsub/README_WxPython.txt @@ -1,9 +1,9 @@ # this file gets copied to wx/lib/pubsub folder when release to wxPython -For wxPython users: +For wxPython users: The code in this wx/lib/pubsub folder is taken verbatim from the PyPubSub -project on SourceForge.net. Pubsub originated as a wxPython lib, but it is now +project on SourceForge.net. Pubsub originated as a wxPython lib, but it is now a standalone project on SourceForge. It is included as part of wxPython distribution for convenience to wxPython users, but pubsub can also be installed standalone (see installation notes at http://pypubsub.sourceforge.net), or you diff --git a/wx/lib/pubsub/RELEASE_NOTES.txt b/wx/lib/pubsub/RELEASE_NOTES.txt index f2ec6c5a..d931911a 100644 --- a/wx/lib/pubsub/RELEASE_NOTES.txt +++ b/wx/lib/pubsub/RELEASE_NOTES.txt @@ -1,8 +1,8 @@ For PyPubSub v3.3.0 ^^^^^^^^^^^^^^^^^^^^^ -* cleanup low-level API: exception classes, moved some out of pub module that did not - belong there (clutter), move couple modules, +* cleanup low-level API: exception classes, moved some out of pub module that did not + belong there (clutter), move couple modules, * completed the reference documentation * support installation via pip * follow some guidelines in some PEPs such as PEP 396 and PEP 8 @@ -11,15 +11,15 @@ For PyPubSub v3.3.0 For PyPubSub v3.2.0 ^^^^^^^^^^^^^^^^^^^ -This is a minor release for small improvements made (see docs/CHANGELOG.txt) -based on feedback from user community. In particular an XML reader for -topic specification contributed by Josh English. Also cleaned up the +This is a minor release for small improvements made (see docs/CHANGELOG.txt) +based on feedback from user community. In particular an XML reader for +topic specification contributed by Josh English. Also cleaned up the documentation, updated the examples folder (available in source distribution -as well as `online`_). +as well as `online`_). .. _online: https://sourceforge.net/p/pubsub/code/HEAD/tree/ -Only 3 changes to API (function names): +Only 3 changes to API (function names): * renamed pub.getDefaultRootAllTopics to pub.getDefaultTopicTreeRoot * removed pub.importTopicTree: use pub.addTopicDefnProvider(source, format) @@ -32,10 +32,10 @@ September 2013 PyPubSub 3.1.2 ^^^^^^^^^^^^^^^^ -This is a minor release for small improvements made (see docs/CHANGELOG.txt) -based on feedback from user community. Also extended the documentation. See -pubsub.sourceforge.net for installation and usage. See the examples folder for -some useful examples. +This is a minor release for small improvements made (see docs/CHANGELOG.txt) +based on feedback from user community. Also extended the documentation. See +pubsub.sourceforge.net for installation and usage. See the examples folder for +some useful examples. Oliver Schoenborn Nov 2011 @@ -44,7 +44,7 @@ Nov 2011 PyPubSub 3.1.1b1 ^^^^^^^^^^^^^^^^^^ -Docs updated. +Docs updated. Oliver Schoenborn May 2010 @@ -53,19 +53,19 @@ May 2010 For PyPubSub v3.1.0b1 ^^^^^^^^^^^^^^^^^^^^^^ -Major cleanup of the API since 3.0 and better support -for the legacy wxPython code. Defining a topic tree +Major cleanup of the API since 3.0 and better support +for the legacy wxPython code. Defining a topic tree via a text file has been improved drastically, making it simpler to document topic messages and payload data -required or optional. More examples have been added, -and the messaging protocols clarified. +required or optional. More examples have been added, +and the messaging protocols clarified. -The included docs are not yet updated, that's what I'm -working on now and will lead to the 3.1.1b1 release. -I'm also working on an add-on module that would allow -two applications to communicate over the network using -pubsub-type messaging (with topics, etc). The design -is almost complete. +The included docs are not yet updated, that's what I'm +working on now and will lead to the 3.1.1b1 release. +I'm also working on an add-on module that would allow +two applications to communicate over the network using +pubsub-type messaging (with topics, etc). The design +is almost complete. Oliver Schoenborn Jan 2010 \ No newline at end of file diff --git a/wx/lib/pubsub/examples/advanced/README.txt b/wx/lib/pubsub/examples/advanced/README.txt index 1ef31654..77ae505a 100644 --- a/wx/lib/pubsub/examples/advanced/README.txt +++ b/wx/lib/pubsub/examples/advanced/README.txt @@ -3,7 +3,7 @@ examples uses the *kwargs* messaging protocol, the other uses the *arg1* messaging protocol. There are two examples that can be run from this folder: **main_kwargs.py**: advanced example that shows other capabilities of - pubsub such as pubsub notification and listener exception + pubsub such as pubsub notification and listener exception handling, in the 'kwargs' messaging protocol. All modules that start with 'kwargs\_' are used, as well as some modules that are independent of protocol and are shared with the arg1_main diff --git a/wx/lib/pubsub/examples/runall.bat b/wx/lib/pubsub/examples/runall.bat index 99dccf8c..0a34aa8d 100644 --- a/wx/lib/pubsub/examples/runall.bat +++ b/wx/lib/pubsub/examples/runall.bat @@ -4,7 +4,7 @@ rem This script runs all examples. This should be mostly for using the rem examples as regression tests (after all tests have passed in tests rem folder). rem One command line argument is required, the python version number to -rem use, no dots: 24 for 2.4, 30 for 3.0, etc. +rem use, no dots: 24 for 2.4, 30 for 3.0, etc. rem rem (C) Oliver Schoenborn 2009 @@ -12,7 +12,7 @@ set PY_VER=%1 IF "%1" EQU "" ( SET PY_VER=26 echo Will use Python 2.6. To use other, put version ID as command line arg - echo Example: for Python 2.7 put 27, for 3.0 put 30, etc. + echo Example: for Python 2.7 put 27, for 3.0 put 30, etc. ) set PYTHON_EXE=python diff --git a/wx/py/CHANGES.txt b/wx/py/CHANGES.txt index 501c091e..dc171e2d 100644 --- a/wx/py/CHANGES.txt +++ b/wx/py/CHANGES.txt @@ -15,7 +15,7 @@ Now (Finally): crustslices.py contains: CrustSlices and CrustSlicesFrame PyShell.py and PySlicesShell.py are the respective standalone shell apps PyCrust.py and PySlices.py are the respective apps that also include Filling - + frame.py etc. still continue to service both PyCrust and PySlices. 0.9.7.8 (9/8/09) @@ -43,7 +43,7 @@ After revising the naming conventions: crustslices.py contains: CrustSlices and CrustSlicesFrame PyShell.py and PySlicesShell.py are the respective standalone shell apps PyCrust.py and PySlices.py are the respective apps that also include Filling - + frame.py etc. still continue to service both PyCrust and PySlices. 0.9.7.7 (8/25/2009) (Current--Still Need to SVNAdd the new file PySlicesShell.py) @@ -160,7 +160,7 @@ On top of these changes I (Robin Dunn) added the following: file pointed to by PYTHONSTARTUP or a file in the config dir if PYTHONSTARTUP is not set in the environment. -* Added an option to skip the running of the startup code when +* Added an option to skip the running of the startup code when PyShell or PyCrust starts. * PyCrust adds a pp(item) function to the shell's namespace that From 5dc20b5a013f22c971e55407b26a45ec17b6c386 Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Thu, 18 Jan 2018 11:10:03 -0800 Subject: [PATCH 09/14] Fixed inverse state of "Show Alpha Control" toggle to the actual visibility of the control --- wx/lib/agw/cubecolourdialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wx/lib/agw/cubecolourdialog.py b/wx/lib/agw/cubecolourdialog.py index fbf3784b..595c06a9 100644 --- a/wx/lib/agw/cubecolourdialog.py +++ b/wx/lib/agw/cubecolourdialog.py @@ -3311,7 +3311,7 @@ class CubeColourDialog(wx.Dialog): :param `agwStyle`: can only be ``CCD_SHOW_ALPHA`` or ``None``. """ - show = self.GetAGWWindowStyleFlag() & CCD_SHOW_ALPHA + show = agwStyle & CCD_SHOW_ALPHA self._agwStyle = agwStyle self.mainSizer.Show(self.alphaSizers[0], show) From d4aea5ee2540bd1202595e09da8607876d6ffb03 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 19 Jan 2018 15:14:07 -0800 Subject: [PATCH 10/14] Update wxWidgets changeset pointer --- ext/wxWidgets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/wxWidgets b/ext/wxWidgets index d6ef8a66..4a981f0a 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit d6ef8a66107aaa6c37f9468dd8e35c006de63c6c +Subproject commit 4a981f0aef41720c7f1000cf17e9e118e99f5fe0 From 8258a1bc4d30c8ca079409f58af2a07784c0cf7c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 19 Jan 2018 15:15:46 -0800 Subject: [PATCH 11/14] Add changelog for wx.dataview.TreeListCtrl fix --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 8d81807a..0c8babc5 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -101,6 +101,9 @@ Changes in this release include the following: default style flag you'll need to pass it to the agwStyle parameter instead of the style parameter. +* Fix crash when deleting all wx.dataview.TreeListCtrl items with wxGTK3. + (#679) + From 8aa43776772197a926c015db2b6e91cfa5252a10 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 20 Jan 2018 13:49:50 -0800 Subject: [PATCH 12/14] Update wxWidgets changeset pointer --- ext/wxWidgets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/wxWidgets b/ext/wxWidgets index 4a981f0a..29466d2e 160000 --- a/ext/wxWidgets +++ b/ext/wxWidgets @@ -1 +1 @@ -Subproject commit 4a981f0aef41720c7f1000cf17e9e118e99f5fe0 +Subproject commit 29466d2ea039fcb53a21f5dde53c68fe40027adf From 08461f109083b557e802bbe9547fa52c7ea108e7 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 20 Jan 2018 13:51:56 -0800 Subject: [PATCH 13/14] Add changelog for wx.RadioBox label fix --- CHANGES.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 0c8babc5..189df972 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -104,6 +104,10 @@ Changes in this release include the following: * Fix crash when deleting all wx.dataview.TreeListCtrl items with wxGTK3. (#679) +* Fix displaying '&' in the label of wx.RadioBox on GTK. (#39) + + + From fcf0d8cc178a847ec133a16b3e1680e843f4873e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 22 Jan 2018 11:52:36 -0800 Subject: [PATCH 14/14] Copy methods from wxGenericProgressDialog to wxProgressDialog. This is needed because some of the methods are non-virtual, and they are reimplemented in the MSW version of wxProgressDialog. In order for those methods to be called they need to have wrappers generated. --- CHANGES.rst | 3 ++- etg/progdlg.py | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 189df972..bec74e38 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -106,7 +106,8 @@ Changes in this release include the following: * Fix displaying '&' in the label of wx.RadioBox on GTK. (#39) - +* Fix problems of the wrong C++ method being called in wx.ProgressDialog on MS + Windows. (#701) diff --git a/etg/progdlg.py b/etg/progdlg.py index f454185a..c34efa32 100644 --- a/etg/progdlg.py +++ b/etg/progdlg.py @@ -9,6 +9,7 @@ import etgtools import etgtools.tweaker_tools as tools +import copy PACKAGE = "wx" MODULE = "_core" @@ -34,7 +35,7 @@ def run(): module.addHeaderCode("#include ") - c = module.find('wxGenericProgressDialog') + c = gpd = module.find('wxGenericProgressDialog') assert isinstance(c, etgtools.ClassDef) tools.fixWindowClass(c)#, False) @@ -47,6 +48,18 @@ def run(): c = module.find('wxProgressDialog') tools.fixWindowClass(c) + # Copy methods from the generic to the native class. This is needed + # because none of the methods are declared in the interface files, and + # since on MSW some non-virtual methods are reimplemented in + # wxProgressDialogs they will not be called if SIP doesn't know about + # them. We'll copy all of them and let the C++ compiler sort things out. + for item in gpd: + if (isinstance(item, etgtools.MethodDef) and + not item.isCtor and + not item.isDtor): + c.addItem(copy.deepcopy(item)) + + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module)