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: " "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()