From 28dff8e00bb9e48aff6776032c66d245ca6e6a2d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 14 Dec 2012 08:58:31 +0000 Subject: [PATCH] Set the svn:eol-style property to native for the newer files git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- .../overviews/command_overview.rst | 130 +++++++++--------- .../overviews/dataobject_overview.rst | 98 ++++++------- .../overviews/tipprovider_overview.rst | 110 +++++++-------- .../converted/AppConsole.SetCLocale.1.py | 4 +- .../converted/Bitmap.NewFromPNGData.2.py | 4 +- .../Control.GetSizeFromTextSize.1.py | 18 +-- .../Control.GetSizeFromTextSize.2.py | 18 +-- .../converted/HeaderCtrl.AddColumnsItems.1.py | 26 ++-- .../python/converted/HeaderCtrl.Create.1.py | 4 +- .../HeaderCtrl.UpdateColumnWidthToFit.1.py | 80 +++++------ .../HeaderCtrlSimple.HideColumn.1.py | 4 +- .../python/converted/RearrangeDialog.1.py | 38 ++--- .../RearrangeDialog.AddExtraControls.1.py | 38 ++--- .../python/converted/RearrangeList.1.py | 4 +- .../python/converted/RichMessageDialog.1.py | 26 ++-- ...taViewCustomRenderer.CreateEditorCtrl.1.py | 12 +- ...CustomRenderer.GetValueFromEditorCtrl.1.py | 12 +- .../converted/dataview.DataViewListCtrl.1.py | 22 +-- .../html.HtmlCell.AdjustPagebreak.1.py | 8 +- .../python/converted/html.HtmlCell.Draw.1.py | 6 +- .../html.HtmlCell.DrawInvisible.1.py | 6 +- .../html.HtmlContainerCell.SetWidthFloat.1.py | 4 +- .../html.HtmlContainerCell.SetWidthFloat.2.py | 4 +- .../converted/html.HtmlFilter.CanRead.1.py | 14 +- .../converted/html.HtmlFilter.ReadFile.1.py | 12 +- .../html.HtmlHelpController.AddBook.1.py | 4 +- .../html.HtmlHelpController.AddBook.2.py | 4 +- .../python/converted/html.HtmlHelpWindow.1.py | 24 ++-- .../python/converted/html.HtmlModalHelp.1.py | 8 +- .../converted/html.HtmlParser.GetFS.1.py | 4 +- .../html.HtmlParser.PushTagHandler.1.py | 20 +-- .../converted/html.HtmlTag.GetBeginPos.1.py | 6 +- .../converted/html.HtmlTag.GetEndPos1.1.py | 6 +- .../converted/html.HtmlTag.GetEndPos2.1.py | 6 +- .../converted/html.HtmlTag.GetParam.1.py | 22 +-- .../converted/html.HtmlTag.HasEnding.1.py | 16 +-- .../html.HtmlTagHandler.HandleTag.1.py | 14 +- .../html.HtmlTagHandler.ParseInner.1.py | 6 +- .../html.HtmlWinParser.GetContainer.1.py | 4 +- .../converted/html.HtmlWindow.SetPage.1.py | 4 +- .../stc.StyledTextCtrl.GetInsertionPoint.1.py | 18 +-- .../python/converted/xml.XmlDocument.1.py | 88 ++++++------ .../python/converted/xml.XmlDocument.2.py | 12 +- .../python/converted/xml.XmlDocument.3.py | 8 +- .../converted/xml.XmlNode.GetNodeContent.1.py | 8 +- .../converted/xml.XmlNode.GetNodeContent.2.py | 8 +- .../converted/xrc.XmlResource.Load.1.py | 6 +- .../converted/xrc.XmlResource.LoadDialog.1.py | 6 +- 48 files changed, 502 insertions(+), 502 deletions(-) diff --git a/docs/sphinx/rest_substitutions/overviews/command_overview.rst b/docs/sphinx/rest_substitutions/overviews/command_overview.rst index 508b7c75..51bf2d60 100644 --- a/docs/sphinx/rest_substitutions/overviews/command_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/command_overview.rst @@ -1,65 +1,65 @@ -.. include:: headings.inc - - -.. _command overview: - -================================================= -|phoenix_title| **Command Overview** -================================================= - - -:class:`Command` is a base class for modelling an application command, which is an action usually -performed by selecting a menu item, pressing a toolbar button or any other means provided by -the application to change the data or view. - -Instead of the application functionality being scattered around if statements and functions in -a way that may be hard to read and maintain, the functionality for a command is explicitly represented -as an object which can be manipulated by a framework or application. - -When a user interface event occurs, the application submits a command to a :class:`CommandProcessor` -object to execute and store. - -The wxPython document/view framework handles Undo and Redo by use of :class:`Command` and :class:`CommandProcessor` -objects. You might find further uses for :class:`Command`, such as implementing a macro facility that -stores, loads and replays commands. - -An application can derive a new class for every command, or, more likely, use one class parameterized -with an integer or string command identifier. - - -.. _commandprocessor overview: - -================================================= -|phoenix_title| **CommandProcessor Overview** -================================================= - - -:class:`CommandProcessor` is a class that maintains a history of :class:`Command` instances, with -undo/redo functionality built-in. Derive a new class from this if you want different behaviour. - - -.. _filehistory overview: - -================================================= -|phoenix_title| **FileHistory Overview** -================================================= - -:class:`FileHistory` encapsulates functionality to record the last few files visited, and to allow -the user to quickly load these files using the list appended to the File menu. Although :class:`FileHistory` -is used by :class:`DocManager`, it can be used independently. You may wish to derive from it to allow -different behaviour, such as popping up a scrolling list of files. - -By calling :meth:`FileHistory.UseMenu` you can associate a file menu with the file history. The menu will -then be used for appending filenames that are added to the history. - -.. note:: - - Please notice that currently if the history already contained filenames when UseMenu() is called (e.g. when - initializing a second MDI child frame), the menu is not automatically initialized with the existing filenames - in the history and so you need to call :meth:`FileHistory.AddFilesToMenu` after UseMenu() explicitly in order - to initialize the menu with the existing list of MRU files (otherwise an assertion failure is raised in debug builds). - -The filenames are appended using menu identifiers in the range ``ID_FILE1`` to ``ID_FILE9``. - - - +.. include:: headings.inc + + +.. _command overview: + +================================================= +|phoenix_title| **Command Overview** +================================================= + + +:class:`Command` is a base class for modelling an application command, which is an action usually +performed by selecting a menu item, pressing a toolbar button or any other means provided by +the application to change the data or view. + +Instead of the application functionality being scattered around if statements and functions in +a way that may be hard to read and maintain, the functionality for a command is explicitly represented +as an object which can be manipulated by a framework or application. + +When a user interface event occurs, the application submits a command to a :class:`CommandProcessor` +object to execute and store. + +The wxPython document/view framework handles Undo and Redo by use of :class:`Command` and :class:`CommandProcessor` +objects. You might find further uses for :class:`Command`, such as implementing a macro facility that +stores, loads and replays commands. + +An application can derive a new class for every command, or, more likely, use one class parameterized +with an integer or string command identifier. + + +.. _commandprocessor overview: + +================================================= +|phoenix_title| **CommandProcessor Overview** +================================================= + + +:class:`CommandProcessor` is a class that maintains a history of :class:`Command` instances, with +undo/redo functionality built-in. Derive a new class from this if you want different behaviour. + + +.. _filehistory overview: + +================================================= +|phoenix_title| **FileHistory Overview** +================================================= + +:class:`FileHistory` encapsulates functionality to record the last few files visited, and to allow +the user to quickly load these files using the list appended to the File menu. Although :class:`FileHistory` +is used by :class:`DocManager`, it can be used independently. You may wish to derive from it to allow +different behaviour, such as popping up a scrolling list of files. + +By calling :meth:`FileHistory.UseMenu` you can associate a file menu with the file history. The menu will +then be used for appending filenames that are added to the history. + +.. note:: + + Please notice that currently if the history already contained filenames when UseMenu() is called (e.g. when + initializing a second MDI child frame), the menu is not automatically initialized with the existing filenames + in the history and so you need to call :meth:`FileHistory.AddFilesToMenu` after UseMenu() explicitly in order + to initialize the menu with the existing list of MRU files (otherwise an assertion failure is raised in debug builds). + +The filenames are appended using menu identifiers in the range ``ID_FILE1`` to ``ID_FILE9``. + + + diff --git a/docs/sphinx/rest_substitutions/overviews/dataobject_overview.rst b/docs/sphinx/rest_substitutions/overviews/dataobject_overview.rst index 750c574d..6c60dedd 100644 --- a/docs/sphinx/rest_substitutions/overviews/dataobject_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/dataobject_overview.rst @@ -1,49 +1,49 @@ -.. include:: headings.inc - - -.. _dataobject overview: - -================================================= -|phoenix_title| **DataObject Overview** -================================================= - -This overview discusses data transfer through clipboard or drag and drop. In wxPython, these two ways to transfer -data (either between different applications or inside one and the same) are very similar which allows to implement -both of them using almost the same code - or, in other words, if you implement drag and drop support for your -application, you get clipboard support for free and vice versa. - -At the heart of both clipboard and drag and drop operations lies the :class:`DataObject` class. The objects of this -class (or, to be precise, classes derived from it) represent the data which is being carried by the mouse during -drag and drop operation or copied to or pasted from the clipboard. :class:`DataObject` is a "smart" piece of data -because it knows which formats it supports (see `GetFormatCount` and `GetAllFormats`) and knows how to render itself -in any of them (see `GetDataHere`). It can also receive its value from the outside in a format it supports if it -implements the `SetData` method. Please see the documentation of this class for more details. - -Both clipboard and drag and drop operations have two sides: the source and target, the data provider and the data -receiver. These which may be in the same application and even the same window when, for example, you drag some text -from one position to another in a word processor. Let us describe what each of them should do. - - -The data provider (source) duties ---------------------------------- - -The data provider is responsible for creating a :class:`DataObject` containing the data to be transferred. Then it -should either pass it to the clipboard using :meth:`Clipboard.SetData` function or to :class:`DropSource` and call -:meth:`DropSource.DoDragDrop` function. - -A small difference is that in the case of clipboard operation, the application usually knows in advance whether it -copies or cuts (i.e. copies and deletes) data - in fact, this usually depends on which menu item the user chose. -But for drag and drop it can only know it after :meth:`DropSource.DoDragDrop` returns (from its return value). - - -The data receiver (target) duties ---------------------------------- - -To receive (paste in usual terminology) data from the clipboard, you should create a :class:`DataObject` derived -class which supports the data formats you need and pass it as argument to :meth:`Clipboard.GetData`. If it returns -``False``, no data in (any of) the supported format(s) is available. If it returns ``True``, the data has been -successfully transferred to :class:`DataObject`. - -For drag and drop case, the :meth:`DropTarget.OnData` virtual function will be called when a data object is dropped, -from which the data itself may be requested by calling :meth:`DropTarget.GetData` method which fills the data object. - +.. include:: headings.inc + + +.. _dataobject overview: + +================================================= +|phoenix_title| **DataObject Overview** +================================================= + +This overview discusses data transfer through clipboard or drag and drop. In wxPython, these two ways to transfer +data (either between different applications or inside one and the same) are very similar which allows to implement +both of them using almost the same code - or, in other words, if you implement drag and drop support for your +application, you get clipboard support for free and vice versa. + +At the heart of both clipboard and drag and drop operations lies the :class:`DataObject` class. The objects of this +class (or, to be precise, classes derived from it) represent the data which is being carried by the mouse during +drag and drop operation or copied to or pasted from the clipboard. :class:`DataObject` is a "smart" piece of data +because it knows which formats it supports (see `GetFormatCount` and `GetAllFormats`) and knows how to render itself +in any of them (see `GetDataHere`). It can also receive its value from the outside in a format it supports if it +implements the `SetData` method. Please see the documentation of this class for more details. + +Both clipboard and drag and drop operations have two sides: the source and target, the data provider and the data +receiver. These which may be in the same application and even the same window when, for example, you drag some text +from one position to another in a word processor. Let us describe what each of them should do. + + +The data provider (source) duties +--------------------------------- + +The data provider is responsible for creating a :class:`DataObject` containing the data to be transferred. Then it +should either pass it to the clipboard using :meth:`Clipboard.SetData` function or to :class:`DropSource` and call +:meth:`DropSource.DoDragDrop` function. + +A small difference is that in the case of clipboard operation, the application usually knows in advance whether it +copies or cuts (i.e. copies and deletes) data - in fact, this usually depends on which menu item the user chose. +But for drag and drop it can only know it after :meth:`DropSource.DoDragDrop` returns (from its return value). + + +The data receiver (target) duties +--------------------------------- + +To receive (paste in usual terminology) data from the clipboard, you should create a :class:`DataObject` derived +class which supports the data formats you need and pass it as argument to :meth:`Clipboard.GetData`. If it returns +``False``, no data in (any of) the supported format(s) is available. If it returns ``True``, the data has been +successfully transferred to :class:`DataObject`. + +For drag and drop case, the :meth:`DropTarget.OnData` virtual function will be called when a data object is dropped, +from which the data itself may be requested by calling :meth:`DropTarget.GetData` method which fills the data object. + diff --git a/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst b/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst index 3bafa170..636998f7 100644 --- a/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst @@ -1,55 +1,55 @@ -.. include:: headings.inc - - -.. _tipprovider overview: - -========================================== -|phoenix_title| **TipProvider Overview** -========================================== - -Many "modern" Windows programs have a feature (some would say annoyance) of presenting the user tips at program startup. - -While this is probably useless to the advanced users of the program, the experience shows that the tips may be -quite helpful for the novices and so more and more programs now do this. For a wxPython programmer, implementing this -feature is extremely easy. To show a tip, it is enough to just call :func:`ShowTip` function like this:: - - if showTipsAtStartup: - - tipProvider = wx.CreateFileTipProvider("tips.txt", 0) - wx.ShowTip(windowParent, tipProvider) - del tipProvider - - -Of course, you need to get the text of the tips from somewhere - in the example above, the text is supposed to be in the -file `tips.txt` from where it is read by the tip provider. The tip provider is just an object of a class deriving from :class:`~adv.TipProvider`. -It has to implement one pure virtual function of the base class, `GetTip`. In the case of the tip provider created by -:func:`CreateFileTipProvider`, the tips are just the lines of the text file. - -If you want to implement your own tip provider (for example, if you wish to hardcode the tips inside your program), you -just have to derive another class from :class:`~adv.TipProvider` and pass a pointer to the object of this class to func:`ShowTip` - then -you don't need :func:`CreateFileTipProvider` at all. - -You will probably want to save somewhere the index of the tip last shown - so that the program doesn't always show the same -tip on startup. As you also need to remember whether to show tips or not (you shouldn't do it if the user unchecked -"Show tips on startup" checkbox in the dialog), you will probably want to store both the index of the last shown tip -(as returned by :meth:`~adv.TipProvider.GetCurrentTip` and the flag telling whether to show the tips at startup at all. - -In a `tips.txt` file, lines that begin with a ``#`` character are considered comments and are automatically skipped. Blank -lines and lines only having spaces are also skipped. - -You can easily add runtime-translation capacity by placing each line of the `tips.txt` file inside the usual translation -function. For example, your `tips.txt` file would look like this:: - - _("This is my first tip") - _("This is my second tip") - - -Now add your `tips.txt` file into the list of files that gettext searches for translatable strings. The tips will thus get -included into your generated .po file catalog and be translated at runtime along with the rest of your application's translatable strings. - -.. note:: - - Each line in the `tips.txt` file needs to strictly begin with exactly the 3 characters of underscore-parenthesis-doublequote, - and end with doublequote-parenthesis, as shown above. Also, remember to escape any doublequote characters within the tip - string with a backslash-doublequote. - +.. include:: headings.inc + + +.. _tipprovider overview: + +========================================== +|phoenix_title| **TipProvider Overview** +========================================== + +Many "modern" Windows programs have a feature (some would say annoyance) of presenting the user tips at program startup. + +While this is probably useless to the advanced users of the program, the experience shows that the tips may be +quite helpful for the novices and so more and more programs now do this. For a wxPython programmer, implementing this +feature is extremely easy. To show a tip, it is enough to just call :func:`ShowTip` function like this:: + + if showTipsAtStartup: + + tipProvider = wx.CreateFileTipProvider("tips.txt", 0) + wx.ShowTip(windowParent, tipProvider) + del tipProvider + + +Of course, you need to get the text of the tips from somewhere - in the example above, the text is supposed to be in the +file `tips.txt` from where it is read by the tip provider. The tip provider is just an object of a class deriving from :class:`~adv.TipProvider`. +It has to implement one pure virtual function of the base class, `GetTip`. In the case of the tip provider created by +:func:`CreateFileTipProvider`, the tips are just the lines of the text file. + +If you want to implement your own tip provider (for example, if you wish to hardcode the tips inside your program), you +just have to derive another class from :class:`~adv.TipProvider` and pass a pointer to the object of this class to func:`ShowTip` - then +you don't need :func:`CreateFileTipProvider` at all. + +You will probably want to save somewhere the index of the tip last shown - so that the program doesn't always show the same +tip on startup. As you also need to remember whether to show tips or not (you shouldn't do it if the user unchecked +"Show tips on startup" checkbox in the dialog), you will probably want to store both the index of the last shown tip +(as returned by :meth:`~adv.TipProvider.GetCurrentTip` and the flag telling whether to show the tips at startup at all. + +In a `tips.txt` file, lines that begin with a ``#`` character are considered comments and are automatically skipped. Blank +lines and lines only having spaces are also skipped. + +You can easily add runtime-translation capacity by placing each line of the `tips.txt` file inside the usual translation +function. For example, your `tips.txt` file would look like this:: + + _("This is my first tip") + _("This is my second tip") + + +Now add your `tips.txt` file into the list of files that gettext searches for translatable strings. The tips will thus get +included into your generated .po file catalog and be translated at runtime along with the rest of your application's translatable strings. + +.. note:: + + Each line in the `tips.txt` file needs to strictly begin with exactly the 3 characters of underscore-parenthesis-doublequote, + and end with doublequote-parenthesis, as shown above. Also, remember to escape any doublequote characters within the tip + string with a backslash-doublequote. + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/AppConsole.SetCLocale.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/AppConsole.SetCLocale.1.py index cf6b25ab..7d2135a5 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/AppConsole.SetCLocale.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/AppConsole.SetCLocale.1.py @@ -1,2 +1,2 @@ - - setlocale(LC_ALL, "") + + setlocale(LC_ALL, "") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.NewFromPNGData.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.NewFromPNGData.2.py index f8857638..1a9388d0 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.NewFromPNGData.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.NewFromPNGData.2.py @@ -1,2 +1,2 @@ - - wx.Image.AddHandler(wx.PNGHandler) + + wx.Image.AddHandler(wx.PNGHandler) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.1.py index cdedab13..e4448974 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.1.py @@ -1,9 +1,9 @@ - - # 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( - postcode.GetSizeFromTextSize( - postcode.GetTextExtent("99999"))) + + # 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( + postcode.GetSizeFromTextSize( + postcode.GetTextExtent("99999"))) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.2.py index cdedab13..e4448974 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.2.py @@ -1,9 +1,9 @@ - - # 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( - postcode.GetSizeFromTextSize( - postcode.GetTextExtent("99999"))) + + # 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( + postcode.GetSizeFromTextSize( + postcode.GetTextExtent("99999"))) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.AddColumnsItems.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.AddColumnsItems.1.py index 08b25378..8da5d12a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.AddColumnsItems.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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() - + + 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/HeaderCtrl.Create.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.Create.1.py index c9f81cd4..13800295 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.Create.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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/HeaderCtrl.UpdateColumnWidthToFit.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.UpdateColumnWidthToFit.1.py index 4c124419..4469053e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.UpdateColumnWidthToFit.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.UpdateColumnWidthToFit.1.py @@ -1,40 +1,40 @@ - - class MyHeaderColumn(wx.HeaderColumn): - - def __init__(self): - - wx.HeaderColumn.__init__(self) - - - def SetWidth(self, width): - - self.width = width - - - def GetWidth(self): - - return self.width - - - class MyHeaderCtrl(wx.HeaderCtrl): - - def __init__(self, parent): - - 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 - - + + class MyHeaderColumn(wx.HeaderColumn): + + def __init__(self): + + wx.HeaderColumn.__init__(self) + + + def SetWidth(self, width): + + self.width = width + + + def GetWidth(self): + + return self.width + + + class MyHeaderCtrl(wx.HeaderCtrl): + + def __init__(self, parent): + + 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 + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrlSimple.HideColumn.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrlSimple.HideColumn.1.py index a4030721..853cd378 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrlSimple.HideColumn.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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/RearrangeDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.1.py index 049f80d3..b5868ac2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.1.py @@ -1,19 +1,19 @@ - - items = ["meat", "fish", "fruits", "beer"] - order = [3, 0, 1, 2] - - dlg = wx.RearrangeDialog(None, - "You can also uncheck the items you don't like " - "at all.", - "Sort the items in order of preference", - order, items) - - if dlg.ShowModal() == wx.ID_OK: - order = dlg.GetOrder() - for n in order: - if n >= 0: - wx.LogMessage("Your most preferred item is \"%s\""%n) - break - - - + + items = ["meat", "fish", "fruits", "beer"] + order = [3, 0, 1, 2] + + dlg = wx.RearrangeDialog(None, + "You can also uncheck the items you don't like " + "at all.", + "Sort the items in order of preference", + order, items) + + if dlg.ShowModal() == wx.ID_OK: + order = dlg.GetOrder() + for n in order: + if n >= 0: + wx.LogMessage("Your most preferred item is \"%s\""%n) + break + + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.AddExtraControls.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.AddExtraControls.1.py index e8498fc2..8fda359e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.AddExtraControls.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.AddExtraControls.1.py @@ -1,19 +1,19 @@ - - class MyRearrangeDialog(wx.RearrangeDialog): - - def __init__(self, parent): - - wx.RearrangeDialog.__init__(self, parent) - - panel = wx.Panel(self) - sizer = wx.BoxSizer(wx.HORIZONTAL) - sizer.Add(wx.StaticText(panel, wx.ID_ANY, - "Column width in pixels:")) - sizer.Add(wx.TextCtrl(panel, wx.ID_ANY, "")) - panel.SetSizer(sizer) - self.AddExtraControls(panel) - - - # ... code to update the text control with the currently selected - # item width and to react to its changes omitted ... - + + class MyRearrangeDialog(wx.RearrangeDialog): + + def __init__(self, parent): + + wx.RearrangeDialog.__init__(self, parent) + + panel = wx.Panel(self) + sizer = wx.BoxSizer(wx.HORIZONTAL) + sizer.Add(wx.StaticText(panel, wx.ID_ANY, + "Column width in pixels:")) + sizer.Add(wx.TextCtrl(panel, wx.ID_ANY, "")) + panel.SetSizer(sizer) + self.AddExtraControls(panel) + + + # ... code to update the text control with the currently selected + # item width and to react to its changes omitted ... + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeList.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeList.1.py index dc305375..b1dbdf0d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeList.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeList.1.py @@ -1,2 +1,2 @@ - - order = [0] # checked item #0 + + order = [0] # checked item #0 diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/RichMessageDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/RichMessageDialog.1.py index 52bcd4eb..a221a13d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/RichMessageDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/RichMessageDialog.1.py @@ -1,13 +1,13 @@ - - def ShowDialog(self): - - if dont_show: - return - - dlg = wx.RichMessageDialog(self, "Welcome to my wonderful program!") - dlg.ShowCheckBox("Don't show welcome dialog again") - dlg.ShowModal() # return value ignored as we have "Ok" only anyhow - - if dlg.IsCheckBoxChecked(): - # ... make sure we won't show it again the next time ... - dont_show = True + + def ShowDialog(self): + + if dont_show: + return + + dlg = wx.RichMessageDialog(self, "Welcome to my wonderful program!") + dlg.ShowCheckBox("Don't show welcome dialog again") + dlg.ShowModal() # return value ignored as we have "Ok" only anyhow + + if dlg.IsCheckBoxChecked(): + # ... make sure we won't show it again the next time ... + dont_show = True diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py index f9d8c96e..96dcfaea 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py @@ -1,6 +1,6 @@ - - - # Some integer... - l = value - return wx.SpinCtrl(parent, wx.ID_ANY, "", - labelRect.GetTopLeft(), labelRect.GetSize(), 0, 0, 100, l) + + + # Some integer... + l = value + return wx.SpinCtrl(parent, wx.ID_ANY, "", + labelRect.GetTopLeft(), labelRect.GetSize(), 0, 0, 100, l) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py index 7bec360a..c410bbeb 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py @@ -1,6 +1,6 @@ - - - # sc is a wx.SpinCtrl - l = sc.GetValue() - value = l - return True + + + # sc is a wx.SpinCtrl + l = sc.GetValue() + value = l + return True diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewListCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewListCtrl.1.py index ff4b09bb..c9abaa19 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewListCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewListCtrl.1.py @@ -1,11 +1,11 @@ - - listctrl = wx.dataview.DataViewListCtrl(parent, wx.ID_ANY) - - listctrl.AppendToggleColumn("Toggle") - listctrl.AppendTextColumn("Text") - - data = [True, "row 1"] - listctrl.AppendItem(data) - - data = [False, "row 3"] - listctrl.AppendItem(data) + + listctrl = wx.dataview.DataViewListCtrl(parent, wx.ID_ANY) + + listctrl.AppendToggleColumn("Toggle") + listctrl.AppendTextColumn("Text") + + data = [True, "row 1"] + listctrl.AppendItem(data) + + data = [False, "row 3"] + listctrl.AppendItem(data) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.AdjustPagebreak.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.AdjustPagebreak.1.py index b067fb1a..edc6dab7 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.AdjustPagebreak.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.AdjustPagebreak.1.py @@ -1,4 +1,4 @@ - - ret_value, kp = container.AdjustPagebreak(p, kp, ph) - while ret_value: - ret_value, kp = container.AdjustPagebreak(p, kp, ph) + + ret_value, kp = container.AdjustPagebreak(p, kp, ph) + while ret_value: + ret_value, kp = container.AdjustPagebreak(p, kp, ph) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.Draw.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.Draw.1.py index 2cc77edd..7d3c1f7e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.Draw.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.Draw.1.py @@ -1,3 +1,3 @@ - - - dc.DrawText("hello", x + cell.PosX, y + cell.PosY) + + + dc.DrawText("hello", x + cell.PosX, y + cell.PosY) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.DrawInvisible.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.DrawInvisible.1.py index e8035d96..4051f4be 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.DrawInvisible.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.DrawInvisible.1.py @@ -1,3 +1,3 @@ - - - dc.DrawText("hello", x + cell.PosX, y + cell.PosY) + + + dc.DrawText("hello", x + cell.PosX, y + cell.PosY) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.1.py index 5b424507..49559212 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.1.py @@ -1,2 +1,2 @@ - - SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) + + SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.2.py index 5b424507..49559212 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.2.py @@ -1,2 +1,2 @@ - - SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) + + SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.CanRead.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.CanRead.1.py index 438693d7..2d99d163 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.CanRead.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.CanRead.1.py @@ -1,7 +1,7 @@ - - def CanRead(file): - - # file is a wx.FSFile in this case... - return (file.GetMimeType() == "application/x-ugh") - - + + def CanRead(file): + + # file is a wx.FSFile in this case... + return (file.GetMimeType() == "application/x-ugh") + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.ReadFile.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.ReadFile.1.py index 6822c26b..b21e96bc 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.ReadFile.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.ReadFile.1.py @@ -1,6 +1,6 @@ - - def ReadFile(file): - - # file is a wx.FSFile in this case... - return "" + + def ReadFile(file): + + # file is a wx.FSFile in this case... + return "" diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpController.AddBook.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpController.AddBook.1.py index 69250a95..6564248a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpController.AddBook.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpController.AddBook.1.py @@ -1,2 +1,2 @@ - - AddBook("help.zip") + + AddBook("help.zip") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpController.AddBook.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpController.AddBook.2.py index 69250a95..6564248a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpController.AddBook.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpController.AddBook.2.py @@ -1,2 +1,2 @@ - - AddBook("help.zip") + + AddBook("help.zip") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpWindow.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpWindow.1.py index 756952b8..531a1b4c 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpWindow.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlHelpWindow.1.py @@ -1,12 +1,12 @@ - - def EmbedHTML(self): - # self.embeddedHelpWindow is a wx.html.HtmlHelpWindow - # self.embeddedHtmlHelp is a wx.html.HtmlHelpController - - # Create embedded HTML Help window - self.embeddedHelpWindow = wx.html.HtmlHelpWindow - self.embeddedHtmlHelp.UseConfig(config, rootPath) # Set your own config object here - self.embeddedHtmlHelp.SetHelpWindow(self.embeddedHelpWindow) - self.embeddedHelpWindow.Create(self, wx.ID_ANY, wx.DefaultPosition, self.GetClientSize(), - wx.TAB_TRAVERSAL | wx.BORDER_NONE, wx.html.HF_DEFAULT_STYLE) - self.embeddedHtmlHelp.AddBook("doc.zip") + + def EmbedHTML(self): + # self.embeddedHelpWindow is a wx.html.HtmlHelpWindow + # self.embeddedHtmlHelp is a wx.html.HtmlHelpController + + # Create embedded HTML Help window + self.embeddedHelpWindow = wx.html.HtmlHelpWindow + self.embeddedHtmlHelp.UseConfig(config, rootPath) # Set your own config object here + self.embeddedHtmlHelp.SetHelpWindow(self.embeddedHelpWindow) + self.embeddedHelpWindow.Create(self, wx.ID_ANY, wx.DefaultPosition, self.GetClientSize(), + wx.TAB_TRAVERSAL | wx.BORDER_NONE, wx.html.HF_DEFAULT_STYLE) + self.embeddedHtmlHelp.AddBook("doc.zip") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlModalHelp.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlModalHelp.1.py index b0dbdcf1..c08f3d0b 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlModalHelp.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlModalHelp.1.py @@ -1,4 +1,4 @@ - - # The help can be browsed during the lifetime of self object when the - # user quits the help, program execution will continue. - help = wx.html.HtmlModalHelp(parent, "help", "My topic") + + # The help can be browsed during the lifetime of self object when the + # user quits the help, program execution will continue. + help = wx.html.HtmlModalHelp(parent, "help", "My topic") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlParser.GetFS.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlParser.GetFS.1.py index 77940aff..a06985f5 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlParser.GetFS.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlParser.GetFS.1.py @@ -1,2 +1,2 @@ - - f = self.Parser.GetFS().OpenFile("image.jpg") + + f = self.Parser.GetFS().OpenFile("image.jpg") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlParser.PushTagHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlParser.PushTagHandler.1.py index 62159484..38e51f32 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlParser.PushTagHandler.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlParser.PushTagHandler.1.py @@ -1,10 +1,10 @@ - # .. code-block:: xml - - - - - - - - - + # .. code-block:: xml + + + + + + + + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetBeginPos.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetBeginPos.1.py index bd71dee9..bf2d9369 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetBeginPos.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetBeginPos.1.py @@ -1,4 +1,4 @@ - # .. code-block:: text - - bla bla bla bla bla internal text bla bla + # .. code-block:: text + + bla bla bla bla bla internal text bla bla | \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetEndPos1.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetEndPos1.1.py index 392d08fe..114329a4 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetEndPos1.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetEndPos1.1.py @@ -1,4 +1,4 @@ - # .. code-block:: text - - bla bla bla bla bla internal text bla bla + # .. code-block:: text + + bla bla bla bla bla internal text bla bla | \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetEndPos2.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetEndPos2.1.py index 760698a2..2e457203 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetEndPos2.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetEndPos2.1.py @@ -1,4 +1,4 @@ - # .. code-block:: text - - bla bla bla bla bla internal text bla bla + # .. code-block:: text + + bla bla bla bla bla internal text bla bla | \ No newline at end of file diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetParam.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetParam.1.py index 7953f9ee..c144cae9 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetParam.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.GetParam.1.py @@ -1,11 +1,11 @@ - - # ... Some code here... - - # you have wx.HtmlTag variable tag which is equal to the - # HTML tag - dummy = tag.GetParam("SIZE") - # dummy == "+2" - dummy = tag.GetParam("COLOR") - # dummy == "#0000FF" - dummy = tag.GetParam("COLOR", true) - # dummy == "\"#0000FF\"" -- see the difference!! + + # ... Some code here... + + # you have wx.HtmlTag variable tag which is equal to the + # HTML tag + dummy = tag.GetParam("SIZE") + # dummy == "+2" + dummy = tag.GetParam("COLOR") + # dummy == "#0000FF" + dummy = tag.GetParam("COLOR", true) + # dummy == "\"#0000FF\"" -- see the difference!! diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.HasEnding.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.HasEnding.1.py index 20c7b9d3..4721f5e7 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.HasEnding.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTag.HasEnding.1.py @@ -1,8 +1,8 @@ - # .. code-block:: html - - - Hello

- How are you? -

This is centered...

- Oops
Oooops! - + # .. code-block:: html + + + Hello

+ How are you? +

This is centered...

+ Oops
Oooops! + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTagHandler.HandleTag.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTagHandler.HandleTag.1.py index 889ac5b5..d05e6665 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTagHandler.HandleTag.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTagHandler.HandleTag.1.py @@ -1,7 +1,7 @@ - - def HandleTag(self, tag): - - # change state of parser (e.g. set bold face) - self.ParseInner(tag) - # ... - # restore original state of parser + + def HandleTag(self, tag): + + # change state of parser (e.g. set bold face) + self.ParseInner(tag) + # ... + # restore original state of parser diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTagHandler.ParseInner.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTagHandler.ParseInner.1.py index c81b32e9..2a4e4824 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTagHandler.ParseInner.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlTagHandler.ParseInner.1.py @@ -1,3 +1,3 @@ - # .. code-block:: html - - Hello, world! + # .. code-block:: html + + Hello, world! diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlWinParser.GetContainer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlWinParser.GetContainer.1.py index 4f06b1c2..e55289bc 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlWinParser.GetContainer.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlWinParser.GetContainer.1.py @@ -1,2 +1,2 @@ - - self.WParser.GetContainer().InsertCell(html_cell) + + self.WParser.GetContainer().InsertCell(html_cell) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlWindow.SetPage.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlWindow.SetPage.1.py index 7037f9fe..0169dc2a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlWindow.SetPage.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlWindow.SetPage.1.py @@ -1,2 +1,2 @@ - - htmlwin.SetPage("Hello, world!") + + htmlwin.SetPage("Hello, world!") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/stc.StyledTextCtrl.GetInsertionPoint.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/stc.StyledTextCtrl.GetInsertionPoint.1.py index 1c8ed668..96e8137d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/stc.StyledTextCtrl.GetInsertionPoint.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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) - + + 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/xml.XmlDocument.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlDocument.1.py index 37a939cc..2cd68128 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlDocument.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlDocument.1.py @@ -1,44 +1,44 @@ - - def ScanDocument(): - - doc = wx.xml.XmlDocument() - if not doc.Load("myfile.xml"): - return False - - # start processing the XML file - if doc.GetRoot().GetName() != "myroot-node": - return False - - # examine prologue - prolog = doc.GetDocumentNode().GetChildren() - while prolog: - - if prolog.GetType() == wx.xml.XML_PI_NODE and prolog.GetName() == "target": - - # process Process Instruction contents - pi = prolog.GetContent() - - # Other code here... - - child = doc.GetRoot().GetChildren() - while child: - - if child.GetName() == "tag1": - - # process text enclosed by tag1/tag1 - content = child.GetNodeContent() - - # Other code here... - - # process attributes of tag1 - attrvalue1 = child.GetAttribute("attr1", "default-value") - attrvalue2 = child.GetAttribute("attr2", "default-value") - - elif child.GetName() == "tag2": - - # process tag2 ... - attrvalue3 = child.GetAttribute("attr3", "default-value") - - - child = child.GetNext() - + + def ScanDocument(): + + doc = wx.xml.XmlDocument() + if not doc.Load("myfile.xml"): + return False + + # start processing the XML file + if doc.GetRoot().GetName() != "myroot-node": + return False + + # examine prologue + prolog = doc.GetDocumentNode().GetChildren() + while prolog: + + if prolog.GetType() == wx.xml.XML_PI_NODE and prolog.GetName() == "target": + + # process Process Instruction contents + pi = prolog.GetContent() + + # Other code here... + + child = doc.GetRoot().GetChildren() + while child: + + if child.GetName() == "tag1": + + # process text enclosed by tag1/tag1 + content = child.GetNodeContent() + + # Other code here... + + # process attributes of tag1 + attrvalue1 = child.GetAttribute("attr1", "default-value") + attrvalue2 = child.GetAttribute("attr2", "default-value") + + elif child.GetName() == "tag2": + + # process tag2 ... + attrvalue3 = child.GetAttribute("attr3", "default-value") + + + child = child.GetNext() + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlDocument.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlDocument.2.py index 1b92baa7..dca363e1 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlDocument.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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) + + 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/xml.XmlDocument.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlDocument.3.py index 788fec29..79803699 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlDocument.3.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlDocument.3.py @@ -1,4 +1,4 @@ - - doc = wx.xml.XmlDocument() - doc.Load("myfile.xml") - doc.Save("myfile2.xml") # myfile2.xml != myfile.xml + + 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/xml.XmlNode.GetNodeContent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlNode.GetNodeContent.1.py index 83729ee2..533da658 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlNode.GetNodeContent.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlNode.GetNodeContent.1.py @@ -1,4 +1,4 @@ - # .. code-block:: text - - XML_ELEMENT_NODE name="tagname", content="" - |-- XML_TEXT_NODE name="", content="tagcontent" + # .. 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/xml.XmlNode.GetNodeContent.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlNode.GetNodeContent.2.py index a410fcbb..b0a38387 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/xml.XmlNode.GetNodeContent.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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" + # .. 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/xrc.XmlResource.Load.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/xrc.XmlResource.Load.1.py index f71581a2..3370aca3 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/xrc.XmlResource.Load.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/xrc.XmlResource.Load.1.py @@ -1,3 +1,3 @@ - - if not wx.xml.XmlResource.Get().Load("rc/*.xrc"): - wx.LogError("Couldn't load resources!") + + 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/xrc.XmlResource.LoadDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/xrc.XmlResource.LoadDialog.1.py index be7780c1..0038aae6 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/xrc.XmlResource.LoadDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/xrc.XmlResource.LoadDialog.1.py @@ -1,3 +1,3 @@ - - dlg = wx.xml.XmlResource.Get().LoadDialog(mainFrame, "my_dialog") - dlg.ShowModal() + + dlg = wx.xml.XmlResource.Get().LoadDialog(mainFrame, "my_dialog") + dlg.ShowModal()