diff --git a/docs/sphinx/_downloads/i18nwxapp/app_base.py b/docs/sphinx/_downloads/i18nwxapp/app_base.py
index 567b8284..b91e3c6f 100644
--- a/docs/sphinx/_downloads/i18nwxapp/app_base.py
+++ b/docs/sphinx/_downloads/i18nwxapp/app_base.py
@@ -1,102 +1,102 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-#
-#
-# Author: Werner F. Bruhin
-# Purpose: how to I18N enable an application
-#
-# Inspired by the I18N wxPython demo and the Internationalization page on
-# the wxPython wiki.
-#
-
-import sys
-import os
-
-import wx
-
-# Install a custom displayhook to keep Python from setting the global
-# _ (underscore) to the value of the last evaluated expression. If
-# we don't do this, our mapping of _ to gettext can get overwritten.
-# This is useful/needed in interactive debugging with PyShell.
-
-def _displayHook(obj):
- if obj is not None:
- print repr(obj)
-
-# add translation macro to builtin similar to what gettext does
-import __builtin__
-__builtin__.__dict__['_'] = wx.GetTranslation
-
-import app_const as appC
-
-from wx.lib.mixins.inspection import InspectionMixin
-
-class BaseApp(wx.App, InspectionMixin):
- def OnInit(self):
- self.Init() # InspectionMixin
- # work around for Python stealing "_"
- sys.displayhook = _displayHook
-
- self.appName = "I18N sample application"
-
- self.doConfig()
-
- self.locale = None
- wx.Locale.AddCatalogLookupPathPrefix('locale')
- self.updateLanguage(self.appConfig.Read(u"Language"))
-
- return True
-
- def doConfig(self):
- """Setup an application configuration file"""
- # configuration folder
- sp = wx.StandardPaths.Get()
- self.configLoc = sp.GetUserConfigDir()
- self.configLoc = os.path.join(self.configLoc, self.appName)
- # win: C:\Users\userid\AppData\Roaming\appName
- # nix: \home\userid\appName
-
- if not os.path.exists(self.configLoc):
- os.mkdir(self.configLoc)
-
- # AppConfig stuff is here
- self.appConfig = wx.FileConfig(appName=self.appName,
- vendorName=u'who you wish',
- localFilename=os.path.join(
- self.configLoc, "AppConfig"))
-
- if not self.appConfig.HasEntry(u'Language'):
- # on first run we default to German
- self.appConfig.Write(key=u'Language', value=u'de')
-
- self.appConfig.Flush()
-
- def updateLanguage(self, lang):
- """
- Update the language to the requested one.
-
- Make *sure* any existing locale is deleted before the new
- one is created. The old C++ object needs to be deleted
- before the new one is created, and if we just assign a new
- instance to the old Python variable, the old C++ locale will
- not be destroyed soon enough, likely causing a crash.
-
- :param string `lang`: one of the supported language codes
-
- """
- # if an unsupported language is requested default to English
- if lang in appC.supLang:
- selLang = appC.supLang[lang]
- else:
- selLang = wx.LANGUAGE_ENGLISH
-
- if self.locale:
- assert sys.getrefcount(self.locale) <= 2
- del self.locale
-
- # create a locale object for this language
- self.locale = wx.Locale(selLang)
- if self.locale.IsOk():
- self.locale.AddCatalog(appC.langDomain)
- else:
- self.locale = None
-
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-#
+#
+# Author: Werner F. Bruhin
+# Purpose: how to I18N enable an application
+#
+# Inspired by the I18N wxPython demo and the Internationalization page on
+# the wxPython wiki.
+#
+
+import sys
+import os
+
+import wx
+
+# Install a custom displayhook to keep Python from setting the global
+# _ (underscore) to the value of the last evaluated expression. If
+# we don't do this, our mapping of _ to gettext can get overwritten.
+# This is useful/needed in interactive debugging with PyShell.
+
+def _displayHook(obj):
+ if obj is not None:
+ print repr(obj)
+
+# add translation macro to builtin similar to what gettext does
+import __builtin__
+__builtin__.__dict__['_'] = wx.GetTranslation
+
+import app_const as appC
+
+from wx.lib.mixins.inspection import InspectionMixin
+
+class BaseApp(wx.App, InspectionMixin):
+ def OnInit(self):
+ self.Init() # InspectionMixin
+ # work around for Python stealing "_"
+ sys.displayhook = _displayHook
+
+ self.appName = "I18N sample application"
+
+ self.doConfig()
+
+ self.locale = None
+ wx.Locale.AddCatalogLookupPathPrefix('locale')
+ self.updateLanguage(self.appConfig.Read(u"Language"))
+
+ return True
+
+ def doConfig(self):
+ """Setup an application configuration file"""
+ # configuration folder
+ sp = wx.StandardPaths.Get()
+ self.configLoc = sp.GetUserConfigDir()
+ self.configLoc = os.path.join(self.configLoc, self.appName)
+ # win: C:\Users\userid\AppData\Roaming\appName
+ # nix: \home\userid\appName
+
+ if not os.path.exists(self.configLoc):
+ os.mkdir(self.configLoc)
+
+ # AppConfig stuff is here
+ self.appConfig = wx.FileConfig(appName=self.appName,
+ vendorName=u'who you wish',
+ localFilename=os.path.join(
+ self.configLoc, "AppConfig"))
+
+ if not self.appConfig.HasEntry(u'Language'):
+ # on first run we default to German
+ self.appConfig.Write(key=u'Language', value=u'de')
+
+ self.appConfig.Flush()
+
+ def updateLanguage(self, lang):
+ """
+ Update the language to the requested one.
+
+ Make *sure* any existing locale is deleted before the new
+ one is created. The old C++ object needs to be deleted
+ before the new one is created, and if we just assign a new
+ instance to the old Python variable, the old C++ locale will
+ not be destroyed soon enough, likely causing a crash.
+
+ :param string `lang`: one of the supported language codes
+
+ """
+ # if an unsupported language is requested default to English
+ if lang in appC.supLang:
+ selLang = appC.supLang[lang]
+ else:
+ selLang = wx.LANGUAGE_ENGLISH
+
+ if self.locale:
+ assert sys.getrefcount(self.locale) <= 2
+ del self.locale
+
+ # create a locale object for this language
+ self.locale = wx.Locale(selLang)
+ if self.locale.IsOk():
+ self.locale.AddCatalog(appC.langDomain)
+ else:
+ self.locale = None
+
diff --git a/docs/sphinx/_downloads/i18nwxapp/app_const.py b/docs/sphinx/_downloads/i18nwxapp/app_const.py
index 95095afc..a9125221 100644
--- a/docs/sphinx/_downloads/i18nwxapp/app_const.py
+++ b/docs/sphinx/_downloads/i18nwxapp/app_const.py
@@ -1,16 +1,16 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-#
-#
-# Author: Werner F. Bruhin
-# Purpose: Application constants
-# Created: 06/04/2012
-
-import wx
-
-# language domain
-langDomain = "I18Nwxapp"
-# languages you want to support
-supLang = {u"en": wx.LANGUAGE_ENGLISH,
- u"fr": wx.LANGUAGE_FRENCH,
- u"de": wx.LANGUAGE_GERMAN,
- }
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-#
+#
+# Author: Werner F. Bruhin
+# Purpose: Application constants
+# Created: 06/04/2012
+
+import wx
+
+# language domain
+langDomain = "I18Nwxapp"
+# languages you want to support
+supLang = {u"en": wx.LANGUAGE_ENGLISH,
+ u"fr": wx.LANGUAGE_FRENCH,
+ u"de": wx.LANGUAGE_GERMAN,
+ }
diff --git a/docs/sphinx/_downloads/i18nwxapp/sampleapp.py b/docs/sphinx/_downloads/i18nwxapp/sampleapp.py
index 970906d3..597530fe 100644
--- a/docs/sphinx/_downloads/i18nwxapp/sampleapp.py
+++ b/docs/sphinx/_downloads/i18nwxapp/sampleapp.py
@@ -1,111 +1,111 @@
-# -*- coding: utf-8 -*-#
-#!/usr/bin/env python
-
-"""The sample I18N application"""
-
-import os
-
-import wx
-import wx.lib.sized_controls as sc
-
-class AppI18N(sc.SizedFrame):
- def __init__(self, parent, **kwds):
- """
- A sample application to demonstrate how to enable I18N support
- """
- super(AppI18N, self).__init__(parent, **kwds)
- self.SetTitle(_(u"The I18N sample application"))
-
- self.createMenu()
- self.createOtherCtrls()
-
- def createMenu(self):
- menubar = wx.MenuBar()
-
- # file menu
- fileMenu = wx.Menu()
- closeMenuItem = fileMenu.Append(wx.NewId(),
- _(u"Close"),
- _(u"Close the application"))
- self.Bind(wx.EVT_MENU, self.onClose, closeMenuItem)
- menubar.Append(fileMenu, _(u"&File"))
-
- # edit menu
- manageMenu = wx.Menu()
- manageSomethingMenuItem = manageMenu.Append(wx.NewId(),
- _(u"Edit something"),
- _(u"Edit an entry of something"))
- self.Bind(wx.EVT_MENU, self.doEditSomething, manageSomethingMenuItem)
-
- menubar.Append(manageMenu, _(u"&Edit"))
-
- # help menu
- helpMenu = wx.Menu()
- aboutMenuItem = helpMenu.Append(wx.NewId(),
- _(u"&About"),
- _(u"About the program"))
- self.Bind(wx.EVT_MENU, self.doAboutBox, aboutMenuItem)
- menubar.Append(helpMenu, _(u"&Help"))
-
- self.SetMenuBar(menubar)
-
- def createOtherCtrls(self):
- pane = self.GetContentsPane()
-
- cPane = sc.SizedPanel(pane)
- cPane.SetSizerType("grid", options={"cols": 2})
- st = wx.StaticText(cPane, wx.ID_ANY,
- _(u"A nice label for the TextCtrl"))
- st.SetSizerProps(valign='center')
- tc = wx.TextCtrl(cPane, wx.ID_ANY)
-
- searchSt = wx.StaticText(cPane, wx.ID_ANY,
- _(u"a search control"))
- searchSt.SetSizerProps(valign='center')
- searchC = wx.SearchCtrl(cPane, wx.ID_ANY)
-
- sline = wx.StaticLine(pane, wx.ID_ANY)
- sline.SetSizerProps(expand=True)
- bPane = sc.SizedPanel(pane)
- fB = wx.Button(bPane, wx.ID_ANY, _(u"Open a file dialog"))
- fB.SetSizerProps(align="center")
- fB.Bind(wx.EVT_BUTTON, self.onFbButton)
-
- def onFbButton(self, event):
- wildcard = "Python source (*.py)|*.py|" \
- "Compiled Python (*.pyc)|*.pyc|" \
- "SPAM files (*.spam)|*.spam|" \
- "Egg file (*.egg)|*.egg|" \
- "All files (*.*)|*.*"
-
- with wx.FileDialog(
- self, message=_(u"Choose a file"),
- defaultDir=os.getcwd(),
- defaultFile="",
- wildcard=wildcard,
- style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR
- ) as dlg:
-
- # Show the dialog and retrieve the user response. If it is the
- # OK response,
- # process the data.
- if dlg.ShowModal() == wx.ID_OK:
- # This returns a Python list of files that were selected.
- paths = dlg.GetPaths()
-
- def onClose(self, event):
- event.Skip()
-
- def doEditSomething(self, event):
- event.Skip()
-
- def doAboutBox(self, event):
- event.Skip()
-
-if __name__ == '__main__':
- import app_base as ab
- app = ab.BaseApp(redirect=False)
-
- frame = AppI18N(None)
- frame.Show()
- app.MainLoop()
+# -*- coding: utf-8 -*-#
+#!/usr/bin/env python
+
+"""The sample I18N application"""
+
+import os
+
+import wx
+import wx.lib.sized_controls as sc
+
+class AppI18N(sc.SizedFrame):
+ def __init__(self, parent, **kwds):
+ """
+ A sample application to demonstrate how to enable I18N support
+ """
+ super(AppI18N, self).__init__(parent, **kwds)
+ self.SetTitle(_(u"The I18N sample application"))
+
+ self.createMenu()
+ self.createOtherCtrls()
+
+ def createMenu(self):
+ menubar = wx.MenuBar()
+
+ # file menu
+ fileMenu = wx.Menu()
+ closeMenuItem = fileMenu.Append(wx.NewId(),
+ _(u"Close"),
+ _(u"Close the application"))
+ self.Bind(wx.EVT_MENU, self.onClose, closeMenuItem)
+ menubar.Append(fileMenu, _(u"&File"))
+
+ # edit menu
+ manageMenu = wx.Menu()
+ manageSomethingMenuItem = manageMenu.Append(wx.NewId(),
+ _(u"Edit something"),
+ _(u"Edit an entry of something"))
+ self.Bind(wx.EVT_MENU, self.doEditSomething, manageSomethingMenuItem)
+
+ menubar.Append(manageMenu, _(u"&Edit"))
+
+ # help menu
+ helpMenu = wx.Menu()
+ aboutMenuItem = helpMenu.Append(wx.NewId(),
+ _(u"&About"),
+ _(u"About the program"))
+ self.Bind(wx.EVT_MENU, self.doAboutBox, aboutMenuItem)
+ menubar.Append(helpMenu, _(u"&Help"))
+
+ self.SetMenuBar(menubar)
+
+ def createOtherCtrls(self):
+ pane = self.GetContentsPane()
+
+ cPane = sc.SizedPanel(pane)
+ cPane.SetSizerType("grid", options={"cols": 2})
+ st = wx.StaticText(cPane, wx.ID_ANY,
+ _(u"A nice label for the TextCtrl"))
+ st.SetSizerProps(valign='center')
+ tc = wx.TextCtrl(cPane, wx.ID_ANY)
+
+ searchSt = wx.StaticText(cPane, wx.ID_ANY,
+ _(u"a search control"))
+ searchSt.SetSizerProps(valign='center')
+ searchC = wx.SearchCtrl(cPane, wx.ID_ANY)
+
+ sline = wx.StaticLine(pane, wx.ID_ANY)
+ sline.SetSizerProps(expand=True)
+ bPane = sc.SizedPanel(pane)
+ fB = wx.Button(bPane, wx.ID_ANY, _(u"Open a file dialog"))
+ fB.SetSizerProps(align="center")
+ fB.Bind(wx.EVT_BUTTON, self.onFbButton)
+
+ def onFbButton(self, event):
+ wildcard = "Python source (*.py)|*.py|" \
+ "Compiled Python (*.pyc)|*.pyc|" \
+ "SPAM files (*.spam)|*.spam|" \
+ "Egg file (*.egg)|*.egg|" \
+ "All files (*.*)|*.*"
+
+ with wx.FileDialog(
+ self, message=_(u"Choose a file"),
+ defaultDir=os.getcwd(),
+ defaultFile="",
+ wildcard=wildcard,
+ style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR
+ ) as dlg:
+
+ # Show the dialog and retrieve the user response. If it is the
+ # OK response,
+ # process the data.
+ if dlg.ShowModal() == wx.ID_OK:
+ # This returns a Python list of files that were selected.
+ paths = dlg.GetPaths()
+
+ def onClose(self, event):
+ event.Skip()
+
+ def doEditSomething(self, event):
+ event.Skip()
+
+ def doAboutBox(self, event):
+ event.Skip()
+
+if __name__ == '__main__':
+ import app_base as ab
+ app = ab.BaseApp(redirect=False)
+
+ frame = AppI18N(None)
+ frame.Show()
+ app.MainLoop()
diff --git a/docs/sphinx/_templates/indexsidebar.html b/docs/sphinx/_templates/indexsidebar.html
index 5a476393..0c9a18a5 100644
--- a/docs/sphinx/_templates/indexsidebar.html
+++ b/docs/sphinx/_templates/indexsidebar.html
@@ -1,15 +1,15 @@
-
Download
-Current version: 2.9.3.74
-Get the latest wxPython library from the wxPython website
- , or view the latest modifications using Viewvc .
-
-
Questions? Suggestions?
-
-Send your questions to the wxPython mailing list :
-
-You can also open an issue at the
+
Download
+Current version: 2.9.3.74
+Get the latest wxPython library from the wxPython website
+ , or view the latest modifications using Viewvc .
+
+
Questions? Suggestions?
+
+Send your questions to the wxPython mailing list :
+
+You can also open an issue at the
tracker .
\ No newline at end of file
diff --git a/docs/sphinx/_templates/layout.html b/docs/sphinx/_templates/layout.html
index ff3e4e0d..90d155ca 100644
--- a/docs/sphinx/_templates/layout.html
+++ b/docs/sphinx/_templates/layout.html
@@ -1,71 +1,71 @@
-{% extends "!layout.html" %}
-
-{%- block relbaritems %}
- {{ title }}
-{% endblock %}
-
-{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool)
- and (sidebars != []) and (pagename != 'index') %}
-
-{% macro phoenixsidebar() %}
- {%- if render_sidebar %}{{ sidebar() }}{%- endif %}
-{% endmacro %}
-
-{% macro sidebarcss() %}
- {%- if not render_sidebar %}
-
- {%- endif %}
-{% endmacro %}
-
-{% block extrahead %}{{ sidebarcss() }}{% endblock %}
-
-{% block sidebar1 %}{{ phoenixsidebar() }}{% endblock %}
-{% block sidebar2 %}{% endblock %}
-
-{% block relbar2 %}{% endblock %}
-
-{% block rootrellink %}
-
-
- Home |
- Search |
- Gallery |
- Documentation »
-
-{%- if pagename != 'search' %}
-
-
-
-
-{%- endif %}
-{% endblock %}
-
-{% block document %}
-
-{%- endblock %}
-
-{% block header %}
-
-
-
-{% endblock %}
-
-set script_files = script_files + ['_static/sidebar.js']
-set script_files = script_files + ['_static/header.js']
+{% extends "!layout.html" %}
+
+{%- block relbaritems %}
+ {{ title }}
+{% endblock %}
+
+{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool)
+ and (sidebars != []) and (pagename != 'index') %}
+
+{% macro phoenixsidebar() %}
+ {%- if render_sidebar %}{{ sidebar() }}{%- endif %}
+{% endmacro %}
+
+{% macro sidebarcss() %}
+ {%- if not render_sidebar %}
+
+ {%- endif %}
+{% endmacro %}
+
+{% block extrahead %}{{ sidebarcss() }}{% endblock %}
+
+{% block sidebar1 %}{{ phoenixsidebar() }}{% endblock %}
+{% block sidebar2 %}{% endblock %}
+
+{% block relbar2 %}{% endblock %}
+
+{% block rootrellink %}
+
+
+ Home |
+ Search |
+ Gallery |
+ Documentation »
+
+{%- if pagename != 'search' %}
+
+
+
+
+{%- endif %}
+{% endblock %}
+
+{% block document %}
+
+{%- endblock %}
+
+{% block header %}
+
+
+
+{% endblock %}
+
+set script_files = script_files + ['_static/sidebar.js']
+set script_files = script_files + ['_static/header.js']
diff --git a/docs/sphinx/_templates/main.html b/docs/sphinx/_templates/main.html
index 44192003..edb87e81 100644
--- a/docs/sphinx/_templates/main.html
+++ b/docs/sphinx/_templates/main.html
@@ -1,105 +1,105 @@
-{% extends "layout.html" %}
-{% set title = 'Documentation' %}
-{% block body %}
- Welcome to wxPython (Phoenix)'s documentation!
-
-
-
SVN Revisions
-
“Built with wxWidgets & wxPython SVN revision |SVN| ”
-
-
-
- Welcome! This is the documentation for wxPython {{ release }}, last updated |TODAY|.
-
-
-
- This is the first, very-alpha release of this set of documentation. Documentation TODOs:
-
-
- Add the pure-Python classes, methods and functions (i.e., wx.CallAfter )
- Find a way to link snippets of code to (almost) every class (maybe from the demo?)
- Link the documentation to the wxPython Wiki (a web crawler will be needed)
- Add wx.lib and the various other pure-Python third party libraries
-
-
-
-
- Phoenix is the code name of for the new version of wxPython. Robin Dunn called this the Phoenix project
- because in the process of doing this project wxPython's implementation will be utterly destroyed and then reborn
- in a new and marvelous way, much like the mythical Phoenix rising from the ashes of its former self.
-
-
-
- For wxPython many things about how the wrapper/bindings code is produced will be changing, and we'll also be
- eliminating some other crud along the way.
-
-
-
- Some interesting documents about the current status or the Phoenix project and its development:
-
-
- Migration Guide: the Migration Guide will give you
- some hints on how to modify your existing wxPython applications to be compatible with Phoenix
-
- TODO List: maily for developers, this document explains what
- remains to be done in order to complete the Phoenix project
- Project Goals: this external link
- highlights the project goals and the driving forces behind it
- Development Process: this external link
- shows the main thoughts behind the project Phoenix implementation
-
-
-
-
-
-
Note
-
- If you wish to help in the documentation effort, the main docstrings guidelines are outlined in
-
this document .
-
-
-
-
-
- The Phoenix documentation has been built automatically starting from XML files representing the
- wxWidgets C++ documentation (generated using Doxygen ).
-
-
-
- I developed a set of Python routines to translate this XML hell into
- reStructuredText . Then, Sphinx
- has been used to generate the final set of documentation for Phoenix.
-
-
-
- Documentation
-
-
-
-
- Phoenix Widgets
- Swig-ed from wxWidgets
-
-
- Phoenix Functions
- Standalone/Static functions
-
-
- Wrapped Sub-Modules
- Contained in wx.something modules
-
-
-
- wx.lib
- Our pure-Python library of widgets
- wx.py
- The py package, formerly the PyCrust package.
- wx.tools
- Some useful tools and utilities for wxPython (Editra, XRCed).
-
-
-
-
+{% extends "layout.html" %}
+{% set title = 'Documentation' %}
+{% block body %}
+ Welcome to wxPython (Phoenix)'s documentation!
+
+
+
SVN Revisions
+
“Built with wxWidgets & wxPython SVN revision |SVN| ”
+
+
+
+ Welcome! This is the documentation for wxPython {{ release }}, last updated |TODAY|.
+
+
+
+ This is the first, very-alpha release of this set of documentation. Documentation TODOs:
+
+
+ Add the pure-Python classes, methods and functions (i.e., wx.CallAfter )
+ Find a way to link snippets of code to (almost) every class (maybe from the demo?)
+ Link the documentation to the wxPython Wiki (a web crawler will be needed)
+ Add wx.lib and the various other pure-Python third party libraries
+
+
+
+
+ Phoenix is the code name of for the new version of wxPython. Robin Dunn called this the Phoenix project
+ because in the process of doing this project wxPython's implementation will be utterly destroyed and then reborn
+ in a new and marvelous way, much like the mythical Phoenix rising from the ashes of its former self.
+
+
+
+ For wxPython many things about how the wrapper/bindings code is produced will be changing, and we'll also be
+ eliminating some other crud along the way.
+
+
+
+ Some interesting documents about the current status or the Phoenix project and its development:
+
+
+ Migration Guide: the Migration Guide will give you
+ some hints on how to modify your existing wxPython applications to be compatible with Phoenix
+
+ TODO List: maily for developers, this document explains what
+ remains to be done in order to complete the Phoenix project
+ Project Goals: this external link
+ highlights the project goals and the driving forces behind it
+ Development Process: this external link
+ shows the main thoughts behind the project Phoenix implementation
+
+
+
+
+
+
Note
+
+ If you wish to help in the documentation effort, the main docstrings guidelines are outlined in
+
this document .
+
+
+
+
+
+ The Phoenix documentation has been built automatically starting from XML files representing the
+ wxWidgets C++ documentation (generated using Doxygen ).
+
+
+
+ I developed a set of Python routines to translate this XML hell into
+ reStructuredText . Then, Sphinx
+ has been used to generate the final set of documentation for Phoenix.
+
+
+
+ Documentation
+
+
+
+
+ Phoenix Widgets
+ Swig-ed from wxWidgets
+
+
+ Phoenix Functions
+ Standalone/Static functions
+
+
+ Wrapped Sub-Modules
+ Contained in wx.something modules
+
+
+
+ wx.lib
+ Our pure-Python library of widgets
+ wx.py
+ The py package, formerly the PyCrust package.
+ wx.tools
+ Some useful tools and utilities for wxPython (Editra, XRCed).
+
+
+
+
{% endblock %}
\ No newline at end of file
diff --git a/docs/sphinx/availability.py b/docs/sphinx/availability.py
index ecdb54b9..266d55cc 100644
--- a/docs/sphinx/availability.py
+++ b/docs/sphinx/availability.py
@@ -1,202 +1,202 @@
-# -*- coding: utf-8 -*-
-
-"""
-Allow "availability" admonitions to be inserted into your documentation.
-Inclusion of availabilities can be switched of by a configuration variable.
-The availabilitylist directive collects all availabilities of your project
-and lists them along with a backlink to the original location.
-"""
-
-from docutils import nodes
-
-from sphinx.locale import _
-from sphinx.environment import NoUri
-from sphinx.util.nodes import set_source_info
-from sphinx.util.compat import Directive, make_admonition
-
-# ----------------------------------------------------------------------- #
-class availability_node(nodes.Admonition, nodes.Element): pass
-
-# ----------------------------------------------------------------------- #
-class availabilitylist(nodes.General, nodes.Element): pass
-
-# ----------------------------------------------------------------------- #
-
-
-class Availability(Directive):
- """
- An "availability" entry, displayed (if configured) in the form of an admonition.
- """
-
- has_content = True
- required_arguments = 0
- optional_arguments = 0
- final_argument_whitespace = False
- option_spec = {}
-
-
- # ----------------------------------------------------------------------- #
-
- def run(self):
- env = self.state.document.settings.env
- targetid = 'index-%s' % env.new_serialno('index')
- targetnode = nodes.target('', '', ids=[targetid])
-
- ad = make_admonition(availability_node, self.name, [_('Availability')], self.options,
- self.content, self.lineno, self.content_offset,
- self.block_text, self.state, self.state_machine)
- set_source_info(self, ad[0])
- return [targetnode] + ad
-
-
-
-# ----------------------------------------------------------------------- #
-
-def process_availabilities(app, doctree):
- # collect all availabilities in the environment
- # this is not done in the directive itself because it some transformations
- # must have already been run, e.g. substitutions
- env = app.builder.env
- if not hasattr(env, 'availability_all_availabilities'):
- env.availability_all_availabilities = []
- for node in doctree.traverse(availability_node):
- try:
- targetnode = node.parent[node.parent.index(node) - 1]
- if not isinstance(targetnode, nodes.target):
- raise IndexError
- except IndexError:
- targetnode = None
- env.availability_all_availabilities.append({
- 'docname': env.docname,
- 'source': node.source or env.doc2path(env.docname),
- 'lineno': node.line,
- 'availability': node.deepcopy(),
- 'target': targetnode,
- })
-
-
-# ----------------------------------------------------------------------- #
-
-class AvailabilityList(Directive):
- """
- A list of all availability entries.
- """
-
- has_content = False
- required_arguments = 0
- optional_arguments = 0
- final_argument_whitespace = False
- option_spec = {}
-
-
- # ----------------------------------------------------------------------- #
-
- def run(self):
- # Simply insert an empty availabilitylist node which will be replaced later
- # when process_availability_nodes is called
- return [availabilitylist('')]
-
-
-# ----------------------------------------------------------------------- #
-
-def process_availability_nodes(app, doctree, fromdocname):
- if not app.config['availability_include_availabilities']:
- for node in doctree.traverse(availability_node):
- node.parent.remove(node)
-
- # Replace all availabilitylist nodes with a list of the collected availabilities.
- # Augment each availability with a backlink to the original location.
- env = app.builder.env
-
- if not hasattr(env, 'availability_all_availabilities'):
- env.availability_all_availabilities = []
-
- for node in doctree.traverse(availabilitylist):
- if not app.config['availability_include_availabilities']:
- node.replace_self([])
- continue
-
- content = []
-
- for availability_info in env.availability_all_availabilities:
- para = nodes.paragraph(classes=['availability-source'])
- description = _('(The <> is located in '
- ' %s, line %d.)') % \
- (availability_info['source'], availability_info['lineno'])
- desc1 = description[:description.find('<<')]
- desc2 = description[description.find('>>')+2:]
- para += nodes.Text(desc1, desc1)
-
- # Create a reference
- newnode = nodes.reference('', '', internal=True)
- innernode = nodes.emphasis(_('original entry'), _('original entry'))
- try:
- newnode['refuri'] = app.builder.get_relative_uri(
- fromdocname, availability_info['docname'])
- newnode['refuri'] += '#' + availability_info['target']['refid']
- except NoUri:
- # ignore if no URI can be determined, e.g. for LaTeX output
- pass
- newnode.append(innernode)
- para += newnode
- para += nodes.Text(desc2, desc2)
-
- # (Recursively) resolve references in the availability content
- availability_entry = availability_info['availability']
- env.resolve_references(availability_entry, availability_info['docname'],
- app.builder)
-
- # Insert into the availabilitylist
- content.append(availability_entry)
- content.append(para)
-
- node.replace_self(content)
-
-
-# ----------------------------------------------------------------------- #
-
-def purge_availabilities(app, env, docname):
- if not hasattr(env, 'availability_all_availabilities'):
- return
- env.availability_all_availabilities = [availability for availability in env.availability_all_availabilities
- if availability['docname'] != docname]
-
-
-# ----------------------------------------------------------------------- #
-
-def visit_availability_node(self, node):
- self.visit_admonition(node)
-
-
-# ----------------------------------------------------------------------- #
-
-def depart_availability_node(self, node):
- self.depart_admonition(node)
-
-
-# ----------------------------------------------------------------------- #
-
-def setup(app):
- app.add_javascript('javascript/header.js')
- app.add_javascript('javascript/sidebar.js')
- app.add_javascript('javascript/jquery.collapse.js')
- app.add_javascript('javascript/jquery.cookie.js')
-
- app.add_config_value('availability_include_availabilities', False, False)
-
- app.add_node(availabilitylist)
- app.add_node(availability_node,
- html=(visit_availability_node, depart_availability_node),
- latex=(visit_availability_node, depart_availability_node),
- text=(visit_availability_node, depart_availability_node),
- man=(visit_availability_node, depart_availability_node),
- texinfo=(visit_availability_node, depart_availability_node))
-
- app.add_directive('availability', Availability)
- app.add_directive('availabilitylist', AvailabilityList)
- app.connect('doctree-read', process_availabilities)
- app.connect('doctree-resolved', process_availability_nodes)
- app.connect('env-purge-doc', purge_availabilities)
-
-
-# ----------------------------------------------------------------------- #
+# -*- coding: utf-8 -*-
+
+"""
+Allow "availability" admonitions to be inserted into your documentation.
+Inclusion of availabilities can be switched of by a configuration variable.
+The availabilitylist directive collects all availabilities of your project
+and lists them along with a backlink to the original location.
+"""
+
+from docutils import nodes
+
+from sphinx.locale import _
+from sphinx.environment import NoUri
+from sphinx.util.nodes import set_source_info
+from sphinx.util.compat import Directive, make_admonition
+
+# ----------------------------------------------------------------------- #
+class availability_node(nodes.Admonition, nodes.Element): pass
+
+# ----------------------------------------------------------------------- #
+class availabilitylist(nodes.General, nodes.Element): pass
+
+# ----------------------------------------------------------------------- #
+
+
+class Availability(Directive):
+ """
+ An "availability" entry, displayed (if configured) in the form of an admonition.
+ """
+
+ has_content = True
+ required_arguments = 0
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {}
+
+
+ # ----------------------------------------------------------------------- #
+
+ def run(self):
+ env = self.state.document.settings.env
+ targetid = 'index-%s' % env.new_serialno('index')
+ targetnode = nodes.target('', '', ids=[targetid])
+
+ ad = make_admonition(availability_node, self.name, [_('Availability')], self.options,
+ self.content, self.lineno, self.content_offset,
+ self.block_text, self.state, self.state_machine)
+ set_source_info(self, ad[0])
+ return [targetnode] + ad
+
+
+
+# ----------------------------------------------------------------------- #
+
+def process_availabilities(app, doctree):
+ # collect all availabilities in the environment
+ # this is not done in the directive itself because it some transformations
+ # must have already been run, e.g. substitutions
+ env = app.builder.env
+ if not hasattr(env, 'availability_all_availabilities'):
+ env.availability_all_availabilities = []
+ for node in doctree.traverse(availability_node):
+ try:
+ targetnode = node.parent[node.parent.index(node) - 1]
+ if not isinstance(targetnode, nodes.target):
+ raise IndexError
+ except IndexError:
+ targetnode = None
+ env.availability_all_availabilities.append({
+ 'docname': env.docname,
+ 'source': node.source or env.doc2path(env.docname),
+ 'lineno': node.line,
+ 'availability': node.deepcopy(),
+ 'target': targetnode,
+ })
+
+
+# ----------------------------------------------------------------------- #
+
+class AvailabilityList(Directive):
+ """
+ A list of all availability entries.
+ """
+
+ has_content = False
+ required_arguments = 0
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {}
+
+
+ # ----------------------------------------------------------------------- #
+
+ def run(self):
+ # Simply insert an empty availabilitylist node which will be replaced later
+ # when process_availability_nodes is called
+ return [availabilitylist('')]
+
+
+# ----------------------------------------------------------------------- #
+
+def process_availability_nodes(app, doctree, fromdocname):
+ if not app.config['availability_include_availabilities']:
+ for node in doctree.traverse(availability_node):
+ node.parent.remove(node)
+
+ # Replace all availabilitylist nodes with a list of the collected availabilities.
+ # Augment each availability with a backlink to the original location.
+ env = app.builder.env
+
+ if not hasattr(env, 'availability_all_availabilities'):
+ env.availability_all_availabilities = []
+
+ for node in doctree.traverse(availabilitylist):
+ if not app.config['availability_include_availabilities']:
+ node.replace_self([])
+ continue
+
+ content = []
+
+ for availability_info in env.availability_all_availabilities:
+ para = nodes.paragraph(classes=['availability-source'])
+ description = _('(The <> is located in '
+ ' %s, line %d.)') % \
+ (availability_info['source'], availability_info['lineno'])
+ desc1 = description[:description.find('<<')]
+ desc2 = description[description.find('>>')+2:]
+ para += nodes.Text(desc1, desc1)
+
+ # Create a reference
+ newnode = nodes.reference('', '', internal=True)
+ innernode = nodes.emphasis(_('original entry'), _('original entry'))
+ try:
+ newnode['refuri'] = app.builder.get_relative_uri(
+ fromdocname, availability_info['docname'])
+ newnode['refuri'] += '#' + availability_info['target']['refid']
+ except NoUri:
+ # ignore if no URI can be determined, e.g. for LaTeX output
+ pass
+ newnode.append(innernode)
+ para += newnode
+ para += nodes.Text(desc2, desc2)
+
+ # (Recursively) resolve references in the availability content
+ availability_entry = availability_info['availability']
+ env.resolve_references(availability_entry, availability_info['docname'],
+ app.builder)
+
+ # Insert into the availabilitylist
+ content.append(availability_entry)
+ content.append(para)
+
+ node.replace_self(content)
+
+
+# ----------------------------------------------------------------------- #
+
+def purge_availabilities(app, env, docname):
+ if not hasattr(env, 'availability_all_availabilities'):
+ return
+ env.availability_all_availabilities = [availability for availability in env.availability_all_availabilities
+ if availability['docname'] != docname]
+
+
+# ----------------------------------------------------------------------- #
+
+def visit_availability_node(self, node):
+ self.visit_admonition(node)
+
+
+# ----------------------------------------------------------------------- #
+
+def depart_availability_node(self, node):
+ self.depart_admonition(node)
+
+
+# ----------------------------------------------------------------------- #
+
+def setup(app):
+ app.add_javascript('javascript/header.js')
+ app.add_javascript('javascript/sidebar.js')
+ app.add_javascript('javascript/jquery.collapse.js')
+ app.add_javascript('javascript/jquery.cookie.js')
+
+ app.add_config_value('availability_include_availabilities', False, False)
+
+ app.add_node(availabilitylist)
+ app.add_node(availability_node,
+ html=(visit_availability_node, depart_availability_node),
+ latex=(visit_availability_node, depart_availability_node),
+ text=(visit_availability_node, depart_availability_node),
+ man=(visit_availability_node, depart_availability_node),
+ texinfo=(visit_availability_node, depart_availability_node))
+
+ app.add_directive('availability', Availability)
+ app.add_directive('availabilitylist', AvailabilityList)
+ app.connect('doctree-read', process_availabilities)
+ app.connect('doctree-resolved', process_availability_nodes)
+ app.connect('env-purge-doc', purge_availabilities)
+
+
+# ----------------------------------------------------------------------- #
diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py
index 2342b746..a3bd6109 100644
--- a/docs/sphinx/conf.py
+++ b/docs/sphinx/conf.py
@@ -1,263 +1,263 @@
-# -*- coding: utf-8 -*-
-#
-# Phoenix documentation build configuration file, created by
-# sphinx-quickstart on Mon Jun 22 09:32:57 2009.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys, os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.append(os.path.abspath('.'))
-sys.path.append('..')
-
-# -- General configuration -----------------------------------------------------
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.todo', 'sphinx.ext.autodoc',
- 'sphinx.ext.autosummary', 'sphinx.ext.coverage',
- 'availability']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.txt'
-
-todo_include_todos = True
-todo_all_todos = True
-
-availability_include_availabilities = True
-availability_all_availabilities = True
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'wxPython (Phoenix)'
-copyright = u'2012, Andrea Gavana'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = '2.9'
-# The full version, including alpha/beta/rc tags.
-release = '2.9.4.80 (Phoenix)'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-today_fmt = '%d %B %Y'
-
-# List of documents that shouldn't be included in the build.
-#unused_docs = []
-
-# List of directories, relative to source directory, that shouldn't be searched
-# for source files.
-exclude_trees = ['_build']
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-default_role = 'autolink'
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-add_function_parentheses = False
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-add_module_names = False
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-show_authors = True
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Options for HTML output ---------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. Major themes that come with
-# Sphinx are currently 'default' and 'sphinxdoc'.
-html_theme = 'phoenix_theme'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
-html_theme_options = dict()
-
-# Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = ['.']
-
-# The name for this set of Sphinx documents. If None, it defaults to
-# " v documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-html_short_title = 'Phoenix Docs'
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-html_logo = '_static/images/sphinxdocs/phoenix_main.png'
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-html_favicon = '_static/images/sphinxdocs/phoenix_small.ico'
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-html_style = 'css/phoenix.css'
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-html_sidebars = {'index': 'indexsidebar.html'}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-html_additional_pages = {'gallery': 'gallery.html', 'main': 'main.html'}
-
-# If false, no module index is generated.
-html_use_modindex = True
-
-# If false, no index is generated.
-html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-html_split_index = True
-
-# If true, links to the reST sources are added to the pages.
-html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = ''
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'PhoenixDocs'
-
-# -- Options for LaTeX output --------------------------------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'PhoenixDocs.tex', u'wxPython (Phoenix) Documentation',
- u'Andrea Gavana', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_use_modindex = True
-
-# -- Options for PDF output --------------------------------------------------
-# Grouping the document tree into PDF files. List of tuples
-# (source start file, target name, title, author, options).
-#
-# If there is more than one author, separate them with \\.
-# For example: r'Guido van Rossum\\Fred L. Drake, Jr., editor'
-#
-# The options element is a dictionary that lets you override
-# this config per-document.
-# For example,
-# ('index', u'MyProject', u'My Project', u'Author Name',
-# dict(pdf_compressed = True))
-# would mean that specific document would be compressed
-# regardless of the global pdf_compressed setting.
-pdf_documents = [('index', u'PhoenixDocs', u'wxPython (Phoenix) Documentation', u'Andrea Gavana'),]
-
-# A comma-separated list of custom stylesheets. Example:
-# pdf_stylesheets = ['sphinx', 'kerning', 'a4', "C:\\AGW\\agw\\fonts\\sphinx.json"]
-# Create a compressed PDF
-# Use True/False or 1/0
-# Example: compressed=True
-#pdf_compressed = False
-# A colon-separated list of folders to search for fonts. Example:
-#pdf_font_path = ['E:\\AGW\\agw\\fonts', 'C:\\Windows\\Fonts']
-# Language to be used for hyphenation support
-#pdf_language = "en_US"
-# Mode for literal blocks wider than the frame. Can be
-# overflow, shrink or truncate
-#pdf_fit_mode = "shrink"
-# Section level that forces a break page.
-# For example: 1 means top-level sections start in a new page
-# 0 means disabled
-#pdf_break_level = 0
-# When a section starts in a new page, force it to be 'even', 'odd',
-# or just use 'any'
-#pdf_breakside = 'any'
-# Insert footnotes where they are defined instead of
-# at the end.
-#pdf_inline_footnotes = True
-# verbosity level. 0 1 or 2
-pdf_verbosity = 2
-# If false, no index is generated.
-#pdf_use_index = True
-# If false, no modindex is generated.
-#pdf_use_modindex = True
-# If false, no coverpage is generated.
-#pdf_use_coverpage = True
-# Documents to append as an appendix to all manuals.
-#pdf_appendices = []
-# Enable experimental feature to split table cells. Use it
-# if you get "DelayedTable too big" errors
-pdf_splittables = True
+# -*- coding: utf-8 -*-
+#
+# Phoenix documentation build configuration file, created by
+# sphinx-quickstart on Mon Jun 22 09:32:57 2009.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+sys.path.append(os.path.abspath('.'))
+sys.path.append('..')
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.todo', 'sphinx.ext.autodoc',
+ 'sphinx.ext.autosummary', 'sphinx.ext.coverage',
+ 'availability']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.txt'
+
+todo_include_todos = True
+todo_all_todos = True
+
+availability_include_availabilities = True
+availability_all_availabilities = True
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'wxPython (Phoenix)'
+copyright = u'2012, Andrea Gavana'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '2.9'
+# The full version, including alpha/beta/rc tags.
+release = '2.9.4.80 (Phoenix)'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+today_fmt = '%d %B %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+default_role = 'autolink'
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+add_function_parentheses = False
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+add_module_names = False
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+show_authors = True
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+html_theme = 'phoenix_theme'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+html_theme_options = dict()
+
+# Add any paths that contain custom themes here, relative to this directory.
+html_theme_path = ['.']
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# " v documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+html_short_title = 'Phoenix Docs'
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+html_logo = '_static/images/sphinxdocs/phoenix_main.png'
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+html_favicon = '_static/images/sphinxdocs/phoenix_small.ico'
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+html_style = 'css/phoenix.css'
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+html_sidebars = {'index': 'indexsidebar.html'}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+html_additional_pages = {'gallery': 'gallery.html', 'main': 'main.html'}
+
+# If false, no module index is generated.
+html_use_modindex = True
+
+# If false, no index is generated.
+html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+html_split_index = True
+
+# If true, links to the reST sources are added to the pages.
+html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'PhoenixDocs'
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'PhoenixDocs.tex', u'wxPython (Phoenix) Documentation',
+ u'Andrea Gavana', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
+
+# -- Options for PDF output --------------------------------------------------
+# Grouping the document tree into PDF files. List of tuples
+# (source start file, target name, title, author, options).
+#
+# If there is more than one author, separate them with \\.
+# For example: r'Guido van Rossum\\Fred L. Drake, Jr., editor'
+#
+# The options element is a dictionary that lets you override
+# this config per-document.
+# For example,
+# ('index', u'MyProject', u'My Project', u'Author Name',
+# dict(pdf_compressed = True))
+# would mean that specific document would be compressed
+# regardless of the global pdf_compressed setting.
+pdf_documents = [('index', u'PhoenixDocs', u'wxPython (Phoenix) Documentation', u'Andrea Gavana'),]
+
+# A comma-separated list of custom stylesheets. Example:
+# pdf_stylesheets = ['sphinx', 'kerning', 'a4', "C:\\AGW\\agw\\fonts\\sphinx.json"]
+# Create a compressed PDF
+# Use True/False or 1/0
+# Example: compressed=True
+#pdf_compressed = False
+# A colon-separated list of folders to search for fonts. Example:
+#pdf_font_path = ['E:\\AGW\\agw\\fonts', 'C:\\Windows\\Fonts']
+# Language to be used for hyphenation support
+#pdf_language = "en_US"
+# Mode for literal blocks wider than the frame. Can be
+# overflow, shrink or truncate
+#pdf_fit_mode = "shrink"
+# Section level that forces a break page.
+# For example: 1 means top-level sections start in a new page
+# 0 means disabled
+#pdf_break_level = 0
+# When a section starts in a new page, force it to be 'even', 'odd',
+# or just use 'any'
+#pdf_breakside = 'any'
+# Insert footnotes where they are defined instead of
+# at the end.
+#pdf_inline_footnotes = True
+# verbosity level. 0 1 or 2
+pdf_verbosity = 2
+# If false, no index is generated.
+#pdf_use_index = True
+# If false, no modindex is generated.
+#pdf_use_modindex = True
+# If false, no coverpage is generated.
+#pdf_use_coverpage = True
+# Documents to append as an appendix to all manuals.
+#pdf_appendices = []
+# Enable experimental feature to split table cells. Use it
+# if you get "DelayedTable too big" errors
+pdf_splittables = True
diff --git a/docs/sphinx/rest_substitutions/overviews/DocstringsGuidelines.rst b/docs/sphinx/rest_substitutions/overviews/DocstringsGuidelines.rst
index 57661b86..8c6ff7a5 100644
--- a/docs/sphinx/rest_substitutions/overviews/DocstringsGuidelines.rst
+++ b/docs/sphinx/rest_substitutions/overviews/DocstringsGuidelines.rst
@@ -1,271 +1,271 @@
-.. include:: headings.inc
-
-.. highlight:: rst
-
-
-.. _docstrings guidelines:
-
-==================================================
-|phoenix_title| **Phoenix Docstrings Guidelines**
-==================================================
-
-This document gives a brief introduction about the current docstrings standards
-in the Phoenix project. Most of the documentation in the Phoenix core is automatically
-generated by parsing the wxWidgets XML docs; however, Phoenix has its own pure-Python
-functions and classes in at least two places:
-
-* **Core Library**: examples include :ref:`CallLater` and :func:`date2pydate`, which require
- manual input of the documentation strings. This is achieved by editing the source Python files
- located in the ``etg`` folder in the Phoenix directory tree;
-* **wx.lib**: the whole of ``wx.lib`` (and its sub-folders) is made up of pure-Python modules,
- ofter representing owner-drawn widgets which are not available as wrapped modules. Again,
- this requires manual editing of the source Python files.
-
-This document is a starting point in setting some reasonable standards on how the pure-Python
-docstrings may be edited and improved to make the overall appearance of the Phoenix documentation
-consistent and pleasant.
-
-
-.. _info field lists:
-
-Info Field Lists
-----------------
-
-`Info Field Lists` refer to the various options available while documenting a method or a function,
-and in particular its parameters, keywords, return type and possibly raised Python `Exceptions`.
-
-Inside Python object description directives, reST field lists with these fields
-are recognized and formatted nicely:
-
-* ``param``, ``parameter``, ``arg``, ``argument``, ``key``, ``keyword``:
- Description of a parameter.
-* ``type``: Type of a parameter.
-* ``raises``, ``raise``, ``except``, ``exception``: That (and when) a specific
- exception is raised.
-* ``var``, ``ivar``, ``cvar``: Description of a variable.
-* ``returns``, ``return``: Description of the return value.
-* ``rtype``: Return type.
-
-
-The field names must consist of one of these keywords and an argument (except
-for ``returns`` and ``rtype``, which do not need an argument). This is best
-explained by an example::
-
- .. method:: Set3StateValue(self, state):
-
- Sets the checkbox item to the given `state`.
-
- :param `state`: can be one of: ``wx.CHK_UNCHECKED`` (check is off), ``wx.CHK_CHECKED``
- (check is on) or ``wx.CHK_UNDETERMINED`` (check is mixed).
- :type `state`: integer
-
- :returns: ``True`` if the value was successfully set, ``False`` otherwise.
- :rtype: bool
-
- :raise: `Exception` when the item is not a 3-state checkbox item.
-
-|
-
-This will render like this:
-
- .. method:: Set3StateValue(self, state):
- :noindex:
-
- Sets the checkbox item to the given `state`.
-
- :param `state`: can be one of: ``wx.CHK_UNCHECKED`` (check is off), ``wx.CHK_CHECKED``
- (check is on) or ``wx.CHK_UNDETERMINED`` (check is mixed).
- :type `state`: integer
-
- :returns: ``True`` if the value was successfully set, ``False`` otherwise.
- :rtype: bool
-
- :raise: `Exception` when the item is not a 3-state checkbox item.
-
-
-|
-
-It is also possible to combine parameter type and description, if the type is a
-single word, like this::
-
- :param integer `state`: can be one of: ``wx.CHK_UNCHECKED`` (check is off), ``wx.CHK_CHECKED``
- (check is on) or ``wx.CHK_UNDETERMINED`` (check is mixed).
-
-
-In general, the standards for the ``:param`` field are the following:
-
-1. Do not use the ``@param`` construct, as I am not sure Sphinx and docutils understand it;
-2. Always try and define the parameter type: if the parameter is another Phoenix class, you can simply
- write this::
-
- :param Point `pt`: the mouse pointer location.
-
- Or, alternatively::
-
- :param `pt`: the mouse pointer location.
- :type `pt`: `Point`
-
-
-Similarly, for the ``:return:`` and ``:rtype:`` field, you may consider doing the following:
-
-1. Try and put double-backticks on words like ``True``, ``False``, ``None`` and the various
- Phoenix constants (i.e., ``wx.TR_DEFAULT_STYLE``);
-2. If you can't guess what a method function returns, just leave the ``:returns:`` and ``:rtype:``
- fields blank.
-
-
-.. seealso:: `Sphinx Info Field List `_
-
-
-.. _admonitions:
-
-Admonitions
------------
-
-Admonitions are specially marked "topics" that can appear anywhere an ordinary body element can.
-They contain arbitrary body elements. Typically, an admonition is rendered as an offset block
-in a document, sometimes outlined or shaded, with a title matching the admonition type. For example::
-
- .. warning:: I am a warning.
-
-
-Will render as:
-
-.. warning:: I am a warning.
-
-|
-
-Currently, the `sphinx_generator` tool recognizes the following admonitions:
-
-1. ``.. note::`` or ``:note:`` : simple annotations to make a particular comment/sentence
- stand out against the rest of the documentation strings for a particular class, method or function;
-2. ``.. warning::`` : this admonition normally indicates a problem or a severe limitation of a method,
- class or function. In the Phoenix world, this may also indicate that a particular widget is not
- supported under one or more platforms;
-3. ``.. deprecated::`` : used to mark deprecated methods, classes or functions;
-4. ``.. availability::`` : normally employed to make the user understand on which platform(s) a particular
- functionality is supported/available;
-5. ``.. seealso::`` or ``:see:`` : added primarily to facilitate the browsing of the docs, this admonition
- should be employed every time you think a user may be interested in seeing a related/similar method
- or a function providing an alternative implementation;
-6. ``.. todo::`` : used to mark incomplete methods/functions, or simply as a remainder for the user and
- the developer that some more functionality needs to be added.
-
-You can put pretty much anything inside an admonition section, as long as it is properly indented. The
-recommendation is to implement it like this::
-
- .. note::
-
- The class :ref:`TreeCtrl` can be used to display a tree, with these notes:
-
- - The note contains all indented body elements
- following.
- - It includes this bullet list.
-
-
-|
-
-Which will render as follows:
-
-.. note::
-
- The class :ref:`TreeCtrl` can be used to display a tree, with these notes:
-
- - The note contains all indented body elements
- following.
- - It includes this bullet list.
-
-
-
-In addition to the aforementioned admonitions, you can also use the default Sphinx directives
-like ``.. versionadded::`` and ``.. versionchanged::``, to highlight the fact that some method,
-function or class has been added/modified starting with a particular Phoenix version.
-
-
-.. seealso:: `Sphinx Paragraph-level markup `_
-
-
-.. _contributing samples:
-
-Contributing Samples
---------------------
-
-.. highlight:: python
-
-If you wish to contribute a (short) sample to be included in the documentation, please follow
-these conventions:
-
-1. Name the snippet of code like ``classname.methodname.INTEGER.py``, i.e. if you wish to contribute 2
- snippets about the :meth:`CheckBox.SetValue` method, please name your snippet files like this:
-
- * `CheckBox.SetValue.1.py`
- * `CheckBox.SetValue.2.py`
-
-
-2. At the very top of the snippet file (on the first line), put your name, or your alias, or anything
- you use as internet name preceeded by a double-hash, i.e.:
-
- ``##Andrea Gavana``
-
-
- So that your source code looks more or less like this::
-
- ##Chris Barker
- #!/usr/bin/env python
-
- """
- A simple test of the GridBagSizer
- http://wiki.wxpython.org/index.cgi/WriteItYourself
- """
-
- # Whatever code here...
- def SendSizeEvent(self):
-
- self.AdjustMySize()
-
-
-
-.. highlight:: rst
-
-This snippet will end up in the snippets `contrib` folder, to differentiate it from the snippets
-automatically generated when parsing the wxWidgets C++ XML documentation.
-
-Please keep the snippets as short as possible: they don't need to be fully-runnable and self contained
-applications, they are simply meant to show a particular/clever/unusual way of using a method, a class
-or a function.
-
-Please do send your sample snippets to me at `this `_ e-mail address or, if
-you have commit rights in the current Phoenix SVN area, feel free to upload them yourself under the
-following folder:
-
-``/trunk/docs/sphinx/rest_substitutions/snippets/python/contrib``
-
-
-.. _contributing screenshots:
-
-Contributing Screenshots
-------------------------
-
-Currently Phoenix is relatively short of widgets screenshots, especially on Linux/Mac platforms.
-
-If you wish to contribute a screenshot of a widget to be included in the documentation, please follow
-these conventions:
-
-- If the widget is a class belonging to the main `wx` namespace, just use the
- class name in lower case (i.e., `wx.Frame` ==> `frame.png`);
-- If it belongs to a sub-namespace (i.e., `wx.dataview`, `wx.aui`, `wx.html`
- and so on), it should be named this way (examples):
-
- 1) `wx.dataview.DataViewCtrl` ==> `dataview.dataviewctrl.png`
- 2) `wx.aui.AuiManager` ==> `aui.auimanager.png`
-
-
-Please do send your screenshots to me at `this `_ e-mail address or, if
-you have commit rights in the current Phoenix SVN area, feel free to upload them yourself under the
-following folder:
-
-``/trunk/docs/sphinx/_static/images/widgets/fullsize``
-
-Please make sure to upload your images in the appropriate sub-folder, depending on the platform you
-chose to take the screenshots on.
-
+.. include:: headings.inc
+
+.. highlight:: rst
+
+
+.. _docstrings guidelines:
+
+==================================================
+|phoenix_title| **Phoenix Docstrings Guidelines**
+==================================================
+
+This document gives a brief introduction about the current docstrings standards
+in the Phoenix project. Most of the documentation in the Phoenix core is automatically
+generated by parsing the wxWidgets XML docs; however, Phoenix has its own pure-Python
+functions and classes in at least two places:
+
+* **Core Library**: examples include :ref:`CallLater` and :func:`date2pydate`, which require
+ manual input of the documentation strings. This is achieved by editing the source Python files
+ located in the ``etg`` folder in the Phoenix directory tree;
+* **wx.lib**: the whole of ``wx.lib`` (and its sub-folders) is made up of pure-Python modules,
+ ofter representing owner-drawn widgets which are not available as wrapped modules. Again,
+ this requires manual editing of the source Python files.
+
+This document is a starting point in setting some reasonable standards on how the pure-Python
+docstrings may be edited and improved to make the overall appearance of the Phoenix documentation
+consistent and pleasant.
+
+
+.. _info field lists:
+
+Info Field Lists
+----------------
+
+`Info Field Lists` refer to the various options available while documenting a method or a function,
+and in particular its parameters, keywords, return type and possibly raised Python `Exceptions`.
+
+Inside Python object description directives, reST field lists with these fields
+are recognized and formatted nicely:
+
+* ``param``, ``parameter``, ``arg``, ``argument``, ``key``, ``keyword``:
+ Description of a parameter.
+* ``type``: Type of a parameter.
+* ``raises``, ``raise``, ``except``, ``exception``: That (and when) a specific
+ exception is raised.
+* ``var``, ``ivar``, ``cvar``: Description of a variable.
+* ``returns``, ``return``: Description of the return value.
+* ``rtype``: Return type.
+
+
+The field names must consist of one of these keywords and an argument (except
+for ``returns`` and ``rtype``, which do not need an argument). This is best
+explained by an example::
+
+ .. method:: Set3StateValue(self, state):
+
+ Sets the checkbox item to the given `state`.
+
+ :param `state`: can be one of: ``wx.CHK_UNCHECKED`` (check is off), ``wx.CHK_CHECKED``
+ (check is on) or ``wx.CHK_UNDETERMINED`` (check is mixed).
+ :type `state`: integer
+
+ :returns: ``True`` if the value was successfully set, ``False`` otherwise.
+ :rtype: bool
+
+ :raise: `Exception` when the item is not a 3-state checkbox item.
+
+|
+
+This will render like this:
+
+ .. method:: Set3StateValue(self, state):
+ :noindex:
+
+ Sets the checkbox item to the given `state`.
+
+ :param `state`: can be one of: ``wx.CHK_UNCHECKED`` (check is off), ``wx.CHK_CHECKED``
+ (check is on) or ``wx.CHK_UNDETERMINED`` (check is mixed).
+ :type `state`: integer
+
+ :returns: ``True`` if the value was successfully set, ``False`` otherwise.
+ :rtype: bool
+
+ :raise: `Exception` when the item is not a 3-state checkbox item.
+
+
+|
+
+It is also possible to combine parameter type and description, if the type is a
+single word, like this::
+
+ :param integer `state`: can be one of: ``wx.CHK_UNCHECKED`` (check is off), ``wx.CHK_CHECKED``
+ (check is on) or ``wx.CHK_UNDETERMINED`` (check is mixed).
+
+
+In general, the standards for the ``:param`` field are the following:
+
+1. Do not use the ``@param`` construct, as I am not sure Sphinx and docutils understand it;
+2. Always try and define the parameter type: if the parameter is another Phoenix class, you can simply
+ write this::
+
+ :param Point `pt`: the mouse pointer location.
+
+ Or, alternatively::
+
+ :param `pt`: the mouse pointer location.
+ :type `pt`: `Point`
+
+
+Similarly, for the ``:return:`` and ``:rtype:`` field, you may consider doing the following:
+
+1. Try and put double-backticks on words like ``True``, ``False``, ``None`` and the various
+ Phoenix constants (i.e., ``wx.TR_DEFAULT_STYLE``);
+2. If you can't guess what a method function returns, just leave the ``:returns:`` and ``:rtype:``
+ fields blank.
+
+
+.. seealso:: `Sphinx Info Field List `_
+
+
+.. _admonitions:
+
+Admonitions
+-----------
+
+Admonitions are specially marked "topics" that can appear anywhere an ordinary body element can.
+They contain arbitrary body elements. Typically, an admonition is rendered as an offset block
+in a document, sometimes outlined or shaded, with a title matching the admonition type. For example::
+
+ .. warning:: I am a warning.
+
+
+Will render as:
+
+.. warning:: I am a warning.
+
+|
+
+Currently, the `sphinx_generator` tool recognizes the following admonitions:
+
+1. ``.. note::`` or ``:note:`` : simple annotations to make a particular comment/sentence
+ stand out against the rest of the documentation strings for a particular class, method or function;
+2. ``.. warning::`` : this admonition normally indicates a problem or a severe limitation of a method,
+ class or function. In the Phoenix world, this may also indicate that a particular widget is not
+ supported under one or more platforms;
+3. ``.. deprecated::`` : used to mark deprecated methods, classes or functions;
+4. ``.. availability::`` : normally employed to make the user understand on which platform(s) a particular
+ functionality is supported/available;
+5. ``.. seealso::`` or ``:see:`` : added primarily to facilitate the browsing of the docs, this admonition
+ should be employed every time you think a user may be interested in seeing a related/similar method
+ or a function providing an alternative implementation;
+6. ``.. todo::`` : used to mark incomplete methods/functions, or simply as a remainder for the user and
+ the developer that some more functionality needs to be added.
+
+You can put pretty much anything inside an admonition section, as long as it is properly indented. The
+recommendation is to implement it like this::
+
+ .. note::
+
+ The class :ref:`TreeCtrl` can be used to display a tree, with these notes:
+
+ - The note contains all indented body elements
+ following.
+ - It includes this bullet list.
+
+
+|
+
+Which will render as follows:
+
+.. note::
+
+ The class :ref:`TreeCtrl` can be used to display a tree, with these notes:
+
+ - The note contains all indented body elements
+ following.
+ - It includes this bullet list.
+
+
+
+In addition to the aforementioned admonitions, you can also use the default Sphinx directives
+like ``.. versionadded::`` and ``.. versionchanged::``, to highlight the fact that some method,
+function or class has been added/modified starting with a particular Phoenix version.
+
+
+.. seealso:: `Sphinx Paragraph-level markup `_
+
+
+.. _contributing samples:
+
+Contributing Samples
+--------------------
+
+.. highlight:: python
+
+If you wish to contribute a (short) sample to be included in the documentation, please follow
+these conventions:
+
+1. Name the snippet of code like ``classname.methodname.INTEGER.py``, i.e. if you wish to contribute 2
+ snippets about the :meth:`CheckBox.SetValue` method, please name your snippet files like this:
+
+ * `CheckBox.SetValue.1.py`
+ * `CheckBox.SetValue.2.py`
+
+
+2. At the very top of the snippet file (on the first line), put your name, or your alias, or anything
+ you use as internet name preceeded by a double-hash, i.e.:
+
+ ``##Andrea Gavana``
+
+
+ So that your source code looks more or less like this::
+
+ ##Chris Barker
+ #!/usr/bin/env python
+
+ """
+ A simple test of the GridBagSizer
+ http://wiki.wxpython.org/index.cgi/WriteItYourself
+ """
+
+ # Whatever code here...
+ def SendSizeEvent(self):
+
+ self.AdjustMySize()
+
+
+
+.. highlight:: rst
+
+This snippet will end up in the snippets `contrib` folder, to differentiate it from the snippets
+automatically generated when parsing the wxWidgets C++ XML documentation.
+
+Please keep the snippets as short as possible: they don't need to be fully-runnable and self contained
+applications, they are simply meant to show a particular/clever/unusual way of using a method, a class
+or a function.
+
+Please do send your sample snippets to me at `this `_ e-mail address or, if
+you have commit rights in the current Phoenix SVN area, feel free to upload them yourself under the
+following folder:
+
+``/trunk/docs/sphinx/rest_substitutions/snippets/python/contrib``
+
+
+.. _contributing screenshots:
+
+Contributing Screenshots
+------------------------
+
+Currently Phoenix is relatively short of widgets screenshots, especially on Linux/Mac platforms.
+
+If you wish to contribute a screenshot of a widget to be included in the documentation, please follow
+these conventions:
+
+- If the widget is a class belonging to the main `wx` namespace, just use the
+ class name in lower case (i.e., `wx.Frame` ==> `frame.png`);
+- If it belongs to a sub-namespace (i.e., `wx.dataview`, `wx.aui`, `wx.html`
+ and so on), it should be named this way (examples):
+
+ 1) `wx.dataview.DataViewCtrl` ==> `dataview.dataviewctrl.png`
+ 2) `wx.aui.AuiManager` ==> `aui.auimanager.png`
+
+
+Please do send your screenshots to me at `this `_ e-mail address or, if
+you have commit rights in the current Phoenix SVN area, feel free to upload them yourself under the
+following folder:
+
+``/trunk/docs/sphinx/_static/images/widgets/fullsize``
+
+Please make sure to upload your images in the appropriate sub-folder, depending on the platform you
+chose to take the screenshots on.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/app_overview.rst b/docs/sphinx/rest_substitutions/overviews/app_overview.rst
index 5555a4ae..ef269b70 100644
--- a/docs/sphinx/rest_substitutions/overviews/app_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/app_overview.rst
@@ -1,58 +1,58 @@
-.. include:: headings.inc
-
-
-.. _app overview:
-
-=================================
-|phoenix_title| **App Overview**
-=================================
-
-
-Introduction
-------------
-
-A wxPython application does not have a main procedure; the equivalent is the :meth:`AppConsole.OnInit` member defined for a class derived from :ref:`App`.
-
-`OnInit` will usually create a top window as a bare minimum. Unlike in earlier versions of wxPython, `OnInit` does not return a frame.
-Instead it returns a boolean value which indicates whether processing should continue (``True``) or not (``False``).
-
-An application closes by destroying all windows. Because all frames must be destroyed for the application to exit, it is advisable to use
-parent frames wherever possible when creating new frames, so that deleting the top level frame will automatically delete child frames.
-The alternative is to explicitly delete child frames in the top-level frame's :ref:`CloseEvent` handler.
-
-In emergencies the :func:`Exit` function can be called to kill the application however normally the application shuts down automatically,
-see :ref:`Application Shutdown `.
-
-An example of defining an application follows::
-
-
- class DerivedApp(wx.App):
-
- def OnInit(self):
-
- the_frame = wx.Frame(None, -1)
-
- # Other initialization code...
-
- the_frame.Show(True)
-
- return True
-
-
-
-.. _application shutdown:
-
-Application Shutdown
---------------------
-
-The application normally shuts down when the last of its top level windows is closed. This is normally the expected behaviour and means
-that it is enough to call :meth:`Window.Close` () in response to the "Exit" menu command if your program has a single top level window.
-If this behaviour is not desirable :meth:`PyApp.SetExitOnFrameDelete` can be called to change it.
-
-.. note:: Note that such logic doesn't apply for the windows shown before the program enters the main loop: in other words, you can
- safely show a dialog from :meth:`AppConsole.OnInit` and not be afraid that your application terminates when this dialog -- which is the last
- top level window for the moment -- is closed.
-
-
-Another aspect of the application shutdown is :meth:`AppConsole.OnExit` which is called when the application exits but before wxPython cleans up
-its internal structures.
+.. include:: headings.inc
+
+
+.. _app overview:
+
+=================================
+|phoenix_title| **App Overview**
+=================================
+
+
+Introduction
+------------
+
+A wxPython application does not have a main procedure; the equivalent is the :meth:`AppConsole.OnInit` member defined for a class derived from :ref:`App`.
+
+`OnInit` will usually create a top window as a bare minimum. Unlike in earlier versions of wxPython, `OnInit` does not return a frame.
+Instead it returns a boolean value which indicates whether processing should continue (``True``) or not (``False``).
+
+An application closes by destroying all windows. Because all frames must be destroyed for the application to exit, it is advisable to use
+parent frames wherever possible when creating new frames, so that deleting the top level frame will automatically delete child frames.
+The alternative is to explicitly delete child frames in the top-level frame's :ref:`CloseEvent` handler.
+
+In emergencies the :func:`Exit` function can be called to kill the application however normally the application shuts down automatically,
+see :ref:`Application Shutdown `.
+
+An example of defining an application follows::
+
+
+ class DerivedApp(wx.App):
+
+ def OnInit(self):
+
+ the_frame = wx.Frame(None, -1)
+
+ # Other initialization code...
+
+ the_frame.Show(True)
+
+ return True
+
+
+
+.. _application shutdown:
+
+Application Shutdown
+--------------------
+
+The application normally shuts down when the last of its top level windows is closed. This is normally the expected behaviour and means
+that it is enough to call :meth:`Window.Close` () in response to the "Exit" menu command if your program has a single top level window.
+If this behaviour is not desirable :meth:`PyApp.SetExitOnFrameDelete` can be called to change it.
+
+.. note:: Note that such logic doesn't apply for the windows shown before the program enters the main loop: in other words, you can
+ safely show a dialog from :meth:`AppConsole.OnInit` and not be afraid that your application terminates when this dialog -- which is the last
+ top level window for the moment -- is closed.
+
+
+Another aspect of the application shutdown is :meth:`AppConsole.OnExit` which is called when the application exits but before wxPython cleans up
+its internal structures.
diff --git a/docs/sphinx/rest_substitutions/overviews/bitmap_overview.rst b/docs/sphinx/rest_substitutions/overviews/bitmap_overview.rst
index 6c27991b..e47a23af 100644
--- a/docs/sphinx/rest_substitutions/overviews/bitmap_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/bitmap_overview.rst
@@ -1,103 +1,103 @@
-.. include:: headings.inc
-
-
-.. _bitmaps and icons:
-
-===============================================
-|phoenix_title| **Bitmaps and Icons**
-===============================================
-
-
-The :ref:`Bitmap` class encapsulates the concept of a platform-dependent bitmap, either monochrome or colour.
-Platform-specific methods for creating a :ref:`Bitmap` object from an existing file are catered for.
-
-A bitmap created dynamically or loaded from a file can be selected into a memory device context (instance of
-:ref:`MemoryDC`). This enables the bitmap to be copied to a window or memory device context using :meth:`DC.Blit` (),
-or to be used as a drawing surface.
-
-.. seealso:: :ref:`MemoryDC` for an example of drawing onto a bitmap.
-
-
-All wxPython platforms support XPMs for small bitmaps and icons.
-
-
-
-.. _supported bitmap file formats:
-
-Supported Bitmap File Formats
------------------------------
-
-The following lists the formats handled on different platforms. Note that missing or partially-implemented
-formats are automatically supplemented by using :ref:`Image` to load the data, and then converting it to :ref:`Bitmap`
-form. Note that using :ref:`Image` is the preferred way to load images in wxPython, with the exception of resources
-(XPM-files or native Windows resources).
-
-
-Bitmap
-^^^^^^
-
-Under Windows, :ref:`Bitmap` may load the following formats:
-
-- Windows bitmap resource (``BITMAP_TYPE_BMP_RESOURCE``)
-- Windows bitmap file (``BITMAP_TYPE_BMP``)
-- XPM data and file (``BITMAP_TYPE_XPM``)
-- All formats that are supported by the :ref:`Image` class.
-
-
-Under wxGTK, :ref:`Bitmap` may load the following formats:
-
-- XPM data and file (``BITMAP_TYPE_XPM``)
-- All formats that are supported by the :ref:`Image` class.
-
-
-Under wxMotif and wxX11, :ref:`Bitmap` may load the following formats:
-
-- XBM data and file (``BITMAP_TYPE_XBM``)
-- XPM data and file (``BITMAP_TYPE_XPM``)
-- All formats that are supported by the :ref:`Image` class.
-
-
-Icon
-^^^^
-
-Under Windows, :ref:`Icon` may load the following formats:
-
-- Windows icon resource (``BITMAP_TYPE_ICO_RESOURCE``)
-- Windows icon file (``BITMAP_TYPE_ICO``)
-- XPM data and file (``BITMAP_TYPE_XPM``)
-
-
-Under wxGTK, :ref:`Icon` may load the following formats:
-
-- XPM data and file (``BITMAP_TYPE_XPM``)
-- All formats that are supported by the :ref:`Image` class.
-
-
-Under wxMotif and wxX11, :ref:`Icon` may load the following formats:
-
-- XBM data and file (``BITMAP_TYPE_XBM``)
-- XPM data and file (``BITMAP_TYPE_XPM``)
-- All formats that are supported by the :ref:`Image` class.
-
-
-Cursor
-^^^^^^
-
-Under Windows, :ref:`Cursor` may load the following formats:
-
-- Windows cursor resource (``BITMAP_TYPE_CUR_RESOURCE``)
-- Windows cursor file (``BITMAP_TYPE_CUR``)
-- Windows icon file (``BITMAP_TYPE_ICO``)
-- Windows bitmap file (``BITMAP_TYPE_BMP``)
-
-
-Under wxGTK, :ref:`Cursor` may load the following formats (in addition to stock cursors):
-
-- None (stock cursors only).
-
-
-Under wxMotif and wxX11, :ref:`Cursor` may load the following formats:
-
-- XBM data and file (``BITMAP_TYPE_XBM``)
-
-
+.. include:: headings.inc
+
+
+.. _bitmaps and icons:
+
+===============================================
+|phoenix_title| **Bitmaps and Icons**
+===============================================
+
+
+The :ref:`Bitmap` class encapsulates the concept of a platform-dependent bitmap, either monochrome or colour.
+Platform-specific methods for creating a :ref:`Bitmap` object from an existing file are catered for.
+
+A bitmap created dynamically or loaded from a file can be selected into a memory device context (instance of
+:ref:`MemoryDC`). This enables the bitmap to be copied to a window or memory device context using :meth:`DC.Blit` (),
+or to be used as a drawing surface.
+
+.. seealso:: :ref:`MemoryDC` for an example of drawing onto a bitmap.
+
+
+All wxPython platforms support XPMs for small bitmaps and icons.
+
+
+
+.. _supported bitmap file formats:
+
+Supported Bitmap File Formats
+-----------------------------
+
+The following lists the formats handled on different platforms. Note that missing or partially-implemented
+formats are automatically supplemented by using :ref:`Image` to load the data, and then converting it to :ref:`Bitmap`
+form. Note that using :ref:`Image` is the preferred way to load images in wxPython, with the exception of resources
+(XPM-files or native Windows resources).
+
+
+Bitmap
+^^^^^^
+
+Under Windows, :ref:`Bitmap` may load the following formats:
+
+- Windows bitmap resource (``BITMAP_TYPE_BMP_RESOURCE``)
+- Windows bitmap file (``BITMAP_TYPE_BMP``)
+- XPM data and file (``BITMAP_TYPE_XPM``)
+- All formats that are supported by the :ref:`Image` class.
+
+
+Under wxGTK, :ref:`Bitmap` may load the following formats:
+
+- XPM data and file (``BITMAP_TYPE_XPM``)
+- All formats that are supported by the :ref:`Image` class.
+
+
+Under wxMotif and wxX11, :ref:`Bitmap` may load the following formats:
+
+- XBM data and file (``BITMAP_TYPE_XBM``)
+- XPM data and file (``BITMAP_TYPE_XPM``)
+- All formats that are supported by the :ref:`Image` class.
+
+
+Icon
+^^^^
+
+Under Windows, :ref:`Icon` may load the following formats:
+
+- Windows icon resource (``BITMAP_TYPE_ICO_RESOURCE``)
+- Windows icon file (``BITMAP_TYPE_ICO``)
+- XPM data and file (``BITMAP_TYPE_XPM``)
+
+
+Under wxGTK, :ref:`Icon` may load the following formats:
+
+- XPM data and file (``BITMAP_TYPE_XPM``)
+- All formats that are supported by the :ref:`Image` class.
+
+
+Under wxMotif and wxX11, :ref:`Icon` may load the following formats:
+
+- XBM data and file (``BITMAP_TYPE_XBM``)
+- XPM data and file (``BITMAP_TYPE_XPM``)
+- All formats that are supported by the :ref:`Image` class.
+
+
+Cursor
+^^^^^^
+
+Under Windows, :ref:`Cursor` may load the following formats:
+
+- Windows cursor resource (``BITMAP_TYPE_CUR_RESOURCE``)
+- Windows cursor file (``BITMAP_TYPE_CUR``)
+- Windows icon file (``BITMAP_TYPE_ICO``)
+- Windows bitmap file (``BITMAP_TYPE_BMP``)
+
+
+Under wxGTK, :ref:`Cursor` may load the following formats (in addition to stock cursors):
+
+- None (stock cursors only).
+
+
+Under wxMotif and wxX11, :ref:`Cursor` may load the following formats:
+
+- XBM data and file (``BITMAP_TYPE_XBM``)
+
+
diff --git a/docs/sphinx/rest_substitutions/overviews/bookctrl_overview.rst b/docs/sphinx/rest_substitutions/overviews/bookctrl_overview.rst
index b8de5b28..5fe55248 100644
--- a/docs/sphinx/rest_substitutions/overviews/bookctrl_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/bookctrl_overview.rst
@@ -1,48 +1,48 @@
-.. include:: headings.inc
-
-
-.. _bookctrl overview:
-
-===============================================
-|phoenix_title| **BookCtrl Overview**
-===============================================
-
-
-Introduction
-------------
-
-A book control is a convenient way of displaying multiple pages of information, displayed one page at a time.
-wxPython has five variants of this control:
-
-- :ref:`Choicebook`: controlled by a :ref:`Choice`
-- :ref:`Listbook`: controlled by a :ref:`ListCtrl`
-- :ref:`Notebook`: uses a row of tabs
-- :ref:`Treebook`: controlled by a :ref:`TreeCtrl`
-- :ref:`Toolbook`: controlled by a :ref:`ToolBar`
-
-
-
-Best Book
----------
-
-:ref:`BookCtrl` is mapped to the class best suited for a given platform. Currently it provides :ref:`Choicebook`
-for smartphones equipped with WinCE, and :ref:`Notebook` for all other platforms. The mapping consists of:
-
-=============================================== ==================================================
-`BookCtrl` `Choicebook` or `Notebook`
-=============================================== ==================================================
-``wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED`` ``wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED`` or ``wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED``
-``wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING`` ``wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING`` or ``wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING``
-EVT_BOOKCTRL_PAGE_CHANGED EVT_CHOICEBOOK_PAGE_CHANGED or EVT_NOTEBOOK_PAGE_CHANGED
-EVT_BOOKCTRL_PAGE_CHANGING EVT_CHOICEBOOK_PAGE_CHANGING or EVT_NOTEBOOK_PAGE_CHANGING
-=============================================== ==================================================
-
-
-For orientation of the book controller, use following flags in style:
-
-- ``BK_TOP``: controller above pages
-- ``BK_BOTTOM``: controller below pages
-- ``BK_LEFT``: controller on the left
-- ``BK_RIGHT``: controller on the right
-- ``BK_DEFAULT``: native controller placement
-
+.. include:: headings.inc
+
+
+.. _bookctrl overview:
+
+===============================================
+|phoenix_title| **BookCtrl Overview**
+===============================================
+
+
+Introduction
+------------
+
+A book control is a convenient way of displaying multiple pages of information, displayed one page at a time.
+wxPython has five variants of this control:
+
+- :ref:`Choicebook`: controlled by a :ref:`Choice`
+- :ref:`Listbook`: controlled by a :ref:`ListCtrl`
+- :ref:`Notebook`: uses a row of tabs
+- :ref:`Treebook`: controlled by a :ref:`TreeCtrl`
+- :ref:`Toolbook`: controlled by a :ref:`ToolBar`
+
+
+
+Best Book
+---------
+
+:ref:`BookCtrl` is mapped to the class best suited for a given platform. Currently it provides :ref:`Choicebook`
+for smartphones equipped with WinCE, and :ref:`Notebook` for all other platforms. The mapping consists of:
+
+=============================================== ==================================================
+`BookCtrl` `Choicebook` or `Notebook`
+=============================================== ==================================================
+``wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED`` ``wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED`` or ``wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED``
+``wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING`` ``wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING`` or ``wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING``
+EVT_BOOKCTRL_PAGE_CHANGED EVT_CHOICEBOOK_PAGE_CHANGED or EVT_NOTEBOOK_PAGE_CHANGED
+EVT_BOOKCTRL_PAGE_CHANGING EVT_CHOICEBOOK_PAGE_CHANGING or EVT_NOTEBOOK_PAGE_CHANGING
+=============================================== ==================================================
+
+
+For orientation of the book controller, use following flags in style:
+
+- ``BK_TOP``: controller above pages
+- ``BK_BOTTOM``: controller below pages
+- ``BK_LEFT``: controller on the left
+- ``BK_RIGHT``: controller on the right
+- ``BK_DEFAULT``: native controller placement
+
diff --git a/docs/sphinx/rest_substitutions/overviews/common_dialogs_overview.rst b/docs/sphinx/rest_substitutions/overviews/common_dialogs_overview.rst
index 09a33c72..bacdd2ff 100644
--- a/docs/sphinx/rest_substitutions/overviews/common_dialogs_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/common_dialogs_overview.rst
@@ -1,226 +1,226 @@
-.. include:: headings.inc
-
-
-.. _common dialogs:
-
-===============================================
-|phoenix_title| **Common Dialogs**
-===============================================
-
-
-Common dialog classes and functions encapsulate commonly-needed dialog box requirements. They are all 'modal',
-grabbing the flow of control until the user dismisses the dialog, to make them easy to use within an application.
-
-Some dialogs have both platform-dependent and platform-independent implementations, so that if underlying windowing
-systems do not provide the required functionality, the generic classes and functions can stand in. For example,
-under MS Windows, :ref:`ColourDialog` uses the standard colour selector. There is also an equivalent called
-`GenericColourDialog` for other platforms, and a macro defines :ref:`ColourDialog` to be the same as
-`GenericColourDialog` on non-MS Windows platforms. However, under MS Windows, the generic dialog can also be used,
-for testing or other purposes.
-
-
-
-.. _colourdialog overview:
-
-ColourDialog Overview
----------------------
-
-The :ref:`ColourDialog` presents a colour selector to the user, and returns with colour information.
-
-
-The MS Windows Colour Selector
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Under Windows, the native colour selector common dialog is used. This presents a dialog box with three main regions:
-at the top left, a palette of 48 commonly-used colours is shown. Under this, there is a palette of 16 'custom colours'
-which can be set by the application if desired. Additionally, the user may open up the dialog box to show a right-hand
-panel containing controls to select a precise colour, and add it to the custom colour palette.
-
-
-The Generic Colour Selector
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Under non-MS Windows platforms, the colour selector is a simulation of most of the features of the MS Windows selector.
-Two palettes of 48 standard and 16 custom colours are presented, with the right-hand area containing three sliders for
-the user to select a colour from red, green and blue components. This colour may be added to the custom colour palette,
-and will replace either the currently selected custom colour, or the first one in the palette if none is selected.
-The RGB colour sliders are not optional in the generic colour selector. The generic colour selector is also available
-under MS Windows; use the name `GenericColourDialog`.
-
-
-Example
-^^^^^^^
-
-Here is an example of using :ref:`ColourDialog`, which sets various parameters of a :ref:`ColourData` object, including
-a grey scale for the custom colours. If the user did not cancel the dialog, the application retrieves the selected colour
-and uses it to set the background of a window::
-
- data = wx.ColourData()
- data.SetChooseFull(True)
-
- for i in xrange(16):
- colour = wx.Colour(i*16, i*16, i*16)
- data.SetCustomColour(i, colour)
-
-
- dialog = wx.ColourDialog(self, data)
-
- if dialog.ShowModal() == wx.ID_OK:
-
- retData = dialog.GetColourData()
- col = retData.GetColour()
- brush = wx.Brush(col, wx.SOLID)
- myWindow.SetBackground(brush)
- myWindow.Clear()
- myWindow.Refresh()
-
-
-
-
-.. _fontdialog overview:
-
-FontDialog Overview
--------------------
-
-
-The :ref:`FontDialog` presents a font selector to the user, and returns with font and colour information.
-
-
-The MS Windows Font Selector
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Under Windows, the native font selector common dialog is used. This presents a dialog box with controls for font name,
-point size, style, weight, underlining, strikeout and text foreground colour. A sample of the font is shown on a white
-area of the dialog box. Note that in the translation from full MS Windows fonts to wxPython font conventions, strikeout
-is ignored and a font family (such as Swiss or Modern) is deduced from the actual font name (such as Arial or Courier).
-
-
-The Generic Font Selector
-^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Under non-MS Windows platforms, the font selector is simpler. Controls for font family, point size, style, weight,
-underlining and text foreground colour are provided, and a sample is shown upon a white background. The generic font
-selector is also available under MS Windows; use the name `GenericFontDialog`.
-
-
-Example
-^^^^^^^
-
-Here is an example of using :ref:`FontDialog`. The application uses the returned font and colour for drawing text on a canvas::
-
- data = wx.FontData()
- data.SetInitialFont(canvasFont)
- data.SetColour(canvasTextColour)
-
- dialog = wx.FontDialog(self, data)
-
- if dialog.ShowModal() == wx.ID_OK:
-
- retData = dialog.GetFontData()
- canvasFont = retData.GetChosenFont()
- canvasTextColour = retData.GetColour()
- myWindow.Refresh()
-
-
-
-
-.. _printdialog overview:
-
-PrintDialog Overview
---------------------
-
-
-This class represents the print and print setup common dialogs. You may obtain a :ref:`PrinterDC` device context from a
-successfully dismissed print dialog.
-
-.. seealso:: :ref:`Printing Framework Overview ` for an example.
-
-
-
-.. _filedialog overview:
-
-FileDialog Overview
--------------------
-
-
-Pops up a file selector box. On Windows and GTK 2.4+, this is the common file selector dialog. In X, this is a file
-selector box with somewhat less functionality. The path and filename are distinct elements of a full file pathname.
-
-If path is "", the current directory will be used. If filename is "", no default filename will be supplied.
-The wildcard determines what files are displayed in the file selector, and file extension supplies a type extension
-for the required filename. Flags may be a combination of ``FD_OPEN``, ``FD_SAVE``, ``FD_OVERWRITE_PROMPT``,
-``FD_HIDE_READONLY``, ``FD_FILE_MUST_EXIST``, ``FD_MULTIPLE``, ``FD_CHANGE_DIR`` or 0.
-
-Both the X and Windows versions implement a wildcard filter. Typing a filename containing wildcards ``(*, ?)`` in the
-filename text item, and clicking on Ok, will result in only those files matching the pattern being displayed. In the
-X version, supplying no default name will result in the wildcard filter being inserted in the filename text item;
-the filter is ignored if a default name is supplied.
-
-The wildcard may be a specification for multiple types of file with a description for each, such as::
-
- wildcard = "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
-
-
-
-.. _dirdialog overview:
-
-DirDialog Overview
--------------------
-
-
-This dialog shows a directory selector dialog, allowing the user to select a single directory.
-
-
-
-.. _textentrydialog overview:
-
-TextEntryDialog Overview
-------------------------
-
-
-This is a dialog with a text entry field. The value that the user entered is obtained using :meth:`TextEntryDialog.GetValue` ().
-
-
-
-.. _passwordentrydialog overview:
-
-PasswordEntryDialog Overview
-----------------------------
-
-
-This is a dialog with a password entry field. The value that the user entered is obtained using :meth:`TextEntryDialog.GetValue` ().
-
-
-
-.. _messagedialog overview:
-
-MessageDialog Overview
-----------------------
-
-
-This dialog shows a message, plus buttons that can be chosen from ``OK``, ``Cancel``, ``Yes``, and ``No``. Under Windows, an
-optional icon can be shown, such as an exclamation mark or question mark.
-
-The return value of :meth:`MessageDialog.ShowModal` () indicates which button the user pressed.
-
-
-
-.. _singlechoicedialog overview:
-
-SingleChoiceDialog Overview
----------------------------
-
-
-This dialog shows a list of choices, plus ``OK`` and (optionally) ``Cancel``. The user can select one of them. The selection
-can be obtained from the dialog as an index, a string or client data.
-
-
-
-.. _multichoicedialog overview:
-
-MultiChoiceDialog Overview
----------------------------
-
-
-This dialog shows a list of choices, plus ``OK`` and (optionally) ``Cancel``. The user can select one or more of them.
-
+.. include:: headings.inc
+
+
+.. _common dialogs:
+
+===============================================
+|phoenix_title| **Common Dialogs**
+===============================================
+
+
+Common dialog classes and functions encapsulate commonly-needed dialog box requirements. They are all 'modal',
+grabbing the flow of control until the user dismisses the dialog, to make them easy to use within an application.
+
+Some dialogs have both platform-dependent and platform-independent implementations, so that if underlying windowing
+systems do not provide the required functionality, the generic classes and functions can stand in. For example,
+under MS Windows, :ref:`ColourDialog` uses the standard colour selector. There is also an equivalent called
+`GenericColourDialog` for other platforms, and a macro defines :ref:`ColourDialog` to be the same as
+`GenericColourDialog` on non-MS Windows platforms. However, under MS Windows, the generic dialog can also be used,
+for testing or other purposes.
+
+
+
+.. _colourdialog overview:
+
+ColourDialog Overview
+---------------------
+
+The :ref:`ColourDialog` presents a colour selector to the user, and returns with colour information.
+
+
+The MS Windows Colour Selector
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Under Windows, the native colour selector common dialog is used. This presents a dialog box with three main regions:
+at the top left, a palette of 48 commonly-used colours is shown. Under this, there is a palette of 16 'custom colours'
+which can be set by the application if desired. Additionally, the user may open up the dialog box to show a right-hand
+panel containing controls to select a precise colour, and add it to the custom colour palette.
+
+
+The Generic Colour Selector
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Under non-MS Windows platforms, the colour selector is a simulation of most of the features of the MS Windows selector.
+Two palettes of 48 standard and 16 custom colours are presented, with the right-hand area containing three sliders for
+the user to select a colour from red, green and blue components. This colour may be added to the custom colour palette,
+and will replace either the currently selected custom colour, or the first one in the palette if none is selected.
+The RGB colour sliders are not optional in the generic colour selector. The generic colour selector is also available
+under MS Windows; use the name `GenericColourDialog`.
+
+
+Example
+^^^^^^^
+
+Here is an example of using :ref:`ColourDialog`, which sets various parameters of a :ref:`ColourData` object, including
+a grey scale for the custom colours. If the user did not cancel the dialog, the application retrieves the selected colour
+and uses it to set the background of a window::
+
+ data = wx.ColourData()
+ data.SetChooseFull(True)
+
+ for i in xrange(16):
+ colour = wx.Colour(i*16, i*16, i*16)
+ data.SetCustomColour(i, colour)
+
+
+ dialog = wx.ColourDialog(self, data)
+
+ if dialog.ShowModal() == wx.ID_OK:
+
+ retData = dialog.GetColourData()
+ col = retData.GetColour()
+ brush = wx.Brush(col, wx.SOLID)
+ myWindow.SetBackground(brush)
+ myWindow.Clear()
+ myWindow.Refresh()
+
+
+
+
+.. _fontdialog overview:
+
+FontDialog Overview
+-------------------
+
+
+The :ref:`FontDialog` presents a font selector to the user, and returns with font and colour information.
+
+
+The MS Windows Font Selector
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Under Windows, the native font selector common dialog is used. This presents a dialog box with controls for font name,
+point size, style, weight, underlining, strikeout and text foreground colour. A sample of the font is shown on a white
+area of the dialog box. Note that in the translation from full MS Windows fonts to wxPython font conventions, strikeout
+is ignored and a font family (such as Swiss or Modern) is deduced from the actual font name (such as Arial or Courier).
+
+
+The Generic Font Selector
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Under non-MS Windows platforms, the font selector is simpler. Controls for font family, point size, style, weight,
+underlining and text foreground colour are provided, and a sample is shown upon a white background. The generic font
+selector is also available under MS Windows; use the name `GenericFontDialog`.
+
+
+Example
+^^^^^^^
+
+Here is an example of using :ref:`FontDialog`. The application uses the returned font and colour for drawing text on a canvas::
+
+ data = wx.FontData()
+ data.SetInitialFont(canvasFont)
+ data.SetColour(canvasTextColour)
+
+ dialog = wx.FontDialog(self, data)
+
+ if dialog.ShowModal() == wx.ID_OK:
+
+ retData = dialog.GetFontData()
+ canvasFont = retData.GetChosenFont()
+ canvasTextColour = retData.GetColour()
+ myWindow.Refresh()
+
+
+
+
+.. _printdialog overview:
+
+PrintDialog Overview
+--------------------
+
+
+This class represents the print and print setup common dialogs. You may obtain a :ref:`PrinterDC` device context from a
+successfully dismissed print dialog.
+
+.. seealso:: :ref:`Printing Framework Overview ` for an example.
+
+
+
+.. _filedialog overview:
+
+FileDialog Overview
+-------------------
+
+
+Pops up a file selector box. On Windows and GTK 2.4+, this is the common file selector dialog. In X, this is a file
+selector box with somewhat less functionality. The path and filename are distinct elements of a full file pathname.
+
+If path is "", the current directory will be used. If filename is "", no default filename will be supplied.
+The wildcard determines what files are displayed in the file selector, and file extension supplies a type extension
+for the required filename. Flags may be a combination of ``FD_OPEN``, ``FD_SAVE``, ``FD_OVERWRITE_PROMPT``,
+``FD_HIDE_READONLY``, ``FD_FILE_MUST_EXIST``, ``FD_MULTIPLE``, ``FD_CHANGE_DIR`` or 0.
+
+Both the X and Windows versions implement a wildcard filter. Typing a filename containing wildcards ``(*, ?)`` in the
+filename text item, and clicking on Ok, will result in only those files matching the pattern being displayed. In the
+X version, supplying no default name will result in the wildcard filter being inserted in the filename text item;
+the filter is ignored if a default name is supplied.
+
+The wildcard may be a specification for multiple types of file with a description for each, such as::
+
+ wildcard = "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
+
+
+
+.. _dirdialog overview:
+
+DirDialog Overview
+-------------------
+
+
+This dialog shows a directory selector dialog, allowing the user to select a single directory.
+
+
+
+.. _textentrydialog overview:
+
+TextEntryDialog Overview
+------------------------
+
+
+This is a dialog with a text entry field. The value that the user entered is obtained using :meth:`TextEntryDialog.GetValue` ().
+
+
+
+.. _passwordentrydialog overview:
+
+PasswordEntryDialog Overview
+----------------------------
+
+
+This is a dialog with a password entry field. The value that the user entered is obtained using :meth:`TextEntryDialog.GetValue` ().
+
+
+
+.. _messagedialog overview:
+
+MessageDialog Overview
+----------------------
+
+
+This dialog shows a message, plus buttons that can be chosen from ``OK``, ``Cancel``, ``Yes``, and ``No``. Under Windows, an
+optional icon can be shown, such as an exclamation mark or question mark.
+
+The return value of :meth:`MessageDialog.ShowModal` () indicates which button the user pressed.
+
+
+
+.. _singlechoicedialog overview:
+
+SingleChoiceDialog Overview
+---------------------------
+
+
+This dialog shows a list of choices, plus ``OK`` and (optionally) ``Cancel``. The user can select one of them. The selection
+can be obtained from the dialog as an index, a string or client data.
+
+
+
+.. _multichoicedialog overview:
+
+MultiChoiceDialog Overview
+---------------------------
+
+
+This dialog shows a list of choices, plus ``OK`` and (optionally) ``Cancel``. The user can select one or more of them.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/config_overview.rst b/docs/sphinx/rest_substitutions/overviews/config_overview.rst
index 8eaf07a9..0833b4eb 100644
--- a/docs/sphinx/rest_substitutions/overviews/config_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/config_overview.rst
@@ -1,44 +1,44 @@
-.. include:: headings.inc
-
-
-.. _config overview:
-
-=================================================
-|phoenix_title| **Config Overview**
-=================================================
-
-
-This overview briefly describes what the config classes are and what they are for. All the details about
-how to use them may be found in the description of the :ref:`ConfigBase` class and the documentation of
-the file, registry and INI file based implementations mentions all the features/limitations specific to
-each one of these versions.
-
-The config classes provide a way to store some application configuration information. They were especially
-designed for this usage and, although may probably be used for many other things as well, should be limited
-to it. It means that this information should be:
-
-- Typed, i.e. strings or numbers for the moment. You cannot store binary data, for example.
-- Small. For instance, it is not recommended to use the Windows registry for amounts of data more than a couple of kilobytes.
-- Not performance critical, neither from speed nor from a memory consumption point of view.
-
-
-On the other hand, the features provided make them very useful for storing all kinds of small to medium volumes
-of hierarchically-organized, heterogeneous data. In short, this is a place where you can conveniently stuff
-all your data (numbers and strings) organizing it in a tree where you use the filesystem-like paths to
-specify the location of a piece of data. In particular, these classes were designed to be as easy to use as possible.
-
-From another point of view, they provide an interface which hides the differences between the Windows registry
-and the standard Unix text format configuration files. Other (future) implementations of :ref:`ConfigBase` might
-also understand GTK resource files or their analogues on the KDE side.
-
-In any case, each implementation of :ref:`ConfigBase` does its best to make the data look the same way everywhere.
-Due to limitations of the underlying physical storage, it may not implement 100% of the base class functionality.
-
-There are groups of entries and the entries themselves. Each entry contains either a string or a number (or a
-boolean value; support for other types of data such as dates or timestamps is planned) and is identified by
-the full path to it: something like ``/MyApp/UserPreferences/Colors/Foreground``.
-
-The previous elements in the path are the group names, and each name may contain an arbitrary number of entries and subgroups.
-
-The path components are always separated with a slash, even though some implementations use the backslash internally.
-Further details (including how to read/write these entries) may be found in the documentation for :ref:`ConfigBase`.
+.. include:: headings.inc
+
+
+.. _config overview:
+
+=================================================
+|phoenix_title| **Config Overview**
+=================================================
+
+
+This overview briefly describes what the config classes are and what they are for. All the details about
+how to use them may be found in the description of the :ref:`ConfigBase` class and the documentation of
+the file, registry and INI file based implementations mentions all the features/limitations specific to
+each one of these versions.
+
+The config classes provide a way to store some application configuration information. They were especially
+designed for this usage and, although may probably be used for many other things as well, should be limited
+to it. It means that this information should be:
+
+- Typed, i.e. strings or numbers for the moment. You cannot store binary data, for example.
+- Small. For instance, it is not recommended to use the Windows registry for amounts of data more than a couple of kilobytes.
+- Not performance critical, neither from speed nor from a memory consumption point of view.
+
+
+On the other hand, the features provided make them very useful for storing all kinds of small to medium volumes
+of hierarchically-organized, heterogeneous data. In short, this is a place where you can conveniently stuff
+all your data (numbers and strings) organizing it in a tree where you use the filesystem-like paths to
+specify the location of a piece of data. In particular, these classes were designed to be as easy to use as possible.
+
+From another point of view, they provide an interface which hides the differences between the Windows registry
+and the standard Unix text format configuration files. Other (future) implementations of :ref:`ConfigBase` might
+also understand GTK resource files or their analogues on the KDE side.
+
+In any case, each implementation of :ref:`ConfigBase` does its best to make the data look the same way everywhere.
+Due to limitations of the underlying physical storage, it may not implement 100% of the base class functionality.
+
+There are groups of entries and the entries themselves. Each entry contains either a string or a number (or a
+boolean value; support for other types of data such as dates or timestamps is planned) and is identified by
+the full path to it: something like ``/MyApp/UserPreferences/Colors/Foreground``.
+
+The previous elements in the path are the group names, and each name may contain an arbitrary number of entries and subgroups.
+
+The path components are always separated with a slash, even though some implementations use the backslash internally.
+Further details (including how to read/write these entries) may be found in the documentation for :ref:`ConfigBase`.
diff --git a/docs/sphinx/rest_substitutions/overviews/datetime_overview.rst b/docs/sphinx/rest_substitutions/overviews/datetime_overview.rst
index 2c3d3908..13675878 100644
--- a/docs/sphinx/rest_substitutions/overviews/datetime_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/datetime_overview.rst
@@ -1,166 +1,166 @@
-.. include:: headings.inc
-
-
-.. _date and time:
-
-===========================================
-|phoenix_title| **Date and Time Overview**
-===========================================
-
-Introduction
-------------
-
-wxPython provides a set of powerful classes to work with dates and times. Some of the supported features of :ref:`DateTime` class are:
-
-* Wide range: the range of supported dates goes from about 4714 B.C. to some 480 million years in the future.
-* Precision: not using floating point calculations anywhere ensures that the date calculations don't suffer from rounding errors.
-* Many features: not only all usual calculations with dates are supported, but also more exotic week and year day calculations,
- work day testing, standard astronomical functions, conversion to and from strings in either strict or free format.
-* Efficiency: objects of :ref:`DateTime` are small (8 bytes) and working with them is fast.
-
-
-
-All date/time classes at a glance
----------------------------------
-
-There are 3 main classes related to date and time: except :ref:`DateTime` itself which represents an absolute moment in time,
-there are also two classes - :ref:`TimeSpan` and :ref:`DateSpan` - which represent the intervals of time.
-
-
-
-DateTime characteristics
-------------------------
-
-:ref:`DateTime` stores the time as a signed number of milliseconds since the Epoch which is fixed, by convention, to Jan 1, 1970 - however
-this is not visible to the class users (in particular, dates prior to the Epoch are handled just as well (or as bad) as the dates after it).
-But it does mean that the best resolution which can be achieved with this class is 1 millisecond.
-
-The size of :ref:`DateTime` object is 8 bytes because it is represented as a 64 bit integer. The resulting range of supported dates is
-thus approximatively 580 million years, but due to the current limitations in the Gregorian calendar support, only dates from Nov 24, 4714BC
-are supported (this is subject to change if there is sufficient interest in doing it).
-
-Finally, the internal representation is time zone independent (always in GMT) and the time zones only come into play when a date is broken
-into year/month/day components. See more about timezones below (see :ref:`Time zone considerations `).
-
-Currently, the only supported calendar is Gregorian one (which is used even for the dates prior to the historic introduction of this calendar
-which was first done on Oct 15, 1582 but is, generally speaking, country, and even region, dependent). Future versions will probably have
-Julian calendar support as well and support for other calendars (Maya, Hebrew, Chinese...) is not ruled out.
-
-
-
-Difference between DateSpan and TimeSpan
-----------------------------------------
-
-While there is only one logical way to represent an absolute moment in the time (and hence only one :ref:`DateTime` class), there are at
-least two methods to describe a time interval.
-
-First, there is the direct and self-explaining way implemented by :ref:`TimeSpan`: it is just a difference in milliseconds between two
-moments in time. Adding or subtracting such an interval to :ref:`DateTime` is always well-defined and is a fast operation.
-
-But in the daily life other, calendar-dependent time interval specifications are used. For example, 'one month later' is commonly used.
-However, it is clear that this is not the same as :ref:`TimeSpan` of 60*60*24*31 seconds because 'one month later' Feb 15 is Mar 15 and
-not Mar 17 or Mar 16 (depending on whether the year is leap or not).
-
-This is why there is another class for representing such intervals called :ref:`DateSpan`. It handles these sort of operations in the
-most natural way possible, but note that manipulating with intervals of this kind is not always well-defined. Consider, for example,
-Jan 31 + '1 month': this will give Feb 28 (or 29), i.e. the last day of February and not the non-existent Feb 31. Of course, this is
-what is usually wanted, but you still might be surprised to notice that now subtracting back the same interval from Feb 28 will result
-in Jan 28 and **not** Jan 31 we started with!
-
-So, unless you plan to implement some kind of natural language parsing in the program, you should probably use :ref:`TimeSpan` instead
-of :ref:`DateSpan` (which is also more efficient). However, :ref:`DateSpan` may be very useful in situations when you do need to
-understand what 'in a month' means - of course, it is just::
-
- wx.DateTime.Now() + wx.DateSpan.Month()
-
-
-
-
-Date arithmetics
-----------------
-
-
-Many different operations may be performed with the dates, however not all of them make sense. For example, multiplying a date by a number
-is an invalid operation, even though multiplying either of the time span classes by a number is perfectly valid.
-
-Here is what can be done:
-
-* **Addition**: a :ref:`TimeSpan` or :ref:`DateSpan` can be added to :ref:`DateTime` resulting in a new :ref:`DateTime` object and also
- 2 objects of the same span class can be added together giving another object of the same class.
-
-* **Subtraction**: the same types of operations as above are allowed and, additionally, a difference between two :ref:`DateTime` objects
- can be taken and this will yield :ref:`TimeSpan`.
-
-* **Multiplication**: a :ref:`TimeSpan` or :ref:`DateSpan` object can be multiplied by an integer number resulting in an object of the same type.
-
-* **Unary minus**: a :ref:`TimeSpan` or :ref:`DateSpan` object may finally be negated giving an interval of the same magnitude but of opposite time direction.
-
-
-For all these operations there are corresponding global (overloaded) operators and also member functions which are synonyms for them:
-`Add()`, `Subtract()` and `Multiply()`. Unary minus as well as composite assignment operations (like +=) are only implemented as members and
-`Neg()` is the synonym for unary minus.
-
-
-
-.. _time zone considerations:
-
-Time zone considerations
-------------------------
-
-Although the time is always stored internally in GMT, you will usually work in the local time zone. Because of this, all :ref:`DateTime`
-constructors and setters which take the broken down date assume that these values are for the local time zone. Thus::
-
- wx.DateTimeFromDMY(1, wx.DateTime.Jan, 1970)
-
-
-will not correspond to the :ref:`DateTime` Epoch unless you happen to live in the UK. All methods returning the date components (year,
-month, day, hour, minute, second...) will also return the correct values for the local time zone by default, so, generally, doing the natural
-things will lead to natural and correct results.
-
-If you only want to do this, you may safely skip the rest of this section. However, if you want to work with different time zones, you
-should read it to the end.
-
-In this (rare) case, you are still limited to the local time zone when constructing :ref:`DateTime` objects, i.e. there is no way to construct
-a :ref:`DateTime` corresponding to the given date in, say, Pacific Standard Time. To do it, you will need to call :meth:`DateTime.ToTimezone`
-or :meth:`DateTime.MakeTimezone` methods to adjust the date for the target time zone. There are also special versions of these functions
-:meth:`DateTime.ToUTC` and :meth:`DateTime.MakeUTC` for the most common case - when the date should be constructed in UTC.
-
-You also can just retrieve the value for some time zone without converting the object to it first. For this you may pass TimeZone argument to
-any of the methods which are affected by the time zone (all methods getting date components and the date formatting ones, for example).
-In particular, the `Format()` family of methods accepts a TimeZone parameter and this allows to simply print time in any time zone.
-
-To see how to do it, the last issue to address is how to construct a TimeZone object which must be passed to all these methods. First of all,
-you may construct it manually by specifying the time zone offset in seconds from GMT, but usually you will just use one of the
-:ref:`Date and Time ` and let the conversion constructor do the job.
-
-I.e. you would just write::
-
- dt = wx.DateTimeFromDMY(8, wx.DateTime.May, 1977)
- print "The time is %s in local time zone" % dt.FormatTime()
- print "The time is %s in GMT" % dt.FormatTime(wx.DateTime.GMT)
-
-
-
-.. _dst overview:
-
-Daylight saving time (DST)
---------------------------
-
-DST (a.k.a. 'summer time') handling is always a delicate task which is better left to the operating system which is supposed to be configured
-by the administrator to behave correctly. Unfortunately, when doing calculations with date outside of the range supported by the standard
-library, we are forced to deal with these issues ourselves.
-
-Several functions are provided to calculate the beginning and end of DST in the given year and to determine whether it is in effect at the
-given moment or not, but they should not be considered as absolutely correct because, first of all, they only work more or less correctly
-for only a handful of countries (any information about other ones appreciated!) and even for them the rules may perfectly well change in the future.
-
-The time zone handling methods (see :ref:`Time zone considerations `) use these functions too, so they are subject
-to the same limitations.
-
-
-
-DateTime and Holidays
----------------------
-
-.. todo:: WRITE THIS DOC PARAGRAPH.
-
+.. include:: headings.inc
+
+
+.. _date and time:
+
+===========================================
+|phoenix_title| **Date and Time Overview**
+===========================================
+
+Introduction
+------------
+
+wxPython provides a set of powerful classes to work with dates and times. Some of the supported features of :ref:`DateTime` class are:
+
+* Wide range: the range of supported dates goes from about 4714 B.C. to some 480 million years in the future.
+* Precision: not using floating point calculations anywhere ensures that the date calculations don't suffer from rounding errors.
+* Many features: not only all usual calculations with dates are supported, but also more exotic week and year day calculations,
+ work day testing, standard astronomical functions, conversion to and from strings in either strict or free format.
+* Efficiency: objects of :ref:`DateTime` are small (8 bytes) and working with them is fast.
+
+
+
+All date/time classes at a glance
+---------------------------------
+
+There are 3 main classes related to date and time: except :ref:`DateTime` itself which represents an absolute moment in time,
+there are also two classes - :ref:`TimeSpan` and :ref:`DateSpan` - which represent the intervals of time.
+
+
+
+DateTime characteristics
+------------------------
+
+:ref:`DateTime` stores the time as a signed number of milliseconds since the Epoch which is fixed, by convention, to Jan 1, 1970 - however
+this is not visible to the class users (in particular, dates prior to the Epoch are handled just as well (or as bad) as the dates after it).
+But it does mean that the best resolution which can be achieved with this class is 1 millisecond.
+
+The size of :ref:`DateTime` object is 8 bytes because it is represented as a 64 bit integer. The resulting range of supported dates is
+thus approximatively 580 million years, but due to the current limitations in the Gregorian calendar support, only dates from Nov 24, 4714BC
+are supported (this is subject to change if there is sufficient interest in doing it).
+
+Finally, the internal representation is time zone independent (always in GMT) and the time zones only come into play when a date is broken
+into year/month/day components. See more about timezones below (see :ref:`Time zone considerations `).
+
+Currently, the only supported calendar is Gregorian one (which is used even for the dates prior to the historic introduction of this calendar
+which was first done on Oct 15, 1582 but is, generally speaking, country, and even region, dependent). Future versions will probably have
+Julian calendar support as well and support for other calendars (Maya, Hebrew, Chinese...) is not ruled out.
+
+
+
+Difference between DateSpan and TimeSpan
+----------------------------------------
+
+While there is only one logical way to represent an absolute moment in the time (and hence only one :ref:`DateTime` class), there are at
+least two methods to describe a time interval.
+
+First, there is the direct and self-explaining way implemented by :ref:`TimeSpan`: it is just a difference in milliseconds between two
+moments in time. Adding or subtracting such an interval to :ref:`DateTime` is always well-defined and is a fast operation.
+
+But in the daily life other, calendar-dependent time interval specifications are used. For example, 'one month later' is commonly used.
+However, it is clear that this is not the same as :ref:`TimeSpan` of 60*60*24*31 seconds because 'one month later' Feb 15 is Mar 15 and
+not Mar 17 or Mar 16 (depending on whether the year is leap or not).
+
+This is why there is another class for representing such intervals called :ref:`DateSpan`. It handles these sort of operations in the
+most natural way possible, but note that manipulating with intervals of this kind is not always well-defined. Consider, for example,
+Jan 31 + '1 month': this will give Feb 28 (or 29), i.e. the last day of February and not the non-existent Feb 31. Of course, this is
+what is usually wanted, but you still might be surprised to notice that now subtracting back the same interval from Feb 28 will result
+in Jan 28 and **not** Jan 31 we started with!
+
+So, unless you plan to implement some kind of natural language parsing in the program, you should probably use :ref:`TimeSpan` instead
+of :ref:`DateSpan` (which is also more efficient). However, :ref:`DateSpan` may be very useful in situations when you do need to
+understand what 'in a month' means - of course, it is just::
+
+ wx.DateTime.Now() + wx.DateSpan.Month()
+
+
+
+
+Date arithmetics
+----------------
+
+
+Many different operations may be performed with the dates, however not all of them make sense. For example, multiplying a date by a number
+is an invalid operation, even though multiplying either of the time span classes by a number is perfectly valid.
+
+Here is what can be done:
+
+* **Addition**: a :ref:`TimeSpan` or :ref:`DateSpan` can be added to :ref:`DateTime` resulting in a new :ref:`DateTime` object and also
+ 2 objects of the same span class can be added together giving another object of the same class.
+
+* **Subtraction**: the same types of operations as above are allowed and, additionally, a difference between two :ref:`DateTime` objects
+ can be taken and this will yield :ref:`TimeSpan`.
+
+* **Multiplication**: a :ref:`TimeSpan` or :ref:`DateSpan` object can be multiplied by an integer number resulting in an object of the same type.
+
+* **Unary minus**: a :ref:`TimeSpan` or :ref:`DateSpan` object may finally be negated giving an interval of the same magnitude but of opposite time direction.
+
+
+For all these operations there are corresponding global (overloaded) operators and also member functions which are synonyms for them:
+`Add()`, `Subtract()` and `Multiply()`. Unary minus as well as composite assignment operations (like +=) are only implemented as members and
+`Neg()` is the synonym for unary minus.
+
+
+
+.. _time zone considerations:
+
+Time zone considerations
+------------------------
+
+Although the time is always stored internally in GMT, you will usually work in the local time zone. Because of this, all :ref:`DateTime`
+constructors and setters which take the broken down date assume that these values are for the local time zone. Thus::
+
+ wx.DateTimeFromDMY(1, wx.DateTime.Jan, 1970)
+
+
+will not correspond to the :ref:`DateTime` Epoch unless you happen to live in the UK. All methods returning the date components (year,
+month, day, hour, minute, second...) will also return the correct values for the local time zone by default, so, generally, doing the natural
+things will lead to natural and correct results.
+
+If you only want to do this, you may safely skip the rest of this section. However, if you want to work with different time zones, you
+should read it to the end.
+
+In this (rare) case, you are still limited to the local time zone when constructing :ref:`DateTime` objects, i.e. there is no way to construct
+a :ref:`DateTime` corresponding to the given date in, say, Pacific Standard Time. To do it, you will need to call :meth:`DateTime.ToTimezone`
+or :meth:`DateTime.MakeTimezone` methods to adjust the date for the target time zone. There are also special versions of these functions
+:meth:`DateTime.ToUTC` and :meth:`DateTime.MakeUTC` for the most common case - when the date should be constructed in UTC.
+
+You also can just retrieve the value for some time zone without converting the object to it first. For this you may pass TimeZone argument to
+any of the methods which are affected by the time zone (all methods getting date components and the date formatting ones, for example).
+In particular, the `Format()` family of methods accepts a TimeZone parameter and this allows to simply print time in any time zone.
+
+To see how to do it, the last issue to address is how to construct a TimeZone object which must be passed to all these methods. First of all,
+you may construct it manually by specifying the time zone offset in seconds from GMT, but usually you will just use one of the
+:ref:`Date and Time ` and let the conversion constructor do the job.
+
+I.e. you would just write::
+
+ dt = wx.DateTimeFromDMY(8, wx.DateTime.May, 1977)
+ print "The time is %s in local time zone" % dt.FormatTime()
+ print "The time is %s in GMT" % dt.FormatTime(wx.DateTime.GMT)
+
+
+
+.. _dst overview:
+
+Daylight saving time (DST)
+--------------------------
+
+DST (a.k.a. 'summer time') handling is always a delicate task which is better left to the operating system which is supposed to be configured
+by the administrator to behave correctly. Unfortunately, when doing calculations with date outside of the range supported by the standard
+library, we are forced to deal with these issues ourselves.
+
+Several functions are provided to calculate the beginning and end of DST in the given year and to determine whether it is in effect at the
+given moment or not, but they should not be considered as absolutely correct because, first of all, they only work more or less correctly
+for only a handful of countries (any information about other ones appreciated!) and even for them the rules may perfectly well change in the future.
+
+The time zone handling methods (see :ref:`Time zone considerations `) use these functions too, so they are subject
+to the same limitations.
+
+
+
+DateTime and Holidays
+---------------------
+
+.. todo:: WRITE THIS DOC PARAGRAPH.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/dc_overview.rst b/docs/sphinx/rest_substitutions/overviews/dc_overview.rst
index 5f45f494..d0024a20 100644
--- a/docs/sphinx/rest_substitutions/overviews/dc_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/dc_overview.rst
@@ -1,38 +1,38 @@
-.. include:: headings.inc
-
-
-.. _device contexts:
-
-===============================================
-|phoenix_title| **Device Contexts**
-===============================================
-
-
-A :ref:`DC` is a device context onto which graphics and text can be drawn. The device context is intended to represent
-a number of output devices in a generic way, with the same API being used throughout.
-
-Some device contexts are created temporarily in order to draw on a window. This is true of :ref:`ScreenDC`, :ref:`ClientDC`,
-:ref:`PaintDC`, and :ref:`WindowDC`. The following describes the differences between these device contexts and when you should use them.
-
-- :ref:`ScreenDC`. Use this to paint on the screen, as opposed to an individual window.
-- :ref:`ClientDC`. Use this to paint on the client area of window (the part without borders and other decorations), but do not use
- it from within an :ref:`PaintEvent`.
-- :ref:`PaintDC`. Use this to paint on the client area of a window, but only from within a :ref:`PaintEvent`.
-- :ref:`WindowDC`. Use this to paint on the whole area of a window, including decorations. This may not be available on non-Windows platforms.
-
-
-To use a client, paint or window device context, create an object on the stack with the window as argument, for example::
-
- def OnMyCmd(self, event):
-
- dc = wx.ClientDC(window)
- DrawMyPicture(dc)
-
-
-
-Try to write code so it is parameterised by :ref:`DC` - if you do this, the same piece of code may write to a number of different devices,
-by passing a different device context. This doesn't work for everything (for example not all device contexts support bitmap drawing)
-but will work most of the time.
-
-
-
+.. include:: headings.inc
+
+
+.. _device contexts:
+
+===============================================
+|phoenix_title| **Device Contexts**
+===============================================
+
+
+A :ref:`DC` is a device context onto which graphics and text can be drawn. The device context is intended to represent
+a number of output devices in a generic way, with the same API being used throughout.
+
+Some device contexts are created temporarily in order to draw on a window. This is true of :ref:`ScreenDC`, :ref:`ClientDC`,
+:ref:`PaintDC`, and :ref:`WindowDC`. The following describes the differences between these device contexts and when you should use them.
+
+- :ref:`ScreenDC`. Use this to paint on the screen, as opposed to an individual window.
+- :ref:`ClientDC`. Use this to paint on the client area of window (the part without borders and other decorations), but do not use
+ it from within an :ref:`PaintEvent`.
+- :ref:`PaintDC`. Use this to paint on the client area of a window, but only from within a :ref:`PaintEvent`.
+- :ref:`WindowDC`. Use this to paint on the whole area of a window, including decorations. This may not be available on non-Windows platforms.
+
+
+To use a client, paint or window device context, create an object on the stack with the window as argument, for example::
+
+ def OnMyCmd(self, event):
+
+ dc = wx.ClientDC(window)
+ DrawMyPicture(dc)
+
+
+
+Try to write code so it is parameterised by :ref:`DC` - if you do this, the same piece of code may write to a number of different devices,
+by passing a different device context. This doesn't work for everything (for example not all device contexts support bitmap drawing)
+but will work most of the time.
+
+
+
diff --git a/docs/sphinx/rest_substitutions/overviews/dialog_overview.rst b/docs/sphinx/rest_substitutions/overviews/dialog_overview.rst
index 0af1caa9..50329810 100644
--- a/docs/sphinx/rest_substitutions/overviews/dialog_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/dialog_overview.rst
@@ -1,101 +1,101 @@
-.. include:: headings.inc
-
-
-.. _dialog overview:
-
-====================================
-|phoenix_title| **Dialog Overview**
-====================================
-
-
-A dialog box is similar to a panel, in that it is a window which can be used for placing controls, with the following exceptions:
-
-- A surrounding frame is implicitly created.
-- Extra functionality is automatically given to the dialog box, such as tabbing between items (currently Windows only).
-- If the dialog box is `modal`, the calling program is blocked until the dialog box is dismissed.
-
-
-.. seealso:: :ref:`TopLevelWindow` and :ref:`Window` for inherited member functions. Validation of data in controls is covered in
- :ref:`Validator Overview `.
-
-
-.. _automatic scrolling dialogs:
-
-Automatic scrolling dialogs
----------------------------
-
-As an ever greater variety of mobile hardware comes to market, it becomes more imperative for wxPython applications to adapt to
-these platforms without putting too much burden on the programmer. One area where wxPython can help is in adapting dialogs for
-the lower resolution screens that inevitably accompany a smaller form factor. :ref:`Dialog` therefore supplies a global
-:ref:`DialogLayoutAdapter` class that implements automatic scrolling adaptation for most sizer-based custom dialogs.
-
-Many applications should therefore be able to adapt to small displays with little or no work, as far as dialogs are concerned.
-By default this adaptation is off. To switch scrolling adaptation on globally in your application, call the static function
-:meth:`Dialog.EnableLayoutAdaptation` passing ``True``. You can also adjust adaptation on a per-dialog basis by calling
-:meth:`Dialog.SetLayoutAdaptationMode` with one of ``DIALOG_ADAPTATION_MODE_DEFAULT`` (use the global setting), ``DIALOG_ADAPTATION_MODE_ENABLED``
-or ``DIALOG_ADAPTATION_MODE_DISABLED``.
-
-The last two modes override the global adaptation setting. With adaptation enabled, if the display size is too small for the dialog,
-wxPython (or rather the standard adapter class :ref:`StandardDialogLayoutAdapter`) will make part of the dialog scrolling, leaving
-standard buttons in a non-scrolling part at the bottom of the dialog. This is done as follows, in :meth:`DialogLayoutAdapter.DoLayoutAdaptation`
-called from within :meth:`Dialog.Show` or :meth:`Dialog.ShowModal`:
-
-- If :meth:`Dialog.GetContentWindow` returns a window derived from :ref:`BookCtrlBase`, the pages are made scrollable and no other adaptation is done.
-- wxPython looks for a :ref:`StdDialogButtonSizer` and uses it for the non-scrolling part.
-- If that search failed, wxPython looks for a horizontal :ref:`BoxSizer` with one or more standard buttons, with identifiers such as ``ID_OK`` and ``ID_CANCEL``.
-- If that search failed too, wxPython finds 'loose' standard buttons (in any kind of sizer) and adds them to a :ref:`StdDialogButtonSizer`.
- If no standard buttons were found, the whole dialog content will scroll.
-- All the children apart from standard buttons are reparented onto a new :ref:`ScrolledWindow` object, using the old top-level sizer
- for the scrolled window and creating a new top-level sizer to lay out the scrolled window and standard button sizer.
-
-
-.. _layout adaptation code:
-
-Customising scrolling adaptation
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-In addition to switching adaptation on and off globally and per dialog, you can choose how aggressively wxPython will search
-for standard buttons by setting :meth:`Dialog.SetLayoutAdaptationLevel`. By default, all the steps described above will be
-performed but by setting the level to 1, for example, you can choose to only look for :ref:`StdDialogButtonSizer`.
-
-You can use :meth:`Dialog.AddMainButtonId` to add identifiers for buttons that should also be treated as standard buttons for the non-scrolling area.
-
-You can derive your own class from :ref:`DialogLayoutAdapter` or :ref:`StandardDialogLayoutAdapter` and call :meth:`Dialog.SetLayoutAdapter`,
-deleting the old object that this function returns. Override the functions `CanDoLayoutAdaptation` and `DoLayoutAdaptation` to test
-for adaptation applicability and perform the adaptation.
-
-You can also override :meth:`Dialog.CanDoLayoutAdaptation` and :meth:`Dialog.DoLayoutAdaptation` in a class derived from :ref:`Dialog`.
-
-
-Situations where automatic scrolling adaptation may fail
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Because adaptation rearranges your sizer and window hierarchy, it is not fool-proof, and may fail in the following situations:
-
-- The dialog doesn't use sizers.
-- The dialog implementation makes assumptions about the window hierarchy, for example getting the parent of a control and casting to the dialog class.
-- The dialog does custom painting and/or event handling not handled by the scrolled window. If this problem can be solved globally,
- you can derive a new adapter class from :ref:`StandardDialogLayoutAdapter` and override its `CreateScrolledWindow` function
- to return an instance of your own class.
-- The dialog has unusual layout, for example a vertical sizer containing a mixture of standard buttons and other controls.
-- The dialog makes assumptions about the sizer hierarchy, for example to show or hide children of the top-level sizer. However,
- the original sizer hierarchy will still hold until `Show` or `ShowModal` is called.
-
-
-You can help make sure that your dialogs will continue to function after adaptation by:
-
-- Avoiding the above situations and assumptions;
-- Using :ref:`StdDialogButtonSizer`;
-- Only making assumptions about hierarchy immediately after the dialog is created;
-- Using an intermediate sizer under the main sizer, a false top-level sizer that can be relied on to exist for the purposes of manipulating child sizers and windows;
-- Overriding :meth:`Dialog.GetContentWindow` to return a book control if your dialog implements pages: wxPython will then only make the pages scrollable.
-
-
-PropertySheetDialog and Wizard
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Adaptation for :ref:`PropertySheetDialog` is always done by simply making the pages scrollable, since :meth:`Dialog.GetContentWindow` returns the dialog's
-book control and this is handled by the standard layout adapter.
-
-:ref:`Wizard` uses its own `CanDoLayoutAdaptation` and `DoLayoutAdaptation` functions rather than the global adapter: again, only the wizard pages are made scrollable.
-
+.. include:: headings.inc
+
+
+.. _dialog overview:
+
+====================================
+|phoenix_title| **Dialog Overview**
+====================================
+
+
+A dialog box is similar to a panel, in that it is a window which can be used for placing controls, with the following exceptions:
+
+- A surrounding frame is implicitly created.
+- Extra functionality is automatically given to the dialog box, such as tabbing between items (currently Windows only).
+- If the dialog box is `modal`, the calling program is blocked until the dialog box is dismissed.
+
+
+.. seealso:: :ref:`TopLevelWindow` and :ref:`Window` for inherited member functions. Validation of data in controls is covered in
+ :ref:`Validator Overview `.
+
+
+.. _automatic scrolling dialogs:
+
+Automatic scrolling dialogs
+---------------------------
+
+As an ever greater variety of mobile hardware comes to market, it becomes more imperative for wxPython applications to adapt to
+these platforms without putting too much burden on the programmer. One area where wxPython can help is in adapting dialogs for
+the lower resolution screens that inevitably accompany a smaller form factor. :ref:`Dialog` therefore supplies a global
+:ref:`DialogLayoutAdapter` class that implements automatic scrolling adaptation for most sizer-based custom dialogs.
+
+Many applications should therefore be able to adapt to small displays with little or no work, as far as dialogs are concerned.
+By default this adaptation is off. To switch scrolling adaptation on globally in your application, call the static function
+:meth:`Dialog.EnableLayoutAdaptation` passing ``True``. You can also adjust adaptation on a per-dialog basis by calling
+:meth:`Dialog.SetLayoutAdaptationMode` with one of ``DIALOG_ADAPTATION_MODE_DEFAULT`` (use the global setting), ``DIALOG_ADAPTATION_MODE_ENABLED``
+or ``DIALOG_ADAPTATION_MODE_DISABLED``.
+
+The last two modes override the global adaptation setting. With adaptation enabled, if the display size is too small for the dialog,
+wxPython (or rather the standard adapter class :ref:`StandardDialogLayoutAdapter`) will make part of the dialog scrolling, leaving
+standard buttons in a non-scrolling part at the bottom of the dialog. This is done as follows, in :meth:`DialogLayoutAdapter.DoLayoutAdaptation`
+called from within :meth:`Dialog.Show` or :meth:`Dialog.ShowModal`:
+
+- If :meth:`Dialog.GetContentWindow` returns a window derived from :ref:`BookCtrlBase`, the pages are made scrollable and no other adaptation is done.
+- wxPython looks for a :ref:`StdDialogButtonSizer` and uses it for the non-scrolling part.
+- If that search failed, wxPython looks for a horizontal :ref:`BoxSizer` with one or more standard buttons, with identifiers such as ``ID_OK`` and ``ID_CANCEL``.
+- If that search failed too, wxPython finds 'loose' standard buttons (in any kind of sizer) and adds them to a :ref:`StdDialogButtonSizer`.
+ If no standard buttons were found, the whole dialog content will scroll.
+- All the children apart from standard buttons are reparented onto a new :ref:`ScrolledWindow` object, using the old top-level sizer
+ for the scrolled window and creating a new top-level sizer to lay out the scrolled window and standard button sizer.
+
+
+.. _layout adaptation code:
+
+Customising scrolling adaptation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In addition to switching adaptation on and off globally and per dialog, you can choose how aggressively wxPython will search
+for standard buttons by setting :meth:`Dialog.SetLayoutAdaptationLevel`. By default, all the steps described above will be
+performed but by setting the level to 1, for example, you can choose to only look for :ref:`StdDialogButtonSizer`.
+
+You can use :meth:`Dialog.AddMainButtonId` to add identifiers for buttons that should also be treated as standard buttons for the non-scrolling area.
+
+You can derive your own class from :ref:`DialogLayoutAdapter` or :ref:`StandardDialogLayoutAdapter` and call :meth:`Dialog.SetLayoutAdapter`,
+deleting the old object that this function returns. Override the functions `CanDoLayoutAdaptation` and `DoLayoutAdaptation` to test
+for adaptation applicability and perform the adaptation.
+
+You can also override :meth:`Dialog.CanDoLayoutAdaptation` and :meth:`Dialog.DoLayoutAdaptation` in a class derived from :ref:`Dialog`.
+
+
+Situations where automatic scrolling adaptation may fail
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Because adaptation rearranges your sizer and window hierarchy, it is not fool-proof, and may fail in the following situations:
+
+- The dialog doesn't use sizers.
+- The dialog implementation makes assumptions about the window hierarchy, for example getting the parent of a control and casting to the dialog class.
+- The dialog does custom painting and/or event handling not handled by the scrolled window. If this problem can be solved globally,
+ you can derive a new adapter class from :ref:`StandardDialogLayoutAdapter` and override its `CreateScrolledWindow` function
+ to return an instance of your own class.
+- The dialog has unusual layout, for example a vertical sizer containing a mixture of standard buttons and other controls.
+- The dialog makes assumptions about the sizer hierarchy, for example to show or hide children of the top-level sizer. However,
+ the original sizer hierarchy will still hold until `Show` or `ShowModal` is called.
+
+
+You can help make sure that your dialogs will continue to function after adaptation by:
+
+- Avoiding the above situations and assumptions;
+- Using :ref:`StdDialogButtonSizer`;
+- Only making assumptions about hierarchy immediately after the dialog is created;
+- Using an intermediate sizer under the main sizer, a false top-level sizer that can be relied on to exist for the purposes of manipulating child sizers and windows;
+- Overriding :meth:`Dialog.GetContentWindow` to return a book control if your dialog implements pages: wxPython will then only make the pages scrollable.
+
+
+PropertySheetDialog and Wizard
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Adaptation for :ref:`PropertySheetDialog` is always done by simply making the pages scrollable, since :meth:`Dialog.GetContentWindow` returns the dialog's
+book control and this is handled by the standard layout adapter.
+
+:ref:`Wizard` uses its own `CanDoLayoutAdaptation` and `DoLayoutAdaptation` functions rather than the global adapter: again, only the wizard pages are made scrollable.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/dnd_overview.rst b/docs/sphinx/rest_substitutions/overviews/dnd_overview.rst
index c144b1a1..aa8ad9d9 100644
--- a/docs/sphinx/rest_substitutions/overviews/dnd_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/dnd_overview.rst
@@ -1,70 +1,70 @@
-.. include:: headings.inc
-
-
-.. _drag and drop overview:
-
-=================================================
-|phoenix_title| **Drag and Drop Overview**
-=================================================
-
-
-It may be noted that data transfer to and from the clipboard is quite similar to data transfer
-with drag and drop and the code to implement these two types is almost the same. In particular,
-both data transfer mechanisms store data in some kind of :ref:`DataObject` and identify its format(s) using
-the :ref:`DataFormat` class.
-
-To be a `drag` source, i.e. to provide the data which may be dragged by the user elsewhere, you
-should implement the following steps:
-
-- **Preparation**: First of all, a data object must be created and initialized with the data you wish to drag. For example::
-
- my_data = wx.TextDataObject("This text will be dragged.")
-
-
-
-- **Drag start**: To start the dragging process (typically in response to a mouse click) you must call
- :meth:`DropSource.DoDragDrop` like this::
-
- dragSource = wx.DropSource(self)
- dragSource.SetData(my_data)
- result = dragSource.DoDragDrop(True)
-
-
-
-- **Dragging**: The call to `DoDragDrop()` blocks the program until the user releases the mouse button (unless
- you override the :meth:`DropSource.GiveFeedback` function to do something special). When the mouse moves in
- a window of a program which understands the same drag-and-drop protocol (any program under Windows or any
- program supporting the XDnD protocol under X Windows), the corresponding :ref:`DropTarget` methods are called - see below.
-
-- **Processing the result**: `DoDragDrop()` returns an effect code which is one of the values of :ref:`DragResult`::
-
- if result == wx.DragCopy:
- # Copy the data
- CopyMyData()
-
- elif result == wx.DragMove:
- # Move the data
- MoveMyData()
-
- else:
- # Default, do nothing
- pass
-
-
-To be a `drop` target, i.e. to receive the data dropped by the user you should follow the instructions below:
-
-- **Initialization**: For a window to be a drop target, it needs to have an associated :ref:`DropTarget` object. Normally,
- you will call :meth:`Window.SetDropTarget` during window creation associating your drop target with it. You must
- derive a class from :ref:`DropTarget` and override its pure virtual methods. Alternatively, you may derive
- from :ref:`TextDropTarget` or :ref:`FileDropTarget` and override their `OnDropText()` or `OnDropFiles()` method.
-
-- **Drop**: When the user releases the mouse over a window, wxPython asks the associated :ref:`DropTarget` object if
- it accepts the data. For this, a :ref:`DataObject` must be associated with the drop target and this data object
- will be responsible for the format negotiation between the drag source and the drop target. If all goes well,
- then :meth:`DropTarget.OnData` will get called and the :ref:`DataObject` belonging to the drop target can get filled with data.
-
-- **The end**: After processing the data, `DoDragDrop()` returns either ``DragCopy`` or ``DragMove`` depending on the
- state of the keys ``Ctrl``, ``Shift`` and ``Alt`` at the moment of the drop. There is currently no way for
- the drop target to change this return code.
-
-
+.. include:: headings.inc
+
+
+.. _drag and drop overview:
+
+=================================================
+|phoenix_title| **Drag and Drop Overview**
+=================================================
+
+
+It may be noted that data transfer to and from the clipboard is quite similar to data transfer
+with drag and drop and the code to implement these two types is almost the same. In particular,
+both data transfer mechanisms store data in some kind of :ref:`DataObject` and identify its format(s) using
+the :ref:`DataFormat` class.
+
+To be a `drag` source, i.e. to provide the data which may be dragged by the user elsewhere, you
+should implement the following steps:
+
+- **Preparation**: First of all, a data object must be created and initialized with the data you wish to drag. For example::
+
+ my_data = wx.TextDataObject("This text will be dragged.")
+
+
+
+- **Drag start**: To start the dragging process (typically in response to a mouse click) you must call
+ :meth:`DropSource.DoDragDrop` like this::
+
+ dragSource = wx.DropSource(self)
+ dragSource.SetData(my_data)
+ result = dragSource.DoDragDrop(True)
+
+
+
+- **Dragging**: The call to `DoDragDrop()` blocks the program until the user releases the mouse button (unless
+ you override the :meth:`DropSource.GiveFeedback` function to do something special). When the mouse moves in
+ a window of a program which understands the same drag-and-drop protocol (any program under Windows or any
+ program supporting the XDnD protocol under X Windows), the corresponding :ref:`DropTarget` methods are called - see below.
+
+- **Processing the result**: `DoDragDrop()` returns an effect code which is one of the values of :ref:`DragResult`::
+
+ if result == wx.DragCopy:
+ # Copy the data
+ CopyMyData()
+
+ elif result == wx.DragMove:
+ # Move the data
+ MoveMyData()
+
+ else:
+ # Default, do nothing
+ pass
+
+
+To be a `drop` target, i.e. to receive the data dropped by the user you should follow the instructions below:
+
+- **Initialization**: For a window to be a drop target, it needs to have an associated :ref:`DropTarget` object. Normally,
+ you will call :meth:`Window.SetDropTarget` during window creation associating your drop target with it. You must
+ derive a class from :ref:`DropTarget` and override its pure virtual methods. Alternatively, you may derive
+ from :ref:`TextDropTarget` or :ref:`FileDropTarget` and override their `OnDropText()` or `OnDropFiles()` method.
+
+- **Drop**: When the user releases the mouse over a window, wxPython asks the associated :ref:`DropTarget` object if
+ it accepts the data. For this, a :ref:`DataObject` must be associated with the drop target and this data object
+ will be responsible for the format negotiation between the drag source and the drop target. If all goes well,
+ then :meth:`DropTarget.OnData` will get called and the :ref:`DataObject` belonging to the drop target can get filled with data.
+
+- **The end**: After processing the data, `DoDragDrop()` returns either ``DragCopy`` or ``DragMove`` depending on the
+ state of the keys ``Ctrl``, ``Shift`` and ``Alt`` at the moment of the drop. There is currently no way for
+ the drop target to change this return code.
+
+
diff --git a/docs/sphinx/rest_substitutions/overviews/events_overview.rst b/docs/sphinx/rest_substitutions/overviews/events_overview.rst
index ae180d95..c78dfd97 100644
--- a/docs/sphinx/rest_substitutions/overviews/events_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/events_overview.rst
@@ -1,311 +1,311 @@
-.. include:: headings.inc
-
-
-.. _events and event handling:
-
-==============================================
-|phoenix_title| **Events and Event Handling**
-==============================================
-
-
-Like with all the other GUI frameworks, the control of flow in wxPython applications is event-based: the program
-normally performs most of its actions in response to the events generated by the user. These events can be
-triggered by using the input devices (such as keyboard, mouse, joystick) directly or, more commonly, by a standard
-control which synthesizes such input events into higher level events: for example, a :ref:`Button` can generate
-a click event when the user presses the left mouse button on it and then releases it without pressing ``Esc`` in
-the meanwhile. There are also events which don't directly correspond to the user actions, such as :ref:`TimerEvent`.
-
-But in all cases wxPython represents these events in a uniform way and allows you to handle them in the same way
-wherever they originate from. And while the events are normally generated by wxPython itself, you can also do this,
-which is especially useful when using custom events (see :ref:`Custom Event Summary `).
-
-To be more precise, each event is described by:
-
-- `Event type`: this is simply a value of type `EventType` which uniquely identifies the type of the event.
- For example, clicking on a button, selecting an item from a list box and pressing a key on the keyboard all
- generate events with different event types.
-- `Event class` carried by the event: each event has some information associated with it and this data is represented
- by an object of a class derived from :ref:`Event`. Events of different types can use the same event class, for
- example both button click and listbox selection events use :ref:`CommandEvent` class (as do all the other simple
- control events), but the key press event uses :ref:`KeyEvent` as the information associated with it is different.
-- `Event source`: :ref:`Event` stores the object which generated the event and, for windows, its identifier (see
- :ref:`Window Identifiers `). As it is common to have more than one object generating events of
- the same type (e.g. a typical window contains several buttons, all generating the same button click event), checking
- the event source object or its id allows to distinguish between them.
-
-
-
-.. _event handling:
-
-Event Handling
---------------
-
-There is one principal way to handle events in wxPython, which uses :meth:`EvtHandler.Bind` () call and can be used
-to bind and unbind the handlers dynamically, i.e. during run-time depending on some conditions. It also allows the direct
-binding of events to:
-
-- A handler method in another object.
-- An ordinary function like a static method or a global function.
-- An arbitrary function.
-
-
-
-.. _dynamic event handling:
-
-Dynamic Event Handling
-----------------------
-
-Let us start by looking at the syntax: in any place in your code, but usually in the code of the class defining the handler
-itself, call its `Bind()` method like this::
-
- class MyFrame(wx.Frame):
-
- def __init__(self, parent):
-
- wx.Frame.__init__(self, parent)
-
- # Other initialization code...
-
- self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
-
-
-
-Event handlers can be bound at any moment. For example, it's possible to do some initialization first and only bind the
-handlers if and when it succeeds. This can avoid the need to test that the object was properly initialized in the event
-handlers themselves. With `Bind()` they simply won't be called if it wasn't correctly initialized.
-
-As a slight extension of the above, the handlers can also be unbound at any time with `Unbind()` (and maybe rebound later).
-
-Almost last but very, very far from least is the flexibility which allows to bind an event to:
-
-- A method in another object.
-- An ordinary function like a static method or a global function.
-- An arbitrary function.
-
-
-Let us now look at more examples of how to use different event handlers using the two overloads of `Bind()` function:
-first one for the object methods and the other one for arbitrary functors (callable objects, including simple functions).
-
-In addition to using a method of the object generating the event itself, you can use a method from a completely different
-object as an event handler::
-
- def OnFrameExit(event)
-
- # Do something useful.
-
-
- class MyFrame(wx.Frame):
-
- def __init__(self, parent):
-
- wx.Frame.__init__(self, parent)
-
- # Other initialization code...
-
- self.Bind(wx.EVT_MENU, OnFrameExit, id=wx.ID_EXIT)
-
-
-
-Note that `MyFrameHandler` doesn't need to derive from :ref:`EvtHandler`.
-
-
-
-.. _how events are processed:
-
-How Events are Processed
-------------------------
-
-The previous sections explain how to define event handlers but don't address the question of how exactly
-wxPython finds the handler to call for the given event. This section describes the algorithm used in detail.
-
-When an event is received from the windowing system, wxPython calls :meth:`EvtHandler.ProcessEvent` () on
-the first event handler object belonging to the window generating the event. The normal order of event table
-searching by `ProcessEvent()` is as follows, with the event processing stopping as soon as a handler is found
-(unless the handler calls :meth:`Event.Skip` () in which case it doesn't count as having handled the event
-and the search continues):
-
-1. Before anything else happens, :meth:`AppConsole.FilterEvent` () is called. If it returns anything but -1 (default),
- the event handling stops immediately.
-2. If this event handler is disabled via a call to :meth:`EvtHandler.SetEvtHandlerEnabled` () the next three
- steps are skipped and the event handler resumes at step (5).
-3. If the object is a :ref:`Window` and has an associated validator, :ref:`Validator` gets a chance to process the event.
-4. The list of dynamically bound event handlers, i.e., those for which `Bind()` was called, is consulted.
-5. The event table containing all the handlers defined using the event table macros in this class and its base classes
- is examined. Notice that this means that any event handler defined in a base class will be executed at this step.
-6. The event is passed to the next event handler, if any, in the event handler chain, i.e., the steps (1) to (4) are done
- for it. Usually there is no next event handler so the control passes to the next step but see :ref:`Event Handlers Chain `
- for how the next handler may be defined.
-7. If the object is a :ref:`Window` and the event is set to propagate (by default only :ref:`CommandEvent` -derived events are set to propagate),
- then the processing restarts from the step (1) (and excluding the step (7)) for the parent window. If this object is not a window
- but the next handler exists, the event is passed to its parent if it is a window. This ensures that in a common case of
- (possibly several) non-window event handlers pushed on top of a window, the event eventually reaches the window parent.
-8. Finally, i.e., if the event is still not processed, the :ref:`App` object itself (which derives from :ref:`EvtHandler`)
- gets a last chance to process it.
-
-
-**Please pay close attention to step 6!** People often overlook or get confused by this powerful feature of the wxPython
-event processing system. The details of event propagation up the window hierarchy are described in the next section.
-
-
-
-.. _how events propagate upwards:
-
-How Events Propagate Upwards
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-As mentioned above, the events of the classes deriving from :ref:`CommandEvent` are propagated by default to the parent
-window if they are not processed in this window itself. But although by default only the command events are propagated
-like this, other events can be propagated as well because the event handling code uses :meth:`Event.ShouldPropagate` ()
-to check whether an event should be propagated. It is also possible to propagate the event only a limited number of times
-and not until it is processed (or a top level parent window is reached).
-
-Finally, there is another additional complication (which, in fact, simplifies life of wxPython programmers significantly):
-when propagating the command events up to the parent window, the event propagation stops when it reaches the parent dialog,
-if any. This means that you don't risk getting unexpected events from the dialog controls (which might be left unprocessed
-by the dialog itself because it doesn't care about them) when a modal dialog is popped up. The events do propagate beyond
-the frames, however. The rationale for this choice is that there are only a few frames in a typical application and their
-parent-child relation are well understood by the programmer while it may be difficult, if not impossible, to track down all
-the dialogs that may be popped up in a complex program (remember that some are created automatically by wxPython).
-If you need to specify a different behaviour for some reason, you can use :meth:`Window.SetExtraStyle` (``WS_EX_BLOCK_EVENTS``)
-explicitly to prevent the events from being propagated beyond the given window or unset this flag for the dialogs that
-have it on by default.
-
-Typically events that deal with a window as a window (size, motion, paint, mouse, keyboard, etc.) are sent only to the window.
-Events that have a higher level of meaning or are generated by the window itself (button click, menu select, tree expand, etc.)
-are command events and are sent up to the parent to see if it is interested in the event. More precisely, as said above, all
-event classes not deriving from :ref:`CommandEvent` (see the :ref:`Event` inheritance diagram) do not propagate upward.
-
-In some cases, it might be desired by the programmer to get a certain number of system events in a parent window, for
-example all key events sent to, but not used by, the native controls in a dialog. In this case, a special event handler
-will have to be written that will override `ProcessEvent()` in order to pass all events (or any selection of them) to the
-parent window.
-
-
-.. _event handlers chain:
-
-Event Handlers Chain
-^^^^^^^^^^^^^^^^^^^^
-
-The step 4 of the event propagation algorithm checks for the next handler in the event handler chain. This chain can be formed
-using :meth:`EvtHandler.SetNextHandler` ():
-
-.. figure:: _static/images/overviews/overview_events_chain.png
- :align: center
-
-|
-
-(referring to the image, if `A.ProcessEvent` is called and it doesn't handle the event, `B.ProcessEvent` will be called and so on...).
-
-Additionally, in the case of :ref:`Window` you can build a stack (implemented using :ref:`EvtHandler` double-linked list) using
-:meth:`Window.PushEventHandler` ():
-
-.. figure:: _static/images/overviews/overview_events_winstack.png
- :align: center
-
-|
-
-
-
-(referring to the image, if `W.ProcessEvent` is called, it immediately calls `A.ProcessEvent`; if nor A nor B handle the event,
-then the :ref:`Window` itself is used -- i.e. the dynamically bind event handlers and static event table entries of :ref:`Window`
-are looked as the last possibility, after all pushed event handlers were tested).
-
-By default the chain is empty, i.e. there is no next handler.
-
-
-.. _custom event summary:
-
-Custom Event Summary
---------------------
-
-General approach
-^^^^^^^^^^^^^^^^
-
-Custom event classes allow you to create more polished-seeming controls by allowing the control's user to process updates
-without needing to sub-class the control. However, to effectively use events, you normally need to create custom event classes.
-
-This recipe gives you some boilerplate code for creating your own custom event classes::
-
- import wx
- import wx.lib.newevent
-
- SomeNewEvent, EVT_SOME_NEW_EVENT = wx.lib.newevent.NewEvent()
- SomeNewCommandEvent, EVT_SOME_NEW_COMMAND_EVENT = wx.lib.newevent.NewCommandEvent()
-
-
-You can bind the events normally via either binding syntax::
-
- self.Bind(EVT_SOME_NEW_EVENT, self.handler)
- EVT_SOME_NEW_EVENT(self, self.handler)
-
-
-You can also attach arbitrary data to the event during its creation, then post it to whatever window you choose::
-
- # Create the event
- evt = SomeNewEvent(attr1="hello", attr2=654)
- # Post the event
- wx.PostEvent(target, evt)
-
-
-When handling events with such arbitrary data, you can fetch the data via attributes, named the same as the names
-passed in during the event instance creation. That is, given the two keyword arguments passed to SomeNewEvent above::
-
-
- def handler(self, evt):
- # Given the above constructed event, the following is true
- evt.attr1 == "hello"
- evt.attr2 == 654
-
-
-
-
-Miscellaneous Notes
--------------------
-
-
-.. _user generated events vs programmatically generated events:
-
-User Generated Events vs Programmatically Generated Events
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-While generically a :ref:`Event` can be generated both by user actions (e.g., resize of a :ref:`Window`) and by calls to functions
-(e.g., :meth:`Window.SetSize`), wxPython controls normally send :ref:`CommandEvent` -derived events only for the user-generated
-events. The only exceptions to this rule are:
-
-- :meth:`BookCtrlBase.AddPage` No event-free alternatives
-- :meth:`BookCtrlBase.AdvanceSelection` No event-free alternatives
-- :meth:`BookCtrlBase.DeletePage` No event-free alternatives
-- :meth:`Notebook.SetSelection`: Use :meth:`Notebook.ChangeSelection` instead, as :meth:`Notebook.SetSelection` is deprecated
-- :meth:`TreeCtrl.Delete`: No event-free alternatives
-- :meth:`TreeCtrl.DeleteAllItems`: No event-free alternatives
-- :meth:`TreeCtrl.EditLabel`: No event-free alternatives
-- All :ref:`TextCtrl` methods
-
-
-:meth:`TextEntry.ChangeValue` can be used instead of :meth:`TextEntry.SetValue` but the other functions, such as :meth:`TextEntry.Replace`
-or meth:`TextCtrl.WriteText` don't have event-free equivalents.
-
-
-
-.. _window identifiers:
-
-Window Identifiers
-^^^^^^^^^^^^^^^^^^
-
-Window identifiers are integers, and are used to uniquely determine window identity in the event system (though you can use it
-for other purposes). In fact, identifiers do not need to be unique across your entire application as long they are unique within
-the particular context you're interested in, such as a frame and its children. You may use the ``ID_OK`` identifier, for example,
-on any number of dialogs as long as you don't have several within the same dialog.
-
-If you pass ``ID_ANY`` or -1 to a window constructor, an identifier will be generated for you automatically by wxPython. This is useful
-when you don't care about the exact identifier either because you're not going to process the events from the control being created
-or because you process the events from all controls in one place (in which case you should specify ``ID_ANY`` in the :meth:`EvtHandler.Bind`
-call as well). The automatically generated identifiers are always negative and so will never conflict with the user-specified
-identifiers which must be always positive.
-
-.. seealso:: See :ref:`Standard event identifiers ` for the list of standard identifiers available.
-
-
-You can use ``ID_HIGHEST`` to determine the number above which it is safe to define your own identifiers. Or, you can use identifiers below ``ID_LOWEST``.
-Finally, you can allocate identifiers dynamically using :func:`NewId` () function too. If you use :func:`NewId` () consistently in your
-application, you can be sure that your identifiers don't conflict accidentally.
+.. include:: headings.inc
+
+
+.. _events and event handling:
+
+==============================================
+|phoenix_title| **Events and Event Handling**
+==============================================
+
+
+Like with all the other GUI frameworks, the control of flow in wxPython applications is event-based: the program
+normally performs most of its actions in response to the events generated by the user. These events can be
+triggered by using the input devices (such as keyboard, mouse, joystick) directly or, more commonly, by a standard
+control which synthesizes such input events into higher level events: for example, a :ref:`Button` can generate
+a click event when the user presses the left mouse button on it and then releases it without pressing ``Esc`` in
+the meanwhile. There are also events which don't directly correspond to the user actions, such as :ref:`TimerEvent`.
+
+But in all cases wxPython represents these events in a uniform way and allows you to handle them in the same way
+wherever they originate from. And while the events are normally generated by wxPython itself, you can also do this,
+which is especially useful when using custom events (see :ref:`Custom Event Summary `).
+
+To be more precise, each event is described by:
+
+- `Event type`: this is simply a value of type `EventType` which uniquely identifies the type of the event.
+ For example, clicking on a button, selecting an item from a list box and pressing a key on the keyboard all
+ generate events with different event types.
+- `Event class` carried by the event: each event has some information associated with it and this data is represented
+ by an object of a class derived from :ref:`Event`. Events of different types can use the same event class, for
+ example both button click and listbox selection events use :ref:`CommandEvent` class (as do all the other simple
+ control events), but the key press event uses :ref:`KeyEvent` as the information associated with it is different.
+- `Event source`: :ref:`Event` stores the object which generated the event and, for windows, its identifier (see
+ :ref:`Window Identifiers `). As it is common to have more than one object generating events of
+ the same type (e.g. a typical window contains several buttons, all generating the same button click event), checking
+ the event source object or its id allows to distinguish between them.
+
+
+
+.. _event handling:
+
+Event Handling
+--------------
+
+There is one principal way to handle events in wxPython, which uses :meth:`EvtHandler.Bind` () call and can be used
+to bind and unbind the handlers dynamically, i.e. during run-time depending on some conditions. It also allows the direct
+binding of events to:
+
+- A handler method in another object.
+- An ordinary function like a static method or a global function.
+- An arbitrary function.
+
+
+
+.. _dynamic event handling:
+
+Dynamic Event Handling
+----------------------
+
+Let us start by looking at the syntax: in any place in your code, but usually in the code of the class defining the handler
+itself, call its `Bind()` method like this::
+
+ class MyFrame(wx.Frame):
+
+ def __init__(self, parent):
+
+ wx.Frame.__init__(self, parent)
+
+ # Other initialization code...
+
+ self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
+
+
+
+Event handlers can be bound at any moment. For example, it's possible to do some initialization first and only bind the
+handlers if and when it succeeds. This can avoid the need to test that the object was properly initialized in the event
+handlers themselves. With `Bind()` they simply won't be called if it wasn't correctly initialized.
+
+As a slight extension of the above, the handlers can also be unbound at any time with `Unbind()` (and maybe rebound later).
+
+Almost last but very, very far from least is the flexibility which allows to bind an event to:
+
+- A method in another object.
+- An ordinary function like a static method or a global function.
+- An arbitrary function.
+
+
+Let us now look at more examples of how to use different event handlers using the two overloads of `Bind()` function:
+first one for the object methods and the other one for arbitrary functors (callable objects, including simple functions).
+
+In addition to using a method of the object generating the event itself, you can use a method from a completely different
+object as an event handler::
+
+ def OnFrameExit(event)
+
+ # Do something useful.
+
+
+ class MyFrame(wx.Frame):
+
+ def __init__(self, parent):
+
+ wx.Frame.__init__(self, parent)
+
+ # Other initialization code...
+
+ self.Bind(wx.EVT_MENU, OnFrameExit, id=wx.ID_EXIT)
+
+
+
+Note that `MyFrameHandler` doesn't need to derive from :ref:`EvtHandler`.
+
+
+
+.. _how events are processed:
+
+How Events are Processed
+------------------------
+
+The previous sections explain how to define event handlers but don't address the question of how exactly
+wxPython finds the handler to call for the given event. This section describes the algorithm used in detail.
+
+When an event is received from the windowing system, wxPython calls :meth:`EvtHandler.ProcessEvent` () on
+the first event handler object belonging to the window generating the event. The normal order of event table
+searching by `ProcessEvent()` is as follows, with the event processing stopping as soon as a handler is found
+(unless the handler calls :meth:`Event.Skip` () in which case it doesn't count as having handled the event
+and the search continues):
+
+1. Before anything else happens, :meth:`AppConsole.FilterEvent` () is called. If it returns anything but -1 (default),
+ the event handling stops immediately.
+2. If this event handler is disabled via a call to :meth:`EvtHandler.SetEvtHandlerEnabled` () the next three
+ steps are skipped and the event handler resumes at step (5).
+3. If the object is a :ref:`Window` and has an associated validator, :ref:`Validator` gets a chance to process the event.
+4. The list of dynamically bound event handlers, i.e., those for which `Bind()` was called, is consulted.
+5. The event table containing all the handlers defined using the event table macros in this class and its base classes
+ is examined. Notice that this means that any event handler defined in a base class will be executed at this step.
+6. The event is passed to the next event handler, if any, in the event handler chain, i.e., the steps (1) to (4) are done
+ for it. Usually there is no next event handler so the control passes to the next step but see :ref:`Event Handlers Chain `
+ for how the next handler may be defined.
+7. If the object is a :ref:`Window` and the event is set to propagate (by default only :ref:`CommandEvent` -derived events are set to propagate),
+ then the processing restarts from the step (1) (and excluding the step (7)) for the parent window. If this object is not a window
+ but the next handler exists, the event is passed to its parent if it is a window. This ensures that in a common case of
+ (possibly several) non-window event handlers pushed on top of a window, the event eventually reaches the window parent.
+8. Finally, i.e., if the event is still not processed, the :ref:`App` object itself (which derives from :ref:`EvtHandler`)
+ gets a last chance to process it.
+
+
+**Please pay close attention to step 6!** People often overlook or get confused by this powerful feature of the wxPython
+event processing system. The details of event propagation up the window hierarchy are described in the next section.
+
+
+
+.. _how events propagate upwards:
+
+How Events Propagate Upwards
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+As mentioned above, the events of the classes deriving from :ref:`CommandEvent` are propagated by default to the parent
+window if they are not processed in this window itself. But although by default only the command events are propagated
+like this, other events can be propagated as well because the event handling code uses :meth:`Event.ShouldPropagate` ()
+to check whether an event should be propagated. It is also possible to propagate the event only a limited number of times
+and not until it is processed (or a top level parent window is reached).
+
+Finally, there is another additional complication (which, in fact, simplifies life of wxPython programmers significantly):
+when propagating the command events up to the parent window, the event propagation stops when it reaches the parent dialog,
+if any. This means that you don't risk getting unexpected events from the dialog controls (which might be left unprocessed
+by the dialog itself because it doesn't care about them) when a modal dialog is popped up. The events do propagate beyond
+the frames, however. The rationale for this choice is that there are only a few frames in a typical application and their
+parent-child relation are well understood by the programmer while it may be difficult, if not impossible, to track down all
+the dialogs that may be popped up in a complex program (remember that some are created automatically by wxPython).
+If you need to specify a different behaviour for some reason, you can use :meth:`Window.SetExtraStyle` (``WS_EX_BLOCK_EVENTS``)
+explicitly to prevent the events from being propagated beyond the given window or unset this flag for the dialogs that
+have it on by default.
+
+Typically events that deal with a window as a window (size, motion, paint, mouse, keyboard, etc.) are sent only to the window.
+Events that have a higher level of meaning or are generated by the window itself (button click, menu select, tree expand, etc.)
+are command events and are sent up to the parent to see if it is interested in the event. More precisely, as said above, all
+event classes not deriving from :ref:`CommandEvent` (see the :ref:`Event` inheritance diagram) do not propagate upward.
+
+In some cases, it might be desired by the programmer to get a certain number of system events in a parent window, for
+example all key events sent to, but not used by, the native controls in a dialog. In this case, a special event handler
+will have to be written that will override `ProcessEvent()` in order to pass all events (or any selection of them) to the
+parent window.
+
+
+.. _event handlers chain:
+
+Event Handlers Chain
+^^^^^^^^^^^^^^^^^^^^
+
+The step 4 of the event propagation algorithm checks for the next handler in the event handler chain. This chain can be formed
+using :meth:`EvtHandler.SetNextHandler` ():
+
+.. figure:: _static/images/overviews/overview_events_chain.png
+ :align: center
+
+|
+
+(referring to the image, if `A.ProcessEvent` is called and it doesn't handle the event, `B.ProcessEvent` will be called and so on...).
+
+Additionally, in the case of :ref:`Window` you can build a stack (implemented using :ref:`EvtHandler` double-linked list) using
+:meth:`Window.PushEventHandler` ():
+
+.. figure:: _static/images/overviews/overview_events_winstack.png
+ :align: center
+
+|
+
+
+
+(referring to the image, if `W.ProcessEvent` is called, it immediately calls `A.ProcessEvent`; if nor A nor B handle the event,
+then the :ref:`Window` itself is used -- i.e. the dynamically bind event handlers and static event table entries of :ref:`Window`
+are looked as the last possibility, after all pushed event handlers were tested).
+
+By default the chain is empty, i.e. there is no next handler.
+
+
+.. _custom event summary:
+
+Custom Event Summary
+--------------------
+
+General approach
+^^^^^^^^^^^^^^^^
+
+Custom event classes allow you to create more polished-seeming controls by allowing the control's user to process updates
+without needing to sub-class the control. However, to effectively use events, you normally need to create custom event classes.
+
+This recipe gives you some boilerplate code for creating your own custom event classes::
+
+ import wx
+ import wx.lib.newevent
+
+ SomeNewEvent, EVT_SOME_NEW_EVENT = wx.lib.newevent.NewEvent()
+ SomeNewCommandEvent, EVT_SOME_NEW_COMMAND_EVENT = wx.lib.newevent.NewCommandEvent()
+
+
+You can bind the events normally via either binding syntax::
+
+ self.Bind(EVT_SOME_NEW_EVENT, self.handler)
+ EVT_SOME_NEW_EVENT(self, self.handler)
+
+
+You can also attach arbitrary data to the event during its creation, then post it to whatever window you choose::
+
+ # Create the event
+ evt = SomeNewEvent(attr1="hello", attr2=654)
+ # Post the event
+ wx.PostEvent(target, evt)
+
+
+When handling events with such arbitrary data, you can fetch the data via attributes, named the same as the names
+passed in during the event instance creation. That is, given the two keyword arguments passed to SomeNewEvent above::
+
+
+ def handler(self, evt):
+ # Given the above constructed event, the following is true
+ evt.attr1 == "hello"
+ evt.attr2 == 654
+
+
+
+
+Miscellaneous Notes
+-------------------
+
+
+.. _user generated events vs programmatically generated events:
+
+User Generated Events vs Programmatically Generated Events
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+While generically a :ref:`Event` can be generated both by user actions (e.g., resize of a :ref:`Window`) and by calls to functions
+(e.g., :meth:`Window.SetSize`), wxPython controls normally send :ref:`CommandEvent` -derived events only for the user-generated
+events. The only exceptions to this rule are:
+
+- :meth:`BookCtrlBase.AddPage` No event-free alternatives
+- :meth:`BookCtrlBase.AdvanceSelection` No event-free alternatives
+- :meth:`BookCtrlBase.DeletePage` No event-free alternatives
+- :meth:`Notebook.SetSelection`: Use :meth:`Notebook.ChangeSelection` instead, as :meth:`Notebook.SetSelection` is deprecated
+- :meth:`TreeCtrl.Delete`: No event-free alternatives
+- :meth:`TreeCtrl.DeleteAllItems`: No event-free alternatives
+- :meth:`TreeCtrl.EditLabel`: No event-free alternatives
+- All :ref:`TextCtrl` methods
+
+
+:meth:`TextEntry.ChangeValue` can be used instead of :meth:`TextEntry.SetValue` but the other functions, such as :meth:`TextEntry.Replace`
+or meth:`TextCtrl.WriteText` don't have event-free equivalents.
+
+
+
+.. _window identifiers:
+
+Window Identifiers
+^^^^^^^^^^^^^^^^^^
+
+Window identifiers are integers, and are used to uniquely determine window identity in the event system (though you can use it
+for other purposes). In fact, identifiers do not need to be unique across your entire application as long they are unique within
+the particular context you're interested in, such as a frame and its children. You may use the ``ID_OK`` identifier, for example,
+on any number of dialogs as long as you don't have several within the same dialog.
+
+If you pass ``ID_ANY`` or -1 to a window constructor, an identifier will be generated for you automatically by wxPython. This is useful
+when you don't care about the exact identifier either because you're not going to process the events from the control being created
+or because you process the events from all controls in one place (in which case you should specify ``ID_ANY`` in the :meth:`EvtHandler.Bind`
+call as well). The automatically generated identifiers are always negative and so will never conflict with the user-specified
+identifiers which must be always positive.
+
+.. seealso:: See :ref:`Standard event identifiers ` for the list of standard identifiers available.
+
+
+You can use ``ID_HIGHEST`` to determine the number above which it is safe to define your own identifiers. Or, you can use identifiers below ``ID_LOWEST``.
+Finally, you can allocate identifiers dynamically using :func:`NewId` () function too. If you use :func:`NewId` () consistently in your
+application, you can be sure that your identifiers don't conflict accidentally.
diff --git a/docs/sphinx/rest_substitutions/overviews/filesystem_overview.rst b/docs/sphinx/rest_substitutions/overviews/filesystem_overview.rst
index 1b895017..b1486925 100644
--- a/docs/sphinx/rest_substitutions/overviews/filesystem_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/filesystem_overview.rst
@@ -1,84 +1,84 @@
-.. include:: headings.inc
-
-
-.. _filesystem overview:
-
-========================================
-|phoenix_title| **FileSystem Overview**
-========================================
-
-The wxHTML library uses a **virtual** file systems mechanism similar to the one used in Midnight Commander, Dos Navigator, FAR or almost any modern file manager.
-
-It allows the user to access data stored in archives as if they were ordinary files. On-the-fly generated files that exist only in memory are also supported.
-
-
-
-Classes
--------
-
-Three classes are used in order to provide virtual file systems mechanism:
-
-* The :ref:`FSFile` class provides information about opened file (name, input stream, mime type and anchor).
-* The :ref:`FileSystem` class is the interface. Its main methods are :meth:`FileSystem.ChangePathTo` and :meth:`FileSystem.OpenFile`. This class is most often used by the end user.
-* The :ref:`FileSystemHandler` is the core of virtual file systems mechanism. You can derive your own handler and pass it to the VFS mechanism. You can derive your
- own handler and pass it to the :meth:`FileSystem.AddHandler` method. In the new handler you only need to override the :meth:`FileSystemHandler.OpenFile` and
- :meth:`FileSystemHandler.CanOpen` methods.
-
-
-
-Locations
----------
-
-Locations (aka filenames aka addresses) are constructed from four parts:
-
-* **protocol** - handler can recognize if it is able to open a file by checking its protocol. Examples are "http", "file" or "ftp".
-* **right location** - is the name of file within the protocol. In "http://www.wxwidgets.org/index.html" the right location is "//www.wxwidgets.org/index.html".
-* **anchor** - an anchor is optional and is usually not present. In "index.htm#chapter2" the anchor is "chapter2".
-* **left location** - this is usually an empty string. It is used by 'local' protocols such as ZIP. See the :ref:`Combined Protocols ` paragraph for details.
-
-
-.. _combined protocols:
-
-Combined Protocols
-------------------
-
-The left location precedes the protocol in the URL string.
-
-It is not used by global protocols like HTTP but it becomes handy when nesting protocols - for example you may want to access files in a ZIP archive:
-
-``file:archives/cpp_doc.zip#zip:reference/fopen.htm#syntax``
-
-In this example, the protocol is "zip", right location is "reference/fopen.htm", anchor is "syntax" and left location is ``file:archives/cpp_doc.zip``.
-
-There are two protocols used in this example: "zip" and "file".
-
-
-.. _list of available handlers:
-
-File Systems Included in wxHTML
--------------------------------
-
-The following virtual file system handlers are part of wxPython so far:
-
-* :ref:`ArchiveFSHandler`: A handler for archives such as zip and tar. URLs examples: "archive.zip#zip:filename", "archive.tar.gz#gzip:#tar:filename".
-* :ref:`FilterFSHandler`: A handler for compression schemes such as gzip. URLs are in the form, e.g.: "document.ps.gz#gzip:".
-* :ref:`InternetFSHandler`: A handler for accessing documents via HTTP or FTP protocols.
-* :ref:`MemoryFSHandler`: This handler allows you to access data stored in memory (such as bitmaps) as if they were regular files. See :ref:`MemoryFSHandler` for details.
- URL is prefixed with memory:, e.g. "memory:myfile.htm".
-
-
-In addition, :ref:`FileSystem` itself can access local files.
-
-
-
-Initializing file system handlers
----------------------------------
-
-Use :meth:`FileSystem.AddHandler` to initialize a handler, for example::
-
-
- def OnInit(self):
-
- wx.FileSystem.AddHandler(wx.MemoryFSHandler())
-
-
+.. include:: headings.inc
+
+
+.. _filesystem overview:
+
+========================================
+|phoenix_title| **FileSystem Overview**
+========================================
+
+The wxHTML library uses a **virtual** file systems mechanism similar to the one used in Midnight Commander, Dos Navigator, FAR or almost any modern file manager.
+
+It allows the user to access data stored in archives as if they were ordinary files. On-the-fly generated files that exist only in memory are also supported.
+
+
+
+Classes
+-------
+
+Three classes are used in order to provide virtual file systems mechanism:
+
+* The :ref:`FSFile` class provides information about opened file (name, input stream, mime type and anchor).
+* The :ref:`FileSystem` class is the interface. Its main methods are :meth:`FileSystem.ChangePathTo` and :meth:`FileSystem.OpenFile`. This class is most often used by the end user.
+* The :ref:`FileSystemHandler` is the core of virtual file systems mechanism. You can derive your own handler and pass it to the VFS mechanism. You can derive your
+ own handler and pass it to the :meth:`FileSystem.AddHandler` method. In the new handler you only need to override the :meth:`FileSystemHandler.OpenFile` and
+ :meth:`FileSystemHandler.CanOpen` methods.
+
+
+
+Locations
+---------
+
+Locations (aka filenames aka addresses) are constructed from four parts:
+
+* **protocol** - handler can recognize if it is able to open a file by checking its protocol. Examples are "http", "file" or "ftp".
+* **right location** - is the name of file within the protocol. In "http://www.wxwidgets.org/index.html" the right location is "//www.wxwidgets.org/index.html".
+* **anchor** - an anchor is optional and is usually not present. In "index.htm#chapter2" the anchor is "chapter2".
+* **left location** - this is usually an empty string. It is used by 'local' protocols such as ZIP. See the :ref:`Combined Protocols ` paragraph for details.
+
+
+.. _combined protocols:
+
+Combined Protocols
+------------------
+
+The left location precedes the protocol in the URL string.
+
+It is not used by global protocols like HTTP but it becomes handy when nesting protocols - for example you may want to access files in a ZIP archive:
+
+``file:archives/cpp_doc.zip#zip:reference/fopen.htm#syntax``
+
+In this example, the protocol is "zip", right location is "reference/fopen.htm", anchor is "syntax" and left location is ``file:archives/cpp_doc.zip``.
+
+There are two protocols used in this example: "zip" and "file".
+
+
+.. _list of available handlers:
+
+File Systems Included in wxHTML
+-------------------------------
+
+The following virtual file system handlers are part of wxPython so far:
+
+* :ref:`ArchiveFSHandler`: A handler for archives such as zip and tar. URLs examples: "archive.zip#zip:filename", "archive.tar.gz#gzip:#tar:filename".
+* :ref:`FilterFSHandler`: A handler for compression schemes such as gzip. URLs are in the form, e.g.: "document.ps.gz#gzip:".
+* :ref:`InternetFSHandler`: A handler for accessing documents via HTTP or FTP protocols.
+* :ref:`MemoryFSHandler`: This handler allows you to access data stored in memory (such as bitmaps) as if they were regular files. See :ref:`MemoryFSHandler` for details.
+ URL is prefixed with memory:, e.g. "memory:myfile.htm".
+
+
+In addition, :ref:`FileSystem` itself can access local files.
+
+
+
+Initializing file system handlers
+---------------------------------
+
+Use :meth:`FileSystem.AddHandler` to initialize a handler, for example::
+
+
+ def OnInit(self):
+
+ wx.FileSystem.AddHandler(wx.MemoryFSHandler())
+
+
diff --git a/docs/sphinx/rest_substitutions/overviews/font_encodings.rst b/docs/sphinx/rest_substitutions/overviews/font_encodings.rst
index 41030391..b42a3d05 100644
--- a/docs/sphinx/rest_substitutions/overviews/font_encodings.rst
+++ b/docs/sphinx/rest_substitutions/overviews/font_encodings.rst
@@ -1,57 +1,57 @@
-.. include:: headings.inc
-
-
-.. _font encodings:
-
-=================================================
-|phoenix_title| **Font Encodings**
-=================================================
-
-
-wxPython has support for multiple font encodings.
-
-By encoding we mean here the mapping between the character codes and the letters. Probably the most well-known encoding is
-(7 bit) ASCII one which is used almost universally now to represent the letters of the English alphabet and some other
-common characters. However, it is not enough to represent the letters of foreign alphabets and here other encodings
-come into play. Please note that we will only discuss 8-bit fonts here and not Unicode.
-
-Font encoding support is ensured by several classes: :ref:`Font` itself, but also :ref:`FontEnumerator` and :ref:`FontMapper`.
-:ref:`Font` encoding support is reflected by a (new) constructor parameter encoding which takes one of the following
-values (elements of enumeration type :ref:`FontEncoding`):
-
-======================================== =========================================================
-``FONTENCODING_SYSTEM`` The default encoding of the underlying operating system (notice that this might be a "foreign" encoding for foreign versions of Windows 9x/NT).
-``FONTENCODING_DEFAULT`` The applications default encoding as returned by :meth:`Font.GetDefaultEncoding`. On program startup, the applications default encoding is the same as ``FONTENCODING_SYSTEM``, but may be changed to make all the fonts created later to use it (by default).
-``FONTENCODING_ISO8859_1..15`` ISO8859 family encodings which are usually used by all non-Microsoft operating systems.
-``FONTENCODING_KOI8`` Standard Cyrillic encoding for the Internet (but see also ``FONTENCODING_ISO8859_5`` and ``FONTENCODING_CP1251``).
-``FONTENCODING_CP1250`` Microsoft analogue of ISO8859-2
-``FONTENCODING_CP1251`` Microsoft analogue of ISO8859-5
-``FONTENCODING_CP1252`` Microsoft analogue of ISO8859-1
-======================================== =========================================================
-
-
-As you may see, Microsoft's encoding partly mirror the standard ISO8859 ones, but there are (minor) differences even between
-ISO8859-1 (Latin1, ISO encoding for Western Europe) and CP1251 (WinLatin1, standard code page for English versions of Windows)
-and there are more of them for other encodings.
-
-The situation is particularly complicated with Cyrillic encodings for which (more than) three incompatible encodings exist:
-KOI8 (the old standard, widely used on the Internet), ISO8859-5 (ISO standard for Cyrillic) and CP1251 (WinCyrillic).
-
-This abundance of (incompatible) encodings should make it clear that using encodings is less easy than it might seem.
-The problems arise both from the fact that the standard encodings for the given language (say Russian, which is written
-in Cyrillic) are different on different platforms and because the fonts in the given encoding might just not be installed
-(this is especially a problem with Unix, or, in general, non-Win32 systems).
-
-To clarify, the :ref:`FontEnumerator` class may be used to enumerate both all available encodings and to find the facename(s)
-in which the given encoding exists. If you can find the font in the correct encoding with :ref:`FontEnumerator` then your
-troubles are over, but, unfortunately, sometimes this is not enough. For example, there is no standard way (that I know of,
-please tell me if you do!) to find a font on a Windows system for KOI8 encoding (only for WinCyrillic one which is quite different),
-so :ref:`FontEnumerator` will never return one, even if the user has installed a KOI8 font on his system.
-
-To solve this problem, a :ref:`FontMapper` class is provided.
-
-This class stores the mapping between the encodings and the font face names which support them in :ref:`ConfigBase` object.
-Of course, it would be fairly useless if it tried to determine these mappings by itself, so, instead, it (optionally) asks
-the user and remembers his answers so that the next time the program will automatically choose the correct font.
-
-
+.. include:: headings.inc
+
+
+.. _font encodings:
+
+=================================================
+|phoenix_title| **Font Encodings**
+=================================================
+
+
+wxPython has support for multiple font encodings.
+
+By encoding we mean here the mapping between the character codes and the letters. Probably the most well-known encoding is
+(7 bit) ASCII one which is used almost universally now to represent the letters of the English alphabet and some other
+common characters. However, it is not enough to represent the letters of foreign alphabets and here other encodings
+come into play. Please note that we will only discuss 8-bit fonts here and not Unicode.
+
+Font encoding support is ensured by several classes: :ref:`Font` itself, but also :ref:`FontEnumerator` and :ref:`FontMapper`.
+:ref:`Font` encoding support is reflected by a (new) constructor parameter encoding which takes one of the following
+values (elements of enumeration type :ref:`FontEncoding`):
+
+======================================== =========================================================
+``FONTENCODING_SYSTEM`` The default encoding of the underlying operating system (notice that this might be a "foreign" encoding for foreign versions of Windows 9x/NT).
+``FONTENCODING_DEFAULT`` The applications default encoding as returned by :meth:`Font.GetDefaultEncoding`. On program startup, the applications default encoding is the same as ``FONTENCODING_SYSTEM``, but may be changed to make all the fonts created later to use it (by default).
+``FONTENCODING_ISO8859_1..15`` ISO8859 family encodings which are usually used by all non-Microsoft operating systems.
+``FONTENCODING_KOI8`` Standard Cyrillic encoding for the Internet (but see also ``FONTENCODING_ISO8859_5`` and ``FONTENCODING_CP1251``).
+``FONTENCODING_CP1250`` Microsoft analogue of ISO8859-2
+``FONTENCODING_CP1251`` Microsoft analogue of ISO8859-5
+``FONTENCODING_CP1252`` Microsoft analogue of ISO8859-1
+======================================== =========================================================
+
+
+As you may see, Microsoft's encoding partly mirror the standard ISO8859 ones, but there are (minor) differences even between
+ISO8859-1 (Latin1, ISO encoding for Western Europe) and CP1251 (WinLatin1, standard code page for English versions of Windows)
+and there are more of them for other encodings.
+
+The situation is particularly complicated with Cyrillic encodings for which (more than) three incompatible encodings exist:
+KOI8 (the old standard, widely used on the Internet), ISO8859-5 (ISO standard for Cyrillic) and CP1251 (WinCyrillic).
+
+This abundance of (incompatible) encodings should make it clear that using encodings is less easy than it might seem.
+The problems arise both from the fact that the standard encodings for the given language (say Russian, which is written
+in Cyrillic) are different on different platforms and because the fonts in the given encoding might just not be installed
+(this is especially a problem with Unix, or, in general, non-Win32 systems).
+
+To clarify, the :ref:`FontEnumerator` class may be used to enumerate both all available encodings and to find the facename(s)
+in which the given encoding exists. If you can find the font in the correct encoding with :ref:`FontEnumerator` then your
+troubles are over, but, unfortunately, sometimes this is not enough. For example, there is no standard way (that I know of,
+please tell me if you do!) to find a font on a Windows system for KOI8 encoding (only for WinCyrillic one which is quite different),
+so :ref:`FontEnumerator` will never return one, even if the user has installed a KOI8 font on his system.
+
+To solve this problem, a :ref:`FontMapper` class is provided.
+
+This class stores the mapping between the encodings and the font face names which support them in :ref:`ConfigBase` object.
+Of course, it would be fairly useless if it tried to determine these mappings by itself, so, instead, it (optionally) asks
+the user and remembers his answers so that the next time the program will automatically choose the correct font.
+
+
diff --git a/docs/sphinx/rest_substitutions/overviews/font_overview.rst b/docs/sphinx/rest_substitutions/overviews/font_overview.rst
index 11e48b6c..ad31dac0 100644
--- a/docs/sphinx/rest_substitutions/overviews/font_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/font_overview.rst
@@ -1,55 +1,55 @@
-.. include:: headings.inc
-
-
-.. _font overview:
-
-=================================================
-|phoenix_title| **Font Overview**
-=================================================
-
-
-Introduction
-------------
-
-A font is an object which determines the appearance of text, primarily when drawing text to a window
-or device context. A font is determined by the following parameters (not all of them have to be specified, of course):
-
-======================== ==========================================
-**Point size** This is the standard way of referring to text size.
-**Family** Supported families are: ``DEFAULT``, ``DECORATIVE``, ``ROMAN``, ``SCRIPT``, ``SWISS``, ``MODERN``. ``MODERN`` is a fixed pitch font; the others are either fixed or variable pitch.
-**Style** The value can be ``NORMAL``, ``SLANT`` or ``ITALIC``.
-**Weight** The value can be ``NORMAL``, ``LIGHT`` or ``BOLD``.
-**Underlining** The value can be ``True`` or ``False``.
-**Face name** An optional string specifying the actual typeface to be used. If ``None``, a default typeface will chosen based on the family.
-**Encoding** The font encoding (see ``FONTENCODING_XXX`` constants and the :ref:`Font Encodings ` for more details)
-======================== ==========================================
-
-Specifying a family, rather than a specific typeface name, ensures a degree of portability across platforms because a
-suitable font will be chosen for the given font family, however it doesn't allow to choose a font precisely as the parameters
-above don't suffice, in general, to identify all the available fonts and this is where using the native font descriptions
-may be helpful - see below.
-
-Under Windows, the face name can be one of the installed fonts on the user's system. Since the choice of fonts differs
-from system to system, either choose standard Windows fonts, or if allowing the user to specify a face name, store the
-family name with any file that might be transported to a different Windows machine or other platform.
-
-.. note:: There is currently a difference between the appearance of fonts on the two platforms, if the mapping mode is anything
- other than ``MM_TEXT``. Under X, font size is always specified in points. Under MS Windows, the unit for text is points but
- the text is scaled according to the current mapping mode. However, user scaling on a device context will also scale fonts under both environments.
-
-
-Native font information
------------------------
-
-An alternative way of choosing fonts is to use the native font description. This is the only acceptable solution if the user
-is allowed to choose the font using the :ref:`FontDialog` because the selected font cannot be described using only the family
-name and so, if only family name is stored permanently, the user would almost surely see a different font in the program later.
-
-Instead, you should store the value returned by :meth:`Font.GetNativeFontInfoDesc` and pass it to :meth:`Font.SetNativeFontInfo`
-later to recreate exactly the same font.
-
-.. note:: Note that the contents of this string depends on the platform and shouldn't be used for any other purpose (in particular, it is not
- meant to be shown to the user). Also please note that although the native font information is currently implemented for Windows and
- Unix (GTK+ and Motif) ports only, all the methods are available for all the ports and should be used to make your program work correctly
- when they are implemented later.
-
+.. include:: headings.inc
+
+
+.. _font overview:
+
+=================================================
+|phoenix_title| **Font Overview**
+=================================================
+
+
+Introduction
+------------
+
+A font is an object which determines the appearance of text, primarily when drawing text to a window
+or device context. A font is determined by the following parameters (not all of them have to be specified, of course):
+
+======================== ==========================================
+**Point size** This is the standard way of referring to text size.
+**Family** Supported families are: ``DEFAULT``, ``DECORATIVE``, ``ROMAN``, ``SCRIPT``, ``SWISS``, ``MODERN``. ``MODERN`` is a fixed pitch font; the others are either fixed or variable pitch.
+**Style** The value can be ``NORMAL``, ``SLANT`` or ``ITALIC``.
+**Weight** The value can be ``NORMAL``, ``LIGHT`` or ``BOLD``.
+**Underlining** The value can be ``True`` or ``False``.
+**Face name** An optional string specifying the actual typeface to be used. If ``None``, a default typeface will chosen based on the family.
+**Encoding** The font encoding (see ``FONTENCODING_XXX`` constants and the :ref:`Font Encodings ` for more details)
+======================== ==========================================
+
+Specifying a family, rather than a specific typeface name, ensures a degree of portability across platforms because a
+suitable font will be chosen for the given font family, however it doesn't allow to choose a font precisely as the parameters
+above don't suffice, in general, to identify all the available fonts and this is where using the native font descriptions
+may be helpful - see below.
+
+Under Windows, the face name can be one of the installed fonts on the user's system. Since the choice of fonts differs
+from system to system, either choose standard Windows fonts, or if allowing the user to specify a face name, store the
+family name with any file that might be transported to a different Windows machine or other platform.
+
+.. note:: There is currently a difference between the appearance of fonts on the two platforms, if the mapping mode is anything
+ other than ``MM_TEXT``. Under X, font size is always specified in points. Under MS Windows, the unit for text is points but
+ the text is scaled according to the current mapping mode. However, user scaling on a device context will also scale fonts under both environments.
+
+
+Native font information
+-----------------------
+
+An alternative way of choosing fonts is to use the native font description. This is the only acceptable solution if the user
+is allowed to choose the font using the :ref:`FontDialog` because the selected font cannot be described using only the family
+name and so, if only family name is stored permanently, the user would almost surely see a different font in the program later.
+
+Instead, you should store the value returned by :meth:`Font.GetNativeFontInfoDesc` and pass it to :meth:`Font.SetNativeFontInfo`
+later to recreate exactly the same font.
+
+.. note:: Note that the contents of this string depends on the platform and shouldn't be used for any other purpose (in particular, it is not
+ meant to be shown to the user). Also please note that although the native font information is currently implemented for Windows and
+ Unix (GTK+ and Motif) ports only, all the methods are available for all the ports and should be used to make your program work correctly
+ when they are implemented later.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/html_overview.rst b/docs/sphinx/rest_substitutions/overviews/html_overview.rst
index 653842c8..7324356f 100644
--- a/docs/sphinx/rest_substitutions/overviews/html_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/html_overview.rst
@@ -1,646 +1,646 @@
-.. include:: headings.inc
-
-
-.. _html overview:
-
-==================================
-|phoenix_title| **HTML Overview**
-==================================
-
-
-The :mod:`html` library provides classes for parsing and displaying HTML.
-
-It is not intended to be a high-end HTML browser. If you are looking for
-something like that try http://www.mozilla.org/.
-
-:mod:`html` can be used as a generic rich text viewer - for example to display a
-nice About Box (like those of GNOME apps) or to display the result of
-database searching. There is a :class:`FileSystem` class which allows you to use
-your own virtual file systems.
-
-:class:`~html.HtmlWindow` supports tag handlers. This means that you can easily extend
-:mod:`html` library with new, unsupported tags. Not only that, you can even use
-your own application-specific tags!
-
-There is a generic :class:`~html.HtmlParser` class, independent of :class:`~html.HtmlWindow`.
-
-
-.. _html quick start:
-
-HTML quick start
-----------------
-
-
-Displaying HTML
-~~~~~~~~~~~~~~~~
-
-Class :class:`~html.HtmlWindow` (derived from :class:`ScrolledWindow`) is used to display
-HTML documents.
-
-It has two important methods: :meth:`~html.HtmlWindow.LoadPage` and
-:meth:`~html.HtmlWindow.SetPage`. LoadPage loads and displays HTML file while SetPage
-displays directly the passed **string**. See the example::
-
- mywin.LoadPage("test.htm")
- mywin.SetPage("htmlbody" \
- "h1Error/h1" \
- "Some error occurred :-H)" \
- "/body/hmtl")
-
-
-
-Setting up HtmlWindow
-~~~~~~~~~~~~~~~~~~~~~~
-
-Because :class:`~html.HtmlWindow` is derived from :class:`ScrolledWindow` and not from
-:class:`Frame`, it doesn't have visible frame. But the user usually wants to see
-the title of HTML page displayed somewhere and the frame's titlebar is the
-ideal place for it.
-
-:class:`~html.HtmlWindow` provides 2 methods in order to handle this:
-:meth:`~html.HtmlWindow.SetRelatedFrame` and :meth:`~html.HtmlWindow.SetRelatedStatusBar`.
-See the example::
-
- html = wx.html.HtmlWindow(self)
- html.SetRelatedFrame(self, "HTML : %%s")
- html.SetRelatedStatusBar(0)
-
-
-The first command associates the HTML object with its parent frame (this
-points to :class:`Frame` object there) and sets the format of the title. Page
-title "Hello, world!" will be displayed as "HTML : Hello, world!" in this
-example.
-
-The second command sets which frame's status bar should be used to display
-browser's messages (such as "Loading..." or "Done" or hypertext links).
-
-
-Customizing HtmlWindow
-~~~~~~~~~~~~~~~~~~~~~~~
-
-You can customize :class:`~html.HtmlWindow` by setting font size, font face and borders
-(space between border of window and displayed HTML). Related functions:
-
-- :meth:`~html.HtmlWindow.SetFonts`
-- :meth:`~html.HtmlWindow.SetBorders`
-- :meth:`~html.HtmlWindow.ReadCustomization`
-- :meth:`~html.HtmlWindow.WriteCustomization`
-
-The last two functions are used to store user customization info :class:`Config`
-stuff (for example in the registry under Windows, or in a dotfile under
-Unix).
-
-
-HTML Printing
---------------
-
-The :mod:`html` library provides printing facilities with several levels of
-complexity. The easiest way to print an HTML document is to use the
-:class:`~html.HtmlEasyPrinting` class.
-
-It lets you print HTML documents with only one command and you don't have to
-worry about deriving from the :class:`Printout` class at all. It is only a simple
-wrapper around the :class:`~html.HtmlPrintout`, normal wxPython printout class.
-
-And finally there is the low level class :class:`~html.HtmlDCRenderer` which you can
-use to render HTML into a rectangular area on any DC.
-
-It supports rendering into multiple rectangles with the same width. (The most
-common use of this is placing one rectangle on each page or printing into two
-columns.)
-
-
-.. _help files format:
-
-Help Files Format
-------------------
-
-:mod:`html` library can be used to show an help manual to the user; in fact, it
-supports natively (through :class:`~html.HtmlHelpController`) a reduced version of MS
-HTML Workshop format.
-
-A **book** consists of three files: the header file, the contents file and
-the index file.
-
-You can make a regular zip archive of these files, plus the HTML and any
-image files, for HTML (or helpview) to read; and the ``".zip"`` file can
-optionally be renamed to ``".htb"``.
-
-
-Header file (.hhp)
-~~~~~~~~~~~~~~~~~~~
-
-.. highlight:: rst
-
-
-The header file must contain these lines (and may contain additional lines
-which are ignored)::
-
- Contents file=filename.hhc
- Index file=filename.hhk
- Title=title of your book
- Default topic=default page to be displayed.htm
-
-
-All filenames (including the Default topic) are relative to the location of
-the ``".hhp"`` file.
-
-.. note::
-
- For localization, in addition the ``".hhp"`` file may contain the line::
-
- Charset=rfc_charset
-
- which specifies what charset (e.g. "iso8859_1") was used in contents and
- index files. Please note that this line is incompatible with MS HTML Help
- Workshop and it would either silently remove it or complain with some error.
-
-
-Contents file (.hhc)
-~~~~~~~~~~~~~~~~~~~~~
-
-.. highlight:: html
-
-
-Contents file has HTML syntax and it can be parsed by regular HTML parser. It
-contains exactly one list (```` statement)::
-
-
-
-
-You can modify value attributes of param tags. The *topic name* is name of
-chapter/topic as is displayed in contents, *filename.htm* is the HTML page
-name (relative to the ``".hhp"`` file) and *numeric_id* is optional - it is
-used only when you use :meth:`~html.HtmlHelpController.Display`.
-
-Items in the list may be nested - one ```` statement may contain a
-```` sub-statement::
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Index file (.hhk)
-~~~~~~~~~~~~~~~~~~
-
-Index files have same format as contents files except that ID params are
-ignored and sublists are **not** allowed.
-
-
-Input Filters
---------------
-
-The :mod:`html` library provides a mechanism for reading and displaying files of
-many different file formats.
-
-:meth:`~html.HtmlWindow.LoadPage` can load not only HTML files but any known file. To
-make a file type known to :class:`~html.HtmlWindow` you must create a :class:`~html.HtmlFilter`
-filter and register it using :meth:`~html.HtmlWindow.AddFilter`.
-
-
-Cells and Containers
----------------------
-
-This article describes mechanism used by :class:`~html.HtmlWinParser` and
-:class:`~html.HtmlWindow` to parse and display HTML documents.
-
-
-Cells
-~~~~~~
-
-You can divide any text (or HTML) into small fragments. Let's call these
-fragments **cells**. Cell is for example one word, horizontal line, image or
-any other part of document. Each cell has width and height (except special
-"magic" cells with zero dimensions - e.g. colour changers or font changers).
-See :class:`~html.HtmlCell`.
-
-
-Containers
-~~~~~~~~~~~
-
-Container is kind of cell that may contain sub-cells. Its size depends on
-number and sizes of its sub-cells (and also depends on width of window). See
-:class:`~html.HtmlContainerCell`, :meth:`~html.HtmlCell.Layout`. This image shows the cells and
-containers:
-
-.. image:: _static/images/overviews/overview_html_contbox.png
- :alt: overview_html_contbox.png
-
-
-
-Using Containers in Tag Handler
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-:class:`~html.HtmlWinParser` provides a user-friendly way of managing containers. It is
-based on the idea of opening and closing containers.
-
-Use :meth:`~html.HtmlWinParser.OpenContainer` to open new a container *within* an
-already opened container. This new container is a *sub-container* of the old
-one. (If you want to create a new container with the same depth level you can
-call ``CloseContainer()``; ``OpenContainer()``; ).
-
-Use :meth:`~html.HtmlWinParser.CloseContainer` to close the container. This doesn't
-create a new container with same depth level but it returns "control" to the
-parent container. See explanation:
-
-.. image:: _static/images/overviews/overview_html_cont.png
- :alt: overview_html_cont.png
-
-
-There clearly must be same number of calls to OpenContainer as to CloseContainer.
-
-
-Example
-::::::::
-
-.. highlight:: python
-
-
-This code creates a new paragraph (container at same depth level) with "Hello, world!"::
-
- myParser.CloseContainer()
- c = myParser.OpenContainer()
-
- myParser.AddText("Hello, ")
- myParser.AddText("world!")
-
- myParser.CloseContainer()
- myParser.OpenContainer()
-
-
-and here is image of the situation:
-
-.. image:: _static/images/overviews/overview_html_hello.png
- :alt: overview_html_hello.png
-
-
-You can see that there was an opened container before the code was executed.
-We closed it, created our own container, then closed our container and opened
-new container.
-
-The result was that we had *same* depth level after executing. This is
-general rule that should be followed by tag handlers: leave depth level of
-containers unmodified (in other words, number of OpenContainer and
-CloseContainer calls should be same within :meth:`~html.HtmlTagHandler.HandleTag` 's
-body).
-
-.. note::
-
- Notice that it would be usually better to use
- :meth:`~html.HtmlContainerCell.InsertCell` instead of adding text to the parser
- directly.
-
-
-Tag Handlers
--------------
-
-The :mod:`html` library provides architecture of pluggable *tag* handlers. Tag
-handler is class that understands particular HTML tag (or tags) and is able
-to interpret it.
-
-:class:`~html.HtmlWinParser` has a static table of **modules**. Each module contains
-one or more tag handlers. Each time a new :class:`~html.HtmlWinParser` object is
-constructed all modules are scanned and handlers are added to HtmlParser's
-list of available handlers.
-
-
-How it works
-~~~~~~~~~~~~~
-
-Common tag handler's :meth:`~html.HtmlTagHandler.HandleTag` method works in four
-steps:
-
-- Save state of parent parser into local variables
-- Change parser state according to tag's params
-- Parse text between the tag and paired ending tag (if present)
-- Restore original parser state
-
-See :class:`~html.HtmlWinParser` for methods for modifying parser's state. In general
-you can do things like opening/closing containers, changing colors, fonts etc...
-
-
-Providing own tag handlers
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-See the :mod:`lib.wxpTag` on how to provide your own tag handlers.
-
-
-Tag handlers
-~~~~~~~~~~~~~
-
-The handler is derived from :class:`~html.HtmlWinTagHandler` (or directly from
-:class:`~html.HtmlTagHandler`).
-
-
-Tags supported by :mod:`html`
------------------------------
-
-:mod:`html` is not a full implementation of HTML standard. Instead, it supports most
-common tags so that it is possible to display *simple* HTML documents with
-it. (For example it works fine with pages created in Netscape Composer or
-generated by tex2rtf).
-
-Following tables list all tags known to :mod:`html`, together with supported
-parameters.
-
-A tag has general form of ``tagname`` param_1 param_2 ... param_n where
-param_i is either ``paramname="paramvalue"`` or ``paramname=paramvalue`` -
-these two are equivalent. Unless stated otherwise, :mod:`html` is case-
-insensitive.
-
-
-Table of common parameter values
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-We will use these substitutions in tags descriptions:
-
-+------------------+---------------------------------------------------------------+
-| [alignment] | CENTER |
-| +---------------------------------------------------------------+
-| | LEFT |
-| +---------------------------------------------------------------+
-| | RIGHT |
-| +---------------------------------------------------------------+
-| | JUSTIFY |
-+------------------+---------------------------------------------------------------+
-| [v_alignment] | TOP |
-| +---------------------------------------------------------------+
-| | BOTTOM |
-| +---------------------------------------------------------------+
-| | CENTER |
-+------------------+---------------------------------------------------------------+
-| [color] | HTML 4.0-compliant colour specification |
-+------------------+---------------------------------------------------------------+
-| [fontsize] | -2 |
-| +---------------------------------------------------------------+
-| | -1 |
-| +---------------------------------------------------------------+
-| | +0 |
-| +---------------------------------------------------------------+
-| | +1 |
-| +---------------------------------------------------------------+
-| | +2 |
-| +---------------------------------------------------------------+
-| | +3 |
-| +---------------------------------------------------------------+
-| | +4 |
-| +---------------------------------------------------------------+
-| | 1 |
-| +---------------------------------------------------------------+
-| | 2 |
-| +---------------------------------------------------------------+
-| | 3 |
-| +---------------------------------------------------------------+
-| | 4 |
-| +---------------------------------------------------------------+
-| | 5 |
-| +---------------------------------------------------------------+
-| | 6 |
-| +---------------------------------------------------------------+
-| | 7 |
-+------------------+---------------------------------------------------------------+
-| [pixels] | integer value that represents dimension in pixels |
-+------------------+---------------------------------------------------------------+
-| [percent] | i% |
-| +---------------------------------------------------------------+
-| | where i is integer |
-+------------------+---------------------------------------------------------------+
-| [url] | an URL |
-+------------------+---------------------------------------------------------------+
-| [string] | text string |
-+------------------+---------------------------------------------------------------+
-| [coords] | c(1),c(2),c(3),...,c(n) |
-| +---------------------------------------------------------------+
-| | where c(i) is integer |
-+------------------+---------------------------------------------------------------+
-
-
-
-List of supported tags
-~~~~~~~~~~~~~~~~~~~~~~~
-
-+------------------+---------------------------------------------------------------+
-| A | NAME=[string] |
-| +---------------------------------------------------------------+
-| | HREF=[url] |
-| +---------------------------------------------------------------+
-| | TARGET=[target window spec] |
-+------------------+---------------------------------------------------------------+
-| ADDRESS | |
-+------------------+---------------------------------------------------------------+
-| AREA | SHAPE=POLY |
-| +---------------------------------------------------------------+
-| | SHAPE=CIRCLE |
-| +---------------------------------------------------------------+
-| | SHAPE=RECT |
-| +---------------------------------------------------------------+
-| | COORDS=[coords] |
-| +---------------------------------------------------------------+
-| | HREF=[url] |
-+------------------+---------------------------------------------------------------+
-| BIG | |
-+------------------+---------------------------------------------------------------+
-| BLOCKQUOTE | |
-+------------------+---------------------------------------------------------------+
-| BODY | TEXT=[color] |
-| +---------------------------------------------------------------+
-| | LINK=[color] |
-| +---------------------------------------------------------------+
-| | BGCOLOR=[color] |
-+------------------+---------------------------------------------------------------+
-| BR | ALIGN=[alignment] |
-+------------------+---------------------------------------------------------------+
-| CENTER | |
-+------------------+---------------------------------------------------------------+
-| CITE | |
-+------------------+---------------------------------------------------------------+
-| CODE | |
-+------------------+---------------------------------------------------------------+
-| DD | |
-+------------------+---------------------------------------------------------------+
-| DIV | ALIGN=[alignment] |
-+------------------+---------------------------------------------------------------+
-| DL | |
-+------------------+---------------------------------------------------------------+
-| DT | |
-+------------------+---------------------------------------------------------------+
-| EM | |
-+------------------+---------------------------------------------------------------+
-| FONT | COLOR=[color] |
-| +---------------------------------------------------------------+
-| | SIZE=[fontsize] |
-| +---------------------------------------------------------------+
-| | FACE=[comma-separated list of facenames] |
-+------------------+---------------------------------------------------------------+
-| HR | ALIGN=[alignment] |
-| +---------------------------------------------------------------+
-| | SIZE=[pixels] |
-| +---------------------------------------------------------------+
-| | WIDTH=[percent|pixels] |
-| +---------------------------------------------------------------+
-| | NOSHADE |
-+------------------+---------------------------------------------------------------+
-| H1 | |
-+------------------+---------------------------------------------------------------+
-| H2 | |
-+------------------+---------------------------------------------------------------+
-| H3 | |
-+------------------+---------------------------------------------------------------+
-| H4 | |
-+------------------+---------------------------------------------------------------+
-| H5 | |
-+------------------+---------------------------------------------------------------+
-| H6 | |
-+------------------+---------------------------------------------------------------+
-| I | |
-+------------------+---------------------------------------------------------------+
-| IMG | SRC=[url] |
-| +---------------------------------------------------------------+
-| | WIDTH=[percent|pixels] |
-| +---------------------------------------------------------------+
-| | HEIGHT=[pixels] |
-| +---------------------------------------------------------------+
-| | ALIGN=TEXTTOP |
-| +---------------------------------------------------------------+
-| | ALIGN=CENTER |
-| +---------------------------------------------------------------+
-| | ALIGN=ABSCENTER |
-| +---------------------------------------------------------------+
-| | ALIGN=BOTTOM |
-| +---------------------------------------------------------------+
-| | USEMAP=[url] |
-+------------------+---------------------------------------------------------------+
-| KBD | |
-+------------------+---------------------------------------------------------------+
-| LI | |
-+------------------+---------------------------------------------------------------+
-| MAP | NAME=[string] |
-+------------------+---------------------------------------------------------------+
-| META | HTTP-EQUIV="Content-Type" |
-| +---------------------------------------------------------------+
-| | CONTENT=[string] |
-+------------------+---------------------------------------------------------------+
-| OL | |
-+------------------+---------------------------------------------------------------+
-| P | ALIGN=[alignment] |
-+------------------+---------------------------------------------------------------+
-| PRE | |
-+------------------+---------------------------------------------------------------+
-| SAMP | |
-+------------------+---------------------------------------------------------------+
-| SMALL | |
-+------------------+---------------------------------------------------------------+
-| SPAN | |
-+------------------+---------------------------------------------------------------+
-| STRIKE | |
-+------------------+---------------------------------------------------------------+
-| STRONG | |
-+------------------+---------------------------------------------------------------+
-| SUB | |
-+------------------+---------------------------------------------------------------+
-| SUP | |
-+------------------+---------------------------------------------------------------+
-| TABLE | ALIGN=[alignment] |
-| +---------------------------------------------------------------+
-| | WIDTH=[percent|pixels] |
-| +---------------------------------------------------------------+
-| | BORDER=[pixels] |
-| +---------------------------------------------------------------+
-| | VALIGN=[v_alignment] |
-| +---------------------------------------------------------------+
-| | BGCOLOR=[color] |
-| +---------------------------------------------------------------+
-| | CELLSPACING=[pixels] |
-| +---------------------------------------------------------------+
-| | CELLPADDING=[pixels] |
-+------------------+---------------------------------------------------------------+
-| TD | ALIGN=[alignment] |
-| +---------------------------------------------------------------+
-| | VALIGN=[v_alignment] |
-| +---------------------------------------------------------------+
-| | BGCOLOR=[color] |
-| +---------------------------------------------------------------+
-| | WIDTH=[percent|pixels] |
-| +---------------------------------------------------------------+
-| | COLSPAN=[pixels] |
-| +---------------------------------------------------------------+
-| | ROWSPAN=[pixels] |
-| +---------------------------------------------------------------+
-| | NOWRAP |
-+------------------+---------------------------------------------------------------+
-| TH | ALIGN=[alignment] |
-| +---------------------------------------------------------------+
-| | VALIGN=[v_alignment] |
-| +---------------------------------------------------------------+
-| | BGCOLOR=[color] |
-| +---------------------------------------------------------------+
-| | WIDTH=[percent|pixels] |
-| +---------------------------------------------------------------+
-| | COLSPAN=[pixels] |
-| +---------------------------------------------------------------+
-| | ROWSPAN=[pixels] |
-+------------------+---------------------------------------------------------------+
-| TITLE | |
-+------------------+---------------------------------------------------------------+
-| TR | ALIGN=[alignment] |
-| +---------------------------------------------------------------+
-| | VALIGN=[v_alignment] |
-| +---------------------------------------------------------------+
-| | BGCOLOR=[color] |
-+------------------+---------------------------------------------------------------+
-| TT | |
-+------------------+---------------------------------------------------------------+
-| U | |
-+------------------+---------------------------------------------------------------+
-| UL | |
-+------------------+---------------------------------------------------------------+
-
-
-
-List of supported styles
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-:mod:`html` doesn't really have CSS support but it does support a few simple
-styles: you can use ``"text-align"``, ``"width"``, ``"vertical-align"`` and
-``"background"`` with all elements and for ``SPAN`` elements a few other
-styles are additionally recognized:
-
-- ``color``
-- ``font-family``
-- ``font-size`` (only in point units)
-- ``font-style`` (only "oblique", "italic" and "normal" values are supported)
-- ``font-weight`` (only "bold" and "normal" values are supported)
-- ``text-decoration`` (only "underline" value is supported)
-
+.. include:: headings.inc
+
+
+.. _html overview:
+
+==================================
+|phoenix_title| **HTML Overview**
+==================================
+
+
+The :mod:`html` library provides classes for parsing and displaying HTML.
+
+It is not intended to be a high-end HTML browser. If you are looking for
+something like that try http://www.mozilla.org/.
+
+:mod:`html` can be used as a generic rich text viewer - for example to display a
+nice About Box (like those of GNOME apps) or to display the result of
+database searching. There is a :class:`FileSystem` class which allows you to use
+your own virtual file systems.
+
+:class:`~html.HtmlWindow` supports tag handlers. This means that you can easily extend
+:mod:`html` library with new, unsupported tags. Not only that, you can even use
+your own application-specific tags!
+
+There is a generic :class:`~html.HtmlParser` class, independent of :class:`~html.HtmlWindow`.
+
+
+.. _html quick start:
+
+HTML quick start
+----------------
+
+
+Displaying HTML
+~~~~~~~~~~~~~~~~
+
+Class :class:`~html.HtmlWindow` (derived from :class:`ScrolledWindow`) is used to display
+HTML documents.
+
+It has two important methods: :meth:`~html.HtmlWindow.LoadPage` and
+:meth:`~html.HtmlWindow.SetPage`. LoadPage loads and displays HTML file while SetPage
+displays directly the passed **string**. See the example::
+
+ mywin.LoadPage("test.htm")
+ mywin.SetPage("htmlbody" \
+ "h1Error/h1" \
+ "Some error occurred :-H)" \
+ "/body/hmtl")
+
+
+
+Setting up HtmlWindow
+~~~~~~~~~~~~~~~~~~~~~~
+
+Because :class:`~html.HtmlWindow` is derived from :class:`ScrolledWindow` and not from
+:class:`Frame`, it doesn't have visible frame. But the user usually wants to see
+the title of HTML page displayed somewhere and the frame's titlebar is the
+ideal place for it.
+
+:class:`~html.HtmlWindow` provides 2 methods in order to handle this:
+:meth:`~html.HtmlWindow.SetRelatedFrame` and :meth:`~html.HtmlWindow.SetRelatedStatusBar`.
+See the example::
+
+ html = wx.html.HtmlWindow(self)
+ html.SetRelatedFrame(self, "HTML : %%s")
+ html.SetRelatedStatusBar(0)
+
+
+The first command associates the HTML object with its parent frame (this
+points to :class:`Frame` object there) and sets the format of the title. Page
+title "Hello, world!" will be displayed as "HTML : Hello, world!" in this
+example.
+
+The second command sets which frame's status bar should be used to display
+browser's messages (such as "Loading..." or "Done" or hypertext links).
+
+
+Customizing HtmlWindow
+~~~~~~~~~~~~~~~~~~~~~~~
+
+You can customize :class:`~html.HtmlWindow` by setting font size, font face and borders
+(space between border of window and displayed HTML). Related functions:
+
+- :meth:`~html.HtmlWindow.SetFonts`
+- :meth:`~html.HtmlWindow.SetBorders`
+- :meth:`~html.HtmlWindow.ReadCustomization`
+- :meth:`~html.HtmlWindow.WriteCustomization`
+
+The last two functions are used to store user customization info :class:`Config`
+stuff (for example in the registry under Windows, or in a dotfile under
+Unix).
+
+
+HTML Printing
+--------------
+
+The :mod:`html` library provides printing facilities with several levels of
+complexity. The easiest way to print an HTML document is to use the
+:class:`~html.HtmlEasyPrinting` class.
+
+It lets you print HTML documents with only one command and you don't have to
+worry about deriving from the :class:`Printout` class at all. It is only a simple
+wrapper around the :class:`~html.HtmlPrintout`, normal wxPython printout class.
+
+And finally there is the low level class :class:`~html.HtmlDCRenderer` which you can
+use to render HTML into a rectangular area on any DC.
+
+It supports rendering into multiple rectangles with the same width. (The most
+common use of this is placing one rectangle on each page or printing into two
+columns.)
+
+
+.. _help files format:
+
+Help Files Format
+------------------
+
+:mod:`html` library can be used to show an help manual to the user; in fact, it
+supports natively (through :class:`~html.HtmlHelpController`) a reduced version of MS
+HTML Workshop format.
+
+A **book** consists of three files: the header file, the contents file and
+the index file.
+
+You can make a regular zip archive of these files, plus the HTML and any
+image files, for HTML (or helpview) to read; and the ``".zip"`` file can
+optionally be renamed to ``".htb"``.
+
+
+Header file (.hhp)
+~~~~~~~~~~~~~~~~~~~
+
+.. highlight:: rst
+
+
+The header file must contain these lines (and may contain additional lines
+which are ignored)::
+
+ Contents file=filename.hhc
+ Index file=filename.hhk
+ Title=title of your book
+ Default topic=default page to be displayed.htm
+
+
+All filenames (including the Default topic) are relative to the location of
+the ``".hhp"`` file.
+
+.. note::
+
+ For localization, in addition the ``".hhp"`` file may contain the line::
+
+ Charset=rfc_charset
+
+ which specifies what charset (e.g. "iso8859_1") was used in contents and
+ index files. Please note that this line is incompatible with MS HTML Help
+ Workshop and it would either silently remove it or complain with some error.
+
+
+Contents file (.hhc)
+~~~~~~~~~~~~~~~~~~~~~
+
+.. highlight:: html
+
+
+Contents file has HTML syntax and it can be parsed by regular HTML parser. It
+contains exactly one list (```` statement)::
+
+
+
+
+You can modify value attributes of param tags. The *topic name* is name of
+chapter/topic as is displayed in contents, *filename.htm* is the HTML page
+name (relative to the ``".hhp"`` file) and *numeric_id* is optional - it is
+used only when you use :meth:`~html.HtmlHelpController.Display`.
+
+Items in the list may be nested - one ```` statement may contain a
+```` sub-statement::
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Index file (.hhk)
+~~~~~~~~~~~~~~~~~~
+
+Index files have same format as contents files except that ID params are
+ignored and sublists are **not** allowed.
+
+
+Input Filters
+--------------
+
+The :mod:`html` library provides a mechanism for reading and displaying files of
+many different file formats.
+
+:meth:`~html.HtmlWindow.LoadPage` can load not only HTML files but any known file. To
+make a file type known to :class:`~html.HtmlWindow` you must create a :class:`~html.HtmlFilter`
+filter and register it using :meth:`~html.HtmlWindow.AddFilter`.
+
+
+Cells and Containers
+---------------------
+
+This article describes mechanism used by :class:`~html.HtmlWinParser` and
+:class:`~html.HtmlWindow` to parse and display HTML documents.
+
+
+Cells
+~~~~~~
+
+You can divide any text (or HTML) into small fragments. Let's call these
+fragments **cells**. Cell is for example one word, horizontal line, image or
+any other part of document. Each cell has width and height (except special
+"magic" cells with zero dimensions - e.g. colour changers or font changers).
+See :class:`~html.HtmlCell`.
+
+
+Containers
+~~~~~~~~~~~
+
+Container is kind of cell that may contain sub-cells. Its size depends on
+number and sizes of its sub-cells (and also depends on width of window). See
+:class:`~html.HtmlContainerCell`, :meth:`~html.HtmlCell.Layout`. This image shows the cells and
+containers:
+
+.. image:: _static/images/overviews/overview_html_contbox.png
+ :alt: overview_html_contbox.png
+
+
+
+Using Containers in Tag Handler
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+:class:`~html.HtmlWinParser` provides a user-friendly way of managing containers. It is
+based on the idea of opening and closing containers.
+
+Use :meth:`~html.HtmlWinParser.OpenContainer` to open new a container *within* an
+already opened container. This new container is a *sub-container* of the old
+one. (If you want to create a new container with the same depth level you can
+call ``CloseContainer()``; ``OpenContainer()``; ).
+
+Use :meth:`~html.HtmlWinParser.CloseContainer` to close the container. This doesn't
+create a new container with same depth level but it returns "control" to the
+parent container. See explanation:
+
+.. image:: _static/images/overviews/overview_html_cont.png
+ :alt: overview_html_cont.png
+
+
+There clearly must be same number of calls to OpenContainer as to CloseContainer.
+
+
+Example
+::::::::
+
+.. highlight:: python
+
+
+This code creates a new paragraph (container at same depth level) with "Hello, world!"::
+
+ myParser.CloseContainer()
+ c = myParser.OpenContainer()
+
+ myParser.AddText("Hello, ")
+ myParser.AddText("world!")
+
+ myParser.CloseContainer()
+ myParser.OpenContainer()
+
+
+and here is image of the situation:
+
+.. image:: _static/images/overviews/overview_html_hello.png
+ :alt: overview_html_hello.png
+
+
+You can see that there was an opened container before the code was executed.
+We closed it, created our own container, then closed our container and opened
+new container.
+
+The result was that we had *same* depth level after executing. This is
+general rule that should be followed by tag handlers: leave depth level of
+containers unmodified (in other words, number of OpenContainer and
+CloseContainer calls should be same within :meth:`~html.HtmlTagHandler.HandleTag` 's
+body).
+
+.. note::
+
+ Notice that it would be usually better to use
+ :meth:`~html.HtmlContainerCell.InsertCell` instead of adding text to the parser
+ directly.
+
+
+Tag Handlers
+-------------
+
+The :mod:`html` library provides architecture of pluggable *tag* handlers. Tag
+handler is class that understands particular HTML tag (or tags) and is able
+to interpret it.
+
+:class:`~html.HtmlWinParser` has a static table of **modules**. Each module contains
+one or more tag handlers. Each time a new :class:`~html.HtmlWinParser` object is
+constructed all modules are scanned and handlers are added to HtmlParser's
+list of available handlers.
+
+
+How it works
+~~~~~~~~~~~~~
+
+Common tag handler's :meth:`~html.HtmlTagHandler.HandleTag` method works in four
+steps:
+
+- Save state of parent parser into local variables
+- Change parser state according to tag's params
+- Parse text between the tag and paired ending tag (if present)
+- Restore original parser state
+
+See :class:`~html.HtmlWinParser` for methods for modifying parser's state. In general
+you can do things like opening/closing containers, changing colors, fonts etc...
+
+
+Providing own tag handlers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+See the :mod:`lib.wxpTag` on how to provide your own tag handlers.
+
+
+Tag handlers
+~~~~~~~~~~~~~
+
+The handler is derived from :class:`~html.HtmlWinTagHandler` (or directly from
+:class:`~html.HtmlTagHandler`).
+
+
+Tags supported by :mod:`html`
+-----------------------------
+
+:mod:`html` is not a full implementation of HTML standard. Instead, it supports most
+common tags so that it is possible to display *simple* HTML documents with
+it. (For example it works fine with pages created in Netscape Composer or
+generated by tex2rtf).
+
+Following tables list all tags known to :mod:`html`, together with supported
+parameters.
+
+A tag has general form of ``tagname`` param_1 param_2 ... param_n where
+param_i is either ``paramname="paramvalue"`` or ``paramname=paramvalue`` -
+these two are equivalent. Unless stated otherwise, :mod:`html` is case-
+insensitive.
+
+
+Table of common parameter values
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We will use these substitutions in tags descriptions:
+
++------------------+---------------------------------------------------------------+
+| [alignment] | CENTER |
+| +---------------------------------------------------------------+
+| | LEFT |
+| +---------------------------------------------------------------+
+| | RIGHT |
+| +---------------------------------------------------------------+
+| | JUSTIFY |
++------------------+---------------------------------------------------------------+
+| [v_alignment] | TOP |
+| +---------------------------------------------------------------+
+| | BOTTOM |
+| +---------------------------------------------------------------+
+| | CENTER |
++------------------+---------------------------------------------------------------+
+| [color] | HTML 4.0-compliant colour specification |
++------------------+---------------------------------------------------------------+
+| [fontsize] | -2 |
+| +---------------------------------------------------------------+
+| | -1 |
+| +---------------------------------------------------------------+
+| | +0 |
+| +---------------------------------------------------------------+
+| | +1 |
+| +---------------------------------------------------------------+
+| | +2 |
+| +---------------------------------------------------------------+
+| | +3 |
+| +---------------------------------------------------------------+
+| | +4 |
+| +---------------------------------------------------------------+
+| | 1 |
+| +---------------------------------------------------------------+
+| | 2 |
+| +---------------------------------------------------------------+
+| | 3 |
+| +---------------------------------------------------------------+
+| | 4 |
+| +---------------------------------------------------------------+
+| | 5 |
+| +---------------------------------------------------------------+
+| | 6 |
+| +---------------------------------------------------------------+
+| | 7 |
++------------------+---------------------------------------------------------------+
+| [pixels] | integer value that represents dimension in pixels |
++------------------+---------------------------------------------------------------+
+| [percent] | i% |
+| +---------------------------------------------------------------+
+| | where i is integer |
++------------------+---------------------------------------------------------------+
+| [url] | an URL |
++------------------+---------------------------------------------------------------+
+| [string] | text string |
++------------------+---------------------------------------------------------------+
+| [coords] | c(1),c(2),c(3),...,c(n) |
+| +---------------------------------------------------------------+
+| | where c(i) is integer |
++------------------+---------------------------------------------------------------+
+
+
+
+List of supported tags
+~~~~~~~~~~~~~~~~~~~~~~~
+
++------------------+---------------------------------------------------------------+
+| A | NAME=[string] |
+| +---------------------------------------------------------------+
+| | HREF=[url] |
+| +---------------------------------------------------------------+
+| | TARGET=[target window spec] |
++------------------+---------------------------------------------------------------+
+| ADDRESS | |
++------------------+---------------------------------------------------------------+
+| AREA | SHAPE=POLY |
+| +---------------------------------------------------------------+
+| | SHAPE=CIRCLE |
+| +---------------------------------------------------------------+
+| | SHAPE=RECT |
+| +---------------------------------------------------------------+
+| | COORDS=[coords] |
+| +---------------------------------------------------------------+
+| | HREF=[url] |
++------------------+---------------------------------------------------------------+
+| BIG | |
++------------------+---------------------------------------------------------------+
+| BLOCKQUOTE | |
++------------------+---------------------------------------------------------------+
+| BODY | TEXT=[color] |
+| +---------------------------------------------------------------+
+| | LINK=[color] |
+| +---------------------------------------------------------------+
+| | BGCOLOR=[color] |
++------------------+---------------------------------------------------------------+
+| BR | ALIGN=[alignment] |
++------------------+---------------------------------------------------------------+
+| CENTER | |
++------------------+---------------------------------------------------------------+
+| CITE | |
++------------------+---------------------------------------------------------------+
+| CODE | |
++------------------+---------------------------------------------------------------+
+| DD | |
++------------------+---------------------------------------------------------------+
+| DIV | ALIGN=[alignment] |
++------------------+---------------------------------------------------------------+
+| DL | |
++------------------+---------------------------------------------------------------+
+| DT | |
++------------------+---------------------------------------------------------------+
+| EM | |
++------------------+---------------------------------------------------------------+
+| FONT | COLOR=[color] |
+| +---------------------------------------------------------------+
+| | SIZE=[fontsize] |
+| +---------------------------------------------------------------+
+| | FACE=[comma-separated list of facenames] |
++------------------+---------------------------------------------------------------+
+| HR | ALIGN=[alignment] |
+| +---------------------------------------------------------------+
+| | SIZE=[pixels] |
+| +---------------------------------------------------------------+
+| | WIDTH=[percent|pixels] |
+| +---------------------------------------------------------------+
+| | NOSHADE |
++------------------+---------------------------------------------------------------+
+| H1 | |
++------------------+---------------------------------------------------------------+
+| H2 | |
++------------------+---------------------------------------------------------------+
+| H3 | |
++------------------+---------------------------------------------------------------+
+| H4 | |
++------------------+---------------------------------------------------------------+
+| H5 | |
++------------------+---------------------------------------------------------------+
+| H6 | |
++------------------+---------------------------------------------------------------+
+| I | |
++------------------+---------------------------------------------------------------+
+| IMG | SRC=[url] |
+| +---------------------------------------------------------------+
+| | WIDTH=[percent|pixels] |
+| +---------------------------------------------------------------+
+| | HEIGHT=[pixels] |
+| +---------------------------------------------------------------+
+| | ALIGN=TEXTTOP |
+| +---------------------------------------------------------------+
+| | ALIGN=CENTER |
+| +---------------------------------------------------------------+
+| | ALIGN=ABSCENTER |
+| +---------------------------------------------------------------+
+| | ALIGN=BOTTOM |
+| +---------------------------------------------------------------+
+| | USEMAP=[url] |
++------------------+---------------------------------------------------------------+
+| KBD | |
++------------------+---------------------------------------------------------------+
+| LI | |
++------------------+---------------------------------------------------------------+
+| MAP | NAME=[string] |
++------------------+---------------------------------------------------------------+
+| META | HTTP-EQUIV="Content-Type" |
+| +---------------------------------------------------------------+
+| | CONTENT=[string] |
++------------------+---------------------------------------------------------------+
+| OL | |
++------------------+---------------------------------------------------------------+
+| P | ALIGN=[alignment] |
++------------------+---------------------------------------------------------------+
+| PRE | |
++------------------+---------------------------------------------------------------+
+| SAMP | |
++------------------+---------------------------------------------------------------+
+| SMALL | |
++------------------+---------------------------------------------------------------+
+| SPAN | |
++------------------+---------------------------------------------------------------+
+| STRIKE | |
++------------------+---------------------------------------------------------------+
+| STRONG | |
++------------------+---------------------------------------------------------------+
+| SUB | |
++------------------+---------------------------------------------------------------+
+| SUP | |
++------------------+---------------------------------------------------------------+
+| TABLE | ALIGN=[alignment] |
+| +---------------------------------------------------------------+
+| | WIDTH=[percent|pixels] |
+| +---------------------------------------------------------------+
+| | BORDER=[pixels] |
+| +---------------------------------------------------------------+
+| | VALIGN=[v_alignment] |
+| +---------------------------------------------------------------+
+| | BGCOLOR=[color] |
+| +---------------------------------------------------------------+
+| | CELLSPACING=[pixels] |
+| +---------------------------------------------------------------+
+| | CELLPADDING=[pixels] |
++------------------+---------------------------------------------------------------+
+| TD | ALIGN=[alignment] |
+| +---------------------------------------------------------------+
+| | VALIGN=[v_alignment] |
+| +---------------------------------------------------------------+
+| | BGCOLOR=[color] |
+| +---------------------------------------------------------------+
+| | WIDTH=[percent|pixels] |
+| +---------------------------------------------------------------+
+| | COLSPAN=[pixels] |
+| +---------------------------------------------------------------+
+| | ROWSPAN=[pixels] |
+| +---------------------------------------------------------------+
+| | NOWRAP |
++------------------+---------------------------------------------------------------+
+| TH | ALIGN=[alignment] |
+| +---------------------------------------------------------------+
+| | VALIGN=[v_alignment] |
+| +---------------------------------------------------------------+
+| | BGCOLOR=[color] |
+| +---------------------------------------------------------------+
+| | WIDTH=[percent|pixels] |
+| +---------------------------------------------------------------+
+| | COLSPAN=[pixels] |
+| +---------------------------------------------------------------+
+| | ROWSPAN=[pixels] |
++------------------+---------------------------------------------------------------+
+| TITLE | |
++------------------+---------------------------------------------------------------+
+| TR | ALIGN=[alignment] |
+| +---------------------------------------------------------------+
+| | VALIGN=[v_alignment] |
+| +---------------------------------------------------------------+
+| | BGCOLOR=[color] |
++------------------+---------------------------------------------------------------+
+| TT | |
++------------------+---------------------------------------------------------------+
+| U | |
++------------------+---------------------------------------------------------------+
+| UL | |
++------------------+---------------------------------------------------------------+
+
+
+
+List of supported styles
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+:mod:`html` doesn't really have CSS support but it does support a few simple
+styles: you can use ``"text-align"``, ``"width"``, ``"vertical-align"`` and
+``"background"`` with all elements and for ``SPAN`` elements a few other
+styles are additionally recognized:
+
+- ``color``
+- ``font-family``
+- ``font-size`` (only in point units)
+- ``font-style`` (only "oblique", "italic" and "normal" values are supported)
+- ``font-weight`` (only "bold" and "normal" values are supported)
+- ``text-decoration`` (only "underline" value is supported)
+
diff --git a/docs/sphinx/rest_substitutions/overviews/index.rst b/docs/sphinx/rest_substitutions/overviews/index.rst
index f1600729..3ad72963 100644
--- a/docs/sphinx/rest_substitutions/overviews/index.rst
+++ b/docs/sphinx/rest_substitutions/overviews/index.rst
@@ -1,186 +1,186 @@
-.. wxPython (Phoenix) documentation master file, created by
- sphinx-quickstart on Fri Dec 09 11:27:02 2011.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
-
-==============================================
-Welcome to wxPython (Phoenix)'s documentation!
-==============================================
-
-
-wxPython
-========
-
-wxPython is a **GUI toolkit** for the `Python `_ programming language. It allows Python programmers to
-create programs with a robust, highly functional graphical user interface, simply and easily.
-
-.. figure:: _static/images/sphinxdocs/central_bar.png
- :align: center
-
-
-|
-
-What is wxPython
-----------------
-
-wxPython is a **GUI toolkit** for the `Python `_ programming language. It allows Python programmers to
-create programs with a robust, highly functional graphical user interface, simply and easily.
-It is implemented as a Python extension module (native code) that wraps the popular `wxWidgets `_ cross
-platform GUI library, which is written in C++.
-
-Like Python and wxWidgets, wxPython is *Open Source* which means that it is free for anyone to use and
-the source code is available for anyone to look at and modify. Or anyone can contribute fixes or
-enhancements to the project.
-
-wxPython is a *cross-platform* toolkit. This means that the same program will run on multiple platforms
-without modification. Currently supported platforms are 32-bit Microsoft Windows, most Unix or unix-like
-systems, and Macintosh OS X+, in most cases the native widgets are used on each platform.
-
-Since the language is Python, wxPython programs are **simple, easy** to write and easy to understand.
-
-As an example, this is a simple "Hello World" program with wxPython::
-
- import wx
-
- app = wx.App()
-
- frame = wx.Frame(None, -1, "Hello World")
- frame.Show()
-
- app.MainLoop()
-
-
-The GUI layouts you can build with wxPython are almost infinite: it has an extremely rich set of widgets (derived from `wxWidgets`) and
-greatly extended by a huge set of pure-Python controls written over the years.
-
-
-Prerequisites
--------------
-
-Like any other complex piece of software, wxPython requires other software in order to function properly.
-Obviously you'll need `Python `_ itself, but if you're reading this you've probably already got
-Python and are just here looking for the `best GUI toolkit `_ available for Python.
-Check out the details for your platform of choice here:
-
-Win32
-^^^^^
-
-* If you have a modern up to date version of Windows and use the binary installer for wxPython found below, you probably
- don't need anything else.
-
-* If your tree controls have strange background colors, try loading this `MS Common Controls Update `_
- as wxWidgets does something that causes a bug in one of the older versions to manifest itself. Another way to get this update
- is to install Internet Explorer or MS Office apps, so if the system has those already then you probably don't need to worry about this.
-
-* wxPython's `wx.glcanvas.GLCanvas` class only provides the GL Context and a wx.Window to put it in, so if you want to use
- the wxGLCanvas you will also need the `PyOpenGL `_ Python extension modules as well.
-
-
-Linux/Unix/Etc.
-^^^^^^^^^^^^^^^
-
-* The first thing you'll need are the `glib and gtk+ `_ libraries. Before you run off and download the sources
- check your system, you probably already have it. Most distributions of Linux come with it and you'll start seeing it on many
- other systems too now that Sun and others have chosen GNOME as the desktop of choice. If you don't have glib and gtk+ already,
- you can get the sources `here `_. Build and install them following the directions included.
-
-* In order to use the wxGLCanvas you'll need to have either OpenGL or the `Mesa3D `_ library on your system.
- wxPython's `wx.glcanvas.GLCanvas` only provides the GL Context and a :class:`Window` to put it in, so you will also need the PyOpenGL
- Python extension modules as well, if you want to use OpenGL.
-
- If you are building wxPython yourself and don't care to use OpenGL/Mesa then you can easily skip building it and can ignore
- this step. See the `build instructions `_ for details.
-
-
-Mac OS X
-^^^^^^^^
-
-The wxPython binaries for OSX are mountable disk images. Simply double click to mount the image and then run the installer application
-in the image. Download the image that matches the version of Python that you want to use it with, and unless you know for sure that you
-need the ansi build please get the Unicode build.
-
-These binaries should work on all versions of OSX from 10.3.9 onwards on either PPC or i386 architectures. Since they use the Carbon API
- they are limited to running in 32-bit mode.
-
-
-OK, I'm interested. What do I do next?
---------------------------------------
-
-You can download the `Prebuild binary of wxPython
-`_ which includes
-the source code for wxPython.
-
-Prebuilt binaries are available for Microsoft Windows, Linux and Mac OS X.
-
-Don't forget to download the wxPython demo and the documentation!
-
-
-Bleeding-edge source
---------------------
-
-If you are a very keen developer, you can access the SVN repository directly for this
-project in the `wxWidgets SVN `_.
-
-
-
-wxPython Documentation
-----------------------
-
-The new wxPython API documentation is available `in this page `_.
-
-
-.. toctree::
- :maxdepth: 2
- :hidden:
- :glob:
-
- MigrationGuide
- TODO
- DocstringsGuidelines
- functions
- 1classindex
- app_overview
- bitmap_overview
- bookctrl_overview
- common_dialogs_overview
- config_overview
- datetime_overview
- dc_overview
- dialog_overview
- dnd_overview
- events_overview
- filesystem_overview
- font_encodings
- font_overview
- html_overview
- internationalization
- writing_non_english_applications
- listctrl_overview
- log_classes_overview
- printing_framework_overview
- refcount_overview
- scrolling_overview
- sizers_overview
- splitterwindow_overview
- standard_event_identifiers
- stock_items
- toolbar_overview
- treectrl_overview
- validator_overview
- window_deletion_overview
- window_ids_overview
- window_sizing_overview
- window_styles_overview
- dataview.1classindex
- lib
- py
- tools
-
-
-Indices and tables
-==================
-
-* `genindex`
-* `modindex`
-* `search`
-
+.. wxPython (Phoenix) documentation master file, created by
+ sphinx-quickstart on Fri Dec 09 11:27:02 2011.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+==============================================
+Welcome to wxPython (Phoenix)'s documentation!
+==============================================
+
+
+wxPython
+========
+
+wxPython is a **GUI toolkit** for the `Python `_ programming language. It allows Python programmers to
+create programs with a robust, highly functional graphical user interface, simply and easily.
+
+.. figure:: _static/images/sphinxdocs/central_bar.png
+ :align: center
+
+
+|
+
+What is wxPython
+----------------
+
+wxPython is a **GUI toolkit** for the `Python `_ programming language. It allows Python programmers to
+create programs with a robust, highly functional graphical user interface, simply and easily.
+It is implemented as a Python extension module (native code) that wraps the popular `wxWidgets `_ cross
+platform GUI library, which is written in C++.
+
+Like Python and wxWidgets, wxPython is *Open Source* which means that it is free for anyone to use and
+the source code is available for anyone to look at and modify. Or anyone can contribute fixes or
+enhancements to the project.
+
+wxPython is a *cross-platform* toolkit. This means that the same program will run on multiple platforms
+without modification. Currently supported platforms are 32-bit Microsoft Windows, most Unix or unix-like
+systems, and Macintosh OS X+, in most cases the native widgets are used on each platform.
+
+Since the language is Python, wxPython programs are **simple, easy** to write and easy to understand.
+
+As an example, this is a simple "Hello World" program with wxPython::
+
+ import wx
+
+ app = wx.App()
+
+ frame = wx.Frame(None, -1, "Hello World")
+ frame.Show()
+
+ app.MainLoop()
+
+
+The GUI layouts you can build with wxPython are almost infinite: it has an extremely rich set of widgets (derived from `wxWidgets`) and
+greatly extended by a huge set of pure-Python controls written over the years.
+
+
+Prerequisites
+-------------
+
+Like any other complex piece of software, wxPython requires other software in order to function properly.
+Obviously you'll need `Python `_ itself, but if you're reading this you've probably already got
+Python and are just here looking for the `best GUI toolkit `_ available for Python.
+Check out the details for your platform of choice here:
+
+Win32
+^^^^^
+
+* If you have a modern up to date version of Windows and use the binary installer for wxPython found below, you probably
+ don't need anything else.
+
+* If your tree controls have strange background colors, try loading this `MS Common Controls Update `_
+ as wxWidgets does something that causes a bug in one of the older versions to manifest itself. Another way to get this update
+ is to install Internet Explorer or MS Office apps, so if the system has those already then you probably don't need to worry about this.
+
+* wxPython's `wx.glcanvas.GLCanvas` class only provides the GL Context and a wx.Window to put it in, so if you want to use
+ the wxGLCanvas you will also need the `PyOpenGL `_ Python extension modules as well.
+
+
+Linux/Unix/Etc.
+^^^^^^^^^^^^^^^
+
+* The first thing you'll need are the `glib and gtk+ `_ libraries. Before you run off and download the sources
+ check your system, you probably already have it. Most distributions of Linux come with it and you'll start seeing it on many
+ other systems too now that Sun and others have chosen GNOME as the desktop of choice. If you don't have glib and gtk+ already,
+ you can get the sources `here `_. Build and install them following the directions included.
+
+* In order to use the wxGLCanvas you'll need to have either OpenGL or the `Mesa3D `_ library on your system.
+ wxPython's `wx.glcanvas.GLCanvas` only provides the GL Context and a :class:`Window` to put it in, so you will also need the PyOpenGL
+ Python extension modules as well, if you want to use OpenGL.
+
+ If you are building wxPython yourself and don't care to use OpenGL/Mesa then you can easily skip building it and can ignore
+ this step. See the `build instructions `_ for details.
+
+
+Mac OS X
+^^^^^^^^
+
+The wxPython binaries for OSX are mountable disk images. Simply double click to mount the image and then run the installer application
+in the image. Download the image that matches the version of Python that you want to use it with, and unless you know for sure that you
+need the ansi build please get the Unicode build.
+
+These binaries should work on all versions of OSX from 10.3.9 onwards on either PPC or i386 architectures. Since they use the Carbon API
+ they are limited to running in 32-bit mode.
+
+
+OK, I'm interested. What do I do next?
+--------------------------------------
+
+You can download the `Prebuild binary of wxPython
+`_ which includes
+the source code for wxPython.
+
+Prebuilt binaries are available for Microsoft Windows, Linux and Mac OS X.
+
+Don't forget to download the wxPython demo and the documentation!
+
+
+Bleeding-edge source
+--------------------
+
+If you are a very keen developer, you can access the SVN repository directly for this
+project in the `wxWidgets SVN `_.
+
+
+
+wxPython Documentation
+----------------------
+
+The new wxPython API documentation is available `in this page `_.
+
+
+.. toctree::
+ :maxdepth: 2
+ :hidden:
+ :glob:
+
+ MigrationGuide
+ TODO
+ DocstringsGuidelines
+ functions
+ 1classindex
+ app_overview
+ bitmap_overview
+ bookctrl_overview
+ common_dialogs_overview
+ config_overview
+ datetime_overview
+ dc_overview
+ dialog_overview
+ dnd_overview
+ events_overview
+ filesystem_overview
+ font_encodings
+ font_overview
+ html_overview
+ internationalization
+ writing_non_english_applications
+ listctrl_overview
+ log_classes_overview
+ printing_framework_overview
+ refcount_overview
+ scrolling_overview
+ sizers_overview
+ splitterwindow_overview
+ standard_event_identifiers
+ stock_items
+ toolbar_overview
+ treectrl_overview
+ validator_overview
+ window_deletion_overview
+ window_ids_overview
+ window_sizing_overview
+ window_styles_overview
+ dataview.1classindex
+ lib
+ py
+ tools
+
+
+Indices and tables
+==================
+
+* `genindex`
+* `modindex`
+* `search`
+
diff --git a/docs/sphinx/rest_substitutions/overviews/internationalization.rst b/docs/sphinx/rest_substitutions/overviews/internationalization.rst
index 06659976..eec7cfb2 100644
--- a/docs/sphinx/rest_substitutions/overviews/internationalization.rst
+++ b/docs/sphinx/rest_substitutions/overviews/internationalization.rst
@@ -1,122 +1,122 @@
-.. include:: headings.inc
-
-
-.. _internationalization:
-.. _I18N:
-.. _localization:
-.. _L10N:
-
-
-==================================================
-|phoenix_title| **Internationalization Overview**
-==================================================
-
-"Internationalization" (often referred to as i18n) is the process to change an
-application so that all user visible texts are translated to the user selected
-language and that things like dates, money amounts and numbers in general are
-shown in a format the user is familiar with/or used to.
-
-The easiest way to show what is needed is by using a little code sample.
-
-
-Text translation
-================
-
-Prepare the source code
------------------------
-
-Text translation in Python is done using gettext [1]_ , to ensure that all
-wxPython labels are also translated we will use :class:`Locale` and
-:func:`GetTranslation` .
-
-How to prepare your source code to enable translation of texts::
-
- aString = _(u"This is a string which will be translated")
-
-
-As you can see it is very simple, you just enclose the text with the translation
-function "_()", obviously there is a bit more to it, see below.
-
-Enabling I18N for a whole application you would do some setup in the application
-file along the following lines:
-
-.. literalinclude:: _downloads/i18nwxapp/app_base.py
- :lines: 25-27
-
-
-Here we setup the "_" translation function and making it available application
-by adding it to builtin.
-
-The code required to change to a different language is as follows:
-
-.. literalinclude:: _downloads/i18nwxapp/app_base.py
- :pyobject: BaseApp.updateLanguage
-
-
-Do the actual translation work
-------------------------------
-
-You need to extract all the text strings marked by the "_" function, a little
-script `geni18n.py` is in the :download:`downloadable zip file <_downloads/i18nwxapp/i18nwxapp.zip>`,
-it will extract all the strings and generate a ``.pot`` file, which is put to
-the locale folder. The `geni18n.py` script will also generate the ``.mo`` files
-for defined languages.
-
-The ``.pot`` file is then provided to the translators and they use it to
-generate a ``.po`` file for the language they translate too or they can also use
-the ``.pot`` file to merge new/changed text strings to an existing ``.po`` file.
-
-To do the actual translation we recomment `poEdit` [2]_ , it allows you to
-create or update a translation catalog (``.po`` file) from the ``.pot`` file.
-
-
-Sample application
-------------------
-
-In the :download:`downloadable zip file <_downloads/i18nwxapp/i18nwxapp.zip>`
-we included a small sample application showing the above in action.
-
-- `app_base.py` contains the initialization code
-- `sampleapp.py` is the main frame/application, just run this to see things in action
-- `geni18n.py` is the script to generate the ``.pot`` file and it also generates the ``.mo`` files.
-
-.. note::
- The application has a button which displays a file dialog, as wxPython uses
- a native widget for this the text are shown in the operating system language
- and not the language which is selected in `app_base.py`.
-
-
-Localization overview
-=====================
-
-"Localization", often referred to as "L10n", is the process to adapt the display
-of dates and numbers to local custom.
-
-E.g. "4/5/2012" would for an American mean April 5. 2012, but for most Europeans
-it would be 4. May 2012.
-
-
-Localize dates
-==============
-
-.. todo:: to be written
-
-
-Localize numbers
-================
-
-.. todo:: to be written
-
-
-Additional resources
-====================
-
-- http://zetcode.com/wxpython/in18/
-- http://wiki.wxpython.org/Internationalization
-- http://en.wikipedia.org/wiki/Internationalization_and_localization
-
-
-.. rubric:: Footnotes
-
-.. [1] gettext - http://docs.python.org/library/gettext.html
+.. include:: headings.inc
+
+
+.. _internationalization:
+.. _I18N:
+.. _localization:
+.. _L10N:
+
+
+==================================================
+|phoenix_title| **Internationalization Overview**
+==================================================
+
+"Internationalization" (often referred to as i18n) is the process to change an
+application so that all user visible texts are translated to the user selected
+language and that things like dates, money amounts and numbers in general are
+shown in a format the user is familiar with/or used to.
+
+The easiest way to show what is needed is by using a little code sample.
+
+
+Text translation
+================
+
+Prepare the source code
+-----------------------
+
+Text translation in Python is done using gettext [1]_ , to ensure that all
+wxPython labels are also translated we will use :class:`Locale` and
+:func:`GetTranslation` .
+
+How to prepare your source code to enable translation of texts::
+
+ aString = _(u"This is a string which will be translated")
+
+
+As you can see it is very simple, you just enclose the text with the translation
+function "_()", obviously there is a bit more to it, see below.
+
+Enabling I18N for a whole application you would do some setup in the application
+file along the following lines:
+
+.. literalinclude:: _downloads/i18nwxapp/app_base.py
+ :lines: 25-27
+
+
+Here we setup the "_" translation function and making it available application
+by adding it to builtin.
+
+The code required to change to a different language is as follows:
+
+.. literalinclude:: _downloads/i18nwxapp/app_base.py
+ :pyobject: BaseApp.updateLanguage
+
+
+Do the actual translation work
+------------------------------
+
+You need to extract all the text strings marked by the "_" function, a little
+script `geni18n.py` is in the :download:`downloadable zip file <_downloads/i18nwxapp/i18nwxapp.zip>`,
+it will extract all the strings and generate a ``.pot`` file, which is put to
+the locale folder. The `geni18n.py` script will also generate the ``.mo`` files
+for defined languages.
+
+The ``.pot`` file is then provided to the translators and they use it to
+generate a ``.po`` file for the language they translate too or they can also use
+the ``.pot`` file to merge new/changed text strings to an existing ``.po`` file.
+
+To do the actual translation we recomment `poEdit` [2]_ , it allows you to
+create or update a translation catalog (``.po`` file) from the ``.pot`` file.
+
+
+Sample application
+------------------
+
+In the :download:`downloadable zip file <_downloads/i18nwxapp/i18nwxapp.zip>`
+we included a small sample application showing the above in action.
+
+- `app_base.py` contains the initialization code
+- `sampleapp.py` is the main frame/application, just run this to see things in action
+- `geni18n.py` is the script to generate the ``.pot`` file and it also generates the ``.mo`` files.
+
+.. note::
+ The application has a button which displays a file dialog, as wxPython uses
+ a native widget for this the text are shown in the operating system language
+ and not the language which is selected in `app_base.py`.
+
+
+Localization overview
+=====================
+
+"Localization", often referred to as "L10n", is the process to adapt the display
+of dates and numbers to local custom.
+
+E.g. "4/5/2012" would for an American mean April 5. 2012, but for most Europeans
+it would be 4. May 2012.
+
+
+Localize dates
+==============
+
+.. todo:: to be written
+
+
+Localize numbers
+================
+
+.. todo:: to be written
+
+
+Additional resources
+====================
+
+- http://zetcode.com/wxpython/in18/
+- http://wiki.wxpython.org/Internationalization
+- http://en.wikipedia.org/wiki/Internationalization_and_localization
+
+
+.. rubric:: Footnotes
+
+.. [1] gettext - http://docs.python.org/library/gettext.html
.. [2] poEdit - http://www.poedit.net/
\ No newline at end of file
diff --git a/docs/sphinx/rest_substitutions/overviews/listctrl_overview.rst b/docs/sphinx/rest_substitutions/overviews/listctrl_overview.rst
index 5afac1b9..c4aaa1eb 100644
--- a/docs/sphinx/rest_substitutions/overviews/listctrl_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/listctrl_overview.rst
@@ -1,14 +1,14 @@
-.. include:: headings.inc
-
-
-.. _listctrl overview:
-
-===============================================
-|phoenix_title| **ListCtrl Overview**
-===============================================
-
-.. todo:: Write this section.
-
-
-
-
+.. include:: headings.inc
+
+
+.. _listctrl overview:
+
+===============================================
+|phoenix_title| **ListCtrl Overview**
+===============================================
+
+.. todo:: Write this section.
+
+
+
+
diff --git a/docs/sphinx/rest_substitutions/overviews/log_classes_overview.rst b/docs/sphinx/rest_substitutions/overviews/log_classes_overview.rst
index 219dc56e..28c11d86 100644
--- a/docs/sphinx/rest_substitutions/overviews/log_classes_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/log_classes_overview.rst
@@ -1,229 +1,229 @@
-.. include:: headings.inc
-
-
-.. _log classes overview:
-
-===============================================
-|phoenix_title| **Log Classes Overview**
-===============================================
-
-
-Introduction
-------------
-
-This is a general overview of logging classes provided by wxPython. The word logging here has a broad sense, including all
-of the program output, not only non-interactive messages. The logging facilities included in wxPython provide the base :ref:`Log`
-class which defines the standard interface for a log target as well as several standard implementations of it and a family of
-functions to use with them.
-
-First of all, no knowledge of :ref:`Log` classes is needed to use them. For this, you should only know about :func:`LogDebug`,
-:func:`LogError`, :func:`LogMessage` and similar functions. All of them have the same syntax as the Python
-`logging `_ module.
-
-Here are all of them:
-
-- :func:`LogFatalError` which is like :func:`LogError`, but also terminates the program with the exit code 3 (using `abort()`
- standard function). Unlike for all the other logging functions, this function can't be overridden by a log target.
-- :func:`LogError` is the function to use for error messages, i.e. the messages that must be shown to the user.
- The default processing is to pop up a message box to inform the user about it.
-- :func:`LogWarning` for warnings. They are also normally shown to the user, but don't interrupt the program work.
-- :func:`LogMessage` is for all normal, informational messages. They also appear in a message box by default (but it can be changed, see below).
-- :func:`LogVerbose` is for verbose output. Normally, it is suppressed, but might be activated if the user wishes to know
- more details about the program progress (another, but possibly confusing name for the same function is :func:`LogInfo`).
-- :func:`LogStatus` is for status messages. They will go into the status bar of the active or specified (as the first argument)
- :ref:`Frame` if it has one.
-- :func:`LogSysError` is mostly used by wxPython itself, but might be handy for logging errors after system call (API function)
- failure. It logs the specified message text as well as the last system error code (`errno` or Windows' `GetLastError()` depending
- on the platform) and the corresponding error message. The second form of this function takes the error code explicitly as the first argument.
-- :func:`LogDebug` is the right function for debug output. It only does anything at all in the debug mode (when the preprocessor
- symbol ``__WXDEBUG__`` is defined) and expands to nothing in release mode (otherwise). Note that under Windows, you must either run
- the program under debugger or use a 3rd party program such as **DebugView** (http://www.microsoft.com/technet/sysinternals/Miscellaneous/DebugView.mspx)
- to actually see the debug output.
-- :func:`LogTrace` as :func:`LogDebug` only does something in debug build. The reason for making it a separate function from it is
- that usually there are a lot of trace messages, so it might make sense to separate them from other debug messages which would be
- flooded in them. Moreover, the second version of this function takes a trace mask as the first argument which allows to further
- restrict the amount of messages generated.
-
-
-The usage of these functions should be fairly straightforward, however it may be asked why not use the other logging facilities,
-such as the Python `logging `_ module. The short answer is that they're all very
-good generic mechanisms, but are not really adapted for wxPython, while the log classes are.
-
-Some of advantages in using wxPython log functions are:
-
-- Portability
-- Flexibility: The output of :ref:`Log` functions can be redirected or suppressed entirely based on their importance, which is
- either impossible or difficult to do with traditional methods. For example, only error messages, or only error messages and
- warnings might be logged, filtering out all informational messages.
-- Completeness: Usually, an error message should be presented to the user when some operation fails. Let's take a quite simple but
- common case of a file error: suppose that you're writing your data file on disk and there is not enough space. The actual error
- might have been detected inside wxPython code, so the calling function doesn't really know the exact reason of the failure,
- it only knows that the data file couldn't be written to the disk. However, as wxPython uses :func:`LogError` in this situation,
- the exact error code (and the corresponding error message) will be given to the user together with "high level" message about
- data file writing error.
-
-
-
-.. _log messages selection:
-
-Log Messages Selection
-----------------------
-
-By default, most log messages are enabled. In particular, this means that errors logged by wxPython code itself (e.g. when it fails
-to perform some operation) will be processed and shown to the user. To disable the logging entirely you can use :meth:`Log.EnableLogging`
-method or, more usually, :ref:`LogNull` class which temporarily disables logging and restores it back to the original setting when it is destroyed.
-
-To limit logging to important messages only, you may use :meth:`Log.SetLogLevel` with e.g. ``LOG_Warning`` value -- this will completely
-disable all logging messages with the severity less than warnings, so :func:`LogMessage` output won't be shown to the user any more.
-
-Moreover, the log level can be set separately for different log components. Before showing how this can be useful, let us explain what
-log components are: they are simply arbitrary strings identifying the component, or module, which generated the message. They are hierarchical
-in the sense that "foo/bar/baz" component is supposed to be a child of "foo". And all components are children of the unnamed root component.
-
-By default, all messages logged by wxPython originate from "wx" component or one of its subcomponents such as "wx/net/ftp", while the
-messages logged by your own code are assigned empty log component. To change this, you need to define ``LOG_COMPONENT`` to a string uniquely
-identifying each component, e.g. you could give it the value "MyProgram" by default and re-define it as "MyProgram/DB" in the module
-working with the database and "MyProgram/DB/Trans" in its part managing the transactions. Then you could use :meth:`Log.SetComponentLevel`
-in the following ways::
-
- # Disable all database error messages, everybody knows databases never
- # fail anyhow
- wx.Log.SetComponentLevel("MyProgram/DB", wx.LOG_FatalError)
-
- # but enable tracing for the transactions as somehow our changes don't
- # get committed sometimes
- wx.Log.SetComponentLevel("MyProgram/DB/Trans", wx.LOG_Trace)
-
- # also enable tracing messages from wxPython dynamic module loading
- # mechanism
- wx.Log.SetComponentLevel("wx/base/module", wx.LOG_Trace)
-
-
-
-Notice that the log level set explicitly for the transactions code overrides the log level of the parent component but that all other database
-code subcomponents inherit its setting by default and so won't generate any log messages at all.
-
-
-
-.. _log targets:
-
-Log Targets
------------
-
-After having enumerated all the functions which are normally used to log the messages, and why would you want to use them, we now
-describe how all this works.
-
-wxPython has the notion of a `log target`: it is just a class deriving from :ref:`Log`. As such, it implements the virtual functions
-of the base class which are called when a message is logged. Only one log target is active at any moment, this is the one used by
-`LogXXX` functions. The normal usage of a log object (i.e. object of a class derived from :ref:`Log`) is to install it as the active
-target with a call to `SetActiveTarget()` and it will be used automatically by all subsequent calls to `LogXXX` functions.
-
-To create a new log target class you only need to derive it from :ref:`Log` and override one or several of :meth:`Log.DoLogRecord`,
-:meth:`Log.DoLogTextAtLevel` and :meth:`Log.DoLogText` in it. The first one is the most flexible and allows you to change the formatting
-of the messages, dynamically filter and redirect them and so on -- all log messages, except for those generated by :func:`LogFatalError`,
-pass by this function. :meth:`Log.DoLogTextAtLevel` should be overridden if you simply want to redirect the log messages somewhere else,
-without changing their formatting. Finally, it is enough to override :meth:`Log.DoLogText` if you only want to redirect the log
-messages and the destination doesn't depend on the message log level.
-
-There are some predefined classes deriving from :ref:`Log` and which might be helpful to see how you can create a new log target
-class and, of course, may also be used without any change. There are:
-
-- :ref:`LogStderr`: This class logs messages to a ``FILE *``, using stderr by default as its name suggests.
-- `LogStream`: This class has the same functionality as :ref:`LogStderr`, but uses stdout.
-- :ref:`LogGui`: This is the standard log target for wxPython applications (it is used by default if you don't do anything) and provides
- the most reasonable handling of all types of messages for given platform.
-- :ref:`LogWindow`: This log target provides a "log console" which collects all messages generated by the application and also passes
- them to the previous active log target. The log window frame has a menu allowing user to clear the log, close it completely or save all messages to file.
-- :ref:`LogBuffer`: This target collects all the logged messages in an internal buffer allowing to show them later to the user all at once.
-- :ref:`LogNull`: The last log class is quite particular: it doesn't do anything. The objects of this class may be instantiated to (temporarily)
- suppress output of `LogXXX` functions.
-
-
-The log targets can also be combined: for example you may wish to redirect the messages somewhere else (for example, to a log file)
-but also process them as normally. For this the :ref:`LogChain`, :ref:`LogInterposer`, and :ref:`LogInterposerTemp` can be used.
-
-
-
-.. _logging in multi-threaded applications:
-
-Logging in Multi-Threaded Applications
---------------------------------------
-
-Starting with wxPython 2.9.1, logging functions can be safely called from any thread. Messages logged from threads other than the main
-one will be buffered until :meth:`Log.Flush` is called in the main thread (which usually happens during idle time, i.e. after processing
-all pending events) and will be really output only then. Notice that the default GUI logger already only output the messages when it is
-flushed, so by default messages from the other threads will be shown more or less at the same moment as usual. However if you define a
-custom log target, messages may be logged out of order, e.g. messages from the main thread with later timestamp may appear before messages
-with earlier timestamp logged from other threads. :ref:`Log` does however guarantee that messages logged by each thread will appear in
-order in which they were logged.
-
-Also notice that :meth:`Log.EnableLogging` and :ref:`LogNull` class which uses it only affect the current thread, i.e. logging messages
-may still be generated by the other threads after a call to `EnableLogging(False)`.
-
-
-
-.. _logging customization:
-
-Logging Customization
----------------------
-
-To completely change the logging behaviour you may define a custom log target. For example, you could define a class inheriting from
-:ref:`Log` which shows all the log messages in some part of your main application window reserved for the message output without
-interrupting the user work flow with modal message boxes.
-
-To use your custom log target you may either call :meth:`Log.SetActiveTarget` with your custom log object or create a :ref:`AppTraits` -derived
-class and override :meth:`AppTraits.CreateLogTarget` virtual method in it and also override :meth:`App.CreateTraits` to return an instance
-of your custom traits object. Notice that in the latter case you should be prepared for logging messages early during the program startup
-and also during program shutdown so you shouldn't rely on existence of the main application window, for example. You can however safely
-assume that GUI is (already/still) available when your log target as used as wxPython automatically switches to using :ref:`LogStderr`
-if it isn't.
-
-There are several methods which may be overridden in the derived class to customize log messages handling: :meth:`Log.DoLogRecord`,
-:meth:`Log.DoLogTextAtLevel` and :meth:`Log.DoLogText`.
-
-The last method is the simplest one: you should override it if you simply want to redirect the log output elsewhere, without taking
-into account the level of the message. If you do want to handle messages of different levels differently, then you should override
-:meth:`Log.DoLogTextAtLevel`.
-
-Additionally, you can customize the way full log messages are constructed from the components (such as time stamp, source file information,
-logging thread ID and so on). This task is performed by :ref:`LogFormatter` class so you need to derive a custom class from it and override
-its `Format()` method to build the log messages in desired way. Notice that if you just need to modify (or suppress) the time stamp display,
-overriding `FormatTime()` is enough.
-
-Finally, if even more control over the output format is needed, then `LogRecord()` can be overridden as it allows to construct custom
-messages depending on the log level or even do completely different things depending on the message severity (for example, throw away all
-messages except warnings and errors, show warnings on the screen and forward the error messages to the user's (or programmer's) cell
-phone -- maybe depending on whether the timestamp tells us if it is day or night in the current time zone).
-
-
-
-.. _using trace masks:
-
-Using trace masks
------------------
-
-Notice that the use of log trace masks is hardly necessary any longer in current wxPython version as the same effect can be achieved by
-using different log components for different log statements of any level. Please see :ref:`Log Messages Selection `
-for more information about the log components.
-
-The functions below allow some limited customization of :ref:`Log` behaviour without writing a new log target class (which, aside from
-being a matter of several minutes, allows you to do anything you want). The verbose messages are the trace messages which are not disabled
-in the release mode and are generated by :func:`LogVerbose`. They are not normally shown to the user because they present little interest,
-but may be activated, for example, in order to help the user find some program problem.
-
-As for the (real) trace messages, their handling depends on the currently enabled trace masks: if :meth:`Log.AddTraceMask` was called for
-the mask of the given message, it will be logged, otherwise nothing happens.
-
-
-For example::
-
- wx.LogTrace(wx.TRACE_OleCalls, "Foo.Bar() called")
-
-
-will log the message if it was preceded by::
-
- wx.Log.AddTraceMask(wx.TRACE_OleCalls)
-
-
-The standard trace masks are given in the :func:`LogTrace` documentation.
-
+.. include:: headings.inc
+
+
+.. _log classes overview:
+
+===============================================
+|phoenix_title| **Log Classes Overview**
+===============================================
+
+
+Introduction
+------------
+
+This is a general overview of logging classes provided by wxPython. The word logging here has a broad sense, including all
+of the program output, not only non-interactive messages. The logging facilities included in wxPython provide the base :ref:`Log`
+class which defines the standard interface for a log target as well as several standard implementations of it and a family of
+functions to use with them.
+
+First of all, no knowledge of :ref:`Log` classes is needed to use them. For this, you should only know about :func:`LogDebug`,
+:func:`LogError`, :func:`LogMessage` and similar functions. All of them have the same syntax as the Python
+`logging `_ module.
+
+Here are all of them:
+
+- :func:`LogFatalError` which is like :func:`LogError`, but also terminates the program with the exit code 3 (using `abort()`
+ standard function). Unlike for all the other logging functions, this function can't be overridden by a log target.
+- :func:`LogError` is the function to use for error messages, i.e. the messages that must be shown to the user.
+ The default processing is to pop up a message box to inform the user about it.
+- :func:`LogWarning` for warnings. They are also normally shown to the user, but don't interrupt the program work.
+- :func:`LogMessage` is for all normal, informational messages. They also appear in a message box by default (but it can be changed, see below).
+- :func:`LogVerbose` is for verbose output. Normally, it is suppressed, but might be activated if the user wishes to know
+ more details about the program progress (another, but possibly confusing name for the same function is :func:`LogInfo`).
+- :func:`LogStatus` is for status messages. They will go into the status bar of the active or specified (as the first argument)
+ :ref:`Frame` if it has one.
+- :func:`LogSysError` is mostly used by wxPython itself, but might be handy for logging errors after system call (API function)
+ failure. It logs the specified message text as well as the last system error code (`errno` or Windows' `GetLastError()` depending
+ on the platform) and the corresponding error message. The second form of this function takes the error code explicitly as the first argument.
+- :func:`LogDebug` is the right function for debug output. It only does anything at all in the debug mode (when the preprocessor
+ symbol ``__WXDEBUG__`` is defined) and expands to nothing in release mode (otherwise). Note that under Windows, you must either run
+ the program under debugger or use a 3rd party program such as **DebugView** (http://www.microsoft.com/technet/sysinternals/Miscellaneous/DebugView.mspx)
+ to actually see the debug output.
+- :func:`LogTrace` as :func:`LogDebug` only does something in debug build. The reason for making it a separate function from it is
+ that usually there are a lot of trace messages, so it might make sense to separate them from other debug messages which would be
+ flooded in them. Moreover, the second version of this function takes a trace mask as the first argument which allows to further
+ restrict the amount of messages generated.
+
+
+The usage of these functions should be fairly straightforward, however it may be asked why not use the other logging facilities,
+such as the Python `logging `_ module. The short answer is that they're all very
+good generic mechanisms, but are not really adapted for wxPython, while the log classes are.
+
+Some of advantages in using wxPython log functions are:
+
+- Portability
+- Flexibility: The output of :ref:`Log` functions can be redirected or suppressed entirely based on their importance, which is
+ either impossible or difficult to do with traditional methods. For example, only error messages, or only error messages and
+ warnings might be logged, filtering out all informational messages.
+- Completeness: Usually, an error message should be presented to the user when some operation fails. Let's take a quite simple but
+ common case of a file error: suppose that you're writing your data file on disk and there is not enough space. The actual error
+ might have been detected inside wxPython code, so the calling function doesn't really know the exact reason of the failure,
+ it only knows that the data file couldn't be written to the disk. However, as wxPython uses :func:`LogError` in this situation,
+ the exact error code (and the corresponding error message) will be given to the user together with "high level" message about
+ data file writing error.
+
+
+
+.. _log messages selection:
+
+Log Messages Selection
+----------------------
+
+By default, most log messages are enabled. In particular, this means that errors logged by wxPython code itself (e.g. when it fails
+to perform some operation) will be processed and shown to the user. To disable the logging entirely you can use :meth:`Log.EnableLogging`
+method or, more usually, :ref:`LogNull` class which temporarily disables logging and restores it back to the original setting when it is destroyed.
+
+To limit logging to important messages only, you may use :meth:`Log.SetLogLevel` with e.g. ``LOG_Warning`` value -- this will completely
+disable all logging messages with the severity less than warnings, so :func:`LogMessage` output won't be shown to the user any more.
+
+Moreover, the log level can be set separately for different log components. Before showing how this can be useful, let us explain what
+log components are: they are simply arbitrary strings identifying the component, or module, which generated the message. They are hierarchical
+in the sense that "foo/bar/baz" component is supposed to be a child of "foo". And all components are children of the unnamed root component.
+
+By default, all messages logged by wxPython originate from "wx" component or one of its subcomponents such as "wx/net/ftp", while the
+messages logged by your own code are assigned empty log component. To change this, you need to define ``LOG_COMPONENT`` to a string uniquely
+identifying each component, e.g. you could give it the value "MyProgram" by default and re-define it as "MyProgram/DB" in the module
+working with the database and "MyProgram/DB/Trans" in its part managing the transactions. Then you could use :meth:`Log.SetComponentLevel`
+in the following ways::
+
+ # Disable all database error messages, everybody knows databases never
+ # fail anyhow
+ wx.Log.SetComponentLevel("MyProgram/DB", wx.LOG_FatalError)
+
+ # but enable tracing for the transactions as somehow our changes don't
+ # get committed sometimes
+ wx.Log.SetComponentLevel("MyProgram/DB/Trans", wx.LOG_Trace)
+
+ # also enable tracing messages from wxPython dynamic module loading
+ # mechanism
+ wx.Log.SetComponentLevel("wx/base/module", wx.LOG_Trace)
+
+
+
+Notice that the log level set explicitly for the transactions code overrides the log level of the parent component but that all other database
+code subcomponents inherit its setting by default and so won't generate any log messages at all.
+
+
+
+.. _log targets:
+
+Log Targets
+-----------
+
+After having enumerated all the functions which are normally used to log the messages, and why would you want to use them, we now
+describe how all this works.
+
+wxPython has the notion of a `log target`: it is just a class deriving from :ref:`Log`. As such, it implements the virtual functions
+of the base class which are called when a message is logged. Only one log target is active at any moment, this is the one used by
+`LogXXX` functions. The normal usage of a log object (i.e. object of a class derived from :ref:`Log`) is to install it as the active
+target with a call to `SetActiveTarget()` and it will be used automatically by all subsequent calls to `LogXXX` functions.
+
+To create a new log target class you only need to derive it from :ref:`Log` and override one or several of :meth:`Log.DoLogRecord`,
+:meth:`Log.DoLogTextAtLevel` and :meth:`Log.DoLogText` in it. The first one is the most flexible and allows you to change the formatting
+of the messages, dynamically filter and redirect them and so on -- all log messages, except for those generated by :func:`LogFatalError`,
+pass by this function. :meth:`Log.DoLogTextAtLevel` should be overridden if you simply want to redirect the log messages somewhere else,
+without changing their formatting. Finally, it is enough to override :meth:`Log.DoLogText` if you only want to redirect the log
+messages and the destination doesn't depend on the message log level.
+
+There are some predefined classes deriving from :ref:`Log` and which might be helpful to see how you can create a new log target
+class and, of course, may also be used without any change. There are:
+
+- :ref:`LogStderr`: This class logs messages to a ``FILE *``, using stderr by default as its name suggests.
+- `LogStream`: This class has the same functionality as :ref:`LogStderr`, but uses stdout.
+- :ref:`LogGui`: This is the standard log target for wxPython applications (it is used by default if you don't do anything) and provides
+ the most reasonable handling of all types of messages for given platform.
+- :ref:`LogWindow`: This log target provides a "log console" which collects all messages generated by the application and also passes
+ them to the previous active log target. The log window frame has a menu allowing user to clear the log, close it completely or save all messages to file.
+- :ref:`LogBuffer`: This target collects all the logged messages in an internal buffer allowing to show them later to the user all at once.
+- :ref:`LogNull`: The last log class is quite particular: it doesn't do anything. The objects of this class may be instantiated to (temporarily)
+ suppress output of `LogXXX` functions.
+
+
+The log targets can also be combined: for example you may wish to redirect the messages somewhere else (for example, to a log file)
+but also process them as normally. For this the :ref:`LogChain`, :ref:`LogInterposer`, and :ref:`LogInterposerTemp` can be used.
+
+
+
+.. _logging in multi-threaded applications:
+
+Logging in Multi-Threaded Applications
+--------------------------------------
+
+Starting with wxPython 2.9.1, logging functions can be safely called from any thread. Messages logged from threads other than the main
+one will be buffered until :meth:`Log.Flush` is called in the main thread (which usually happens during idle time, i.e. after processing
+all pending events) and will be really output only then. Notice that the default GUI logger already only output the messages when it is
+flushed, so by default messages from the other threads will be shown more or less at the same moment as usual. However if you define a
+custom log target, messages may be logged out of order, e.g. messages from the main thread with later timestamp may appear before messages
+with earlier timestamp logged from other threads. :ref:`Log` does however guarantee that messages logged by each thread will appear in
+order in which they were logged.
+
+Also notice that :meth:`Log.EnableLogging` and :ref:`LogNull` class which uses it only affect the current thread, i.e. logging messages
+may still be generated by the other threads after a call to `EnableLogging(False)`.
+
+
+
+.. _logging customization:
+
+Logging Customization
+---------------------
+
+To completely change the logging behaviour you may define a custom log target. For example, you could define a class inheriting from
+:ref:`Log` which shows all the log messages in some part of your main application window reserved for the message output without
+interrupting the user work flow with modal message boxes.
+
+To use your custom log target you may either call :meth:`Log.SetActiveTarget` with your custom log object or create a :ref:`AppTraits` -derived
+class and override :meth:`AppTraits.CreateLogTarget` virtual method in it and also override :meth:`App.CreateTraits` to return an instance
+of your custom traits object. Notice that in the latter case you should be prepared for logging messages early during the program startup
+and also during program shutdown so you shouldn't rely on existence of the main application window, for example. You can however safely
+assume that GUI is (already/still) available when your log target as used as wxPython automatically switches to using :ref:`LogStderr`
+if it isn't.
+
+There are several methods which may be overridden in the derived class to customize log messages handling: :meth:`Log.DoLogRecord`,
+:meth:`Log.DoLogTextAtLevel` and :meth:`Log.DoLogText`.
+
+The last method is the simplest one: you should override it if you simply want to redirect the log output elsewhere, without taking
+into account the level of the message. If you do want to handle messages of different levels differently, then you should override
+:meth:`Log.DoLogTextAtLevel`.
+
+Additionally, you can customize the way full log messages are constructed from the components (such as time stamp, source file information,
+logging thread ID and so on). This task is performed by :ref:`LogFormatter` class so you need to derive a custom class from it and override
+its `Format()` method to build the log messages in desired way. Notice that if you just need to modify (or suppress) the time stamp display,
+overriding `FormatTime()` is enough.
+
+Finally, if even more control over the output format is needed, then `LogRecord()` can be overridden as it allows to construct custom
+messages depending on the log level or even do completely different things depending on the message severity (for example, throw away all
+messages except warnings and errors, show warnings on the screen and forward the error messages to the user's (or programmer's) cell
+phone -- maybe depending on whether the timestamp tells us if it is day or night in the current time zone).
+
+
+
+.. _using trace masks:
+
+Using trace masks
+-----------------
+
+Notice that the use of log trace masks is hardly necessary any longer in current wxPython version as the same effect can be achieved by
+using different log components for different log statements of any level. Please see :ref:`Log Messages Selection `
+for more information about the log components.
+
+The functions below allow some limited customization of :ref:`Log` behaviour without writing a new log target class (which, aside from
+being a matter of several minutes, allows you to do anything you want). The verbose messages are the trace messages which are not disabled
+in the release mode and are generated by :func:`LogVerbose`. They are not normally shown to the user because they present little interest,
+but may be activated, for example, in order to help the user find some program problem.
+
+As for the (real) trace messages, their handling depends on the currently enabled trace masks: if :meth:`Log.AddTraceMask` was called for
+the mask of the given message, it will be logged, otherwise nothing happens.
+
+
+For example::
+
+ wx.LogTrace(wx.TRACE_OleCalls, "Foo.Bar() called")
+
+
+will log the message if it was preceded by::
+
+ wx.Log.AddTraceMask(wx.TRACE_OleCalls)
+
+
+The standard trace masks are given in the :func:`LogTrace` documentation.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/printing_framework_overview.rst b/docs/sphinx/rest_substitutions/overviews/printing_framework_overview.rst
index 096e6231..a72dce0a 100644
--- a/docs/sphinx/rest_substitutions/overviews/printing_framework_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/printing_framework_overview.rst
@@ -1,155 +1,155 @@
-.. include:: headings.inc
-
-
-.. _printing framework overview:
-
-=================================================
-|phoenix_title| **Printing Framework Overview**
-=================================================
-
-
-The printing framework relies on the application to provide classes whose member functions can respond
-to particular requests, such as 'print this page' or 'does this page exist in the document?'. This method
-allows wxPython to take over the housekeeping duties of turning preview pages, calling the print dialog box,
-creating the printer device context, and so on: the application can concentrate on the rendering of the
-information onto a device context.
-
-In most cases, the only class you will need to derive from is :ref:`Printout`; all others will be used as-is.
-
-A brief description of each class's role and how they work together follows.
-
-
-Printout
---------
-
-A document's printing ability is represented in an application by a derived :ref:`Printout` class. This class
-prints a page on request, and can be passed to the Print function of a :ref:`Printer` object to actually print
-the document, or can be passed to a :ref:`PrintPreview` object to initiate previewing. The following code
-shows how easy it is to initiate printing, previewing and the print setup dialog, once the :ref:`Printout`
-functionality has been defined. Notice the use of `MyPrintout` for both printing and previewing. All the preview
-user interface functionality is taken care of by wxPython::
-
- if printing:
- printer = wx.Printer()
- printout = MyPrintout("My printout")
- printer.Print(self, printout, True)
-
- elif preview:
- # Pass two printout objects: for preview, and possible printing.
- preview = wx.PrintPreview(MyPrintout(), MyPrintout())
- frame = wx.PreviewFrame(preview, self, "Demo Print Preview", wx.Point(100, 100), wx.Size(600, 650))
- frame.Centre(wx.BOTH)
- frame.Initialize()
- frame.Show(True)
-
-
-
-:ref:`Printout` assembles the printed page and (using your subclass's overrides) writes requested pages to a :ref:`DC`
-that is passed to it. This :ref:`DC` could be a :ref:`MemoryDC` (for displaying the preview image on-screen),
-a :ref:`PrinterDC` (for printing under MSW and Mac), or a :ref:`PostScriptDC` (for printing under GTK or generating PostScript output).
-
-If your window classes have a `Draw(dc)` routine to do screen rendering, your :ref:`Printout` subclass will typically
-call those routines to create portions of the image on your printout. Your :ref:`Printout` subclass can also make its
-own calls to its :ref:`DC` to draw headers, footers, page numbers, etc.
-
-The scaling of the drawn image typically differs from the screen to the preview and printed images. This class provides
-a set of routines named `FitThisSizeToXXX()`, `MapScreenSizeToXXX()`, and `GetLogicalXXXRect`, which can be used to set
-the user scale and origin of the Printout's DC so that your class can easily map your image to the printout withouth
-getting into the details of screen and printer PPI and scaling.
-
-
-Printer
--------
-
-Class :ref:`Printer` encapsulates the platform-dependent print function with a common interface. In most cases, you will
-not need to derive a class from :ref:`Printer`; simply create a :ref:`Printer` object in your `Print` function as in the example above.
-
-
-PrintPreview
-------------
-
-Class :ref:`PrintPreview` manages the print preview process. Among other things, it constructs the DCs that get passed to your
-:ref:`Printout` subclass for printing and manages the display of multiple pages, a zoomable preview image, and so forth.
-In most cases you will use this class as-is, but you can create your own subclass, for example, to change the layout or
-contents of the preview window.
-
-
-PrinterDC
----------
-
-Class :ref:`PrinterDC` is the :ref:`DC` that represents the actual printed page under MSW and Mac. During printing, an object
-of this class will be passed to your derived :ref:`Printout` object to draw upon. The size of the :ref:`PrinterDC` will depend
-on the paper orientation and the resolution of the printer.
-
-There are two important rectangles in printing: the page rectangle defines the printable area seen by the application, and under
-MSW and Mac, it is the printable area specified by the printer. (For PostScript printing, the page rectangle is the entire page.)
-The inherited function :meth:`DC.GetSize` returns the page size in device pixels. The point (0,0) on the :ref:`PrinterDC`
-represents the top left corner of the page rectangle; that is, the page rect is given by `Rect(0, 0, w, h)`, where (w,h) are the values
-returned by `GetSize`.
-
-The paper rectangle, on the other hand, represents the entire paper area including the non-printable border. Thus, the coordinates
-of the top left corner of the paper rectangle will have small negative values, while the width and height will be somewhat larger
-than that of the page rectangle. The :ref:`PrinterDC` -specific function :meth:`PrinterDC.GetPaperRect` returns the paper
-rectangle of the given :ref:`PrinterDC`.
-
-
-PostScriptDC
-------------
-
-Class :ref:`PostScriptDC` is the :ref:`DC` that represents the actual printed page under GTK and other PostScript printing.
-During printing, an object of this class will be passed to your derived :ref:`Printout` object to draw upon. The size of
-the :ref:`PostScriptDC` will depend upon the :ref:`PrintData` used to construct it.
-
-Unlike a :ref:`PrinterDC`, there is no distinction between the page rectangle and the paper rectangle in a :ref:`PostScriptDC`;
-both rectangles are taken to represent the entire sheet of paper.
-
-
-PrintDialog
------------
-
-Class :ref:`PrintDialog` puts up the standard print dialog, which allows you to select the page range for printing (as well
-as many other print settings, which may vary from platform to platform). You provide an object of type :ref:`PrintDialogData` to
-the :ref:`PrintDialog` at construction, which is used to populate the dialog.
-
-
-PrintData
----------
-
-Class :ref:`PrintData` is a subset of :ref:`PrintDialogData` that is used (internally) to initialize a :ref:`PrinterDC` or
-:ref:`PostScriptDC`. (In fact, a :ref:`PrintData` is a data member of a :ref:`PrintDialogData` and a :ref:`PageSetupDialogData`).
-Essentially, :ref:`PrintData` contains those bits of information from the two dialogs necessary to configure the :ref:`PrinterDC` or
-:ref:`PostScriptDC` (e.g., size, orientation, etc.). You might wish to create a global instance of this object to provide
-call-to-call persistence to your application's print settings.
-
-
-PrintDialogData
----------------
-
-Class :ref:`PrintDialogData` contains the settings entered by the user in the print dialog. It contains such things as page range,
-number of copies, and so forth. In most cases, you won't need to access this information; the framework takes care of asking your
-:ref:`Printout` derived object for the pages requested by the user.
-
-
-PageSetupDialog
----------------
-
-Class :ref:`PageSetupDialog` puts up the standard page setup dialog, which allows you to specify the orientation, paper size,
-and related settings. You provide it with a :ref:`PageSetupDialogData` object at intialization, which is used to populate the dialog;
-when the dialog is dismissed, this object contains the settings chosen by the user, including orientation and/or page margins.
-
-
-.. note:: Note that on Macintosh, the native page setup dialog does not contain entries that allow you to change the page margins.
-
-
-
-PageSetupDialogData
--------------------
-
-Class :ref:`PageSetupDialogData` contains settings affecting the page size (paper size), orientation, margins, and so forth. Note
-that not all platforms populate all fields; for example, the MSW page setup dialog lets you set the page margins while the Mac setup dialog does not.
-
-You will typically create a global instance of each of a :ref:`PrintData` and :ref:`PageSetupDialogData` at program initiation,
-which will contain the default settings provided by the system. Each time the user calls up either the :ref:`PrintDialog` or the
-:ref:`PageSetupDialog`, you pass these data structures to initialize the dialog values and to be updated by the dialog.
-The framework then queries these data structures to get information like the printed page range (from the :ref:`PrintDialogData`) or
-the paper size and/or page orientation (from the :ref:`PageSetupDialogData`).
+.. include:: headings.inc
+
+
+.. _printing framework overview:
+
+=================================================
+|phoenix_title| **Printing Framework Overview**
+=================================================
+
+
+The printing framework relies on the application to provide classes whose member functions can respond
+to particular requests, such as 'print this page' or 'does this page exist in the document?'. This method
+allows wxPython to take over the housekeeping duties of turning preview pages, calling the print dialog box,
+creating the printer device context, and so on: the application can concentrate on the rendering of the
+information onto a device context.
+
+In most cases, the only class you will need to derive from is :ref:`Printout`; all others will be used as-is.
+
+A brief description of each class's role and how they work together follows.
+
+
+Printout
+--------
+
+A document's printing ability is represented in an application by a derived :ref:`Printout` class. This class
+prints a page on request, and can be passed to the Print function of a :ref:`Printer` object to actually print
+the document, or can be passed to a :ref:`PrintPreview` object to initiate previewing. The following code
+shows how easy it is to initiate printing, previewing and the print setup dialog, once the :ref:`Printout`
+functionality has been defined. Notice the use of `MyPrintout` for both printing and previewing. All the preview
+user interface functionality is taken care of by wxPython::
+
+ if printing:
+ printer = wx.Printer()
+ printout = MyPrintout("My printout")
+ printer.Print(self, printout, True)
+
+ elif preview:
+ # Pass two printout objects: for preview, and possible printing.
+ preview = wx.PrintPreview(MyPrintout(), MyPrintout())
+ frame = wx.PreviewFrame(preview, self, "Demo Print Preview", wx.Point(100, 100), wx.Size(600, 650))
+ frame.Centre(wx.BOTH)
+ frame.Initialize()
+ frame.Show(True)
+
+
+
+:ref:`Printout` assembles the printed page and (using your subclass's overrides) writes requested pages to a :ref:`DC`
+that is passed to it. This :ref:`DC` could be a :ref:`MemoryDC` (for displaying the preview image on-screen),
+a :ref:`PrinterDC` (for printing under MSW and Mac), or a :ref:`PostScriptDC` (for printing under GTK or generating PostScript output).
+
+If your window classes have a `Draw(dc)` routine to do screen rendering, your :ref:`Printout` subclass will typically
+call those routines to create portions of the image on your printout. Your :ref:`Printout` subclass can also make its
+own calls to its :ref:`DC` to draw headers, footers, page numbers, etc.
+
+The scaling of the drawn image typically differs from the screen to the preview and printed images. This class provides
+a set of routines named `FitThisSizeToXXX()`, `MapScreenSizeToXXX()`, and `GetLogicalXXXRect`, which can be used to set
+the user scale and origin of the Printout's DC so that your class can easily map your image to the printout withouth
+getting into the details of screen and printer PPI and scaling.
+
+
+Printer
+-------
+
+Class :ref:`Printer` encapsulates the platform-dependent print function with a common interface. In most cases, you will
+not need to derive a class from :ref:`Printer`; simply create a :ref:`Printer` object in your `Print` function as in the example above.
+
+
+PrintPreview
+------------
+
+Class :ref:`PrintPreview` manages the print preview process. Among other things, it constructs the DCs that get passed to your
+:ref:`Printout` subclass for printing and manages the display of multiple pages, a zoomable preview image, and so forth.
+In most cases you will use this class as-is, but you can create your own subclass, for example, to change the layout or
+contents of the preview window.
+
+
+PrinterDC
+---------
+
+Class :ref:`PrinterDC` is the :ref:`DC` that represents the actual printed page under MSW and Mac. During printing, an object
+of this class will be passed to your derived :ref:`Printout` object to draw upon. The size of the :ref:`PrinterDC` will depend
+on the paper orientation and the resolution of the printer.
+
+There are two important rectangles in printing: the page rectangle defines the printable area seen by the application, and under
+MSW and Mac, it is the printable area specified by the printer. (For PostScript printing, the page rectangle is the entire page.)
+The inherited function :meth:`DC.GetSize` returns the page size in device pixels. The point (0,0) on the :ref:`PrinterDC`
+represents the top left corner of the page rectangle; that is, the page rect is given by `Rect(0, 0, w, h)`, where (w,h) are the values
+returned by `GetSize`.
+
+The paper rectangle, on the other hand, represents the entire paper area including the non-printable border. Thus, the coordinates
+of the top left corner of the paper rectangle will have small negative values, while the width and height will be somewhat larger
+than that of the page rectangle. The :ref:`PrinterDC` -specific function :meth:`PrinterDC.GetPaperRect` returns the paper
+rectangle of the given :ref:`PrinterDC`.
+
+
+PostScriptDC
+------------
+
+Class :ref:`PostScriptDC` is the :ref:`DC` that represents the actual printed page under GTK and other PostScript printing.
+During printing, an object of this class will be passed to your derived :ref:`Printout` object to draw upon. The size of
+the :ref:`PostScriptDC` will depend upon the :ref:`PrintData` used to construct it.
+
+Unlike a :ref:`PrinterDC`, there is no distinction between the page rectangle and the paper rectangle in a :ref:`PostScriptDC`;
+both rectangles are taken to represent the entire sheet of paper.
+
+
+PrintDialog
+-----------
+
+Class :ref:`PrintDialog` puts up the standard print dialog, which allows you to select the page range for printing (as well
+as many other print settings, which may vary from platform to platform). You provide an object of type :ref:`PrintDialogData` to
+the :ref:`PrintDialog` at construction, which is used to populate the dialog.
+
+
+PrintData
+---------
+
+Class :ref:`PrintData` is a subset of :ref:`PrintDialogData` that is used (internally) to initialize a :ref:`PrinterDC` or
+:ref:`PostScriptDC`. (In fact, a :ref:`PrintData` is a data member of a :ref:`PrintDialogData` and a :ref:`PageSetupDialogData`).
+Essentially, :ref:`PrintData` contains those bits of information from the two dialogs necessary to configure the :ref:`PrinterDC` or
+:ref:`PostScriptDC` (e.g., size, orientation, etc.). You might wish to create a global instance of this object to provide
+call-to-call persistence to your application's print settings.
+
+
+PrintDialogData
+---------------
+
+Class :ref:`PrintDialogData` contains the settings entered by the user in the print dialog. It contains such things as page range,
+number of copies, and so forth. In most cases, you won't need to access this information; the framework takes care of asking your
+:ref:`Printout` derived object for the pages requested by the user.
+
+
+PageSetupDialog
+---------------
+
+Class :ref:`PageSetupDialog` puts up the standard page setup dialog, which allows you to specify the orientation, paper size,
+and related settings. You provide it with a :ref:`PageSetupDialogData` object at intialization, which is used to populate the dialog;
+when the dialog is dismissed, this object contains the settings chosen by the user, including orientation and/or page margins.
+
+
+.. note:: Note that on Macintosh, the native page setup dialog does not contain entries that allow you to change the page margins.
+
+
+
+PageSetupDialogData
+-------------------
+
+Class :ref:`PageSetupDialogData` contains settings affecting the page size (paper size), orientation, margins, and so forth. Note
+that not all platforms populate all fields; for example, the MSW page setup dialog lets you set the page margins while the Mac setup dialog does not.
+
+You will typically create a global instance of each of a :ref:`PrintData` and :ref:`PageSetupDialogData` at program initiation,
+which will contain the default settings provided by the system. Each time the user calls up either the :ref:`PrintDialog` or the
+:ref:`PageSetupDialog`, you pass these data structures to initialize the dialog values and to be updated by the dialog.
+The framework then queries these data structures to get information like the printed page range (from the :ref:`PrintDialogData`) or
+the paper size and/or page orientation (from the :ref:`PageSetupDialogData`).
diff --git a/docs/sphinx/rest_substitutions/overviews/refcount_overview.rst b/docs/sphinx/rest_substitutions/overviews/refcount_overview.rst
index 5b937dda..13bce946 100644
--- a/docs/sphinx/rest_substitutions/overviews/refcount_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/refcount_overview.rst
@@ -1,72 +1,72 @@
-.. include:: headings.inc
-
-
-.. _reference counting:
-
-=================================================
-|phoenix_title| **Reference Counting Overview**
-=================================================
-
-
-Why You Shouldn't Care About It
--------------------------------
-
-Many wxPython objects use a technique known as `reference counting`, also known as `copy on write` (COW). This means that when an
-object is assigned to another, no copying really takes place. Only the reference count on the shared object data is incremented
-and both objects share the same data (a very fast operation).
-
-But as soon as one of the two (or more) objects is modified, the data has to be copied because the changes to one of the objects
-shouldn't be seen in the others. As data copying only happens when the object is written to, this is known as COW.
-
-What is important to understand is that all this happens absolutely transparently to the class users and that whether an object
-is shared or not is not seen from the outside of the class - in any case, the result of any operation on it is the same.
-
-
-Object Comparison
------------------
-
-The ``==`` and ``!=`` operators of the reference counted classes always do a `deep comparison`. This means that the equality operator
-will return true if two objects are identical and not only if they share the same data.
-
-
-Note that wxPython follows the STL philosophy: when a comparison operator cannot be implemented efficiently (like for e.g.
-:ref:`Image` 's ``==`` operator which would need to compare the entire image's data, pixel-by-pixel), it's not implemented at all.
-That's why not all reference counted classes provide comparison operators.
-
-
-Also note that if you only need to do a shallow comparison between two :ref:`Object` derived classes, you should not use the ``==``
-and ``!=`` operators but rather the :meth:`Object.IsSameAs` () function.
-
-
-Object Destruction
-------------------
-
-When a COW object destructor is called, it may not delete the data: if it's shared, the destructor will just decrement the shared
-data's reference count without destroying it. Only when the destructor of the last object owning the data is called, the data is
-really destroyed. Just like all other COW-things, this happens transparently to the class users so that you shouldn't care about it.
-
-
-List of Reference Counted Classes
----------------------------------
-
-The following classes in wxPython have efficient (i.e. fast) assignment operators and copy constructors since they are reference-counted:
-
-- :ref:`AcceleratorTable`
-- :ref:`animate.Animation`
-- :ref:`Bitmap`
-- :ref:`Brush`
-- :ref:`Cursor`
-- :ref:`Font`
-- :ref:`GraphicsBrush`
-- :ref:`GraphicsContext`
-- :ref:`GraphicsFont`
-- :ref:`GraphicsMatrix`
-- :ref:`GraphicsPath`
-- :ref:`GraphicsPen`
-- :ref:`Icon`
-- :ref:`Image`
-- :ref:`Metafile`
-- :ref:`Palette`
-
-
-Note that the list above reports the objects which are reference counted in all ports of wxPython; some ports may use this technique also for other classes.
+.. include:: headings.inc
+
+
+.. _reference counting:
+
+=================================================
+|phoenix_title| **Reference Counting Overview**
+=================================================
+
+
+Why You Shouldn't Care About It
+-------------------------------
+
+Many wxPython objects use a technique known as `reference counting`, also known as `copy on write` (COW). This means that when an
+object is assigned to another, no copying really takes place. Only the reference count on the shared object data is incremented
+and both objects share the same data (a very fast operation).
+
+But as soon as one of the two (or more) objects is modified, the data has to be copied because the changes to one of the objects
+shouldn't be seen in the others. As data copying only happens when the object is written to, this is known as COW.
+
+What is important to understand is that all this happens absolutely transparently to the class users and that whether an object
+is shared or not is not seen from the outside of the class - in any case, the result of any operation on it is the same.
+
+
+Object Comparison
+-----------------
+
+The ``==`` and ``!=`` operators of the reference counted classes always do a `deep comparison`. This means that the equality operator
+will return true if two objects are identical and not only if they share the same data.
+
+
+Note that wxPython follows the STL philosophy: when a comparison operator cannot be implemented efficiently (like for e.g.
+:ref:`Image` 's ``==`` operator which would need to compare the entire image's data, pixel-by-pixel), it's not implemented at all.
+That's why not all reference counted classes provide comparison operators.
+
+
+Also note that if you only need to do a shallow comparison between two :ref:`Object` derived classes, you should not use the ``==``
+and ``!=`` operators but rather the :meth:`Object.IsSameAs` () function.
+
+
+Object Destruction
+------------------
+
+When a COW object destructor is called, it may not delete the data: if it's shared, the destructor will just decrement the shared
+data's reference count without destroying it. Only when the destructor of the last object owning the data is called, the data is
+really destroyed. Just like all other COW-things, this happens transparently to the class users so that you shouldn't care about it.
+
+
+List of Reference Counted Classes
+---------------------------------
+
+The following classes in wxPython have efficient (i.e. fast) assignment operators and copy constructors since they are reference-counted:
+
+- :ref:`AcceleratorTable`
+- :ref:`animate.Animation`
+- :ref:`Bitmap`
+- :ref:`Brush`
+- :ref:`Cursor`
+- :ref:`Font`
+- :ref:`GraphicsBrush`
+- :ref:`GraphicsContext`
+- :ref:`GraphicsFont`
+- :ref:`GraphicsMatrix`
+- :ref:`GraphicsPath`
+- :ref:`GraphicsPen`
+- :ref:`Icon`
+- :ref:`Image`
+- :ref:`Metafile`
+- :ref:`Palette`
+
+
+Note that the list above reports the objects which are reference counted in all ports of wxPython; some ports may use this technique also for other classes.
diff --git a/docs/sphinx/rest_substitutions/overviews/scrolling_overview.rst b/docs/sphinx/rest_substitutions/overviews/scrolling_overview.rst
index 76fb329f..d4a4a0bf 100644
--- a/docs/sphinx/rest_substitutions/overviews/scrolling_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/scrolling_overview.rst
@@ -1,68 +1,68 @@
-.. include:: headings.inc
-
-
-.. _scrolled windows:
-
-=================================================
-|phoenix_title| **Scrolled Windows Overview**
-=================================================
-
-
-Scrollbars come in various guises in wxWidgets. All windows have the potential to show a vertical scrollbar and/or a horizontal
-scrollbar: it is a basic capability of a window. However, in practice, not all windows do make use of scrollbars, such as a
-single-line :ref:`TextCtrl`.
-
-Because any class derived from :ref:`Window` may have scrollbars, there are functions to manipulate the scrollbars and event
-handlers to intercept scroll events. But just because a window generates a scroll event, doesn't mean that the window necessarily
-handles it and physically scrolls the window. The base class :ref:`Window` in fact doesn't have any default functionality to
-handle scroll events. If you created a :ref:`Window` object with scrollbars, and then clicked on the scrollbars, nothing at
-all would happen. This is deliberate, because the interpretation of scroll events varies from one window class to another.
-
-:ref:`ScrolledWindow` is an example of a window that adds functionality to make scrolling really work. It assumes that scrolling
-happens in consistent units, not different-sized jumps, and that page size is represented by the visible portion of the window.
-It is suited to drawing applications, but perhaps not so suitable for a sophisticated editor in which the amount scrolled may
-vary according to the size of text on a given line. For this, you would derive from :ref:`Window` and implement scrolling yourself.
-:ref:`grid.Grid` is an example of a class that implements its own scrolling, largely because columns and rows can vary in size.
-
-
-The Scrollbar Model
--------------------
-
-The function :meth:`Window.SetScrollbar` gives a clue about the way a scrollbar is modeled. This function takes the following arguments:
-
-=================== ===================================
-`orientation` Which scrollbar: ``VERTICAL`` or ``HORIZONTAL``.
-`position` The position of the scrollbar in scroll units.
-`visible` The size of the visible portion of the scrollbar, in scroll units.
-`range` The maximum position of the scrollbar.
-`refresh` Whether the scrollbar should be repainted.
-=================== ===================================
-
-`orientation` determines whether we're talking about the built-in horizontal or vertical scrollbar.
-
-`position` is simply the position of the 'thumb' (the bit you drag to scroll around). It is given in scroll units, and so is
-relative to the total range of the scrollbar.
-
-`visible` gives the number of scroll units that represents the portion of the window currently visible. Normally, a scrollbar is
-capable of indicating this visually by showing a different length of thumb.
-
-`range` is the maximum value of the scrollbar, where zero is the start position. You choose the units that suit you, so if you wanted to display text that has 100 lines, you would set this to 100. Note that this doesn't have to correspond to the number of pixels scrolled - it is up to you how you actually show the contents of the window.
-
-`refresh` just indicates whether the scrollbar should be repainted immediately or not.
-
-
-An Example
-----------
-
-Let's say you wish to display 50 lines of text, using the same font. The window is sized so that you can only see 16 lines at a time. You would use::
-
- SetScrollbar(wx.VERTICAL, 0, 16, 50)
-
-
-.. note:: Note that with the window at this size, the thumb position can never go above 50 minus 16, or 34. You can determine how many lines
- are currently visible by dividing the current view size by the character height in pixels.
-
-When defining your own scrollbar behaviour, you will always need to recalculate the scrollbar settings when the window size changes. You
-could therefore put your scrollbar calculations and `SetScrollbar` call into a function named `AdjustScrollbars`, which can be called
-initially and also from your :ref:`SizeEvent` handler function.
-
+.. include:: headings.inc
+
+
+.. _scrolled windows:
+
+=================================================
+|phoenix_title| **Scrolled Windows Overview**
+=================================================
+
+
+Scrollbars come in various guises in wxWidgets. All windows have the potential to show a vertical scrollbar and/or a horizontal
+scrollbar: it is a basic capability of a window. However, in practice, not all windows do make use of scrollbars, such as a
+single-line :ref:`TextCtrl`.
+
+Because any class derived from :ref:`Window` may have scrollbars, there are functions to manipulate the scrollbars and event
+handlers to intercept scroll events. But just because a window generates a scroll event, doesn't mean that the window necessarily
+handles it and physically scrolls the window. The base class :ref:`Window` in fact doesn't have any default functionality to
+handle scroll events. If you created a :ref:`Window` object with scrollbars, and then clicked on the scrollbars, nothing at
+all would happen. This is deliberate, because the interpretation of scroll events varies from one window class to another.
+
+:ref:`ScrolledWindow` is an example of a window that adds functionality to make scrolling really work. It assumes that scrolling
+happens in consistent units, not different-sized jumps, and that page size is represented by the visible portion of the window.
+It is suited to drawing applications, but perhaps not so suitable for a sophisticated editor in which the amount scrolled may
+vary according to the size of text on a given line. For this, you would derive from :ref:`Window` and implement scrolling yourself.
+:ref:`grid.Grid` is an example of a class that implements its own scrolling, largely because columns and rows can vary in size.
+
+
+The Scrollbar Model
+-------------------
+
+The function :meth:`Window.SetScrollbar` gives a clue about the way a scrollbar is modeled. This function takes the following arguments:
+
+=================== ===================================
+`orientation` Which scrollbar: ``VERTICAL`` or ``HORIZONTAL``.
+`position` The position of the scrollbar in scroll units.
+`visible` The size of the visible portion of the scrollbar, in scroll units.
+`range` The maximum position of the scrollbar.
+`refresh` Whether the scrollbar should be repainted.
+=================== ===================================
+
+`orientation` determines whether we're talking about the built-in horizontal or vertical scrollbar.
+
+`position` is simply the position of the 'thumb' (the bit you drag to scroll around). It is given in scroll units, and so is
+relative to the total range of the scrollbar.
+
+`visible` gives the number of scroll units that represents the portion of the window currently visible. Normally, a scrollbar is
+capable of indicating this visually by showing a different length of thumb.
+
+`range` is the maximum value of the scrollbar, where zero is the start position. You choose the units that suit you, so if you wanted to display text that has 100 lines, you would set this to 100. Note that this doesn't have to correspond to the number of pixels scrolled - it is up to you how you actually show the contents of the window.
+
+`refresh` just indicates whether the scrollbar should be repainted immediately or not.
+
+
+An Example
+----------
+
+Let's say you wish to display 50 lines of text, using the same font. The window is sized so that you can only see 16 lines at a time. You would use::
+
+ SetScrollbar(wx.VERTICAL, 0, 16, 50)
+
+
+.. note:: Note that with the window at this size, the thumb position can never go above 50 minus 16, or 34. You can determine how many lines
+ are currently visible by dividing the current view size by the character height in pixels.
+
+When defining your own scrollbar behaviour, you will always need to recalculate the scrollbar settings when the window size changes. You
+could therefore put your scrollbar calculations and `SetScrollbar` call into a function named `AdjustScrollbars`, which can be called
+initially and also from your :ref:`SizeEvent` handler function.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/sizers_overview.rst b/docs/sphinx/rest_substitutions/overviews/sizers_overview.rst
index bd04081f..d6a68786 100644
--- a/docs/sphinx/rest_substitutions/overviews/sizers_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/sizers_overview.rst
@@ -1,331 +1,331 @@
-.. include:: headings.inc
-
-
-.. _sizers overview:
-
-=============================================
-|phoenix_title| **Sizers Overview**
-=============================================
-
-
-Sizers, as represented by the :ref:`Sizer` class and its descendants in the wxPython class hierarchy, have become the method of
-choice to define the layout of controls in dialogs in wxPython because of their ability to create visually appealing dialogs
-independent of the platform, taking into account the differences in size and style of the individual controls.
-Editors such as wxDesigner, DialogBlocks, XRCed and wxWorkshop create dialogs based exclusively on sizers, practically forcing
-the user to create platform independent layouts without compromises.
-
-The next section describes and shows what can be done with sizers. The following sections briefly describe how to program with
-individual sizer classes.
-
-
-The Idea Behind Sizers
-----------------------
-
-The layout algorithm used by sizers in wxPython is closely related to layout systems in other GUI toolkits, such as Java's AWT,
-the GTK toolkit or the Qt toolkit. It is based upon the idea of individual subwindows reporting their minimal required size and
-their ability to get stretched if the size of the parent window has changed. This will most often mean that the programmer does
-not set the start-up size of a dialog, the dialog will rather be assigned a sizer and this sizer will be queried about the
-recommended size. This sizer in turn will query its children (which can be normal windows, empty space or other sizers) so
-that a hierarchy of sizers can be constructed. Note that :ref:`Sizer` does not derive from :ref:`Window` and thus does not
-interfere with tab ordering and requires very few resources compared to a real window on screen.
-
-What makes sizers so well fitted for use in wxPython is the fact that every control reports its own minimal size and the algorithm
-can handle differences in font sizes or different window (dialog item) sizes on different platforms without problems. For example,
-if the standard font as well as the overall design of Linux/GTK widgets requires more space than on Windows, the initial dialog
-size will automatically be bigger on Linux/GTK than on Windows.
-
-There are currently five different kinds of sizers available in wxPython. Each represents either a certain way to lay out dialog
-items in a dialog or it fulfills a special task such as wrapping a static box around a dialog item (or another sizer). These sizers
-will be discussed one by one in the text below. For more detailed information on how to use sizers programmatically, please refer
-to the section :ref:`Programming with BoxSizer `.
-
-
-Common Features
----------------
-
-All sizers are containers, that is, they are used to lay out one dialog item (or several dialog items), which they contain. Such
-items are sometimes referred to as the children of the sizer. Independent of how the individual sizers lay out their children,
-all children have certain features in common:
-
-**A minimal size**: This minimal size is usually identical to the initial size of the controls and may either be set explicitly in
-the :ref:`Size` field of the control constructor or may be calculated by wxPython, typically by setting the height and/or the width
-of the item to -1. Note that only some controls can calculate their size (such as a checkbox) whereas others (such as a listbox)
-don't have any natural width or height and thus require an explicit size. Some controls can calculate their height, but not their
-width (e.g. a single line text control):
-
-
-.. figure:: _static/images/overviews/overview_sizer_04.png
- :align: center
-
-
-|
-
-
-**A border**: The border is just empty space and is used to separate dialog items in a dialog. This border can either be all around,
-or at any combination of sides such as only above and below the control. The thickness of this border must be set explicitly, typically
-5 points. The following samples show dialogs with only one dialog item (a button) and a border of 0, 5, and 10 pixels around the button:
-
-
-.. figure:: _static/images/overviews/overview_sizer_02.png
- :align: center
-
-
-|
-
-
-**An alignment**: Often, a dialog item is given more space than its minimal size plus its border. Depending on what flags are used
-for the respective dialog item, the dialog item can be made to fill out the available space entirely, i.e. it will grow to a size
-larger than the minimal size, or it will be moved to either the centre of the available space or to either side of the space. The
-following sample shows a listbox and three buttons in a horizontal box sizer; one button is centred, one is aligned at the top, one is
-aligned at the bottom:
-
-
-.. figure:: _static/images/overviews/overview_sizer_06.png
- :align: center
-
-
-|
-
-
-**A stretch factor**: If a sizer contains more than one child and it is offered more space than its children and their borders need, the
-question arises how to distribute the surplus space among the children. For this purpose, a stretch factor may be assigned to each child,
-where the default value of 0 indicates that the child will not get more space than its requested minimum size. A value of more than zero
-is interpreted in relation to the sum of all stretch factors in the children of the respective sizer, i.e. if two children get a stretch
-factor of 1, they will get half the extra space each independent of whether one control has a minimal sizer inferior to the other or not.
-The following sample shows a dialog with three buttons, the first one has a stretch factor of 1 and thus gets stretched, whereas the other
-two buttons have a stretch factor of zero and keep their initial width:
-
-
-.. figure:: _static/images/overviews/overview_sizer_07.png
- :align: center
-
-
-|
-
-
-Within wxDesigner, this stretch factor gets set from the `Option` menu.
-
-
-Hiding Controls Using Sizers
-----------------------------
-
-You can hide controls contained in sizers the same way you would hide any control, using the :meth:`Window.Show` method. However, :ref:`Sizer`
-also offers a separate method which can tell the sizer not to consider that control in its size calculations. To hide a window using the
-sizer, call :meth:`Sizer.Show`. You must then call `Layout` on the sizer to force an update.
-
-This is useful when hiding parts of the interface, since you can avoid removing the controls from the sizer and having to add them back later.
-
-.. note:: This is supported only by :ref:`BoxSizer` and :ref:`FlexGridSizer`.
-
-
-
-BoxSizer
-^^^^^^^^
-
-:ref:`BoxSizer` can lay out its children either vertically or horizontally, depending on what flag is being used in its constructor.
-When using a vertical sizer, each child can be centered, aligned to the right or aligned to the left. Correspondingly, when using a
-horizontal sizer, each child can be centered, aligned at the bottom or aligned at the top. The stretch factor described in the last
-paragraph is used for the main orientation, i.e. when using a horizontal box sizer, the stretch factor determines how much the child can
-be stretched horizontally. The following sample shows the same dialog as in the last sample, only the box sizer is a vertical box sizer now:
-
-.. figure:: _static/images/overviews/overview_sizer_08.png
- :align: center
-
-
-
-StaticBoxSizer
-^^^^^^^^^^^^^^
-
-:ref:`StaticBoxSixer` is the same as a :ref:`BoxSizer`, but surrounded by a static box. Here is a sample:
-
-
-.. figure:: _static/images/overviews/overview_sizer_09.png
- :align: center
-
-
-
-GridSizer
-^^^^^^^^^
-
-:ref:`GridSizer` is a two-dimensional sizer. All children are given the same size, which is the minimal size required by the biggest
-child, in this case the text control in the left bottom border. Either the number of columns or the number or rows is fixed and the grid
-sizer will grow in the respectively other orientation if new children are added:
-
-
-.. figure:: _static/images/overviews/overview_sizer_10.png
- :align: center
-
-
-For programming information, see :ref:`GridSizer`.
-
-
-FlexGridSizer
-^^^^^^^^^^^^^
-
-Another two-dimensional sizer derived from :ref:`GridSizer`. The width of each column and the height of each row are calculated individually
-according to the minimal requirements from the respectively biggest child. Additionally, columns and rows can be declared to be stretchable
-if the sizer is assigned a size different from the one it requested. The following sample shows the same dialog as the one above, but using
-a flex grid sizer:
-
-
-.. figure:: _static/images/overviews/overview_sizer_11.png
- :align: center
-
-
-
-.. _programming with boxsizer:
-
-Programming with BoxSizer
----------------------------
-
-The basic idea behind a :ref:`BoxSizer` is that windows will most often be laid out in rather simple basic geometry, typically in a row or a
-column or several hierarchies of either.
-
-As an example, we will construct a dialog that will contain a text field at the top and two buttons at the bottom. This can be seen as a
-top-hierarchy column with the text at the top and buttons at the bottom and a low-hierarchy row with an ``OK`` button to the left and a ``Cancel``
-button to the right. In many cases (particularly dialogs under Unix and normal frames) the main window will be resizable by the user and this
-change of size will have to get propagated to its children. In our case, we want the text area to grow with the dialog, whereas the button
-shall have a fixed size. In addition, there will be a thin border around all controls to make the dialog look nice and - to make matter worse - the
-buttons shall be centred as the width of the dialog changes.
-
-It is the unique feature of a box sizer, that it can grow in both directions (height and width) but can distribute its growth in the
-main direction (horizontal for a row) `unevenly` among its children. In our example case, the vertical sizer is supposed to propagate all its
-height changes to only the text area, not to the button area. This is determined by the `proportion` parameter when adding a window (or
-another sizer) to a sizer. It is interpreted as a weight factor, i.e. it can be zero, indicating that the window may not be resized at all,
-or above zero. If several windows have a value above zero, the value is interpreted relative to the sum of all weight factors of the sizer,
-so when adding two windows with a value of 1, they will both get resized equally much and each half as much as the sizer owning them.
-Then what do we do when a column sizer changes its width? This behaviour is controlled by `flags` (the second parameter of the `Add()` function):
-Zero or no flag indicates that the window will preserve it is original size, ``GROW`` flag (same as ``EXPAND``) forces the window to grow with
-the sizer, and ``SHAPED`` flag tells the window to change it is size proportionally, preserving original aspect ratio. When ``GROW`` flag is
-not used, the item can be aligned within available space. ``ALIGN_LEFT``, ``ALIGN_TOP``, ``ALIGN_RIGHT``, ``ALIGN_BOTTOM``, ``ALIGN_CENTER_HORIZONTAL``
-and ``ALIGN_CENTER_VERTICAL`` do what they say. ``ALIGN_CENTRE`` (same as ``ALIGN_CENTER``) is defined as
-(``ALIGN_CENTER_HORIZONTAL`` | ``ALIGN_CENTER_VERTICAL``). Default alignment is ``ALIGN_LEFT`` | ``ALIGN_TOP``.
-
-As mentioned above, any window belonging to a sizer may have a border, and it can be specified which of the four sides may have this border,
-using the ``TOP``, ``LEFT``, ``RIGHT`` and ``BOTTOM`` constants or ``ALL`` for all directions (and you may also use ``NORTH``, ``WEST`` etc instead).
-These flags can be used in combination with the alignment flags above as the second parameter of the `Add()` method using the binary or operator ``|``.
-The sizer of the border also must be made known, and it is the third parameter in the `Add()` method. This means, that the entire behaviour of a
-sizer and its children can be controlled by the three parameters of the `Add()` method.
-
-Example::
-
- # We want to get a dialog that is stretchable because it
- # has a text ctrl at the top and two buttons at the bottom.
-
- class MyDialog(wx.Dialog):
-
- def __init__(self, parent, id, title):
-
- wx.Dialog(parent, id, title, wx.DefaultPosition, wx.DefaultSize,
- wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
-
- topsizer = wx.BoxSizer(wx.VERTICAL)
-
- # create text ctrl with minimal size 100x60
- topsizer.Add(
- wx.TextCtrl(self, -1, "My text.", wx.DefaultPosition, wx.Size(100,60), wx.TE_MULTILINE),
- 1, # make vertically stretchable
- wx.EXPAND | # make horizontally stretchable
- wx.ALL, # and make border all around
- 10) # set border width to 10
-
- button_sizer = wx.BoxSizer(wx.HORIZONTAL)
- button_sizer.Add(
- wx.Button(self, wx.ID_OK, "OK"),
- 0, # make horizontally unstretchable
- wx.ALL, # make border all around (implicit top alignment)
- 10) # set border width to 10
- button_sizer.Add(
- wx.Button(self, wx.ID_CANCEL, "Cancel"),
- 0, # make horizontally unstretchable
- wx.ALL, # make border all around (implicit top alignment)
- 10) # set border width to 10
-
- topsizer.Add(
- button_sizer,
- 0, # make vertically unstretchable
- wx.ALIGN_CENTER) # no border and centre horizontally
-
- self.SetSizerAndFit(topsizer) # use the sizer for layout and size window
- # accordingly and prevent it from being resized
- # to smaller size
-
-
-
-Note that the new way of specifying flags to :ref:`Sizer` is via :ref:`SizerFlags`. This class greatly eases the burden of passing flags to a :ref:`Sizer`.
-
-Here's how you'd do the previous example with :ref:`SizerFlags`::
-
-
- # We want to get a dialog that is stretchable because it
- # has a text ctrl at the top and two buttons at the bottom.
-
- class MyDialog(wx.Dialog):
-
- def __init__(self, parent, id, title):
-
- wx.Dialog(parent, id, title, wx.DefaultPosition, wx.DefaultSize,
- wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
-
- topsizer = wx.BoxSizer(wx.VERTICAL)
-
- # create text ctrl with minimal size 100x60
- topsizer.Add(
- wx.TextCtrl(self, -1, "My text.", wx.DefaultPosition, wx.Size(100,60), wx.TE_MULTILINE),
- wx.SizerFlags(1).Align().Expand().Border(wx.ALL, 10))
-
- button_sizer = wx.BoxSizer(wx.HORIZONTAL)
- button_sizer.Add(
- wx.Button(self, wx.ID_OK, "OK"),
- wx.SizerFlags(0).Align().Border(wx.ALL, 10))
-
- button_sizer.Add(
- wx.Button(self, wx.ID_CANCEL, "Cancel"),
- wx.SizerFlags(0).Align().Border(wx.ALL, 10))
-
- topsizer.Add(
- button_sizer,
- wx.SizerFlags(0).Center())
-
- self.SetSizerAndFit(topsizer) # use the sizer for layout and set size and hints
-
-
-
-Other Types of Sizers
----------------------
-
-:ref:`GridSizer` is a sizer which lays out its children in a two-dimensional table with all table fields having the same size, i.e.
-the width of each field is the width of the widest child, the height of each field is the height of the tallest child.
-
-:ref:`FlexGridSizer` is a sizer which lays out its children in a two-dimensional table with all table fields in one row having the
-same height and all fields in one column having the same width, but all rows or all columns are not necessarily the same height or
-width as in the :ref:`GridSizer`.
-
-:ref:`StaticBoxSizer` is a sizer derived from :ref:`BoxSizer` but adds a static box around the sizer. Note that this static box
-has to be created separately.
-
-:ref:`GridBagSizer` is a rather special kind of sizer which, unlike the other classes, allows to directly put the elements at the
-given position in the sizer. Please see its documentation for more details.
-
-
-CreateButtonSizer
------------------
-
-As a convenience, :meth:`Dialog.CreateButtonSizer` (flags) can be used to create a standard button sizer in which standard buttons
-are displayed. The following flags can be passed to this method::
-
- wx.YES_NO # Add Yes/No subpanel
- wx.YES # return wx.ID_YES
- wx.NO # return wx.ID_NO
- wx.NO_DEFAULT # make the wx.NO button the default,
- # otherwise wx.YES or wx.OK button will be default
-
- wx.OK # return wx.ID_OK
- wx.CANCEL # return wx.ID_CANCEL
- wx.HELP # return wx.ID_HELP
-
- wx.FORWARD # return wx.ID_FORWARD
- wx.BACKWARD # return wx.ID_BACKWARD
- wx.SETUP # return wx.ID_SETUP
- wx.MORE # return wx.ID_MORE
-
+.. include:: headings.inc
+
+
+.. _sizers overview:
+
+=============================================
+|phoenix_title| **Sizers Overview**
+=============================================
+
+
+Sizers, as represented by the :ref:`Sizer` class and its descendants in the wxPython class hierarchy, have become the method of
+choice to define the layout of controls in dialogs in wxPython because of their ability to create visually appealing dialogs
+independent of the platform, taking into account the differences in size and style of the individual controls.
+Editors such as wxDesigner, DialogBlocks, XRCed and wxWorkshop create dialogs based exclusively on sizers, practically forcing
+the user to create platform independent layouts without compromises.
+
+The next section describes and shows what can be done with sizers. The following sections briefly describe how to program with
+individual sizer classes.
+
+
+The Idea Behind Sizers
+----------------------
+
+The layout algorithm used by sizers in wxPython is closely related to layout systems in other GUI toolkits, such as Java's AWT,
+the GTK toolkit or the Qt toolkit. It is based upon the idea of individual subwindows reporting their minimal required size and
+their ability to get stretched if the size of the parent window has changed. This will most often mean that the programmer does
+not set the start-up size of a dialog, the dialog will rather be assigned a sizer and this sizer will be queried about the
+recommended size. This sizer in turn will query its children (which can be normal windows, empty space or other sizers) so
+that a hierarchy of sizers can be constructed. Note that :ref:`Sizer` does not derive from :ref:`Window` and thus does not
+interfere with tab ordering and requires very few resources compared to a real window on screen.
+
+What makes sizers so well fitted for use in wxPython is the fact that every control reports its own minimal size and the algorithm
+can handle differences in font sizes or different window (dialog item) sizes on different platforms without problems. For example,
+if the standard font as well as the overall design of Linux/GTK widgets requires more space than on Windows, the initial dialog
+size will automatically be bigger on Linux/GTK than on Windows.
+
+There are currently five different kinds of sizers available in wxPython. Each represents either a certain way to lay out dialog
+items in a dialog or it fulfills a special task such as wrapping a static box around a dialog item (or another sizer). These sizers
+will be discussed one by one in the text below. For more detailed information on how to use sizers programmatically, please refer
+to the section :ref:`Programming with BoxSizer `.
+
+
+Common Features
+---------------
+
+All sizers are containers, that is, they are used to lay out one dialog item (or several dialog items), which they contain. Such
+items are sometimes referred to as the children of the sizer. Independent of how the individual sizers lay out their children,
+all children have certain features in common:
+
+**A minimal size**: This minimal size is usually identical to the initial size of the controls and may either be set explicitly in
+the :ref:`Size` field of the control constructor or may be calculated by wxPython, typically by setting the height and/or the width
+of the item to -1. Note that only some controls can calculate their size (such as a checkbox) whereas others (such as a listbox)
+don't have any natural width or height and thus require an explicit size. Some controls can calculate their height, but not their
+width (e.g. a single line text control):
+
+
+.. figure:: _static/images/overviews/overview_sizer_04.png
+ :align: center
+
+
+|
+
+
+**A border**: The border is just empty space and is used to separate dialog items in a dialog. This border can either be all around,
+or at any combination of sides such as only above and below the control. The thickness of this border must be set explicitly, typically
+5 points. The following samples show dialogs with only one dialog item (a button) and a border of 0, 5, and 10 pixels around the button:
+
+
+.. figure:: _static/images/overviews/overview_sizer_02.png
+ :align: center
+
+
+|
+
+
+**An alignment**: Often, a dialog item is given more space than its minimal size plus its border. Depending on what flags are used
+for the respective dialog item, the dialog item can be made to fill out the available space entirely, i.e. it will grow to a size
+larger than the minimal size, or it will be moved to either the centre of the available space or to either side of the space. The
+following sample shows a listbox and three buttons in a horizontal box sizer; one button is centred, one is aligned at the top, one is
+aligned at the bottom:
+
+
+.. figure:: _static/images/overviews/overview_sizer_06.png
+ :align: center
+
+
+|
+
+
+**A stretch factor**: If a sizer contains more than one child and it is offered more space than its children and their borders need, the
+question arises how to distribute the surplus space among the children. For this purpose, a stretch factor may be assigned to each child,
+where the default value of 0 indicates that the child will not get more space than its requested minimum size. A value of more than zero
+is interpreted in relation to the sum of all stretch factors in the children of the respective sizer, i.e. if two children get a stretch
+factor of 1, they will get half the extra space each independent of whether one control has a minimal sizer inferior to the other or not.
+The following sample shows a dialog with three buttons, the first one has a stretch factor of 1 and thus gets stretched, whereas the other
+two buttons have a stretch factor of zero and keep their initial width:
+
+
+.. figure:: _static/images/overviews/overview_sizer_07.png
+ :align: center
+
+
+|
+
+
+Within wxDesigner, this stretch factor gets set from the `Option` menu.
+
+
+Hiding Controls Using Sizers
+----------------------------
+
+You can hide controls contained in sizers the same way you would hide any control, using the :meth:`Window.Show` method. However, :ref:`Sizer`
+also offers a separate method which can tell the sizer not to consider that control in its size calculations. To hide a window using the
+sizer, call :meth:`Sizer.Show`. You must then call `Layout` on the sizer to force an update.
+
+This is useful when hiding parts of the interface, since you can avoid removing the controls from the sizer and having to add them back later.
+
+.. note:: This is supported only by :ref:`BoxSizer` and :ref:`FlexGridSizer`.
+
+
+
+BoxSizer
+^^^^^^^^
+
+:ref:`BoxSizer` can lay out its children either vertically or horizontally, depending on what flag is being used in its constructor.
+When using a vertical sizer, each child can be centered, aligned to the right or aligned to the left. Correspondingly, when using a
+horizontal sizer, each child can be centered, aligned at the bottom or aligned at the top. The stretch factor described in the last
+paragraph is used for the main orientation, i.e. when using a horizontal box sizer, the stretch factor determines how much the child can
+be stretched horizontally. The following sample shows the same dialog as in the last sample, only the box sizer is a vertical box sizer now:
+
+.. figure:: _static/images/overviews/overview_sizer_08.png
+ :align: center
+
+
+
+StaticBoxSizer
+^^^^^^^^^^^^^^
+
+:ref:`StaticBoxSixer` is the same as a :ref:`BoxSizer`, but surrounded by a static box. Here is a sample:
+
+
+.. figure:: _static/images/overviews/overview_sizer_09.png
+ :align: center
+
+
+
+GridSizer
+^^^^^^^^^
+
+:ref:`GridSizer` is a two-dimensional sizer. All children are given the same size, which is the minimal size required by the biggest
+child, in this case the text control in the left bottom border. Either the number of columns or the number or rows is fixed and the grid
+sizer will grow in the respectively other orientation if new children are added:
+
+
+.. figure:: _static/images/overviews/overview_sizer_10.png
+ :align: center
+
+
+For programming information, see :ref:`GridSizer`.
+
+
+FlexGridSizer
+^^^^^^^^^^^^^
+
+Another two-dimensional sizer derived from :ref:`GridSizer`. The width of each column and the height of each row are calculated individually
+according to the minimal requirements from the respectively biggest child. Additionally, columns and rows can be declared to be stretchable
+if the sizer is assigned a size different from the one it requested. The following sample shows the same dialog as the one above, but using
+a flex grid sizer:
+
+
+.. figure:: _static/images/overviews/overview_sizer_11.png
+ :align: center
+
+
+
+.. _programming with boxsizer:
+
+Programming with BoxSizer
+---------------------------
+
+The basic idea behind a :ref:`BoxSizer` is that windows will most often be laid out in rather simple basic geometry, typically in a row or a
+column or several hierarchies of either.
+
+As an example, we will construct a dialog that will contain a text field at the top and two buttons at the bottom. This can be seen as a
+top-hierarchy column with the text at the top and buttons at the bottom and a low-hierarchy row with an ``OK`` button to the left and a ``Cancel``
+button to the right. In many cases (particularly dialogs under Unix and normal frames) the main window will be resizable by the user and this
+change of size will have to get propagated to its children. In our case, we want the text area to grow with the dialog, whereas the button
+shall have a fixed size. In addition, there will be a thin border around all controls to make the dialog look nice and - to make matter worse - the
+buttons shall be centred as the width of the dialog changes.
+
+It is the unique feature of a box sizer, that it can grow in both directions (height and width) but can distribute its growth in the
+main direction (horizontal for a row) `unevenly` among its children. In our example case, the vertical sizer is supposed to propagate all its
+height changes to only the text area, not to the button area. This is determined by the `proportion` parameter when adding a window (or
+another sizer) to a sizer. It is interpreted as a weight factor, i.e. it can be zero, indicating that the window may not be resized at all,
+or above zero. If several windows have a value above zero, the value is interpreted relative to the sum of all weight factors of the sizer,
+so when adding two windows with a value of 1, they will both get resized equally much and each half as much as the sizer owning them.
+Then what do we do when a column sizer changes its width? This behaviour is controlled by `flags` (the second parameter of the `Add()` function):
+Zero or no flag indicates that the window will preserve it is original size, ``GROW`` flag (same as ``EXPAND``) forces the window to grow with
+the sizer, and ``SHAPED`` flag tells the window to change it is size proportionally, preserving original aspect ratio. When ``GROW`` flag is
+not used, the item can be aligned within available space. ``ALIGN_LEFT``, ``ALIGN_TOP``, ``ALIGN_RIGHT``, ``ALIGN_BOTTOM``, ``ALIGN_CENTER_HORIZONTAL``
+and ``ALIGN_CENTER_VERTICAL`` do what they say. ``ALIGN_CENTRE`` (same as ``ALIGN_CENTER``) is defined as
+(``ALIGN_CENTER_HORIZONTAL`` | ``ALIGN_CENTER_VERTICAL``). Default alignment is ``ALIGN_LEFT`` | ``ALIGN_TOP``.
+
+As mentioned above, any window belonging to a sizer may have a border, and it can be specified which of the four sides may have this border,
+using the ``TOP``, ``LEFT``, ``RIGHT`` and ``BOTTOM`` constants or ``ALL`` for all directions (and you may also use ``NORTH``, ``WEST`` etc instead).
+These flags can be used in combination with the alignment flags above as the second parameter of the `Add()` method using the binary or operator ``|``.
+The sizer of the border also must be made known, and it is the third parameter in the `Add()` method. This means, that the entire behaviour of a
+sizer and its children can be controlled by the three parameters of the `Add()` method.
+
+Example::
+
+ # We want to get a dialog that is stretchable because it
+ # has a text ctrl at the top and two buttons at the bottom.
+
+ class MyDialog(wx.Dialog):
+
+ def __init__(self, parent, id, title):
+
+ wx.Dialog(parent, id, title, wx.DefaultPosition, wx.DefaultSize,
+ wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
+
+ topsizer = wx.BoxSizer(wx.VERTICAL)
+
+ # create text ctrl with minimal size 100x60
+ topsizer.Add(
+ wx.TextCtrl(self, -1, "My text.", wx.DefaultPosition, wx.Size(100,60), wx.TE_MULTILINE),
+ 1, # make vertically stretchable
+ wx.EXPAND | # make horizontally stretchable
+ wx.ALL, # and make border all around
+ 10) # set border width to 10
+
+ button_sizer = wx.BoxSizer(wx.HORIZONTAL)
+ button_sizer.Add(
+ wx.Button(self, wx.ID_OK, "OK"),
+ 0, # make horizontally unstretchable
+ wx.ALL, # make border all around (implicit top alignment)
+ 10) # set border width to 10
+ button_sizer.Add(
+ wx.Button(self, wx.ID_CANCEL, "Cancel"),
+ 0, # make horizontally unstretchable
+ wx.ALL, # make border all around (implicit top alignment)
+ 10) # set border width to 10
+
+ topsizer.Add(
+ button_sizer,
+ 0, # make vertically unstretchable
+ wx.ALIGN_CENTER) # no border and centre horizontally
+
+ self.SetSizerAndFit(topsizer) # use the sizer for layout and size window
+ # accordingly and prevent it from being resized
+ # to smaller size
+
+
+
+Note that the new way of specifying flags to :ref:`Sizer` is via :ref:`SizerFlags`. This class greatly eases the burden of passing flags to a :ref:`Sizer`.
+
+Here's how you'd do the previous example with :ref:`SizerFlags`::
+
+
+ # We want to get a dialog that is stretchable because it
+ # has a text ctrl at the top and two buttons at the bottom.
+
+ class MyDialog(wx.Dialog):
+
+ def __init__(self, parent, id, title):
+
+ wx.Dialog(parent, id, title, wx.DefaultPosition, wx.DefaultSize,
+ wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
+
+ topsizer = wx.BoxSizer(wx.VERTICAL)
+
+ # create text ctrl with minimal size 100x60
+ topsizer.Add(
+ wx.TextCtrl(self, -1, "My text.", wx.DefaultPosition, wx.Size(100,60), wx.TE_MULTILINE),
+ wx.SizerFlags(1).Align().Expand().Border(wx.ALL, 10))
+
+ button_sizer = wx.BoxSizer(wx.HORIZONTAL)
+ button_sizer.Add(
+ wx.Button(self, wx.ID_OK, "OK"),
+ wx.SizerFlags(0).Align().Border(wx.ALL, 10))
+
+ button_sizer.Add(
+ wx.Button(self, wx.ID_CANCEL, "Cancel"),
+ wx.SizerFlags(0).Align().Border(wx.ALL, 10))
+
+ topsizer.Add(
+ button_sizer,
+ wx.SizerFlags(0).Center())
+
+ self.SetSizerAndFit(topsizer) # use the sizer for layout and set size and hints
+
+
+
+Other Types of Sizers
+---------------------
+
+:ref:`GridSizer` is a sizer which lays out its children in a two-dimensional table with all table fields having the same size, i.e.
+the width of each field is the width of the widest child, the height of each field is the height of the tallest child.
+
+:ref:`FlexGridSizer` is a sizer which lays out its children in a two-dimensional table with all table fields in one row having the
+same height and all fields in one column having the same width, but all rows or all columns are not necessarily the same height or
+width as in the :ref:`GridSizer`.
+
+:ref:`StaticBoxSizer` is a sizer derived from :ref:`BoxSizer` but adds a static box around the sizer. Note that this static box
+has to be created separately.
+
+:ref:`GridBagSizer` is a rather special kind of sizer which, unlike the other classes, allows to directly put the elements at the
+given position in the sizer. Please see its documentation for more details.
+
+
+CreateButtonSizer
+-----------------
+
+As a convenience, :meth:`Dialog.CreateButtonSizer` (flags) can be used to create a standard button sizer in which standard buttons
+are displayed. The following flags can be passed to this method::
+
+ wx.YES_NO # Add Yes/No subpanel
+ wx.YES # return wx.ID_YES
+ wx.NO # return wx.ID_NO
+ wx.NO_DEFAULT # make the wx.NO button the default,
+ # otherwise wx.YES or wx.OK button will be default
+
+ wx.OK # return wx.ID_OK
+ wx.CANCEL # return wx.ID_CANCEL
+ wx.HELP # return wx.ID_HELP
+
+ wx.FORWARD # return wx.ID_FORWARD
+ wx.BACKWARD # return wx.ID_BACKWARD
+ wx.SETUP # return wx.ID_SETUP
+ wx.MORE # return wx.ID_MORE
+
diff --git a/docs/sphinx/rest_substitutions/overviews/splitterwindow_overview.rst b/docs/sphinx/rest_substitutions/overviews/splitterwindow_overview.rst
index e7e1ff2e..65d46503 100644
--- a/docs/sphinx/rest_substitutions/overviews/splitterwindow_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/splitterwindow_overview.rst
@@ -1,69 +1,69 @@
-.. include:: headings.inc
-
-
-.. _splitterwindow overview:
-
-=================================================
-|phoenix_title| **Splitter Windows Overview**
-=================================================
-
-
-The following screenshot shows the appearance of a splitter window with a horizontal split.
-
-The style ``SP_3D`` has been used to show a 3D border and 3D sash.
-
-.. figure:: _static/images/overviews/overview_splitter_3d.png
- :align: center
-
-
-
-Example
--------
-
-The following fragment shows how to create a splitter window, creating two subwindows and hiding one of them::
-
- splitter = wx.SplitterWindow(self, -1, wx.Point(0, 0),
- wx.Size(400, 400), wx.SP_3D)
-
- leftWindow = MyWindow(splitter)
- leftWindow.SetScrollbars(20, 20, 50, 50)
-
- rightWindow = MyWindow(splitter)
- rightWindow.SetScrollbars(20, 20, 50, 50)
- rightWindow.Show(False)
-
- splitter.Initialize(leftWindow)
-
- # Set this to prevent unsplitting
- # splitter.SetMinimumPaneSize(20)
-
-
-The next fragment shows how the splitter window can be manipulated after creation::
-
- def OnSplitVertical(self, event):
-
- if splitter.IsSplit():
- splitter.Unsplit()
-
- leftWindow.Show(True)
- rightWindow.Show(True)
- splitter.SplitVertically(leftWindow, rightWindow)
-
-
- def OnSplitHorizontal(self, event):
-
- if splitter.IsSplit():
- splitter.Unsplit()
-
- leftWindow.Show(True)
- rightWindow.Show(True)
- splitter.SplitHorizontally(leftWindow, rightWindow)
-
-
- def OnUnsplit(self, event):
-
- if splitter.IsSplit():
- splitter.Unsplit()
-
-
-
+.. include:: headings.inc
+
+
+.. _splitterwindow overview:
+
+=================================================
+|phoenix_title| **Splitter Windows Overview**
+=================================================
+
+
+The following screenshot shows the appearance of a splitter window with a horizontal split.
+
+The style ``SP_3D`` has been used to show a 3D border and 3D sash.
+
+.. figure:: _static/images/overviews/overview_splitter_3d.png
+ :align: center
+
+
+
+Example
+-------
+
+The following fragment shows how to create a splitter window, creating two subwindows and hiding one of them::
+
+ splitter = wx.SplitterWindow(self, -1, wx.Point(0, 0),
+ wx.Size(400, 400), wx.SP_3D)
+
+ leftWindow = MyWindow(splitter)
+ leftWindow.SetScrollbars(20, 20, 50, 50)
+
+ rightWindow = MyWindow(splitter)
+ rightWindow.SetScrollbars(20, 20, 50, 50)
+ rightWindow.Show(False)
+
+ splitter.Initialize(leftWindow)
+
+ # Set this to prevent unsplitting
+ # splitter.SetMinimumPaneSize(20)
+
+
+The next fragment shows how the splitter window can be manipulated after creation::
+
+ def OnSplitVertical(self, event):
+
+ if splitter.IsSplit():
+ splitter.Unsplit()
+
+ leftWindow.Show(True)
+ rightWindow.Show(True)
+ splitter.SplitVertically(leftWindow, rightWindow)
+
+
+ def OnSplitHorizontal(self, event):
+
+ if splitter.IsSplit():
+ splitter.Unsplit()
+
+ leftWindow.Show(True)
+ rightWindow.Show(True)
+ splitter.SplitHorizontally(leftWindow, rightWindow)
+
+
+ def OnUnsplit(self, event):
+
+ if splitter.IsSplit():
+ splitter.Unsplit()
+
+
+
diff --git a/docs/sphinx/rest_substitutions/overviews/standard_event_identifiers.rst b/docs/sphinx/rest_substitutions/overviews/standard_event_identifiers.rst
index 3b90402d..10114e17 100644
--- a/docs/sphinx/rest_substitutions/overviews/standard_event_identifiers.rst
+++ b/docs/sphinx/rest_substitutions/overviews/standard_event_identifiers.rst
@@ -1,24 +1,24 @@
-.. include:: headings.inc
-
-
-.. _standard event identifiers:
-
-===============================================
-|phoenix_title| **Standard event identifiers**
-===============================================
-
-wxPython defines a special identifier value ``ID_ANY`` (-1) which is used in the following two situations:
-
-- When creating a new window you may specify ``ID_ANY`` to let wxPython assign an unused identifier to it automatically
-- When installing an event handler using :meth:`EvtHandler.Bind`, you may use it to indicate that you want to handle
- the events coming from any control, regardless of its identifier
-
-
-Another standard special identifier value is ``ID_NONE``: this is a value which is not matched by any other id.
-
-wxPython also defines a few standard command identifiers which may be used by the user code and also are sometimes
-used by wxPython itself. These reserved identifiers are all in the range between ``ID_LOWEST`` and ``ID_HIGHEST`` and,
-accordingly, the user code should avoid defining its own constants in this range (e.g. by using :func:`NewId` ()).
-
-Refer to :ref:`the list of stock items ` for the subset of standard IDs which are stock IDs as well.
-
+.. include:: headings.inc
+
+
+.. _standard event identifiers:
+
+===============================================
+|phoenix_title| **Standard event identifiers**
+===============================================
+
+wxPython defines a special identifier value ``ID_ANY`` (-1) which is used in the following two situations:
+
+- When creating a new window you may specify ``ID_ANY`` to let wxPython assign an unused identifier to it automatically
+- When installing an event handler using :meth:`EvtHandler.Bind`, you may use it to indicate that you want to handle
+ the events coming from any control, regardless of its identifier
+
+
+Another standard special identifier value is ``ID_NONE``: this is a value which is not matched by any other id.
+
+wxPython also defines a few standard command identifiers which may be used by the user code and also are sometimes
+used by wxPython itself. These reserved identifiers are all in the range between ``ID_LOWEST`` and ``ID_HIGHEST`` and,
+accordingly, the user code should avoid defining its own constants in this range (e.g. by using :func:`NewId` ()).
+
+Refer to :ref:`the list of stock items ` for the subset of standard IDs which are stock IDs as well.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/stock_items.rst b/docs/sphinx/rest_substitutions/overviews/stock_items.rst
index c2190b5a..5761e0d5 100644
--- a/docs/sphinx/rest_substitutions/overviews/stock_items.rst
+++ b/docs/sphinx/rest_substitutions/overviews/stock_items.rst
@@ -1,241 +1,241 @@
-.. include:: headings.inc
-
-
-.. _stock items:
-.. _stock id list:
-
-===============================================
-|phoenix_title| **Stock items**
-===============================================
-
-The following is the list of the window IDs for which stock buttons and menu items are created.
-
-See the :ref:`Button` constructor and the :ref:`MenuItem` constructor for classes which automatically
-add stock bitmaps when using stock IDs. Also note that you can retrieve stock bitmaps using :ref:`ArtProvider`.
-
-
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| Stock ID | GTK Icon | Stock label |
-+======================================+======================================================================+==========================+
-| ``ID_ABOUT`` | .. figure:: _static/images/stock/gtk-about.png | &About... |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_ADD`` | .. figure:: _static/images/stock/gtk-add.png | Add |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_APPLY`` | .. figure:: _static/images/stock/gtk-apply.png | &Apply |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_BACKWARD`` | .. figure:: _static/images/stock/gtk-go-back-ltr.png | &Back |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_BOLD`` | .. figure:: _static/images/stock/gtk-bold.png | &Bold |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_BOTTOM`` | .. figure:: _static/images/stock/gtk-goto-bottom.png | &Bottom |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_CANCEL`` | .. figure:: _static/images/stock/gtk-cancel.png | &Cancel |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_CDROM`` | .. figure:: _static/images/stock/gtk-cdrom.png | &CD-Rom |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_CLEAR`` | .. figure:: _static/images/stock/gtk-clear.png | &Clear |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_CLOSE`` | .. figure:: _static/images/stock/gtk-close.png | &Close |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_CONVERT`` | .. figure:: _static/images/stock/gtk-convert.png | &Convert |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_COPY`` | .. figure:: _static/images/stock/gtk-copy.png | &Copy |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_CUT`` | .. figure:: _static/images/stock/gtk-cut.png | Cu&t |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_DELETE`` | .. figure:: _static/images/stock/gtk-delete.png | &Delete |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_DOWN`` | .. figure:: _static/images/stock/gtk-go-down.png | &Down |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_EDIT`` | .. figure:: _static/images/stock/gtk-edit.png | &Edit |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_EXECUTE`` | .. figure:: _static/images/stock/gtk-execute.png | &Execute |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_EXIT`` | .. figure:: _static/images/stock/gtk-quit.png | &Quit |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_FILE`` | .. figure:: _static/images/stock/gtk-file.png | &File |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_FIND`` | .. figure:: _static/images/stock/gtk-find.png | &Find |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_FIRST`` | .. figure:: _static/images/stock/gtk-goto-first-ltr.png | &First |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_FLOPPY`` | .. figure:: _static/images/stock/gtk-floppy.png | &Floppy |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_FORWARD`` | .. figure:: _static/images/stock/gtk-go-forward-ltr.png | &Forward |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_HARDDISK`` | .. figure:: _static/images/stock/gtk-harddisk.png | &Harddisk |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_HELP`` | .. figure:: _static/images/stock/gtk-help.png | &Help |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_HOME`` | .. figure:: _static/images/stock/gtk-home.png | &Home |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_INDENT`` | .. figure:: _static/images/stock/gtk-indent-ltr.png | Indent |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_INDEX`` | .. figure:: _static/images/stock/gtk-index.png | &Index |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_INFO`` | .. figure:: _static/images/stock/gtk-info.png | &Info |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_ITALIC`` | .. figure:: _static/images/stock/gtk-italic.png | &Italic |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_JUMP_TO`` | .. figure:: _static/images/stock/gtk-jump-to-ltr.png | &Jump to |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_JUSTIFY_CENTER`` | .. figure:: _static/images/stock/gtk-justify-center.png | Centered |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_JUSTIFY_FILL`` | .. figure:: _static/images/stock/gtk-justify-fill.png | Justified |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_JUSTIFY_LEFT`` | .. figure:: _static/images/stock/gtk-justify-left.png | Align Left |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_JUSTIFY_RIGHT`` | .. figure:: _static/images/stock/gtk-justify-right.png | Align Right |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_LAST`` | .. figure:: _static/images/stock/gtk-goto-last-ltr.png | &Last |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_NETWORK`` | .. figure:: _static/images/stock/gtk-network.png | &Network |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_NEW`` | .. figure:: _static/images/stock/gtk-new.png | &New |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_NO`` | .. figure:: _static/images/stock/gtk-no.png | &No |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_OK`` | .. figure:: _static/images/stock/gtk-ok.png | &OK |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_OPEN`` | .. figure:: _static/images/stock/gtk-open.png | &Open... |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_PASTE`` | .. figure:: _static/images/stock/gtk-paste.png | &Paste |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_PREFERENCES`` | .. figure:: _static/images/stock/gtk-preferences.png | &Preferences |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_PREVIEW`` | .. figure:: _static/images/stock/gtk-print-preview.png | Print previe&w |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_PRINT`` | .. figure:: _static/images/stock/gtk-print.png | &Print... |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_PROPERTIES`` | .. figure:: _static/images/stock/gtk-properties.png | &Properties |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_REDO`` | .. figure:: _static/images/stock/gtk-redo-ltr.png | &Redo |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_REFRESH`` | .. figure:: _static/images/stock/gtk-refresh.png | Refresh |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_REMOVE`` | .. figure:: _static/images/stock/gtk-remove.png | Remove |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_REPLACE`` | .. figure:: _static/images/stock/gtk-find-and-replace.png | Rep&lace |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_REVERT_TO_SAVED`` | .. figure:: _static/images/stock/gtk-revert-to-saved-ltr.png | Revert to Saved |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_SAVE`` | .. figure:: _static/images/stock/gtk-save.png | &Save |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_SAVEAS`` | .. figure:: _static/images/stock/gtk-save-as.png | Save &As... |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_SELECTALL`` | .. figure:: _static/images/stock/gtk-select-all.png | Select &All |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_SELECT_COLOR`` | .. figure:: _static/images/stock/gtk-select-color.png | &Color |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_SELECT_FONT`` | .. figure:: _static/images/stock/gtk-select-font.png | &Font |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_SORT_ASCENDING`` | .. figure:: _static/images/stock/gtk-sort-ascending.png | &Ascending |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_SORT_DESCENDING`` | .. figure:: _static/images/stock/gtk-sort-descending.png | &Descending |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_SPELL_CHECK`` | .. figure:: _static/images/stock/gtk-spell-check.png | &Spell Check |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_STOP`` | .. figure:: _static/images/stock/gtk-stop.png | &Stop |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_STRIKETHROUGH`` | .. figure:: _static/images/stock/gtk-strikethrough.png | &Strikethrough |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_TOP`` | .. figure:: _static/images/stock/gtk-goto-top.png | &Top |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_UNDELETE`` | .. figure:: _static/images/stock/gtk-undelete-ltr.png | Undelete |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_UNDERLINE`` | .. figure:: _static/images/stock/gtk-underline.png | &Underline |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_UNDO`` | .. figure:: _static/images/stock/gtk-undo-ltr.png | &Undo |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_UNINDENT`` | .. figure:: _static/images/stock/gtk-unindent-ltr.png | &Unindent |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_UP`` | .. figure:: _static/images/stock/gtk-go-up.png | &Up |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_YES`` | .. figure:: _static/images/stock/gtk-yes.png | &Yes |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_ZOOM_100`` | .. figure:: _static/images/stock/gtk-zoom-100.png | &Actual Size |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_ZOOM_FIT`` | .. figure:: _static/images/stock/gtk-zoom-fit.png | Zoom to &Fit |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_ZOOM_IN`` | .. figure:: _static/images/stock/gtk-zoom-in.png | Zoom &In |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-| ``ID_ZOOM_OUT`` | .. figure:: _static/images/stock/gtk-zoom-out.png | Zoom &Out |
-| | :align: left | |
-+--------------------------------------+----------------------------------------------------------------------+--------------------------+
-
-
-|
-
-.. note:: Note that some of the IDs listed above also have a stock accelerator and an associated help string.
-
+.. include:: headings.inc
+
+
+.. _stock items:
+.. _stock id list:
+
+===============================================
+|phoenix_title| **Stock items**
+===============================================
+
+The following is the list of the window IDs for which stock buttons and menu items are created.
+
+See the :ref:`Button` constructor and the :ref:`MenuItem` constructor for classes which automatically
+add stock bitmaps when using stock IDs. Also note that you can retrieve stock bitmaps using :ref:`ArtProvider`.
+
+
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| Stock ID | GTK Icon | Stock label |
++======================================+======================================================================+==========================+
+| ``ID_ABOUT`` | .. figure:: _static/images/stock/gtk-about.png | &About... |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_ADD`` | .. figure:: _static/images/stock/gtk-add.png | Add |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_APPLY`` | .. figure:: _static/images/stock/gtk-apply.png | &Apply |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_BACKWARD`` | .. figure:: _static/images/stock/gtk-go-back-ltr.png | &Back |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_BOLD`` | .. figure:: _static/images/stock/gtk-bold.png | &Bold |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_BOTTOM`` | .. figure:: _static/images/stock/gtk-goto-bottom.png | &Bottom |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_CANCEL`` | .. figure:: _static/images/stock/gtk-cancel.png | &Cancel |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_CDROM`` | .. figure:: _static/images/stock/gtk-cdrom.png | &CD-Rom |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_CLEAR`` | .. figure:: _static/images/stock/gtk-clear.png | &Clear |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_CLOSE`` | .. figure:: _static/images/stock/gtk-close.png | &Close |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_CONVERT`` | .. figure:: _static/images/stock/gtk-convert.png | &Convert |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_COPY`` | .. figure:: _static/images/stock/gtk-copy.png | &Copy |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_CUT`` | .. figure:: _static/images/stock/gtk-cut.png | Cu&t |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_DELETE`` | .. figure:: _static/images/stock/gtk-delete.png | &Delete |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_DOWN`` | .. figure:: _static/images/stock/gtk-go-down.png | &Down |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_EDIT`` | .. figure:: _static/images/stock/gtk-edit.png | &Edit |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_EXECUTE`` | .. figure:: _static/images/stock/gtk-execute.png | &Execute |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_EXIT`` | .. figure:: _static/images/stock/gtk-quit.png | &Quit |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_FILE`` | .. figure:: _static/images/stock/gtk-file.png | &File |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_FIND`` | .. figure:: _static/images/stock/gtk-find.png | &Find |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_FIRST`` | .. figure:: _static/images/stock/gtk-goto-first-ltr.png | &First |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_FLOPPY`` | .. figure:: _static/images/stock/gtk-floppy.png | &Floppy |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_FORWARD`` | .. figure:: _static/images/stock/gtk-go-forward-ltr.png | &Forward |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_HARDDISK`` | .. figure:: _static/images/stock/gtk-harddisk.png | &Harddisk |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_HELP`` | .. figure:: _static/images/stock/gtk-help.png | &Help |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_HOME`` | .. figure:: _static/images/stock/gtk-home.png | &Home |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_INDENT`` | .. figure:: _static/images/stock/gtk-indent-ltr.png | Indent |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_INDEX`` | .. figure:: _static/images/stock/gtk-index.png | &Index |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_INFO`` | .. figure:: _static/images/stock/gtk-info.png | &Info |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_ITALIC`` | .. figure:: _static/images/stock/gtk-italic.png | &Italic |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_JUMP_TO`` | .. figure:: _static/images/stock/gtk-jump-to-ltr.png | &Jump to |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_JUSTIFY_CENTER`` | .. figure:: _static/images/stock/gtk-justify-center.png | Centered |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_JUSTIFY_FILL`` | .. figure:: _static/images/stock/gtk-justify-fill.png | Justified |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_JUSTIFY_LEFT`` | .. figure:: _static/images/stock/gtk-justify-left.png | Align Left |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_JUSTIFY_RIGHT`` | .. figure:: _static/images/stock/gtk-justify-right.png | Align Right |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_LAST`` | .. figure:: _static/images/stock/gtk-goto-last-ltr.png | &Last |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_NETWORK`` | .. figure:: _static/images/stock/gtk-network.png | &Network |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_NEW`` | .. figure:: _static/images/stock/gtk-new.png | &New |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_NO`` | .. figure:: _static/images/stock/gtk-no.png | &No |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_OK`` | .. figure:: _static/images/stock/gtk-ok.png | &OK |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_OPEN`` | .. figure:: _static/images/stock/gtk-open.png | &Open... |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_PASTE`` | .. figure:: _static/images/stock/gtk-paste.png | &Paste |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_PREFERENCES`` | .. figure:: _static/images/stock/gtk-preferences.png | &Preferences |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_PREVIEW`` | .. figure:: _static/images/stock/gtk-print-preview.png | Print previe&w |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_PRINT`` | .. figure:: _static/images/stock/gtk-print.png | &Print... |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_PROPERTIES`` | .. figure:: _static/images/stock/gtk-properties.png | &Properties |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_REDO`` | .. figure:: _static/images/stock/gtk-redo-ltr.png | &Redo |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_REFRESH`` | .. figure:: _static/images/stock/gtk-refresh.png | Refresh |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_REMOVE`` | .. figure:: _static/images/stock/gtk-remove.png | Remove |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_REPLACE`` | .. figure:: _static/images/stock/gtk-find-and-replace.png | Rep&lace |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_REVERT_TO_SAVED`` | .. figure:: _static/images/stock/gtk-revert-to-saved-ltr.png | Revert to Saved |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_SAVE`` | .. figure:: _static/images/stock/gtk-save.png | &Save |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_SAVEAS`` | .. figure:: _static/images/stock/gtk-save-as.png | Save &As... |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_SELECTALL`` | .. figure:: _static/images/stock/gtk-select-all.png | Select &All |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_SELECT_COLOR`` | .. figure:: _static/images/stock/gtk-select-color.png | &Color |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_SELECT_FONT`` | .. figure:: _static/images/stock/gtk-select-font.png | &Font |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_SORT_ASCENDING`` | .. figure:: _static/images/stock/gtk-sort-ascending.png | &Ascending |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_SORT_DESCENDING`` | .. figure:: _static/images/stock/gtk-sort-descending.png | &Descending |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_SPELL_CHECK`` | .. figure:: _static/images/stock/gtk-spell-check.png | &Spell Check |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_STOP`` | .. figure:: _static/images/stock/gtk-stop.png | &Stop |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_STRIKETHROUGH`` | .. figure:: _static/images/stock/gtk-strikethrough.png | &Strikethrough |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_TOP`` | .. figure:: _static/images/stock/gtk-goto-top.png | &Top |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_UNDELETE`` | .. figure:: _static/images/stock/gtk-undelete-ltr.png | Undelete |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_UNDERLINE`` | .. figure:: _static/images/stock/gtk-underline.png | &Underline |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_UNDO`` | .. figure:: _static/images/stock/gtk-undo-ltr.png | &Undo |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_UNINDENT`` | .. figure:: _static/images/stock/gtk-unindent-ltr.png | &Unindent |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_UP`` | .. figure:: _static/images/stock/gtk-go-up.png | &Up |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_YES`` | .. figure:: _static/images/stock/gtk-yes.png | &Yes |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_ZOOM_100`` | .. figure:: _static/images/stock/gtk-zoom-100.png | &Actual Size |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_ZOOM_FIT`` | .. figure:: _static/images/stock/gtk-zoom-fit.png | Zoom to &Fit |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_ZOOM_IN`` | .. figure:: _static/images/stock/gtk-zoom-in.png | Zoom &In |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+| ``ID_ZOOM_OUT`` | .. figure:: _static/images/stock/gtk-zoom-out.png | Zoom &Out |
+| | :align: left | |
++--------------------------------------+----------------------------------------------------------------------+--------------------------+
+
+
+|
+
+.. note:: Note that some of the IDs listed above also have a stock accelerator and an associated help string.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/toolbar_overview.rst b/docs/sphinx/rest_substitutions/overviews/toolbar_overview.rst
index 39561e2d..3e122cb5 100644
--- a/docs/sphinx/rest_substitutions/overviews/toolbar_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/toolbar_overview.rst
@@ -1,34 +1,34 @@
-.. include:: headings.inc
-
-
-.. _toolbar overview:
-
-===========================================
-|phoenix_title| **ToolBar Overview**
-===========================================
-
-Introduction
-------------
-
-The toolbar family of classes allows an application to use toolbars in a variety of configurations and styles.
-
-The toolbar is a popular user interface component and contains a set of bitmap buttons or toggles.
-A toolbar gives faster access to an application's facilities than menus, which have to be popped up and
-selected rather laboriously.
-
-Instead of supplying one toolbar class with a number of different implementations depending on platform, wxPython
-separates out the classes. This is because there are a number of different toolbar styles that you may wish to use
-simultaneously, and also, future toolbar implementations will emerge which cannot all be shoe-horned into the one class.
-
-A toolbar might appear as a single row of images under the menubar, or it might be in a separate frame layout
-in several rows and columns. The class handles the layout of the images, unless explicit positioning is requested.
-
-A tool is a bitmap which can either be a button (there is no 'state', it just generates an event when clicked) or it
-can be a toggle. If a toggle, a second bitmap can be provided to depict the 'on' state; if the second bitmap is omitted,
-either the inverse of the first bitmap will be used (for monochrome displays) or a thick border is drawn around the
-bitmap (for colour displays where inverting will not have the desired result).
-
-The Windows-specific toolbar classes expect 16-colour bitmaps that are 16 pixels wide and 15 pixels high. If you want
-to use a different size, call :meth:`ToolBar.SetToolBitmapSize` as the demo shows, before adding tools to the button bar.
-Don't supply more than one bitmap for each tool, because the toolbar generates all three images (normal, depressed,
+.. include:: headings.inc
+
+
+.. _toolbar overview:
+
+===========================================
+|phoenix_title| **ToolBar Overview**
+===========================================
+
+Introduction
+------------
+
+The toolbar family of classes allows an application to use toolbars in a variety of configurations and styles.
+
+The toolbar is a popular user interface component and contains a set of bitmap buttons or toggles.
+A toolbar gives faster access to an application's facilities than menus, which have to be popped up and
+selected rather laboriously.
+
+Instead of supplying one toolbar class with a number of different implementations depending on platform, wxPython
+separates out the classes. This is because there are a number of different toolbar styles that you may wish to use
+simultaneously, and also, future toolbar implementations will emerge which cannot all be shoe-horned into the one class.
+
+A toolbar might appear as a single row of images under the menubar, or it might be in a separate frame layout
+in several rows and columns. The class handles the layout of the images, unless explicit positioning is requested.
+
+A tool is a bitmap which can either be a button (there is no 'state', it just generates an event when clicked) or it
+can be a toggle. If a toggle, a second bitmap can be provided to depict the 'on' state; if the second bitmap is omitted,
+either the inverse of the first bitmap will be used (for monochrome displays) or a thick border is drawn around the
+bitmap (for colour displays where inverting will not have the desired result).
+
+The Windows-specific toolbar classes expect 16-colour bitmaps that are 16 pixels wide and 15 pixels high. If you want
+to use a different size, call :meth:`ToolBar.SetToolBitmapSize` as the demo shows, before adding tools to the button bar.
+Don't supply more than one bitmap for each tool, because the toolbar generates all three images (normal, depressed,
and checked) from the single bitmap you give it.
\ No newline at end of file
diff --git a/docs/sphinx/rest_substitutions/overviews/treectrl_overview.rst b/docs/sphinx/rest_substitutions/overviews/treectrl_overview.rst
index 9da7656f..7b5702b0 100644
--- a/docs/sphinx/rest_substitutions/overviews/treectrl_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/treectrl_overview.rst
@@ -1,69 +1,69 @@
-.. include:: headings.inc
-
-
-.. _treectrl overview:
-
-===============================================
-|phoenix_title| **TreeCtrl Overview**
-===============================================
-
-The tree control displays its items in a tree like structure. Each item has its own (optional) icon
-and a label. An item may be either collapsed (meaning that its children are not visible) or expanded
-(meaning that its children are shown). Each item in the tree is identified by its itemId which is of
-opaque data type :ref:`TreeItemId`. You can test whether an item is valid by calling :meth:`TreeItemId.IsOk`.
-
-The items text and image may be retrieved and changed with `(Get|Set)ItemText` and `(Get|Set)ItemImage`.
-In fact, an item may even have two images associated with it: the normal one and another one for selected
-state which is set/retrieved with `(Get|Set)ItemSelectedImage` functions, but this functionality might
-be unavailable on some platforms.
-
-Tree items have several attributes: an item may be selected or not, visible or not, bold or not. It may
-also be expanded or collapsed. All these attributes may be retrieved with the corresponding functions:
-:meth:`TreeCtrl.IsSelected`, :meth:`TreeCtrl.IsVisible`, :meth:`TreeCtrl.IsBold` and :meth:`TreeCtrl.IsExpanded`.
-Only one item at a time may be selected, selecting another one (with :meth:`TreeCtrl.SelectItem`) automatically
-unselects the previously selected one.
-
-In addition to its icon and label, a user-specific data structure may be associated with all tree items.
-If you wish to do it, you should derive a class from :ref:`TreeItemData` which is a very simple class
-having only one function `GetId()` which returns the id of the item this data is associated with. This data
-will be freed by the control itself when the associated item is deleted (all items are deleted when the
-control is destroyed), so you shouldn't delete it yourself (if you do it, you should call `SetItemData(None)`
-to prevent the tree from deleting the pointer second time). The associated data may be retrieved with
-:meth:`TreeCtrl.GetItemData` function.
-
-Working with trees is relatively straightforward if all the items are added to the tree at the moment of
-its creation. However, for large trees it may be very inefficient. To improve the performance you may want
-to delay adding the items to the tree until the branch containing the items is expanded: so, in the
-beginning, only the root item is created (with :meth:`TreeCtrl.AddRoot`). Other items are added when
-``EVT_TREE_ITEM_EXPANDING`` event is received: then all items lying immediately under the item being expanded
-should be added, but, of course, only when this event is received for the first time for this item - otherwise,
-the items would be added twice if the user expands/collapses/re-expands the branch.
-
-The tree control provides functions for enumerating its items. There are 3 groups of enumeration functions: for
-the children of a given item, for the sibling of the given item and for the visible items (those which are
-currently shown to the user: an item may be invisible either because its branch is collapsed or because it
-is scrolled out of view). Child enumeration functions require the caller to give them a `cookie` parameter: it
-is a number which is opaque to the caller but is used by the tree control itself to allow multiple enumerations
-to run simultaneously (this is explicitly allowed). The only thing to remember is that the `cookie` passed
-to :meth:`TreeCtrl.GetFirstChild` and to :meth:`TreeCtrl.GetNextChild` should be the same variable (and that
-nothing should be done with it by the user code).
-
-Among other features of the tree control are:
-
-* Item Sorting with :meth:`TreeCtrl.SortChildren` which uses the user-defined comparison function `OnCompareItems`
- (by default the comparison is the alphabetic comparison of tree labels);
-* Hit Testing (determining to which portion of the control the given point belongs, useful for implementing
- drag-and-drop in the tree) with :meth:`TreeCtrl.HitTest`;
-* Editing of the tree item labels in place (see :meth:`TreeCtrl.EditLabel`).
-
-Finally, the tree control has a keyboard interface: the cursor navigation (arrow) keys may be used to change
-the current selection. ``HOME`` and ``END`` are used to go to the first/last sibling of the current item. ``+``,
-``-`` and ``*`` expand, collapse and toggle the current branch. Note, however, that ``DEL`` and ``INS`` keys
-do nothing by default, but it is common to associate them with deleting an item from a tree and inserting
-a new one into it.
-
-
-.. seealso:: :ref:`TreeCtrl`, :ref:`ImageList`
-
-
-
+.. include:: headings.inc
+
+
+.. _treectrl overview:
+
+===============================================
+|phoenix_title| **TreeCtrl Overview**
+===============================================
+
+The tree control displays its items in a tree like structure. Each item has its own (optional) icon
+and a label. An item may be either collapsed (meaning that its children are not visible) or expanded
+(meaning that its children are shown). Each item in the tree is identified by its itemId which is of
+opaque data type :ref:`TreeItemId`. You can test whether an item is valid by calling :meth:`TreeItemId.IsOk`.
+
+The items text and image may be retrieved and changed with `(Get|Set)ItemText` and `(Get|Set)ItemImage`.
+In fact, an item may even have two images associated with it: the normal one and another one for selected
+state which is set/retrieved with `(Get|Set)ItemSelectedImage` functions, but this functionality might
+be unavailable on some platforms.
+
+Tree items have several attributes: an item may be selected or not, visible or not, bold or not. It may
+also be expanded or collapsed. All these attributes may be retrieved with the corresponding functions:
+:meth:`TreeCtrl.IsSelected`, :meth:`TreeCtrl.IsVisible`, :meth:`TreeCtrl.IsBold` and :meth:`TreeCtrl.IsExpanded`.
+Only one item at a time may be selected, selecting another one (with :meth:`TreeCtrl.SelectItem`) automatically
+unselects the previously selected one.
+
+In addition to its icon and label, a user-specific data structure may be associated with all tree items.
+If you wish to do it, you should derive a class from :ref:`TreeItemData` which is a very simple class
+having only one function `GetId()` which returns the id of the item this data is associated with. This data
+will be freed by the control itself when the associated item is deleted (all items are deleted when the
+control is destroyed), so you shouldn't delete it yourself (if you do it, you should call `SetItemData(None)`
+to prevent the tree from deleting the pointer second time). The associated data may be retrieved with
+:meth:`TreeCtrl.GetItemData` function.
+
+Working with trees is relatively straightforward if all the items are added to the tree at the moment of
+its creation. However, for large trees it may be very inefficient. To improve the performance you may want
+to delay adding the items to the tree until the branch containing the items is expanded: so, in the
+beginning, only the root item is created (with :meth:`TreeCtrl.AddRoot`). Other items are added when
+``EVT_TREE_ITEM_EXPANDING`` event is received: then all items lying immediately under the item being expanded
+should be added, but, of course, only when this event is received for the first time for this item - otherwise,
+the items would be added twice if the user expands/collapses/re-expands the branch.
+
+The tree control provides functions for enumerating its items. There are 3 groups of enumeration functions: for
+the children of a given item, for the sibling of the given item and for the visible items (those which are
+currently shown to the user: an item may be invisible either because its branch is collapsed or because it
+is scrolled out of view). Child enumeration functions require the caller to give them a `cookie` parameter: it
+is a number which is opaque to the caller but is used by the tree control itself to allow multiple enumerations
+to run simultaneously (this is explicitly allowed). The only thing to remember is that the `cookie` passed
+to :meth:`TreeCtrl.GetFirstChild` and to :meth:`TreeCtrl.GetNextChild` should be the same variable (and that
+nothing should be done with it by the user code).
+
+Among other features of the tree control are:
+
+* Item Sorting with :meth:`TreeCtrl.SortChildren` which uses the user-defined comparison function `OnCompareItems`
+ (by default the comparison is the alphabetic comparison of tree labels);
+* Hit Testing (determining to which portion of the control the given point belongs, useful for implementing
+ drag-and-drop in the tree) with :meth:`TreeCtrl.HitTest`;
+* Editing of the tree item labels in place (see :meth:`TreeCtrl.EditLabel`).
+
+Finally, the tree control has a keyboard interface: the cursor navigation (arrow) keys may be used to change
+the current selection. ``HOME`` and ``END`` are used to go to the first/last sibling of the current item. ``+``,
+``-`` and ``*`` expand, collapse and toggle the current branch. Note, however, that ``DEL`` and ``INS`` keys
+do nothing by default, but it is common to associate them with deleting an item from a tree and inserting
+a new one into it.
+
+
+.. seealso:: :ref:`TreeCtrl`, :ref:`ImageList`
+
+
+
diff --git a/docs/sphinx/rest_substitutions/overviews/validator_overview.rst b/docs/sphinx/rest_substitutions/overviews/validator_overview.rst
index cc024508..a9b84570 100644
--- a/docs/sphinx/rest_substitutions/overviews/validator_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/validator_overview.rst
@@ -1,108 +1,108 @@
-.. include:: headings.inc
-
-
-.. _validator overview:
-
-=======================================
-|phoenix_title| **Validator Overview**
-=======================================
-
-
-.. _validator basic concepts:
-
-Validator basic concepts
-------------------------
-
-The aim of the validator concept is to make dialogs very much easier to write. A validator is an object that can be
-plugged into a control (such as a :ref:`TextCtrl`), and mediates between Python data and the control, transferring
-the data in either direction and validating it. It also is able to intercept events generated by the control, providing
-filtering behaviour without the need to derive a new control class.
-
-:ref:`Validator` can also be used to intercept keystrokes and other events within an input field. To use a validator,
-you have to create your own sub-class of :ref:`Validator` (neither `TextValidator` nor `GenericValidator` are implemented
-in wxPython). This sub-class is then associated with your input field by calling::
-
- myInputField.SetValidator(myValidator)
-
-
-.. note:: Your :ref:`Validator` sub-class must implement the :meth:`Validator.Clone` method.
-
-
-.. note::
-
- Note that any :ref:`Window` may have a validator; using the ``WS_EX_VALIDATE_RECURSIVELY`` style (see
- :ref:`Window extended styles `) you can also implement recursive validation.
-
-
-
-.. _anatomy of a validator:
-
-Anatomy of a Validator
-----------------------
-
-A programmer creating a new validator class should provide the following functionality.
-
-A validator constructor is responsible for allowing the programmer to specify the kind of validation required, and perhaps
-a pointer to a Python variable that is used for storing the data for the control. If such a variable address is not supplied
-by the user, then the validator should store the data internally.
-
-The :meth:`Validator.Validate` method should return true if the data in the control (not the Python variable) is valid.
-It should also show an appropriate message if data was not valid.
-
-The :meth:`Validator.TransferToWindow` member function should transfer the data from the validator or associated Python
-variable to the control.
-
-The :meth:`Validator.TransferFromWindow` member function should transfer the data from the control to the validator or
-associated Python variable.
-
-There should be a copy constructor, and a :meth:`Validator.Clone` function which returns a copy of the validator object.
-This is important because validators are passed by reference to window constructors, and must therefore be cloned internally.
-
-You can optionally define event handlers for the validator, to implement filtering. These handlers will capture events before
-the control itself does (see :ref:`How Events are Processed `).
-
-
-
-.. _how validators interact with dialogs:
-
-How Validators Interact with Dialogs
-------------------------------------
-
-
-For validators to work correctly, validator functions must be called at the right times during dialog initialisation and dismissal.
-
-When a :meth:`Dialog.Show` is called (for a modeless dialog) or :meth:`Dialog.ShowModal` is called (for a modal dialog),
-the function :meth:`Window.InitDialog` is automatically called. This in turn sends an initialisation event to the dialog. The
-default handler for the ``wxEVT_INIT_DIALOG`` event is defined in the :ref:`Window` class to simply call the function
-:meth:`Window.TransferDataToWindow`. This function finds all the validators in the window's children and calls the
-:meth:`Validator.TransferToWindow` function for each. Thus, data is transferred from Python variables to the dialog just as the
-dialog is being shown.
-
-.. note:: If you are using a window or panel instead of a dialog, you will need to call :meth:`Window.InitDialog` explicitly before
- showing the window.
-
-
-When the user clicks on a button, for example the ``OK`` button, the application should first call :meth:`Window.Validate`, which
-returns ``False`` if any of the child window validators failed to validate the window data. The button handler should return
-immediately if validation failed. Secondly, the application should call :meth:`Window.TransferDataFromWindow` and return if this failed.
-It is then safe to end the dialog by calling :meth:`Dialog.EndModal` (if modal) or :meth:`Dialog.Show` (if modeless).
-
-In fact, :ref:`Dialog` contains a default command event handler for the ``ID_OK`` button. It goes like this::
-
- def OnOK(self, event):
-
- if self.Validate() and self.TransferDataFromWindow():
-
- if self.IsModal():
- self.EndModal(wx.ID_OK)
- else:
- self.SetReturnCode(wx.ID_OK)
- self.Show(False)
-
-
-
-So if using validators and a normal ``OK`` button, you may not even need to write any code for handling dialog dismissal.
-
-If you load your dialog from a resource file, you will need to iterate through the controls setting validators, since validators
-can't be specified in a dialog resource.
-
+.. include:: headings.inc
+
+
+.. _validator overview:
+
+=======================================
+|phoenix_title| **Validator Overview**
+=======================================
+
+
+.. _validator basic concepts:
+
+Validator basic concepts
+------------------------
+
+The aim of the validator concept is to make dialogs very much easier to write. A validator is an object that can be
+plugged into a control (such as a :ref:`TextCtrl`), and mediates between Python data and the control, transferring
+the data in either direction and validating it. It also is able to intercept events generated by the control, providing
+filtering behaviour without the need to derive a new control class.
+
+:ref:`Validator` can also be used to intercept keystrokes and other events within an input field. To use a validator,
+you have to create your own sub-class of :ref:`Validator` (neither `TextValidator` nor `GenericValidator` are implemented
+in wxPython). This sub-class is then associated with your input field by calling::
+
+ myInputField.SetValidator(myValidator)
+
+
+.. note:: Your :ref:`Validator` sub-class must implement the :meth:`Validator.Clone` method.
+
+
+.. note::
+
+ Note that any :ref:`Window` may have a validator; using the ``WS_EX_VALIDATE_RECURSIVELY`` style (see
+ :ref:`Window extended styles `) you can also implement recursive validation.
+
+
+
+.. _anatomy of a validator:
+
+Anatomy of a Validator
+----------------------
+
+A programmer creating a new validator class should provide the following functionality.
+
+A validator constructor is responsible for allowing the programmer to specify the kind of validation required, and perhaps
+a pointer to a Python variable that is used for storing the data for the control. If such a variable address is not supplied
+by the user, then the validator should store the data internally.
+
+The :meth:`Validator.Validate` method should return true if the data in the control (not the Python variable) is valid.
+It should also show an appropriate message if data was not valid.
+
+The :meth:`Validator.TransferToWindow` member function should transfer the data from the validator or associated Python
+variable to the control.
+
+The :meth:`Validator.TransferFromWindow` member function should transfer the data from the control to the validator or
+associated Python variable.
+
+There should be a copy constructor, and a :meth:`Validator.Clone` function which returns a copy of the validator object.
+This is important because validators are passed by reference to window constructors, and must therefore be cloned internally.
+
+You can optionally define event handlers for the validator, to implement filtering. These handlers will capture events before
+the control itself does (see :ref:`How Events are Processed `).
+
+
+
+.. _how validators interact with dialogs:
+
+How Validators Interact with Dialogs
+------------------------------------
+
+
+For validators to work correctly, validator functions must be called at the right times during dialog initialisation and dismissal.
+
+When a :meth:`Dialog.Show` is called (for a modeless dialog) or :meth:`Dialog.ShowModal` is called (for a modal dialog),
+the function :meth:`Window.InitDialog` is automatically called. This in turn sends an initialisation event to the dialog. The
+default handler for the ``wxEVT_INIT_DIALOG`` event is defined in the :ref:`Window` class to simply call the function
+:meth:`Window.TransferDataToWindow`. This function finds all the validators in the window's children and calls the
+:meth:`Validator.TransferToWindow` function for each. Thus, data is transferred from Python variables to the dialog just as the
+dialog is being shown.
+
+.. note:: If you are using a window or panel instead of a dialog, you will need to call :meth:`Window.InitDialog` explicitly before
+ showing the window.
+
+
+When the user clicks on a button, for example the ``OK`` button, the application should first call :meth:`Window.Validate`, which
+returns ``False`` if any of the child window validators failed to validate the window data. The button handler should return
+immediately if validation failed. Secondly, the application should call :meth:`Window.TransferDataFromWindow` and return if this failed.
+It is then safe to end the dialog by calling :meth:`Dialog.EndModal` (if modal) or :meth:`Dialog.Show` (if modeless).
+
+In fact, :ref:`Dialog` contains a default command event handler for the ``ID_OK`` button. It goes like this::
+
+ def OnOK(self, event):
+
+ if self.Validate() and self.TransferDataFromWindow():
+
+ if self.IsModal():
+ self.EndModal(wx.ID_OK)
+ else:
+ self.SetReturnCode(wx.ID_OK)
+ self.Show(False)
+
+
+
+So if using validators and a normal ``OK`` button, you may not even need to write any code for handling dialog dismissal.
+
+If you load your dialog from a resource file, you will need to iterate through the controls setting validators, since validators
+can't be specified in a dialog resource.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/window_deletion_overview.rst b/docs/sphinx/rest_substitutions/overviews/window_deletion_overview.rst
index b0c2cbf8..aa6ffe93 100644
--- a/docs/sphinx/rest_substitutions/overviews/window_deletion_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/window_deletion_overview.rst
@@ -1,95 +1,95 @@
-.. include:: headings.inc
-
-
-.. _window deletion:
-
-=============================================
-|phoenix_title| **Window Deletion Overview**
-=============================================
-
-
-Window deletion can be a confusing subject, so this overview is provided to help make it clear when and
-how you delete windows, or respond to user requests to close windows.
-
-
-
-Sequence of Events During Window Deletion
------------------------------------------
-
-When the user clicks on the system close button or system close command, in a frame or a dialog, wxPython calls :meth:`Window.Close`.
-This in turn generates an ``EVT_CLOSE`` event: see :ref:`CloseEvent`.
-
-It is the duty of the application to define a suitable event handler, and decide whether or not to destroy the window. If the
-application is for some reason forcing the application to close (:meth:`CloseEvent.CanVeto` returns ``False``), the window should
-always be destroyed, otherwise there is the option to ignore the request, or maybe wait until the user has answered a question
-before deciding whether it is safe to close. The handler for ``EVT_CLOSE`` should signal to the calling code if it does not destroy
-the window, by calling :meth:`CloseEvent.Veto`. Calling this provides useful information to the calling code.
-
-The :ref:`CloseEvent` handler should only call :meth:`Window.Destroy` to delete the window, and not use the `del` operator. This
-is because for some window classes, wxPython delays actual deletion of the window until all events have been processed, since otherwise
-there is the danger that events will be sent to a non-existent window.
-
-As reinforced in the next section, calling `Close` does not guarantee that the window will be destroyed. Call :meth:`Window.Destroy`
-if you want to be certain that the window is destroyed.
-
-
-
-Closing Windows
----------------
-
-Your application can either use :meth:`Window.Close` event just as the framework does, or it can call :meth:`Window.Destroy` directly.
-If using `Close()`, you can pass a ``True`` argument to this function to tell the event handler that we definitely want to delete
-the frame and it cannot be vetoed.
-
-The advantage of using `Close` instead of `Destroy` is that it will call any clean-up code defined by the ``EVT_CLOSE`` handler; for
-example it may close a document contained in a window after first asking the user whether the work should be saved. `Close` can be
-vetoed by this process (return ``False``), whereas `Destroy` definitely destroys the window.
-
-
-
-Default Window Close Behaviour
-------------------------------
-
-The default close event handler for :ref:`Dialog` simulates a ``Cancel`` command, generating a ``ID_CANCEL`` event. Since the handler
-for this cancel event might itself call `Close`, there is a check for infinite looping. The default handler for ``ID_CANCEL`` hides
-the dialog (if modeless) or calls `EndModal(ID_CANCEL)` (if modal). In other words, by default, the dialog is not destroyed.
-
-The default close event handler for :ref:`Frame` destroys the frame using `Destroy()`.
-
-
-
-User Calls to Exit From a Menu
-------------------------------
-
-What should I do when the user calls up `Exit` from a menu? You can simply call :meth:`Window.Close` on the frame. This will invoke
-your own close event handler which may destroy the frame.
-
-You can do checking to see if your application can be safely exited at this point, either from within your close event handler, or
-from within your exit menu command handler. For example, you may wish to check that all files have been saved. Give the user a chance
-to save and quit, to not save but quit anyway, or to cancel the exit command altogether.
-
-
-
-Exiting the Application Gracefully
-----------------------------------
-
-A wxPython application automatically exits when the last top level window (:ref:`Frame` or :ref:`Dialog`), is destroyed. Put any
-application-wide cleanup code in :meth:`AppConsole.OnExit` (this is a method, not an event handler).
-
-
-
-Automatic Deletion of Child Windows
------------------------------------
-
-Child windows are deleted from within the parent destructor. This includes any children that are themselves frames or dialogs, so you
-may wish to close these child frame or dialog windows explicitly from within the parent close handler.
-
-
-
-Other Kinds of Windows
-----------------------
-
-So far we've been talking about 'managed' windows, i.e. frames and dialogs. Windows with parents, such as controls, don't have delayed
-destruction and don't usually have close event handlers, though you can implement them if you wish. For consistency, continue to use
-the :meth:`Window.Destroy` method instead of the `del` operator when deleting these kinds of windows explicitly.
-
+.. include:: headings.inc
+
+
+.. _window deletion:
+
+=============================================
+|phoenix_title| **Window Deletion Overview**
+=============================================
+
+
+Window deletion can be a confusing subject, so this overview is provided to help make it clear when and
+how you delete windows, or respond to user requests to close windows.
+
+
+
+Sequence of Events During Window Deletion
+-----------------------------------------
+
+When the user clicks on the system close button or system close command, in a frame or a dialog, wxPython calls :meth:`Window.Close`.
+This in turn generates an ``EVT_CLOSE`` event: see :ref:`CloseEvent`.
+
+It is the duty of the application to define a suitable event handler, and decide whether or not to destroy the window. If the
+application is for some reason forcing the application to close (:meth:`CloseEvent.CanVeto` returns ``False``), the window should
+always be destroyed, otherwise there is the option to ignore the request, or maybe wait until the user has answered a question
+before deciding whether it is safe to close. The handler for ``EVT_CLOSE`` should signal to the calling code if it does not destroy
+the window, by calling :meth:`CloseEvent.Veto`. Calling this provides useful information to the calling code.
+
+The :ref:`CloseEvent` handler should only call :meth:`Window.Destroy` to delete the window, and not use the `del` operator. This
+is because for some window classes, wxPython delays actual deletion of the window until all events have been processed, since otherwise
+there is the danger that events will be sent to a non-existent window.
+
+As reinforced in the next section, calling `Close` does not guarantee that the window will be destroyed. Call :meth:`Window.Destroy`
+if you want to be certain that the window is destroyed.
+
+
+
+Closing Windows
+---------------
+
+Your application can either use :meth:`Window.Close` event just as the framework does, or it can call :meth:`Window.Destroy` directly.
+If using `Close()`, you can pass a ``True`` argument to this function to tell the event handler that we definitely want to delete
+the frame and it cannot be vetoed.
+
+The advantage of using `Close` instead of `Destroy` is that it will call any clean-up code defined by the ``EVT_CLOSE`` handler; for
+example it may close a document contained in a window after first asking the user whether the work should be saved. `Close` can be
+vetoed by this process (return ``False``), whereas `Destroy` definitely destroys the window.
+
+
+
+Default Window Close Behaviour
+------------------------------
+
+The default close event handler for :ref:`Dialog` simulates a ``Cancel`` command, generating a ``ID_CANCEL`` event. Since the handler
+for this cancel event might itself call `Close`, there is a check for infinite looping. The default handler for ``ID_CANCEL`` hides
+the dialog (if modeless) or calls `EndModal(ID_CANCEL)` (if modal). In other words, by default, the dialog is not destroyed.
+
+The default close event handler for :ref:`Frame` destroys the frame using `Destroy()`.
+
+
+
+User Calls to Exit From a Menu
+------------------------------
+
+What should I do when the user calls up `Exit` from a menu? You can simply call :meth:`Window.Close` on the frame. This will invoke
+your own close event handler which may destroy the frame.
+
+You can do checking to see if your application can be safely exited at this point, either from within your close event handler, or
+from within your exit menu command handler. For example, you may wish to check that all files have been saved. Give the user a chance
+to save and quit, to not save but quit anyway, or to cancel the exit command altogether.
+
+
+
+Exiting the Application Gracefully
+----------------------------------
+
+A wxPython application automatically exits when the last top level window (:ref:`Frame` or :ref:`Dialog`), is destroyed. Put any
+application-wide cleanup code in :meth:`AppConsole.OnExit` (this is a method, not an event handler).
+
+
+
+Automatic Deletion of Child Windows
+-----------------------------------
+
+Child windows are deleted from within the parent destructor. This includes any children that are themselves frames or dialogs, so you
+may wish to close these child frame or dialog windows explicitly from within the parent close handler.
+
+
+
+Other Kinds of Windows
+----------------------
+
+So far we've been talking about 'managed' windows, i.e. frames and dialogs. Windows with parents, such as controls, don't have delayed
+destruction and don't usually have close event handlers, though you can implement them if you wish. For consistency, continue to use
+the :meth:`Window.Destroy` method instead of the `del` operator when deleting these kinds of windows explicitly.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/window_ids_overview.rst b/docs/sphinx/rest_substitutions/overviews/window_ids_overview.rst
index 22cfc636..56935bbc 100644
--- a/docs/sphinx/rest_substitutions/overviews/window_ids_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/window_ids_overview.rst
@@ -1,30 +1,30 @@
-.. include:: headings.inc
-
-
-.. _window ids:
-
-=================================================
-|phoenix_title| **Window IDs Overview**
-=================================================
-
-
-Various controls and other parts of wxPython need an ID. Sometimes the ID may be directly provided by the user or
-have a predefined value, such as ``ID_OPEN``. Often, however, the value of the ID is unimportant and is created
-automatically by calling :meth:`Window.NewControlId` or by passing ``ID_ANY`` as the ID of an object.
-
-There are two ways to generate an ID. One way is to start at a negative number, and for each new ID, return the
-next smallest number. This is fine for systems that can use the full range of negative numbers for IDs, as
-this provides more than enough IDs and it would take a very very long time to run out and wrap around.
-However, some systems cannot use the full range of the ID value. Windows, for example, can only use 16 bit
-IDs, and only has about 32000 possible automatic IDs that can be generated by :meth:`Window.NewControlId`.
-If the program runs long enough, depending on the program itself, using this first method would cause the IDs
-to wrap around into the positive ID range and cause possible clashes with any directly specified ID values.
-
-The other way is to keep track of the IDs returned by :meth:`Window.NewControlId` and don't return them again
-until the ID is completely free and not being used by any other objects. This will make sure that the ID values
-do not clash with one another. This is accomplished by keeping a reference count for each of the IDs that can
-possibly be returned by :meth:`Window.NewControlId`. Other IDs are not reference counted.
-
-
-.. seealso:: :ref:`IdManager`, :meth:`Window.NewControlId`, :meth:`Window.UnreserveControlId`
-
+.. include:: headings.inc
+
+
+.. _window ids:
+
+=================================================
+|phoenix_title| **Window IDs Overview**
+=================================================
+
+
+Various controls and other parts of wxPython need an ID. Sometimes the ID may be directly provided by the user or
+have a predefined value, such as ``ID_OPEN``. Often, however, the value of the ID is unimportant and is created
+automatically by calling :meth:`Window.NewControlId` or by passing ``ID_ANY`` as the ID of an object.
+
+There are two ways to generate an ID. One way is to start at a negative number, and for each new ID, return the
+next smallest number. This is fine for systems that can use the full range of negative numbers for IDs, as
+this provides more than enough IDs and it would take a very very long time to run out and wrap around.
+However, some systems cannot use the full range of the ID value. Windows, for example, can only use 16 bit
+IDs, and only has about 32000 possible automatic IDs that can be generated by :meth:`Window.NewControlId`.
+If the program runs long enough, depending on the program itself, using this first method would cause the IDs
+to wrap around into the positive ID range and cause possible clashes with any directly specified ID values.
+
+The other way is to keep track of the IDs returned by :meth:`Window.NewControlId` and don't return them again
+until the ID is completely free and not being used by any other objects. This will make sure that the ID values
+do not clash with one another. This is accomplished by keeping a reference count for each of the IDs that can
+possibly be returned by :meth:`Window.NewControlId`. Other IDs are not reference counted.
+
+
+.. seealso:: :ref:`IdManager`, :meth:`Window.NewControlId`, :meth:`Window.UnreserveControlId`
+
diff --git a/docs/sphinx/rest_substitutions/overviews/window_sizing_overview.rst b/docs/sphinx/rest_substitutions/overviews/window_sizing_overview.rst
index c5a6129c..3c0af732 100644
--- a/docs/sphinx/rest_substitutions/overviews/window_sizing_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/window_sizing_overview.rst
@@ -1,70 +1,70 @@
-.. include:: headings.inc
-
-
-.. _window sizing overview:
-
-===========================================
-|phoenix_title| **Window Sizing Overview**
-===========================================
-
-
-It can sometimes be confusing to keep track of the various size-related attributes of a :ref:`Window`, how they
-relate to each other, and how they interact with sizers.
-
-This document will attempt to clear the fog a little, and give some simple explanations of things.
-
-Glossary
---------
-
-- **"Best Size"**: the best size of a widget depends on what kind of widget it is, and usually also on the contents of
- the widget. For example a :ref:`ListBox` 's best size will be calculated based on how many items it has, up to a
- certain limit, or a :ref:`Button` 's best size will be calculated based on its label size, but normally won't be smaller
- than the platform default button size (unless a style flag overrides that). There is a special method in the wxPython
- window classes called :meth:`Window.DoGetBestSize` that a class needs to override if it wants to calculate its own best
- size based on its content.
-- **"Minimal Size"**: the minimal size of a widget is a size that is normally explicitly set by the programmer either
- with the :meth:`Window.SetMinSize` method or with the :meth:`Window.SetSizeHints` method. Most controls will also set
- the minimal size to the size given in the control's constructor if a non-default value is passed. Top-level windows
- such as :ref:`Frame` will not allow the user to resize the frame below the minimal size.
-- **"Maximum Size"**: just like for the minimal size, the maximum size is normally explicitly set by the programmer with
- the :meth:`Window.SetMaxSize` method or with :meth:`Window.SetSizeHints`. Top-level windows such as :ref:`Frame` will
- not allow the user to resize the frame above the maximum size.
-- **"Size"**: the size of a widget can be explicitly set or fetched with the :meth:`Window.SetSize` or :meth:`Window.GetSize`
- methods. This size value is the size that the widget is currently using on screen and is the way to change the size of
- something that is not being managed by a sizer.
-- **"Client Size"**: the client size represents the widget's area inside of any borders belonging to the widget and is the
- area that can be drawn upon in a ``EVT_PAINT`` event. If a widget doesn't have a border then its client size is the
- same as its size.
-- **"Initial Size"**: the initial size of a widget is the size given to the constructor of the widget, if any. As mentioned
- above most controls will also set this size value as the control's minimal size. If the size passed to the constructor is
- the default ``DefaultSize``, or if the size is not fully specified (such as `wx.Size(150, -1)`) then most controls will
- fill in the missing size components using the best size and will set the initial size of the control to the resulting size.
-- **"Virtual Size"**: the virtual size is the size of the potentially viewable area of the widget. The virtual size of a
- widget may be larger than its actual size and in this case scrollbars will appear to the let the user 'explore' the full
- contents of the widget. See :ref:`Scrolled` for more info.
-
-
-
-Functions related to sizing
----------------------------
-
-- :meth:`Window.GetEffectiveMinSize`: returns a blending of the widget's minimal size and best size, giving precedence to
- the minimal size. For example, if a widget's min size is set to (150, -1) and the best size is (80, 22) then the best
- fitting size is (150, 22). If the min size is (50, 20) then the best fitting size is (50, 20). This method is what is
- called by the sizers when determining what the requirements of each item in the sizer is, and is used for calculating
- the overall minimum needs of the sizer.
-- :meth:`Window.SetInitialSize`: this is a little different than the typical size setters. Rather than just setting an
- "initial size" attribute it actually sets the minimal size to the value passed in, blends that value with the best size,
- and then sets the size of the widget to be the result. So you can consider this method to be a "Smart SetSize". This
- method is what is called by the constructor of most controls to set the minimal size and the initial size of the control.
-- :meth:`Window.Fit`: this method sets the size of a window to fit around its children. If it has no children then nothing
- is done, if it does have children then the size of the window is set to the window's best size.
-- :meth:`Sizer.Fit`: this sets the size of the window to be large enough to accommodate the minimum size needed by the sizer,
- (along with a few other constraints...). If the sizer is the one that is assigned to the window then this should be
- equivalent to :meth:`Window.Fit`.
-- :meth:`Sizer.Layout`: recalculates the minimum space needed by each item in the sizer, and then lays out the items
- within the space currently allotted to the sizer.
-- :meth:`Window.Layout`: if the window has a sizer then it sets the space given to the sizer to the current size of the window,
- which results in a call to :meth:`Sizer.Layout`. If the window has layout constraints instead of a sizer then the constraints
- algorithm is run. The `Layout()` method is what is called by the default ``EVT_SIZE`` handler for container windows.
-
+.. include:: headings.inc
+
+
+.. _window sizing overview:
+
+===========================================
+|phoenix_title| **Window Sizing Overview**
+===========================================
+
+
+It can sometimes be confusing to keep track of the various size-related attributes of a :ref:`Window`, how they
+relate to each other, and how they interact with sizers.
+
+This document will attempt to clear the fog a little, and give some simple explanations of things.
+
+Glossary
+--------
+
+- **"Best Size"**: the best size of a widget depends on what kind of widget it is, and usually also on the contents of
+ the widget. For example a :ref:`ListBox` 's best size will be calculated based on how many items it has, up to a
+ certain limit, or a :ref:`Button` 's best size will be calculated based on its label size, but normally won't be smaller
+ than the platform default button size (unless a style flag overrides that). There is a special method in the wxPython
+ window classes called :meth:`Window.DoGetBestSize` that a class needs to override if it wants to calculate its own best
+ size based on its content.
+- **"Minimal Size"**: the minimal size of a widget is a size that is normally explicitly set by the programmer either
+ with the :meth:`Window.SetMinSize` method or with the :meth:`Window.SetSizeHints` method. Most controls will also set
+ the minimal size to the size given in the control's constructor if a non-default value is passed. Top-level windows
+ such as :ref:`Frame` will not allow the user to resize the frame below the minimal size.
+- **"Maximum Size"**: just like for the minimal size, the maximum size is normally explicitly set by the programmer with
+ the :meth:`Window.SetMaxSize` method or with :meth:`Window.SetSizeHints`. Top-level windows such as :ref:`Frame` will
+ not allow the user to resize the frame above the maximum size.
+- **"Size"**: the size of a widget can be explicitly set or fetched with the :meth:`Window.SetSize` or :meth:`Window.GetSize`
+ methods. This size value is the size that the widget is currently using on screen and is the way to change the size of
+ something that is not being managed by a sizer.
+- **"Client Size"**: the client size represents the widget's area inside of any borders belonging to the widget and is the
+ area that can be drawn upon in a ``EVT_PAINT`` event. If a widget doesn't have a border then its client size is the
+ same as its size.
+- **"Initial Size"**: the initial size of a widget is the size given to the constructor of the widget, if any. As mentioned
+ above most controls will also set this size value as the control's minimal size. If the size passed to the constructor is
+ the default ``DefaultSize``, or if the size is not fully specified (such as `wx.Size(150, -1)`) then most controls will
+ fill in the missing size components using the best size and will set the initial size of the control to the resulting size.
+- **"Virtual Size"**: the virtual size is the size of the potentially viewable area of the widget. The virtual size of a
+ widget may be larger than its actual size and in this case scrollbars will appear to the let the user 'explore' the full
+ contents of the widget. See :ref:`Scrolled` for more info.
+
+
+
+Functions related to sizing
+---------------------------
+
+- :meth:`Window.GetEffectiveMinSize`: returns a blending of the widget's minimal size and best size, giving precedence to
+ the minimal size. For example, if a widget's min size is set to (150, -1) and the best size is (80, 22) then the best
+ fitting size is (150, 22). If the min size is (50, 20) then the best fitting size is (50, 20). This method is what is
+ called by the sizers when determining what the requirements of each item in the sizer is, and is used for calculating
+ the overall minimum needs of the sizer.
+- :meth:`Window.SetInitialSize`: this is a little different than the typical size setters. Rather than just setting an
+ "initial size" attribute it actually sets the minimal size to the value passed in, blends that value with the best size,
+ and then sets the size of the widget to be the result. So you can consider this method to be a "Smart SetSize". This
+ method is what is called by the constructor of most controls to set the minimal size and the initial size of the control.
+- :meth:`Window.Fit`: this method sets the size of a window to fit around its children. If it has no children then nothing
+ is done, if it does have children then the size of the window is set to the window's best size.
+- :meth:`Sizer.Fit`: this sets the size of the window to be large enough to accommodate the minimum size needed by the sizer,
+ (along with a few other constraints...). If the sizer is the one that is assigned to the window then this should be
+ equivalent to :meth:`Window.Fit`.
+- :meth:`Sizer.Layout`: recalculates the minimum space needed by each item in the sizer, and then lays out the items
+ within the space currently allotted to the sizer.
+- :meth:`Window.Layout`: if the window has a sizer then it sets the space given to the sizer to the current size of the window,
+ which results in a call to :meth:`Sizer.Layout`. If the window has layout constraints instead of a sizer then the constraints
+ algorithm is run. The `Layout()` method is what is called by the default ``EVT_SIZE`` handler for container windows.
+
diff --git a/docs/sphinx/rest_substitutions/overviews/window_styles_overview.rst b/docs/sphinx/rest_substitutions/overviews/window_styles_overview.rst
index e3ed8b7d..5e2d70be 100644
--- a/docs/sphinx/rest_substitutions/overviews/window_styles_overview.rst
+++ b/docs/sphinx/rest_substitutions/overviews/window_styles_overview.rst
@@ -1,22 +1,22 @@
-.. include:: headings.inc
-
-
-.. _window styles:
-
-=================================================
-|phoenix_title| **Window Styles Overview**
-=================================================
-
-
-Window styles are used to specify alternative behaviour and appearances for windows, when they are created.
-
-The symbols are defined in such a way that they can be combined in a 'bit-list' using the Python `bitwise-or` operator (``|``).
-
-For example::
-
- style = wx.CAPTION | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER
-
-
-For the window styles specific to each window class, please see the documentation for the window.
-
-Most windows can use the generic styles listed for :ref:`Window` in addition to their own styles.
+.. include:: headings.inc
+
+
+.. _window styles:
+
+=================================================
+|phoenix_title| **Window Styles Overview**
+=================================================
+
+
+Window styles are used to specify alternative behaviour and appearances for windows, when they are created.
+
+The symbols are defined in such a way that they can be combined in a 'bit-list' using the Python `bitwise-or` operator (``|``).
+
+For example::
+
+ style = wx.CAPTION | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER
+
+
+For the window styles specific to each window class, please see the documentation for the window.
+
+Most windows can use the generic styles listed for :ref:`Window` in addition to their own styles.
diff --git a/docs/sphinx/rest_substitutions/overviews/writing_non_english_applications.rst b/docs/sphinx/rest_substitutions/overviews/writing_non_english_applications.rst
index 79878b9b..43852beb 100644
--- a/docs/sphinx/rest_substitutions/overviews/writing_non_english_applications.rst
+++ b/docs/sphinx/rest_substitutions/overviews/writing_non_english_applications.rst
@@ -1,26 +1,26 @@
-.. include:: headings.inc
-
-
-.. _writing non-english applications:
-
-=====================================================
-|phoenix_title| **Writing Non-English Applications**
-=====================================================
-
-This article describes how to write applications that communicate with the
-user in a language other than English. Unfortunately many languages use
-different charsets under Unix and Windows (and other platforms, to make the
-situation even more complicated). These charsets usually differ in so many
-characters that it is impossible to use the same texts under all platforms.
-
-The wxPython library provides a mechanism that helps you avoid distributing
-many identical, only differently encoded, packages with your application
-(e.g. help files and menu items in iso8859-13 and windows-1257). Thanks to
-this mechanism you can, for example, distribute only iso8859-13 data and it
-will be handled transparently under all systems.
-
-Please read the :ref:`Internationalization ` page which
-describes the locales concept.
-
-.. todo:: to be written (do we want to write it?!?!)
-
+.. include:: headings.inc
+
+
+.. _writing non-english applications:
+
+=====================================================
+|phoenix_title| **Writing Non-English Applications**
+=====================================================
+
+This article describes how to write applications that communicate with the
+user in a language other than English. Unfortunately many languages use
+different charsets under Unix and Windows (and other platforms, to make the
+situation even more complicated). These charsets usually differ in so many
+characters that it is impossible to use the same texts under all platforms.
+
+The wxPython library provides a mechanism that helps you avoid distributing
+many identical, only differently encoded, packages with your application
+(e.g. help files and menu items in iso8859-13 and windows-1257). Thanks to
+this mechanism you can, for example, distribute only iso8859-13 data and it
+will be handled transparently under all systems.
+
+Please read the :ref:`Internationalization ` page which
+describes the locales concept.
+
+.. todo:: to be written (do we want to write it?!?!)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/AboutDialogInfo.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/AboutDialogInfo.1.py
index 861b5428..cd1047ac 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/AboutDialogInfo.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/AboutDialogInfo.1.py
@@ -1,13 +1,13 @@
-
- def OnAbout(self, event):
-
- aboutInfo = wx.AboutDialogInfo()
- aboutInfo.SetName("MyApp")
- aboutInfo.SetVersion(MY_APP_VERSION_STRING)
- aboutInfo.SetDescription(_("My wxPython-based application!"))
- aboutInfo.SetCopyright("(C) 1992-2012")
- aboutInfo.SetWebSite("http:#myapp.org")
- aboutInfo.AddDeveloper("My Self")
-
- wx.AboutBox(aboutInfo)
-
+
+ def OnAbout(self, event):
+
+ aboutInfo = wx.AboutDialogInfo()
+ aboutInfo.SetName("MyApp")
+ aboutInfo.SetVersion(MY_APP_VERSION_STRING)
+ aboutInfo.SetDescription(_("My wxPython-based application!"))
+ aboutInfo.SetCopyright("(C) 1992-2012")
+ aboutInfo.SetWebSite("http:#myapp.org")
+ aboutInfo.AddDeveloper("My Self")
+
+ wx.AboutBox(aboutInfo)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/AcceleratorTable.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/AcceleratorTable.1.py
index 6d3cd003..e681a8da 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/AcceleratorTable.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/AcceleratorTable.1.py
@@ -1,10 +1,10 @@
-
- entries = [wx.AcceleratorEntry() for i in xrange(4)]
-
- entries[0].Set(wx.ACCEL_CTRL, 'N', ID_NEW_WINDOW)
- entries[1].Set(wx.ACCEL_CTRL, 'X', wx.ID_EXIT)
- entries[2].Set(wx.ACCEL_SHIFT, 'A', ID_ABOUT)
- entries[3].Set(wx.ACCEL_NORMAL, wx.WXK_DELETE, wx.ID_CUT)
-
- accel = wx.AcceleratorTable(entries)
+
+ entries = [wx.AcceleratorEntry() for i in xrange(4)]
+
+ entries[0].Set(wx.ACCEL_CTRL, 'N', ID_NEW_WINDOW)
+ entries[1].Set(wx.ACCEL_CTRL, 'X', wx.ID_EXIT)
+ entries[2].Set(wx.ACCEL_SHIFT, 'A', ID_ABOUT)
+ entries[3].Set(wx.ACCEL_NORMAL, wx.WXK_DELETE, wx.ID_CUT)
+
+ accel = wx.AcceleratorTable(entries)
frame.SetAcceleratorTable(accel)
\ No newline at end of file
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2D.Concat.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2D.Concat.1.py
index 472ba2c6..1750e3a3 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2D.Concat.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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 |
+
+ # | 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/AffineMatrix2D.Invert.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2D.Invert.1.py
index ff50ba9f..2b1555e1 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2D.Invert.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2D.Invert.1.py
@@ -1,4 +1,4 @@
-
- # | m_11 m_12 0 |
- # Invert | m_21 m_22 0 |
- # | m_tx m_ty 1 |
+
+ # | 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/AffineMatrix2DBase.Concat.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2DBase.Concat.1.py
index 472ba2c6..1750e3a3 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2DBase.Concat.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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 |
+
+ # | 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/AffineMatrix2DBase.Invert.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2DBase.Invert.1.py
index ff50ba9f..2b1555e1 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2DBase.Invert.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/AffineMatrix2DBase.Invert.1.py
@@ -1,4 +1,4 @@
-
- # | m_11 m_12 0 |
- # Invert | m_21 m_22 0 |
- # | m_tx m_ty 1 |
+
+ # | 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/App.SetTopWindow.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/App.SetTopWindow.1.py
index 5dd00c7e..8db8f874 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/App.SetTopWindow.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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/ArtProvider.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.1.py
index e4e1f0a4..5f117e7b 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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())
+
+ 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/ArtProvider.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.2.py
index a5492206..dd0d985c 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ArtProvider.2.py
@@ -1,4 +1,4 @@
-
- if wx.Platform == '__WXGTK__':
- bmp = wx.ArtProvider.GetBitmap("gtk-cdrom", wx.ART_MENU)
-
+
+ if wx.Platform == '__WXGTK__':
+ bmp = wx.ArtProvider.GetBitmap("gtk-cdrom", wx.ART_MENU)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.__init__.1.py
index f39f3787..7ba169a0 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.__init__.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.__init__.1.py
@@ -1,3 +1,3 @@
-
- newBitmap = oldBitmap.GetSubBitmap(
- wx.Rect(0, 0, oldBitmap.GetWidth(), oldBitmap.GetHeight()))
+
+ newBitmap = oldBitmap.GetSubBitmap(
+ wx.Rect(0, 0, oldBitmap.GetWidth(), oldBitmap.GetHeight()))
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/BoxSizer.AddSpacer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/BoxSizer.AddSpacer.1.py
index f4e9389a..83b0b7fe 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/BoxSizer.AddSpacer.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/BoxSizer.AddSpacer.1.py
@@ -1,9 +1,9 @@
-
- if boxSizer.IsVertical():
-
- boxSizer.Add(0, size, 0)
-
- else:
-
- boxSizer.Add(size, 0, 0)
-
+
+ if boxSizer.IsVertical():
+
+ boxSizer.Add(0, size, 0)
+
+ else:
+
+ boxSizer.Add(size, 0, 0)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/BusyCursor.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/BusyCursor.1.py
index 52ef7fef..d88a47d6 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/BusyCursor.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/BusyCursor.1.py
@@ -1,7 +1,7 @@
-
- wait = wx.BusyCursor()
-
- for i in xrange(10000):
- DoACalculation()
-
- del wait
+
+ wait = wx.BusyCursor()
+
+ for i in xrange(10000):
+ DoACalculation()
+
+ del wait
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/CloseEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/CloseEvent.1.py
index 3b65b602..87d30dc7 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/CloseEvent.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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
-
+
+ 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/CollapsiblePane.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/CollapsiblePane.1.py
index 578ba92a..9d4b5f9a 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/CollapsiblePane.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/CollapsiblePane.1.py
@@ -1,12 +1,12 @@
-
- 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)
- paneSz.Add(wx.StaticText(win, wx.ID_ANY, "test!"), 1, wx.GROW|wx.ALL, 2)
- win.SetSizer(paneSz)
- paneSz.SetSizeHints(win)
+
+ 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)
+ paneSz.Add(wx.StaticText(win, wx.ID_ANY, "test!"), 1, wx.GROW|wx.ALL, 2)
+ win.SetSizer(paneSz)
+ paneSz.SetSizeHints(win)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.1.py
index 764211e7..b8bb54fe 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.1.py
@@ -1,14 +1,14 @@
-
- # using wx.Config instead of writing wx.FileConfig or wx.RegConfig enhances
- # portability of the code
- 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)
+
+ # using wx.Config instead of writing wx.FileConfig or wx.RegConfig enhances
+ # portability of the code
+ 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/ConfigBase.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.2.py
index c1818b0c..dfbdb071 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.2.py
@@ -1,23 +1,23 @@
-
- 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')
-
+
+ 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/ConfigBase.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.3.py
index ed3d7f85..93950934 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.3.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.3.py
@@ -1,10 +1,10 @@
-
- def foo(config):
-
- oldPath = config.GetPath()
-
- config.SetPath("/Foo/Data")
- # ...
-
- config.SetPath(oldPath)
-
+
+ def foo(config):
+
+ oldPath = config.GetPath()
+
+ config.SetPath("/Foo/Data")
+ # ...
+
+ config.SetPath(oldPath)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.4.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.4.py
index 76dadbea..58238ade 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.4.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.4.py
@@ -1,11 +1,11 @@
-
- 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')
-
+
+ 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/ConfigBase.5.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.5.py
index 3808ea40..b6991df1 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.5.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigBase.5.py
@@ -1,21 +1,21 @@
-
- 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)
- more, value, index = config.GetNextGroup(index)
-
- # ... we have all group (and entry) names in names...
+
+ 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)
+ 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/ConfigPathChanger.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigPathChanger.1.py
index 188d190f..3b538812 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigPathChanger.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigPathChanger.1.py
@@ -1,21 +1,21 @@
-
- # 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")
-
- 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
-
+
+ # 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")
+
+ 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/ConfigPathChanger.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigPathChanger.__init__.1.py
index aef65fb8..36c7f1ed 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigPathChanger.__init__.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigPathChanger.__init__.1.py
@@ -1,2 +1,2 @@
-
- wx.ConfigPathChanger(wx.ConfigBase.Get(), "/MyProgram/SomeKeyName")
+
+ wx.ConfigPathChanger(wx.ConfigBase.Get(), "/MyProgram/SomeKeyName")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigPathChanger.__init__.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigPathChanger.__init__.2.py
index 826fcabe..5e85316d 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigPathChanger.__init__.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ConfigPathChanger.__init__.2.py
@@ -1,2 +1,2 @@
-
- wx.ConfigPathChanger(wx.ConfigBase.Get(), "/MyProgram/")
+
+ wx.ConfigPathChanger(wx.ConfigBase.Get(), "/MyProgram/")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ContextHelp.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ContextHelp.1.py
index 208fca48..7d13f552 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ContextHelp.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ContextHelp.1.py
@@ -1,2 +1,2 @@
-
- contextHelp = wx.ContextHelp(myWindow)
+
+ contextHelp = wx.ContextHelp(myWindow)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Control.SetLabelMarkup.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Control.SetLabelMarkup.1.py
index 39c80505..8829a3cb 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Control.SetLabelMarkup.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Control.SetLabelMarkup.1.py
@@ -1,7 +1,7 @@
-
- text = wx.StaticText(self, -1, 'Hello world!')
-
- # Some more code...
- text.SetLabelMarkup("&Bed &mp "
- "breakfast "
- "available HERE ")
+
+ text = wx.StaticText(self, -1, 'Hello world!')
+
+ # Some more code...
+ text.SetLabelMarkup("&Bed &mp "
+ "breakfast "
+ "available HERE ")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Cursor.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Cursor.1.py
index 89980a16..0f1601e0 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Cursor.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Cursor.1.py
@@ -1,40 +1,40 @@
-
- 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,
- 255, 31, 255, 255, 255, 31, 255, 255, 255, 25, 243,
- 255, 255, 19, 249, 255, 255, 7, 252, 255, 255, 15, 254,
- 255, 255, 31, 255, 255, 255, 191, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 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,
- 31, 0, 0, 254, 15, 0, 0, 252, 7, 0, 0, 248, 3, 0, 0,
- 240, 1, 0, 0, 224, 0, 0, 0, 64, 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, 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)
+
+ 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,
+ 255, 31, 255, 255, 255, 31, 255, 255, 255, 25, 243,
+ 255, 255, 19, 249, 255, 255, 7, 252, 255, 255, 15, 254,
+ 255, 255, 31, 255, 255, 255, 191, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 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,
+ 31, 0, 0, 254, 15, 0, 0, 252, 7, 0, 0, 248, 3, 0, 0,
+ 240, 1, 0, 0, 224, 0, 0, 0, 64, 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, 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/Cursor.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Cursor.__init__.1.py
index 517852b0..37f2a65d 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Cursor.__init__.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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)
+
+ 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/DCClipper.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/DCClipper.1.py
index 37242287..2d45b0e5 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/DCClipper.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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 ...
-
+
+ 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/DateTime.ConvertYearToBC.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ConvertYearToBC.1.py
index 88403cb1..5018ed25 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ConvertYearToBC.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ConvertYearToBC.1.py
@@ -1,5 +1,5 @@
-
- dt = wx.DateTimeFromDMY(8, 5, 1977)
- y = dt.GetYear()
- epoch = (y > 0 and ["AD"] or ["BC"])[0]
- print "The year is %d%s"%(wx.DateTime.ConvertYearToBC(y), epoch)
+
+ dt = wx.DateTimeFromDMY(8, 5, 1977)
+ y = dt.GetYear()
+ epoch = (y > 0 and ["AD"] or ["BC"])[0]
+ print "The year is %d%s"%(wx.DateTime.ConvertYearToBC(y), epoch)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.Now.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.Now.1.py
index 36bf8806..fe32b99c 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.Now.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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))
+
+ 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/DateTime.ParseFormat.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ParseFormat.1.py
index 18f06416..39f33f67 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ParseFormat.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ParseFormat.1.py
@@ -1,12 +1,12 @@
-
- dt = wx.DateTime() # Uninitialized datetime
- bDate = "25/12/2012"
-
- if not dt.ParseFormat(bDate, "%d-%m-%Y"):
- # This datetime format is wrong on purpose
- print "Wrong format"
-
- elif dt.ParseFormat(bDate, "%d/%m/%Y"):
- # This is correct
- print "Format OK!", dt
-
+
+ dt = wx.DateTime() # Uninitialized datetime
+ bDate = "25/12/2012"
+
+ if not dt.ParseFormat(bDate, "%d-%m-%Y"):
+ # This datetime format is wrong on purpose
+ print "Wrong format"
+
+ elif dt.ParseFormat(bDate, "%d/%m/%Y"):
+ # This is correct
+ print "Format OK!", dt
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ParseFormat.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ParseFormat.2.py
index 18f06416..39f33f67 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ParseFormat.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/DateTime.ParseFormat.2.py
@@ -1,12 +1,12 @@
-
- dt = wx.DateTime() # Uninitialized datetime
- bDate = "25/12/2012"
-
- if not dt.ParseFormat(bDate, "%d-%m-%Y"):
- # This datetime format is wrong on purpose
- print "Wrong format"
-
- elif dt.ParseFormat(bDate, "%d/%m/%Y"):
- # This is correct
- print "Format OK!", dt
-
+
+ dt = wx.DateTime() # Uninitialized datetime
+ bDate = "25/12/2012"
+
+ if not dt.ParseFormat(bDate, "%d-%m-%Y"):
+ # This datetime format is wrong on purpose
+ print "Wrong format"
+
+ elif dt.ParseFormat(bDate, "%d/%m/%Y"):
+ # This is correct
+ print "Format OK!", dt
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Dialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Dialog.1.py
index acffa5bb..276b177c 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Dialog.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Dialog.1.py
@@ -1,13 +1,13 @@
-
- def AskUser(self):
-
- dlg = MyAskDialog(self)
-
- if dlg.ShowModal() == wx.ID_OK:
- # do something here
- print 'Hello'
-
- # else: dialog was cancelled or some another button pressed
-
- dlg.Destroy()
-
+
+ def AskUser(self):
+
+ dlg = MyAskDialog(self)
+
+ if dlg.ShowModal() == wx.ID_OK:
+ # do something here
+ print 'Hello'
+
+ # else: dialog was cancelled or some another button pressed
+
+ dlg.Destroy()
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Dialog.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Dialog.2.py
index 0d64b1e9..49e3b9b5 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Dialog.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Dialog.2.py
@@ -1,11 +1,11 @@
-
- def AskUser(self):
-
- dlg = MyAskDialog(self)
-
- if dlg.ShowModal() == wx.ID_OK:
- # do something here
- print 'Hello'
-
- # no need to call Destroy() here
-
+
+ def AskUser(self):
+
+ dlg = MyAskDialog(self)
+
+ if dlg.ShowModal() == wx.ID_OK:
+ # do something here
+ print 'Hello'
+
+ # no need to call Destroy() here
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/DirDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/DirDialog.1.py
index 7b68c565..37ae0bd0 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/DirDialog.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/DirDialog.1.py
@@ -1,4 +1,4 @@
-
- dlg = wx.DirDialog (None, "Choose input directory", "",
- wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST)
-
+
+ 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/Event.Clone.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Event.Clone.1.py
index 1fc0e19e..60d64704 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Event.Clone.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Event.Clone.1.py
@@ -1,4 +1,4 @@
-
- def Clone(self):
-
- return MyEvent()
+
+ def Clone(self):
+
+ return MyEvent()
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/EventBlocker.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/EventBlocker.1.py
index 418883a0..109c6aef 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/EventBlocker.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/EventBlocker.1.py
@@ -1,14 +1,14 @@
-
- def DoSomething(self):
- # block all events directed to this window while
- # we do the 1000 FunctionWhichSendsEvents() calls
- blocker = wx.EventBlocker(self)
-
- 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)
-
+
+ def DoSomething(self):
+ # block all events directed to this window while
+ # we do the 1000 FunctionWhichSendsEvents() calls
+ blocker = wx.EventBlocker(self)
+
+ 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/EventFilter.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/EventFilter.1.py
index a2e6568f..1543b05b 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/EventFilter.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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 or t == wx.EVT_MOTION or \
- t == wx.EVT_LEFT_DOWN or t == wx.EVT_RIGHT_DOWN or \
- t == wx.EVT_MIDDLE_DOWN:
-
- self.last = wx.DateTime.Now()
-
-
- # Continue processing the event normally as well.
- 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
-
+
+ # 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 or t == wx.EVT_MOTION or \
+ t == wx.EVT_LEFT_DOWN or t == wx.EVT_RIGHT_DOWN or \
+ t == wx.EVT_MIDDLE_DOWN:
+
+ self.last = wx.DateTime.Now()
+
+
+ # Continue processing the event normally as well.
+ 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
+
\ No newline at end of file
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/EventLoopActivator.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/EventLoopActivator.1.py
index 33fee4e0..abf5de22 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/EventLoopActivator.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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
+
+ 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/EventLoopBase.Dispatch.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/EventLoopBase.Dispatch.1.py
index 1ecec182..7f916734 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/EventLoopBase.Dispatch.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/EventLoopBase.Dispatch.1.py
@@ -1,3 +1,3 @@
-
- while evtloop.Pending():
- evtloop.Dispatch()
+
+ while evtloop.Pending():
+ evtloop.Dispatch()
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/EvtHandler.QueueEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/EvtHandler.QueueEvent.1.py
index 5cdc5713..234c0204 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/EvtHandler.QueueEvent.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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)
-
+
+ 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/EvtHandler.QueueEvent.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/EvtHandler.QueueEvent.2.py
index e0ec1693..14c1e6a6 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/EvtHandler.QueueEvent.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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())
-
+
+ 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/EvtHandler.SetNextHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/EvtHandler.SetNextHandler.1.py
index 7d64e380..3375fa40 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/EvtHandler.SetNextHandler.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/EvtHandler.SetNextHandler.1.py
@@ -1,3 +1,3 @@
-
- handlerA.SetNextHandler(handlerB)
- handlerB.SetPreviousHandler(handlerA)
+
+ handlerA.SetNextHandler(handlerB)
+ handlerB.SetPreviousHandler(handlerA)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/FSFile.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/FSFile.__init__.1.py
index ae9aae3a..4a96db44 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/FSFile.__init__.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/FSFile.__init__.1.py
@@ -1,8 +1,8 @@
-
- class MyFSFile(wx.FSFile):
-
- def __init__(self):
-
- wx.FSFile.__init__(self)
-
-
+
+ class MyFSFile(wx.FSFile):
+
+ def __init__(self):
+
+ wx.FSFile.__init__(self)
+
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.1.py
index 43fc2035..b3280939 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.1.py
@@ -1,27 +1,27 @@
-
- def OnOpen(self, event):
-
- if self.contentNotSaved:
-
- if wx.MessageBox("Current content has not been saved! Proceed?", "Please confirm",
- wx.ICON_QUESTION | wx.YES_NO, self) == wx.NO:
- return
-
- # else: proceed asking to the user the new file to open
-
- openFileDialog = wx.FileDialog(self, "Open XYZ file", "", "",
- "XYZ files (*.xyz)|*.xyz", wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
-
- if openFileDialog.ShowModal() == wx.ID_CANCEL:
- return # the user changed idea...
-
- # proceed loading the file chosen by the user
- # this can be done with e.g. wxPython input streams:
- input_stream = wx.FileInputStream(openFileDialog.GetPath())
-
- if not input_stream.IsOk():
-
- wx.LogError("Cannot open file '%s'."%openFileDialog.GetPath())
- return
-
+
+ def OnOpen(self, event):
+
+ if self.contentNotSaved:
+
+ if wx.MessageBox("Current content has not been saved! Proceed?", "Please confirm",
+ wx.ICON_QUESTION | wx.YES_NO, self) == wx.NO:
+ return
+
+ # else: proceed asking to the user the new file to open
+
+ openFileDialog = wx.FileDialog(self, "Open XYZ file", "", "",
+ "XYZ files (*.xyz)|*.xyz", wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
+
+ if openFileDialog.ShowModal() == wx.ID_CANCEL:
+ return # the user changed idea...
+
+ # proceed loading the file chosen by the user
+ # this can be done with e.g. wxPython input streams:
+ input_stream = wx.FileInputStream(openFileDialog.GetPath())
+
+ if not input_stream.IsOk():
+
+ wx.LogError("Cannot open file '%s'."%openFileDialog.GetPath())
+ return
+
\ No newline at end of file
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.2.py
index cf8afced..6d0f6de1 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.2.py
@@ -1,17 +1,17 @@
-
- def OnSaveAs(self, event):
-
- saveFileDialog = wx.FileDialog(self, "Save XYZ file", "", "",
- "XYZ files (*.xyz)|*.xyz", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
-
- if saveFileDialog.ShowModal() == wx.ID_CANCEL:
- return # the user changed idea...
-
- # save the current contents in the file
- # this can be done with e.g. wxPython output streams:
- output_stream = wx.FileOutputStream(saveFileDialog.GetPath())
-
- if not output_stream.IsOk():
- wx.LogError("Cannot save current contents in file '%s'."%saveFileDialog.GetPath())
- return
-
+
+ def OnSaveAs(self, event):
+
+ saveFileDialog = wx.FileDialog(self, "Save XYZ file", "", "",
+ "XYZ files (*.xyz)|*.xyz", wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
+
+ if saveFileDialog.ShowModal() == wx.ID_CANCEL:
+ return # the user changed idea...
+
+ # save the current contents in the file
+ # this can be done with e.g. wxPython output streams:
+ output_stream = wx.FileOutputStream(saveFileDialog.GetPath())
+
+ if not output_stream.IsOk():
+ wx.LogError("Cannot save current contents in file '%s'."%saveFileDialog.GetPath())
+ return
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.3.py
index cd5f72e3..0789fe9d 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.3.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/FileDialog.3.py
@@ -1,2 +1,2 @@
-
- wildcard = "BMP and GIF files (*.bmp*.gif)|*.bmp*.gif|PNG files (*.png)|*.png"
+
+ wildcard = "BMP and GIF files (*.bmp*.gif)|*.bmp*.gif|PNG files (*.png)|*.png"
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.AddHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.AddHandler.1.py
index 4f93a3a6..0f3871d1 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.AddHandler.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.AddHandler.1.py
@@ -1,2 +1,2 @@
-
- wx.FileSystem.AddHandler(My_FS_Handler)
+
+ wx.FileSystem.AddHandler(My_FS_Handler)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.ChangePathTo.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.ChangePathTo.1.py
index 0d40d202..00cf0a75 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.ChangePathTo.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.ChangePathTo.1.py
@@ -1,4 +1,4 @@
-
- ChangePathTo("dir/subdir/xh.htm")
- ChangePathTo("dir/subdir", True)
- ChangePathTo("dir/subdir/", True)
+
+ ChangePathTo("dir/subdir/xh.htm")
+ ChangePathTo("dir/subdir", True)
+ ChangePathTo("dir/subdir/", True)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.ChangePathTo.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.ChangePathTo.2.py
index 4792fb75..085f50ee 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystem.ChangePathTo.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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' !!
+
+ 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/FileSystemHandler.CanOpen.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystemHandler.CanOpen.1.py
index f7a6692a..c4958699 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystemHandler.CanOpen.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystemHandler.CanOpen.1.py
@@ -1,5 +1,5 @@
-
- def CanOpen(self, location):
-
- return self.GetProtocol(location) == "http"
-
+
+ def CanOpen(self, location):
+
+ return self.GetProtocol(location) == "http"
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystemHandler.GetMimeTypeFromExt.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystemHandler.GetMimeTypeFromExt.1.py
index bbbba263..45f38225 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystemHandler.GetMimeTypeFromExt.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/FileSystemHandler.GetMimeTypeFromExt.1.py
@@ -1,3 +1,3 @@
-
- if GetMimeTypeFromExt("index.htm") == "text/html":
- wx.MessageBox("Is HTML!")
+
+ if GetMimeTypeFromExt("index.htm") == "text/html":
+ wx.MessageBox("Is HTML!")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Frame.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Frame.1.py
index fa5258dd..c980105b 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Frame.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Frame.1.py
@@ -1,2 +1,2 @@
-
- style = wx.DEFAULT_FRAME_STYLE & ~(wx.RESIZE_BORDER | wx.MAXIMIZE_BOX)
+
+ style = wx.DEFAULT_FRAME_STYLE & ~(wx.RESIZE_BORDER | wx.MAXIMIZE_BOX)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/GraphicsContext.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/GraphicsContext.1.py
index 1c9cdc21..ae227319 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/GraphicsContext.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/GraphicsContext.1.py
@@ -1,25 +1,25 @@
-
- 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()
- path.AddCircle(50.0, 50.0, 50.0)
- path.MoveToPoint(0.0, 50.0)
- path.AddLineToPoint(100.0, 50.0)
- path.MoveToPoint(50.0, 0.0)
- path.AddLineToPoint(50.0, 100.0)
- path.CloseSubpath()
- path.AddRectangle(25.0, 25.0, 50.0, 50.0)
-
- gc.StrokePath(path)
-
-
+
+ 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()
+ path.AddCircle(50.0, 50.0, 50.0)
+ path.MoveToPoint(0.0, 50.0)
+ path.AddLineToPoint(100.0, 50.0)
+ path.MoveToPoint(50.0, 0.0)
+ 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/GraphicsRenderer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/GraphicsRenderer.1.py
index 62df5608..b80fb200 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/GraphicsRenderer.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/GraphicsRenderer.1.py
@@ -1,3 +1,3 @@
-
- path = wx.GraphicsPath() # from somewhere
- brush = path.GetRenderer().CreateBrush(wx.BLACK_BRUSH)
+
+ path = wx.GraphicsPath() # from somewhere
+ brush = path.GetRenderer().CreateBrush(wx.BLACK_BRUSH)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderColumnSimple.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderColumnSimple.1.py
index 7c017ddc..4c591b35 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderColumnSimple.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderColumnSimple.1.py
@@ -1,6 +1,6 @@
-
- header = wx.HeaderCtrlSimple() # Fill in the constructor
- col = wx.HeaderColumnSimple("Title")
- col.SetWidth(100)
- col.SetSortable(100)
- header.AppendColumn(col)
+
+ header = wx.HeaderCtrlSimple() # Fill in the constructor
+ col = wx.HeaderColumnSimple("Title")
+ col.SetWidth(100)
+ col.SetSortable(100)
+ header.AppendColumn(col)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/HelpControllerBase.SetViewer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/HelpControllerBase.SetViewer.1.py
index f99f56fa..20f21136 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/HelpControllerBase.SetViewer.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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)
+
+ 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/IconBundle.GetIcon.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/IconBundle.GetIcon.1.py
index 6653b217..c536b4dd 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/IconBundle.GetIcon.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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/Image.ComputeHistogram.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Image.ComputeHistogram.1.py
index ec020eea..2aa686e9 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Image.ComputeHistogram.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Image.ComputeHistogram.1.py
@@ -1,10 +1,10 @@
-
- # 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
-
+
+ # 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/Image.GetImageExtWildcard.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Image.GetImageExtWildcard.1.py
index 7c169699..76c9339d 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Image.GetImageExtWildcard.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Image.GetImageExtWildcard.1.py
@@ -1,4 +1,4 @@
-
- FileDlg = wx.FileDialog(self, "Choose Image", os.getcwd(), "",
- "Image Files " + wx.Image.GetImageExtWildcard(),
- wx.FD_OPEN)
+
+ 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/Image.LoadFile.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Image.LoadFile.1.py
index 4b1a53f5..ac785f20 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Image.LoadFile.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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)
+
+ 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/Image.LoadFile.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Image.LoadFile.2.py
index 4b1a53f5..ac785f20 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Image.LoadFile.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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)
+
+ 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/Image.SaveFile.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Image.SaveFile.1.py
index 6800fb0c..3fd4cac4 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Image.SaveFile.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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)
+
+ 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/Image.SaveFile.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Image.SaveFile.2.py
index 6800fb0c..3fd4cac4 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Image.SaveFile.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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)
+
+ 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/Image.Scale.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Image.Scale.1.py
index 50facf29..443c312d 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Image.Scale.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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.BitmapFromImage(image.Scale(32, 32))
-
- # another possibility:
- image.Rescale(32, 32)
- bmp = wx.BitmapFromImage(image)
-
+
+ # 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.BitmapFromImage(image.Scale(32, 32))
+
+ # another possibility:
+ image.Rescale(32, 32)
+ bmp = wx.BitmapFromImage(image)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Image.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Image.__init__.1.py
index 4b1a53f5..ac785f20 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Image.__init__.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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)
+
+ 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/InfoBar.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/InfoBar.1.py
index b356f5c7..f828ae2b 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/InfoBar.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/InfoBar.1.py
@@ -1,20 +1,20 @@
-
- class MyFrame(wx.Frame):
-
- def __init__(self, parent):
-
- 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)
-
+
+ class MyFrame(wx.Frame):
+
+ def __init__(self, parent):
+
+ 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/KeyEvent.GetKeyCode.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/KeyEvent.GetKeyCode.1.py
index 66b42cd2..5bbe79ae 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/KeyEvent.GetKeyCode.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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()
-
-
-
-
+
+ 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/KeyboardState.GetModifiers.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/KeyboardState.GetModifiers.1.py
index 1dc7b175..09d0b5d4 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/KeyboardState.GetModifiers.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/KeyboardState.GetModifiers.1.py
@@ -1,5 +1,5 @@
-
- if ControlDown() and not AltDown() and not ShiftDown() and not MetaDown():
- # handle Ctrl-XXX ...
- HandleControl()
-
+
+ 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/KeyboardState.GetModifiers.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/KeyboardState.GetModifiers.2.py
index 0dbccdb9..b039d0e7 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/KeyboardState.GetModifiers.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/KeyboardState.GetModifiers.2.py
@@ -1,4 +1,4 @@
-
- if GetModifiers() == wx.MOD_CONTROL:
- # handle Ctrl-XXX ...
- HandleControl()
+
+ if GetModifiers() == wx.MOD_CONTROL:
+ # handle Ctrl-XXX ...
+ HandleControl()
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.GetNextItem.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.GetNextItem.1.py
index 33de5e80..c49c8ab4 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.GetNextItem.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.GetNextItem.1.py
@@ -1,13 +1,13 @@
-
- item = -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)
-
+
+ item = -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/ListCtrl.SetColumnsOrder.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetColumnsOrder.1.py
index beae944c..a871d61d 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetColumnsOrder.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetColumnsOrder.1.py
@@ -1,13 +1,13 @@
-
- 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,
- # 1 and 2 respectively
+
+ 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,
+ # 1 and 2 respectively
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetItemState.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetItemState.1.py
index 51ae6cc7..8605487a 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetItemState.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetItemState.1.py
@@ -1,2 +1,2 @@
-
- listCtrl.SetItemState(item, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
+
+ listCtrl.SetItemState(item, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetItemState.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetItemState.2.py
index 70b4ae4c..da7026d2 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetItemState.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SetItemState.2.py
@@ -1,2 +1,2 @@
-
- listCtrl.SetItemState(item, 0, wx.LIST_STATE_SELECTED)
+
+ listCtrl.SetItemState(item, 0, wx.LIST_STATE_SELECTED)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SortItems.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SortItems.1.py
index 56cf8486..e3fcdb2c 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SortItems.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ListCtrl.SortItems.1.py
@@ -1,6 +1,6 @@
-
- def ListCompareFunction(self, item1, item2):
-
- pass
-
-
+
+ def ListCompareFunction(self, item1, item2):
+
+ pass
+
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Log.LogRecord.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Log.LogRecord.1.py
index 499df34b..518c1018 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Log.LogRecord.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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)
-
+
+ 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/Log.SetComponentLevel.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Log.SetComponentLevel.1.py
index 24fa6b4b..7917be5f 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Log.SetComponentLevel.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Log.SetComponentLevel.1.py
@@ -1,2 +1,2 @@
-
- wx.Log.SetComponentLevel("wx./net", wx.LOG_Error)
+
+ wx.Log.SetComponentLevel("wx./net", wx.LOG_Error)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/LogChain.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/LogChain.1.py
index 2012dea8..3ec3467c 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/LogChain.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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
+
+ 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/MDIParentFrame.OnCreateClient.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/MDIParentFrame.OnCreateClient.1.py
index 2b227b70..0237faff 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/MDIParentFrame.OnCreateClient.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/MDIParentFrame.OnCreateClient.1.py
@@ -1,3 +1,3 @@
-
- frame = MyParentFrame()
- frame.Create(parent, myParentFrameId, "My Parent Frame")
+
+ frame = MyParentFrame()
+ frame.Create(parent, myParentFrameId, "My Parent Frame")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/MemoryDC.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/MemoryDC.1.py
index af51368c..81fb5b73 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/MemoryDC.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/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)
+
+ # 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/MemoryDC.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/MemoryDC.2.py
index 62a581c4..9f354df7 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/MemoryDC.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/MemoryDC.2.py
@@ -1,2 +1,2 @@
-
- temp_dc.SelectObject(wx.NullBitmap)
+
+ temp_dc.SelectObject(wx.NullBitmap)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/MemoryFSHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/MemoryFSHandler.1.py
index 4e2a55ae..95757721 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/MemoryFSHandler.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/MemoryFSHandler.1.py
@@ -1,35 +1,35 @@
-
- def OnAbout(self, event):
-
- bcur = wx.BeginBusyCursor()
-
- wx.FileSystem.AddHandler(wx.MemoryFSHandler)
- wx.MemoryFSHandler.AddFile("logo.pcx", wx.Bitmap("logo.pcx", wx.BITMAP_TYPE_PCX))
- wx.MemoryFSHandler.AddFile("about.htm",
- "About: "
- " ")
-
- dlg = wx.Dialog(self, -1, _("About"))
-
- topsizer = wx.BoxSizer(wx.VERTICAL)
-
- html = wx.html.HtmlWindow(dlg, size=wx.Size(380, 160), style=wx.HW_SCROLLBAR_NEVER)
- html.SetBorders(0)
- html.LoadPage("memory:about.htm")
- html.SetSize(html.GetInternalRepresentation().GetWidth(),
- html.GetInternalRepresentation().GetHeight())
-
- topsizer.Add(html, 1, wx.ALL, 10)
- topsizer.Add(wx.StaticLine(dlg, -1), 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 10)
- topsizer.Add(wx.Button(dlg, wx.ID_OK, "Ok"),
- 0, wx.ALL | wx.ALIGN_RIGHT, 15)
-
- dlg.SetAutoLayout(True)
- dlg.SetSizer(topsizer)
- topsizer.Fit(dlg)
- dlg.Centre()
- dlg.ShowModal()
-
- wx.MemoryFSHandler.RemoveFile("logo.pcx")
- wx.MemoryFSHandler.RemoveFile("about.htm")
-
+
+ def OnAbout(self, event):
+
+ bcur = wx.BeginBusyCursor()
+
+ wx.FileSystem.AddHandler(wx.MemoryFSHandler)
+ wx.MemoryFSHandler.AddFile("logo.pcx", wx.Bitmap("logo.pcx", wx.BITMAP_TYPE_PCX))
+ wx.MemoryFSHandler.AddFile("about.htm",
+ "About: "
+ " ")
+
+ dlg = wx.Dialog(self, -1, _("About"))
+
+ topsizer = wx.BoxSizer(wx.VERTICAL)
+
+ html = wx.html.HtmlWindow(dlg, size=wx.Size(380, 160), style=wx.HW_SCROLLBAR_NEVER)
+ html.SetBorders(0)
+ html.LoadPage("memory:about.htm")
+ html.SetSize(html.GetInternalRepresentation().GetWidth(),
+ html.GetInternalRepresentation().GetHeight())
+
+ topsizer.Add(html, 1, wx.ALL, 10)
+ topsizer.Add(wx.StaticLine(dlg, -1), 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 10)
+ topsizer.Add(wx.Button(dlg, wx.ID_OK, "Ok"),
+ 0, wx.ALL | wx.ALIGN_RIGHT, 15)
+
+ dlg.SetAutoLayout(True)
+ dlg.SetSizer(topsizer)
+ topsizer.Fit(dlg)
+ dlg.Centre()
+ dlg.ShowModal()
+
+ wx.MemoryFSHandler.RemoveFile("logo.pcx")
+ wx.MemoryFSHandler.RemoveFile("about.htm")
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.1.py
index 00e23389..ee06dc71 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.1.py
@@ -1,2 +1,2 @@
-
- self.fileMenu.Append(ID_NEW_FILE, "&New file\tCTRL+N", "Creates a XYZ document")
+
+ self.fileMenu.Append(ID_NEW_FILE, "&New file\tCTRL+N", "Creates a XYZ document")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.2.py
index 2e815841..4735ae8a 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.2.py
@@ -1,2 +1,2 @@
-
- self.fileMenu.Append(wx.ID_NEW, "", "Creates a XYZ document")
+
+ self.fileMenu.Append(wx.ID_NEW, "", "Creates a XYZ document")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.3.py
index 00e23389..ee06dc71 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.3.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.3.py
@@ -1,2 +1,2 @@
-
- self.fileMenu.Append(ID_NEW_FILE, "&New file\tCTRL+N", "Creates a XYZ document")
+
+ self.fileMenu.Append(ID_NEW_FILE, "&New file\tCTRL+N", "Creates a XYZ document")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.4.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.4.py
index 2e815841..4735ae8a 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.4.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Menu.Append.4.py
@@ -1,2 +1,2 @@
-
- self.fileMenu.Append(wx.ID_NEW, "", "Creates a XYZ document")
+
+ self.fileMenu.Append(wx.ID_NEW, "", "Creates a XYZ document")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.GetLabelText.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.GetLabelText.1.py
index f92fbf0e..ae0d5784 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.GetLabelText.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.GetLabelText.1.py
@@ -1,2 +1,2 @@
-
- wx.MenuItem.GetLabelfromText("&Hello\tCtrl-h")
+
+ wx.MenuItem.GetLabelfromText("&Hello\tCtrl-h")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.SetItemLabel.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.SetItemLabel.1.py
index f1e4eb06..98c38e8b 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.SetItemLabel.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.SetItemLabel.1.py
@@ -1,5 +1,5 @@
-
- self.myMenuItem.SetItemLabel("My &item\tCTRL+I")
- self.myMenuItem2.SetItemLabel("Clean and build\tF7")
- self.myMenuItem3.SetItemLabel("Simple item")
- self.myMenuItem4.SetItemLabel("Item with &accelerator")
+
+ self.myMenuItem.SetItemLabel("My &item\tCTRL+I")
+ self.myMenuItem2.SetItemLabel("Clean and build\tF7")
+ self.myMenuItem3.SetItemLabel("Simple item")
+ self.myMenuItem4.SetItemLabel("Item with &accelerator")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.__init__.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.__init__.1.py
index 399023ef..5684bc19 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.__init__.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/MenuItem.__init__.1.py
@@ -1,11 +1,11 @@
-
- # use all stock properties:
- helpMenu.Append(wx.ID_ABOUT)
-
- # use the stock label and the stock accelerator but not the stock help string:
- helpMenu.Append(wx.ID_ABOUT, "", "My custom help string")
-
- # use all stock properties except for the bitmap:
- mymenu = wx.MenuItem(helpMenu, wx.ID_ABOUT)
- mymenu.SetBitmap(wx.ArtProvider.GetBitmap(wx.ART_WARNING))
- helpMenu.Append(mymenu)
+
+ # use all stock properties:
+ helpMenu.Append(wx.ID_ABOUT)
+
+ # use the stock label and the stock accelerator but not the stock help string:
+ helpMenu.Append(wx.ID_ABOUT, "", "My custom help string")
+
+ # use all stock properties except for the bitmap:
+ mymenu = wx.MenuItem(helpMenu, wx.ID_ABOUT)
+ mymenu.SetBitmap(wx.ArtProvider.GetBitmap(wx.ART_WARNING))
+ helpMenu.Append(mymenu)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/MessageDialog.SetYesNoLabels.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/MessageDialog.SetYesNoLabels.1.py
index a9e57a2b..28a1b30a 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/MessageDialog.SetYesNoLabels.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/MessageDialog.SetYesNoLabels.1.py
@@ -1,3 +1,3 @@
-
- dlg = wx.MessageDialog(parent, message, caption)
- dlg.SetYesNoLabels(wx.ID_SAVE, "&Don't save")
+
+ dlg = wx.MessageDialog(parent, message, caption)
+ dlg.SetYesNoLabels(wx.ID_SAVE, "&Don't save")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/MessageDialog.SetYesNoLabels.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/MessageDialog.SetYesNoLabels.2.py
index c8875dd0..b45b2acd 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/MessageDialog.SetYesNoLabels.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/MessageDialog.SetYesNoLabels.2.py
@@ -1,6 +1,6 @@
-
- dlg = wx.MessageDialog(parent, message, caption)
- if dlg.SetYesNoLabels("&Quit", "&Don't quit"):
- dlg.SetMessage("What do you want to do?")
- else: # buttons have standard "Yes"/"No" values, so rephrase the question
- dlg.SetMessage("Do you really want to quit?")
+
+ dlg = wx.MessageDialog(parent, message, caption)
+ if dlg.SetYesNoLabels("&Quit", "&Don't quit"):
+ dlg.SetMessage("What do you want to do?")
+ else: # buttons have standard "Yes"/"No" values, so rephrase the question
+ dlg.SetMessage("Do you really want to quit?")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/NonOwnedWindow.SetShape.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/NonOwnedWindow.SetShape.1.py
index c4d477c5..f9854f95 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/NonOwnedWindow.SetShape.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/NonOwnedWindow.SetShape.1.py
@@ -1,7 +1,7 @@
-
- size = self.GetSize()
-
- path = wx.GraphicsRenderer.GetDefaultRenderer().CreatePath()
- path.AddCircle(size.x/2, size.y/2, 30)
-
- self.SetShape(path)
+
+ size = self.GetSize()
+
+ path = wx.GraphicsRenderer.GetDefaultRenderer().CreatePath()
+ path.AddCircle(size.x/2, size.y/2, 30)
+
+ self.SetShape(path)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Notebook.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Notebook.1.py
index 4c9697ad..b96935af 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Notebook.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Notebook.1.py
@@ -1,2 +1,2 @@
-
- wx.SystemOptions.SetOption("msw.notebook.themed-background", 0)
+
+ wx.SystemOptions.SetOption("msw.notebook.themed-background", 0)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Notebook.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Notebook.2.py
index 423c8b64..5c2c296c 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Notebook.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Notebook.2.py
@@ -1,6 +1,6 @@
-
- col = notebook.GetThemeBackgroundColour()
-
- if col.IsOk():
- page.SetBackgroundColour(col)
-
+
+ col = notebook.GetThemeBackgroundColour()
+
+ if col.IsOk():
+ page.SetBackgroundColour(col)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/PaintEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/PaintEvent.1.py
index a83661de..95c42957 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/PaintEvent.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/PaintEvent.1.py
@@ -1,6 +1,6 @@
-
- def OnPaint(self, event):
-
- dc = wx.PaintDC(self)
- DrawMyDocument(dc)
-
+
+ def OnPaint(self, event):
+
+ dc = wx.PaintDC(self)
+ DrawMyDocument(dc)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/PaintEvent.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/PaintEvent.2.py
index 1fa22ada..8b6def7e 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/PaintEvent.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/PaintEvent.2.py
@@ -1,21 +1,21 @@
-
- # Called when window needs to be repainted.
- def OnPaint(self, event):
-
- dc = wx.PaintDC(self)
-
- # Find out where the window is scrolled to
- vbX, vbY = self.GetViewStart()
-
- # get the update rect list
- upd = wx.RegionIterator(self.GetUpdateRegion())
-
- while upd.HaveRects():
-
- rect = upd.GetRect()
-
- # Repaint this rectangle
- PaintRectangle(rect, dc)
-
- upd.Next()
-
+
+ # Called when window needs to be repainted.
+ def OnPaint(self, event):
+
+ dc = wx.PaintDC(self)
+
+ # Find out where the window is scrolled to
+ vbX, vbY = self.GetViewStart()
+
+ # get the update rect list
+ upd = wx.RegionIterator(self.GetUpdateRegion())
+
+ while upd.HaveRects():
+
+ rect = upd.GetRect()
+
+ # Repaint this rectangle
+ PaintRectangle(rect, dc)
+
+ upd.Next()
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/PlatformInfo.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/PlatformInfo.1.py
index d4639bf3..56240d59 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/PlatformInfo.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/PlatformInfo.1.py
@@ -1,2 +1,2 @@
-
- wx.LogMessage("This application is running under %s." % wx.PlatformInfo.Get().GetOperatingSystemIdName())
+
+ wx.LogMessage("This application is running under %s." % wx.PlatformInfo.Get().GetOperatingSystemIdName())
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Point.SetDefaults.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Point.SetDefaults.1.py
index 107ffff8..f9dfecc8 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Point.SetDefaults.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Point.SetDefaults.1.py
@@ -1,5 +1,5 @@
-
- if not pos.IsFullySpecified():
-
- pos.SetDefaults(GetDefaultPosition())
-
+
+ if not pos.IsFullySpecified():
+
+ pos.SetDefaults(GetDefaultPosition())
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Scrolled.DoPrepareDC.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Scrolled.DoPrepareDC.1.py
index bc66f2ea..07fbab82 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Scrolled.DoPrepareDC.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Scrolled.DoPrepareDC.1.py
@@ -1,16 +1,16 @@
-
- def OnEvent(self, event):
-
- dc = wx.ClientDC(self)
- self.DoPrepareDC(dc)
-
- dc.SetPen(wx.BLACK_PEN)
-
- x, y = event.GetPosition()
-
- if (xpos > -1 and ypos > -1 and event.Dragging()):
- dc.DrawLine(xpos, ypos, x, y)
-
- xpos = x
- ypos = y
-
+
+ def OnEvent(self, event):
+
+ dc = wx.ClientDC(self)
+ self.DoPrepareDC(dc)
+
+ dc.SetPen(wx.BLACK_PEN)
+
+ x, y = event.GetPosition()
+
+ if (xpos > -1 and ypos > -1 and event.Dragging()):
+ dc.DrawLine(xpos, ypos, x, y)
+
+ xpos = x
+ ypos = y
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Scrolled.SetScrollbars.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Scrolled.SetScrollbars.1.py
index f0a76730..2c167c0c 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Scrolled.SetScrollbars.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Scrolled.SetScrollbars.1.py
@@ -1,2 +1,2 @@
-
- window.SetScrollbars(20, 20, 50, 50)
+
+ window.SetScrollbars(20, 20, 50, 50)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/SearchCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/SearchCtrl.1.py
index cba3b21b..c912e6f7 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/SearchCtrl.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/SearchCtrl.1.py
@@ -1,2 +1,2 @@
-
- event.GetString()
+
+ event.GetString()
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/SingleInstanceChecker.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/SingleInstanceChecker.1.py
index bb4a63b9..8a246444 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/SingleInstanceChecker.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/SingleInstanceChecker.1.py
@@ -1,14 +1,14 @@
-
- def OnInit(self):
-
- self.name = "SingleApp-%s" % wx.GetUserId()
- self.instance = wx.SingleInstanceChecker(self.name)
-
- if self.instance.IsAnotherRunning():
- wx.MessageBox("Another instance is running", "ERROR")
- return False
-
- frame = SingleAppFrame(None, "SingleApp")
- frame.Show()
- return True
-
+
+ def OnInit(self):
+
+ self.name = "SingleApp-%s" % wx.GetUserId()
+ self.instance = wx.SingleInstanceChecker(self.name)
+
+ if self.instance.IsAnotherRunning():
+ wx.MessageBox("Another instance is running", "ERROR")
+ return False
+
+ frame = SingleAppFrame(None, "SingleApp")
+ frame.Show()
+ return True
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Size.SetDefaults.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Size.SetDefaults.1.py
index d762072b..70ffaa51 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Size.SetDefaults.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Size.SetDefaults.1.py
@@ -1,5 +1,5 @@
-
- if not size.IsFullySpecified():
-
- size.SetDefaults(GetDefaultSize())
-
+
+ if not size.IsFullySpecified():
+
+ size.SetDefaults(GetDefaultSize())
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Sizer.AddSpacer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Sizer.AddSpacer.1.py
index 5e416ee5..38e02726 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Sizer.AddSpacer.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Sizer.AddSpacer.1.py
@@ -1,2 +1,2 @@
-
- wx.Sizer.Add(size, size, 0)
+
+ wx.Sizer.Add(size, size, 0)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Sizer.AddStretchSpacer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Sizer.AddStretchSpacer.1.py
index ffdb4516..0b28bdb9 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Sizer.AddStretchSpacer.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Sizer.AddStretchSpacer.1.py
@@ -1,2 +1,2 @@
-
- wx.Sizer.Add(0, 0, proportion)
+
+ wx.Sizer.Add(0, 0, proportion)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.1.py
index 98ed9811..6fa76186 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.1.py
@@ -1,2 +1,2 @@
-
- sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
+
+ sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.2.py
index 2f2d358f..39f54cbd 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.2.py
@@ -1,2 +1,2 @@
-
- sizer.Add(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
+
+ sizer.Add(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.3.py
index b7734172..9a0867b0 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.3.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/SizerFlags.3.py
@@ -1,6 +1,6 @@
-
- flagsExpand = wx.SizerFlags(1)
- flagsExpand.Expand().Border(wx.ALL, 10)
-
- sizer.Add(ctrl1, flagsExpand)
- sizer.Add(ctrl2, flagsExpand)
+
+ flagsExpand = wx.SizerFlags(1)
+ flagsExpand.Expand().Border(wx.ALL, 10)
+
+ sizer.Add(ctrl1, flagsExpand)
+ sizer.Add(ctrl2, flagsExpand)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/StandardPaths.MSWGetShellDir.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/StandardPaths.MSWGetShellDir.1.py
index 2e965c82..5a266e4a 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/StandardPaths.MSWGetShellDir.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/StandardPaths.MSWGetShellDir.1.py
@@ -1,6 +1,6 @@
-
- if wx.Platform == '__WXMSW__':
- # get the location of files waiting to be burned on a CD
- cdburnArea = wx.StandardPaths.MSWGetShellDir(CSIDL_CDBURN_AREA)
-
- # endif __WXMSW__
+
+ if wx.Platform == '__WXMSW__':
+ # get the location of files waiting to be burned on a CD
+ cdburnArea = wx.StandardPaths.MSWGetShellDir(CSIDL_CDBURN_AREA)
+
+ # endif __WXMSW__
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/StandardPaths.UseAppInfo.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/StandardPaths.UseAppInfo.1.py
index 68ecf065..96464831 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/StandardPaths.UseAppInfo.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/StandardPaths.UseAppInfo.1.py
@@ -1,2 +1,2 @@
-
- info = AppInfo_AppName | AppInfo_VendorName
+
+ info = AppInfo_AppName | AppInfo_VendorName
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBox.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBox.1.py
index 8c3b87d0..9478f589 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBox.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBox.1.py
@@ -1,9 +1,9 @@
-
- def CreateControls(self):
-
- panel = wx.Panel(self)
- box = wx.StaticBox(panel, wx.ID_ANY, "StaticBox")
-
- text = wx.StaticText(box, wx.ID_ANY, "This window is a child of the staticbox")
-
- # Other code...
+
+ def CreateControls(self):
+
+ panel = wx.Panel(self)
+ box = wx.StaticBox(panel, wx.ID_ANY, "StaticBox")
+
+ text = wx.StaticText(box, wx.ID_ANY, "This window is a child of the staticbox")
+
+ # Other code...
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBox.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBox.2.py
index c44137bd..711523a8 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBox.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBox.2.py
@@ -1,6 +1,6 @@
-
- box = wx.StaticBox(panel, wx.ID_ANY, "StaticBox")
-
- text = wx.StaticText(panel, wx.ID_ANY, "This window is a child of the panel")
-
- # Other code...
+
+ box = wx.StaticBox(panel, wx.ID_ANY, "StaticBox")
+
+ text = wx.StaticText(panel, wx.ID_ANY, "This window is a child of the panel")
+
+ # Other code...
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBoxSizer.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBoxSizer.1.py
index 6786e090..33f9b748 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBoxSizer.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/StaticBoxSizer.1.py
@@ -1,12 +1,12 @@
-
- def CreateControls(self):
-
- panel = wx.Panel(self)
- # Other controls here...
-
- sz = wx.StaticBoxSizer(wx.VERTICAL, panel, "Box")
- sz.Add(wx.StaticText(sz.GetStaticBox(), wx.ID_ANY,
- "This window is a child of the staticbox"))
-
- # Other code...
-
+
+ def CreateControls(self):
+
+ panel = wx.Panel(self)
+ # Other controls here...
+
+ sz = wx.StaticBoxSizer(wx.VERTICAL, panel, "Box")
+ sz.Add(wx.StaticText(sz.GetStaticBox(), wx.ID_ANY,
+ "This window is a child of the staticbox"))
+
+ # Other code...
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/TextCompleterSimple.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/TextCompleterSimple.1.py
index 3bfe6db0..29bc89a3 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/TextCompleterSimple.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/TextCompleterSimple.1.py
@@ -1,29 +1,29 @@
-
- class MyTextCompleter(wx.TextCompleterSimple):
-
- def __init__(self):
-
- wx.TextCompleterSimple.__init__(self)
-
-
- def GetCompletions(self, prefix, res):
-
- firstWord = prefix.split()[0]
-
- if firstWord == "white":
- res.append("white pawn")
- res.append("white rook")
-
- elif firstWord == "black":
- res.append("black king")
- res.append("black queen")
-
- else:
- res.append("white")
- res.append("black")
-
-
- # Later on...
- text = wx.TextCtrl(parent, wx.ID_ANY, 'My Text')
- text.AutoComplete(MyTextCompleter)
-
+
+ class MyTextCompleter(wx.TextCompleterSimple):
+
+ def __init__(self):
+
+ wx.TextCompleterSimple.__init__(self)
+
+
+ def GetCompletions(self, prefix, res):
+
+ firstWord = prefix.split()[0]
+
+ if firstWord == "white":
+ res.append("white pawn")
+ res.append("white rook")
+
+ elif firstWord == "black":
+ res.append("black king")
+ res.append("black queen")
+
+ else:
+ res.append("white")
+ res.append("black")
+
+
+ # Later on...
+ text = wx.TextCtrl(parent, wx.ID_ANY, 'My Text')
+ text.AutoComplete(MyTextCompleter)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/TextCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/TextCtrl.1.py
index 37df47dd..64cfc9ea 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/TextCtrl.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/TextCtrl.1.py
@@ -1,7 +1,7 @@
-
- text.SetDefaultStyle(wx.TextAttr(wx.RED))
- text.AppendText("Red text\n")
- text.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))
- text.AppendText("Red on grey text\n")
- text.SetDefaultStyle(wx.TextAttr(wx.BLUE))
- text.AppendText("Blue on grey text\n")
+
+ text.SetDefaultStyle(wx.TextAttr(wx.RED))
+ text.AppendText("Red text\n")
+ text.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))
+ text.AppendText("Red on grey text\n")
+ text.SetDefaultStyle(wx.TextAttr(wx.BLUE))
+ text.AppendText("Blue on grey text\n")
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/TextEntry.GetInsertionPoint.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/TextEntry.GetInsertionPoint.1.py
index 67cd269f..1cfa1779 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/TextEntry.GetInsertionPoint.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/TextEntry.GetInsertionPoint.1.py
@@ -1,10 +1,10 @@
-
- def GetCurrentChar(textCtrl):
-
- pos = textCtrl.GetInsertionPoint()
-
- if pos == textCtrl.GetLastPosition():
- return ''
-
- return textCtrl.GetValue()[pos]
-
+
+ def GetCurrentChar(textCtrl):
+
+ pos = textCtrl.GetInsertionPoint()
+
+ if pos == textCtrl.GetLastPosition():
+ return ''
+
+ return textCtrl.GetValue()[pos]
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/TimerEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/TimerEvent.1.py
index c8cb533e..03df445a 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/TimerEvent.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/TimerEvent.1.py
@@ -1,19 +1,19 @@
-
- class MyFrame(wx.Frame):
-
- def __init__(self, parent):
-
- wx.Frame.__init__(self, parent)
-
- self.timer = wx.Timer(self, TIMER_ID)
- self.Bind(wx.EVT_TIMER, self.OnTimer)
-
- self.timer.Start(1000) # 1 second interval
-
-
- def OnTimer(self, event):
-
- # do whatever you want to do every second here
- print 'Hello'
-
-
+
+ class MyFrame(wx.Frame):
+
+ def __init__(self, parent):
+
+ wx.Frame.__init__(self, parent)
+
+ self.timer = wx.Timer(self, TIMER_ID)
+ self.Bind(wx.EVT_TIMER, self.OnTimer)
+
+ self.timer.Start(1000) # 1 second interval
+
+
+ def OnTimer(self, event):
+
+ # do whatever you want to do every second here
+ print 'Hello'
+
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.1.py
index 161cd719..e1c06334 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.1.py
@@ -1,2 +1,2 @@
-
- wx.SystemOptions.SetOption("msw.remap", 0)
+
+ wx.SystemOptions.SetOption("msw.remap", 0)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.2.py
index 4469402e..fd396376 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.2.py
@@ -1,2 +1,2 @@
-
- wx.SystemOptions.SetOption("msw.remap", 2)
+
+ wx.SystemOptions.SetOption("msw.remap", 2)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.3.py
index 72897b37..b5337dcd 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.3.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/ToolBar.3.py
@@ -1,4 +1,4 @@
-
- if wx.GetApp().GetComCtl32Version() >= 600 and wx.DisplayDepth() >= 32:
- # Use the 32-bit images
- wx.SystemOptions.SetOption("msw.remap", 2)
+
+ if wx.GetApp().GetComCtl32Version() >= 600 and wx.DisplayDepth() >= 32:
+ # Use the 32-bit images
+ wx.SystemOptions.SetOption("msw.remap", 2)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Validator.SetWindow.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Validator.SetWindow.1.py
index 7950c113..2bc9051e 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Validator.SetWindow.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Validator.SetWindow.1.py
@@ -1,3 +1,3 @@
-
- wx.TextCtrl(self, wx.ID_ANY, u'', wx.DefaultPosition, wx.DefaultSize, 0,
- validator=MyValidator())
+
+ wx.TextCtrl(self, wx.ID_ANY, u'', wx.DefaultPosition, wx.DefaultSize, 0,
+ validator=MyValidator())
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.DoUpdateWindowUI.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.DoUpdateWindowUI.1.py
index a388a604..f1b3ec93 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.DoUpdateWindowUI.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.DoUpdateWindowUI.1.py
@@ -1,13 +1,13 @@
-
- # do the window-specific processing after processing the update event
- def DoUpdateWindowUI(self, event):
-
- if event.GetSetEnabled():
- self.Enable(event.GetEnabled())
-
- if event.GetSetText():
-
- if event.GetText() != self.GetTitle():
- self.SetTitle(event.GetText())
-
-
+
+ # do the window-specific processing after processing the update event
+ def DoUpdateWindowUI(self, event):
+
+ if event.GetSetEnabled():
+ self.Enable(event.GetEnabled())
+
+ if event.GetSetText():
+
+ if event.GetText() != self.GetTitle():
+ self.SetTitle(event.GetText())
+
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Fit.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Fit.1.py
index 401ed691..073042e4 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Fit.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Fit.1.py
@@ -1,2 +1,2 @@
-
- window.SetClientSize(child.GetSize())
+
+ window.SetClientSize(child.GetSize())
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.HandleWindowEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.HandleWindowEvent.1.py
index f0c2c6e2..3d3d8f58 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.HandleWindowEvent.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.HandleWindowEvent.1.py
@@ -1,2 +1,2 @@
-
- GetEventHandler().SafelyProcessEvent(event)
+
+ GetEventHandler().SafelyProcessEvent(event)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.1.py
index bdfe9905..fedbbbad 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.1.py
@@ -1,2 +1,2 @@
-
- self.SetSize(x, y, -1, -1, wx.SIZE_USE_EXISTING)
+
+ self.SetSize(x, y, -1, -1, wx.SIZE_USE_EXISTING)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.2.py
index bdfe9905..fedbbbad 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.2.py
@@ -1,2 +1,2 @@
-
- self.SetSize(x, y, -1, -1, wx.SIZE_USE_EXISTING)
+
+ self.SetSize(x, y, -1, -1, wx.SIZE_USE_EXISTING)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.3.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.3.py
index bdfe9905..fedbbbad 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.3.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.Move.3.py
@@ -1,2 +1,2 @@
-
- self.SetSize(x, y, -1, -1, wx.SIZE_USE_EXISTING)
+
+ self.SetSize(x, y, -1, -1, wx.SIZE_USE_EXISTING)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.ProcessEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.ProcessEvent.1.py
index fd31708d..57b81dbb 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.ProcessEvent.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.ProcessEvent.1.py
@@ -1,2 +1,2 @@
-
- self.GetEventHandler().ProcessEvent()
+
+ self.GetEventHandler().ProcessEvent()
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.ProcessWindowEvent.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.ProcessWindowEvent.1.py
index a5d0604d..89a2697b 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.ProcessWindowEvent.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.ProcessWindowEvent.1.py
@@ -1,2 +1,2 @@
-
- self.GetEventHandler().ProcessEvent(event)
+
+ self.GetEventHandler().ProcessEvent(event)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.PushEventHandler.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.PushEventHandler.1.py
index acf01b22..0da1720c 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.PushEventHandler.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.PushEventHandler.1.py
@@ -1,3 +1,3 @@
-
- W.PushEventHandler(A)
- W.PushEventHandler(B)
+
+ W.PushEventHandler(A)
+ W.PushEventHandler(B)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetBackgroundStyle.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetBackgroundStyle.1.py
index 89454855..b2373b03 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetBackgroundStyle.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetBackgroundStyle.1.py
@@ -1,17 +1,17 @@
-
- class MyWidget(wx.Window):
-
- def __init__(self, parent):
-
- pre = wx.PreWindow() # Use Pre- constructor here!
-
- # Do this first:
- self.SetBackgroundStyle(wx.BG_STYLE_TRANSPARENT)
-
- # And really create the window afterwards:
- pre.Create(parent)
- self.PostCreate(pre)
-
-
-
-
+
+ class MyWidget(wx.Window):
+
+ def __init__(self, parent):
+
+ pre = wx.PreWindow() # Use Pre- constructor here!
+
+ # Do this first:
+ self.SetBackgroundStyle(wx.BG_STYLE_TRANSPARENT)
+
+ # And really create the window afterwards:
+ pre.Create(parent)
+ self.PostCreate(pre)
+
+
+
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetMaxClientSize.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetMaxClientSize.1.py
index 349f9dfb..0dd86184 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetMaxClientSize.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetMaxClientSize.1.py
@@ -1,2 +1,2 @@
-
- self.SetMaxSize(self.ClientToWindowSize(size))
+
+ self.SetMaxSize(self.ClientToWindowSize(size))
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetMinClientSize.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetMinClientSize.1.py
index bb7ea7b5..d71497d6 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetMinClientSize.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetMinClientSize.1.py
@@ -1,2 +1,2 @@
-
- self.SetMinSize(self.ClientToWindowSize(size))
+
+ self.SetMinSize(self.ClientToWindowSize(size))
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetScrollbar.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetScrollbar.1.py
index 3ab3016b..40cac0bf 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetScrollbar.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.SetScrollbar.1.py
@@ -1,2 +1,2 @@
-
- self.SetScrollbar(wx.VERTICAL, 0, 16, 50)
+
+ self.SetScrollbar(wx.VERTICAL, 0, 16, 50)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.UpdateWindowUI.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.UpdateWindowUI.1.py
index cfddf366..b6b29039 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/Window.UpdateWindowUI.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Window.UpdateWindowUI.1.py
@@ -1,6 +1,6 @@
-
- def OnInternalIdle(self):
-
- if wx.UpdateUIEvent.CanUpdate(self):
- self.UpdateWindowUI(wx.UPDATE_UI_FROMIDLE)
-
+
+ def OnInternalIdle(self):
+
+ if wx.UpdateUIEvent.CanUpdate(self):
+ self.UpdateWindowUI(wx.UPDATE_UI_FROMIDLE)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/WindowModalDialogEvent.Clone.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/WindowModalDialogEvent.Clone.1.py
index 1fc0e19e..60d64704 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/WindowModalDialogEvent.Clone.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/WindowModalDialogEvent.Clone.1.py
@@ -1,4 +1,4 @@
-
- def Clone(self):
-
- return MyEvent()
+
+ def Clone(self):
+
+ return MyEvent()
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewModel.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewModel.1.py
index b8419a77..cf817fab 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewModel.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewModel.1.py
@@ -1,7 +1,7 @@
-
- musicCtrl = wx.dataview.DataViewCtrl(self, wx.ID_ANY)
- musicModel = MyMusicModel()
- musicCtrl.AssociateModel(musicModel)
- musicModel.DecRef() # avoid memory leak !!
-
- # add columns now
+
+ musicCtrl = wx.dataview.DataViewCtrl(self, wx.ID_ANY)
+ musicModel = MyMusicModel()
+ musicCtrl.AssociateModel(musicModel)
+ musicModel.DecRef() # avoid memory leak !!
+
+ # add columns now
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewModel.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewModel.2.py
index 74c8ab57..026b3713 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewModel.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewModel.2.py
@@ -1,6 +1,6 @@
-
- musicCtrl = wx.dataview.DataViewCtrl(self, wx.ID_ANY)
- musicModel = MyMusicModel()
- musicCtrl.AssociateModel(musicModel.get())
-
- # add columns now
+
+ musicCtrl = wx.dataview.DataViewCtrl(self, wx.ID_ANY)
+ musicModel = MyMusicModel()
+ musicCtrl.AssociateModel(musicModel.get())
+
+ # add columns now
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewRenderer.DisableEllipsize.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewRenderer.DisableEllipsize.1.py
index d6cbab59..7c44e76c 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewRenderer.DisableEllipsize.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewRenderer.DisableEllipsize.1.py
@@ -1,2 +1,2 @@
-
- EnableEllipsize(wx.ELLIPSIZE_NONE)
+
+ EnableEllipsize(wx.ELLIPSIZE_NONE)
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.AboutBox.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.AboutBox.1.py
index ed610767..3e1e5593 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.AboutBox.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.AboutBox.1.py
@@ -1,11 +1,11 @@
-
- def ShowSimpleAboutDialog(self, event):
-
- info = wx.AboutDialogInfo()
- info.SetName(_("My Program"))
- info.SetVersion(_("1.2.3 Beta"))
- info.SetDescription(_("This program does something great."))
- info.SetCopyright(wx.T("(C) 2007 Me "))
-
- wx.AboutBox(info)
-
+
+ def ShowSimpleAboutDialog(self, event):
+
+ info = wx.AboutDialogInfo()
+ info.SetName(_("My Program"))
+ info.SetVersion(_("1.2.3 Beta"))
+ info.SetDescription(_("This program does something great."))
+ info.SetCopyright(wx.T("(C) 2007 Me "))
+
+ wx.AboutBox(info)
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.DirSelector.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.DirSelector.1.py
index 429c74c5..07cd5f74 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.DirSelector.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.DirSelector.1.py
@@ -1,6 +1,6 @@
-
- selector = wx.DirSelector("Choose a folder")
- if selector.strip():
- # Do something with the folder name
- print selector
-
+
+ selector = wx.DirSelector("Choose a folder")
+ if selector.strip():
+ # Do something with the folder name
+ print selector
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.FileSelector.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.FileSelector.1.py
index b4e63dcb..c97f3ab2 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.FileSelector.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.FileSelector.1.py
@@ -1,2 +1,2 @@
-
- wildcard = "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
+
+ wildcard = "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.FileSelector.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.FileSelector.2.py
index f7571d72..1dcbc369 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.FileSelector.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.FileSelector.2.py
@@ -1,8 +1,8 @@
-
- filename = wx.FileSelector("Choose a file to open")
-
- if filename.strip():
- # work with the file
- print filename
-
- # else: cancelled by user
+
+ filename = wx.FileSelector("Choose a file to open")
+
+ if filename.strip():
+ # work with the file
+ print filename
+
+ # else: cancelled by user
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.Kill.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.Kill.1.py
index 15f2be95..b1b9afcd 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.Kill.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.Kill.1.py
@@ -1,20 +1,20 @@
-
- # Signal enumeration
-
- wx.SIGNONE # verify if the process exists under Unix
- wx.SIGHUP
- wx.SIGINT
- wx.SIGQUIT
- wx.SIGILL
- wx.SIGTRAP
- wx.SIGABRT
- wx.SIGEMT
- wx.SIGFPE
- wx.SIGKILL # forcefully kill, dangerous!
- wx.SIGBUS
- wx.SIGSEGV
- wx.SIGSYS
- wx.SIGPIPE
- wx.SIGALRM
- wx.SIGTERM # terminate the process gently
-
+
+ # Signal enumeration
+
+ wx.SIGNONE # verify if the process exists under Unix
+ wx.SIGHUP
+ wx.SIGINT
+ wx.SIGQUIT
+ wx.SIGILL
+ wx.SIGTRAP
+ wx.SIGABRT
+ wx.SIGEMT
+ wx.SIGFPE
+ wx.SIGKILL # forcefully kill, dangerous!
+ wx.SIGBUS
+ wx.SIGSEGV
+ wx.SIGSYS
+ wx.SIGPIPE
+ wx.SIGALRM
+ wx.SIGTERM # terminate the process gently
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.Kill.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.Kill.2.py
index b732d472..ebc61616 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.Kill.2.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.Kill.2.py
@@ -1,9 +1,9 @@
-
- # KillError enumeration
-
- wx.KILL_OK # no error
- wx.KILL_BAD_SIGNAL # no such signal
- wx.KILL_ACCESS_DENIED # permission denied
- wx.KILL_NO_PROCESS # no such process
- wx.KILL_ERROR # another, unspecified error
-
+
+ # KillError enumeration
+
+ wx.KILL_OK # no error
+ wx.KILL_BAD_SIGNAL # no such signal
+ wx.KILL_ACCESS_DENIED # permission denied
+ wx.KILL_NO_PROCESS # no such process
+ wx.KILL_ERROR # another, unspecified error
+
diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.MessageBox.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.MessageBox.1.py
index 036b36fc..ed1e974f 100644
--- a/docs/sphinx/rest_substitutions/snippets/python/converted/functions.MessageBox.1.py
+++ b/docs/sphinx/rest_substitutions/snippets/python/converted/functions.MessageBox.1.py
@@ -1,5 +1,5 @@
-
- answer = wx.MessageBox("Quit program?", "Confirm",
- wx.YES_NO | wx.CANCEL, main_frame)
- if answer == wx.YES:
- main_frame.Close()
+
+ answer = wx.MessageBox("Quit program?", "Confirm",
+ wx.YES_NO | wx.CANCEL, main_frame)
+ if answer == wx.YES:
+ main_frame.Close()
diff --git a/docs/sphinx/rest_substitutions/tables/ArtProvider.1.rst b/docs/sphinx/rest_substitutions/tables/ArtProvider.1.rst
index d7b4d9a8..827b4d0c 100644
--- a/docs/sphinx/rest_substitutions/tables/ArtProvider.1.rst
+++ b/docs/sphinx/rest_substitutions/tables/ArtProvider.1.rst
@@ -1,23 +1,23 @@
-============================================ ======================================= ==================================
-- ``ART_ERROR`` - ``ART_GOTO_LAST`` (since 2.9.2) - ``ART_FILE_SAVE_AS``
-- ``ART_QUESTION`` - ``ART_PRINT`` - ``ART_DELETE``
-- ``ART_WARNING`` - ``ART_HELP`` - ``ART_COPY``
-- ``ART_INFORMATION`` - ``ART_TIP`` - ``ART_CUT``
-- ``ART_ADD_BOOKMARK`` - ``ART_REPORT_VIEW`` - ``ART_PASTE``
-- ``ART_DEL_BOOKMARK`` - ``ART_LIST_VIEW`` - ``ART_UNDO``
-- ``ART_HELP_SIDE_PANEL`` - ``ART_NEW_DIR`` - ``ART_REDO``
-- ``ART_HELP_SETTINGS`` - ``ART_FOLDER`` - ``ART_PLUS`` (since 2.9.2)
-- ``ART_HELP_BOOK`` - ``ART_FOLDER_OPEN`` - ``ART_MINUS`` (since 2.9.2)
-- ``ART_HELP_FOLDER`` - ``ART_GO_DIR_UP`` - ``ART_CLOSE``
-- ``ART_HELP_PAGE`` - ``ART_EXECUTABLE_FILE`` - ``ART_QUIT``
-- ``ART_GO_BACK`` - ``ART_NORMAL_FILE`` - ``ART_FIND``
-- ``ART_GO_FORWARD`` - ``ART_TICK_MARK`` - ``ART_FIND_AND_REPLACE``
-- ``ART_GO_UP`` - ``ART_CROSS_MARK`` - ``ART_HARDDISK``
-- ``ART_GO_DOWN`` - ``ART_MISSING_IMAGE`` - ``ART_FLOPPY``
-- ``ART_GO_TO_PARENT`` - ``ART_NEW`` - ``ART_CDROM``
-- ``ART_GO_HOME`` - ``ART_FILE_OPEN``
-- ``ART_GOTO_FIRST`` (since 2.9.2) - ``ART_FILE_SAVE``
-============================================ ======================================= ==================================
-
-|
-
+============================================ ======================================= ==================================
+- ``ART_ERROR`` - ``ART_GOTO_LAST`` (since 2.9.2) - ``ART_FILE_SAVE_AS``
+- ``ART_QUESTION`` - ``ART_PRINT`` - ``ART_DELETE``
+- ``ART_WARNING`` - ``ART_HELP`` - ``ART_COPY``
+- ``ART_INFORMATION`` - ``ART_TIP`` - ``ART_CUT``
+- ``ART_ADD_BOOKMARK`` - ``ART_REPORT_VIEW`` - ``ART_PASTE``
+- ``ART_DEL_BOOKMARK`` - ``ART_LIST_VIEW`` - ``ART_UNDO``
+- ``ART_HELP_SIDE_PANEL`` - ``ART_NEW_DIR`` - ``ART_REDO``
+- ``ART_HELP_SETTINGS`` - ``ART_FOLDER`` - ``ART_PLUS`` (since 2.9.2)
+- ``ART_HELP_BOOK`` - ``ART_FOLDER_OPEN`` - ``ART_MINUS`` (since 2.9.2)
+- ``ART_HELP_FOLDER`` - ``ART_GO_DIR_UP`` - ``ART_CLOSE``
+- ``ART_HELP_PAGE`` - ``ART_EXECUTABLE_FILE`` - ``ART_QUIT``
+- ``ART_GO_BACK`` - ``ART_NORMAL_FILE`` - ``ART_FIND``
+- ``ART_GO_FORWARD`` - ``ART_TICK_MARK`` - ``ART_FIND_AND_REPLACE``
+- ``ART_GO_UP`` - ``ART_CROSS_MARK`` - ``ART_HARDDISK``
+- ``ART_GO_DOWN`` - ``ART_MISSING_IMAGE`` - ``ART_FLOPPY``
+- ``ART_GO_TO_PARENT`` - ``ART_NEW`` - ``ART_CDROM``
+- ``ART_GO_HOME`` - ``ART_FILE_OPEN``
+- ``ART_GOTO_FIRST`` (since 2.9.2) - ``ART_FILE_SAVE``
+============================================ ======================================= ==================================
+
+|
+
diff --git a/docs/sphinx/rest_substitutions/tables/ColourDatabase.1.rst b/docs/sphinx/rest_substitutions/tables/ColourDatabase.1.rst
index aec8b6a6..e2eb09c7 100644
--- a/docs/sphinx/rest_substitutions/tables/ColourDatabase.1.rst
+++ b/docs/sphinx/rest_substitutions/tables/ColourDatabase.1.rst
@@ -1,22 +1,22 @@
-================================= ================================ ==================================== ==================================
-``AQUAMARINE`` ``FIREBRICK`` ``MEDIUM FOREST GREEN`` ``RED``
-``BLACK`` ``FOREST GREEN`` ``MEDIUM GOLDENROD`` ``SALMON``
-``BLUE`` ``GOLD`` ``MEDIUM ORCHID`` ``SEA GREEN``
-``BLUE VIOLET`` ``GOLDENROD`` ``MEDIUM SEA GREEN`` ``SIENNA``
-``BROWN`` ``GREY`` ``MEDIUM SLATE BLUE`` ``SKY BLUE``
-``CADET BLUE`` ``GREEN`` ``MEDIUM SPRING GREEN`` ``SLATE BLUE``
-``CORAL`` ``GREEN YELLOW`` ``MEDIUM TURQUOISE`` ``SPRING GREEN``
-``CORNFLOWER BLUE`` ``INDIAN RED`` ``MEDIUM VIOLET RED`` ``STEEL BLUE``
-``CYAN`` ``KHAKI`` ``MIDNIGHT BLUE`` ``TAN``
-``DARK GREY`` ``LIGHT BLUE`` ``NAVY`` ``THISTLE``
-``DARK GREEN`` ``LIGHT GREY`` ``ORANGE`` ``TURQUOISE``
-``DARK OLIVE GREEN`` ``LIGHT STEEL BLUE`` ``ORANGE RED`` ``VIOLET``
-``DARK ORCHID`` ``LIME GREEN`` ``ORCHID`` ``VIOLET RED``
-``DARK SLATE BLUE`` ``MAGENTA`` ``PALE GREEN`` ``WHEAT``
-``DARK SLATE GREY`` ``MAROON`` ``PINK`` ``WHITE``
-``DARK TURQUOISE`` ``MEDIUM AQUAMARINE`` ``PLUM`` ``YELLOW``
-``DIM GREY`` ``MEDIUM BLUE`` ``PURPLE`` ``YELLOW GREEN``
-================================= ================================ ==================================== ==================================
-
-|
-
+================================= ================================ ==================================== ==================================
+``AQUAMARINE`` ``FIREBRICK`` ``MEDIUM FOREST GREEN`` ``RED``
+``BLACK`` ``FOREST GREEN`` ``MEDIUM GOLDENROD`` ``SALMON``
+``BLUE`` ``GOLD`` ``MEDIUM ORCHID`` ``SEA GREEN``
+``BLUE VIOLET`` ``GOLDENROD`` ``MEDIUM SEA GREEN`` ``SIENNA``
+``BROWN`` ``GREY`` ``MEDIUM SLATE BLUE`` ``SKY BLUE``
+``CADET BLUE`` ``GREEN`` ``MEDIUM SPRING GREEN`` ``SLATE BLUE``
+``CORAL`` ``GREEN YELLOW`` ``MEDIUM TURQUOISE`` ``SPRING GREEN``
+``CORNFLOWER BLUE`` ``INDIAN RED`` ``MEDIUM VIOLET RED`` ``STEEL BLUE``
+``CYAN`` ``KHAKI`` ``MIDNIGHT BLUE`` ``TAN``
+``DARK GREY`` ``LIGHT BLUE`` ``NAVY`` ``THISTLE``
+``DARK GREEN`` ``LIGHT GREY`` ``ORANGE`` ``TURQUOISE``
+``DARK OLIVE GREEN`` ``LIGHT STEEL BLUE`` ``ORANGE RED`` ``VIOLET``
+``DARK ORCHID`` ``LIME GREEN`` ``ORCHID`` ``VIOLET RED``
+``DARK SLATE BLUE`` ``MAGENTA`` ``PALE GREEN`` ``WHEAT``
+``DARK SLATE GREY`` ``MAROON`` ``PINK`` ``WHITE``
+``DARK TURQUOISE`` ``MEDIUM AQUAMARINE`` ``PLUM`` ``YELLOW``
+``DIM GREY`` ``MEDIUM BLUE`` ``PURPLE`` ``YELLOW GREEN``
+================================= ================================ ==================================== ==================================
+
+|
+
diff --git a/docs/sphinx/rest_substitutions/tables/Sizer.1.rst b/docs/sphinx/rest_substitutions/tables/Sizer.1.rst
index 2508dc3d..a2fa9ecf 100644
--- a/docs/sphinx/rest_substitutions/tables/Sizer.1.rst
+++ b/docs/sphinx/rest_substitutions/tables/Sizer.1.rst
@@ -1,49 +1,49 @@
-+---------------------------------------------------------------------+-----------------------------------------------------------------------------+
-| Sizer Flag | Description |
-+=====================================================================+=============================================================================+
-| ``TOP`` | These flags are used to specify which side(s) of the sizer |
-+---------------------------------------------------------------------+ item the border width will apply to. |
-| ``BOTTOM`` | |
-+---------------------------------------------------------------------+ |
-| ``LEFT`` | |
-+---------------------------------------------------------------------+ |
-| ``RIGHT`` | |
-+---------------------------------------------------------------------+ |
-| ``ALL`` | |
-+---------------------------------------------------------------------+-----------------------------------------------------------------------------+
-| ``EXPAND`` | The item will be expanded to fill the space assigned to |
-| | the item. |
-+---------------------------------------------------------------------+-----------------------------------------------------------------------------+
-| ``SHAPED`` | The item will be expanded as much as possible while also |
-| | maintaining its aspect ratio |
-+---------------------------------------------------------------------+-----------------------------------------------------------------------------+
-| ``FIXED_MINSIZE`` | Normally `Sizers` will use |
-| | :meth:`Window.GetAdjustedBestSize` to |
-| | determine what the minimal size of window items should be, and will use that|
-| | size to calculate the layout. This allows layouts to adjust when an item |
-| | changes and its best size becomes different. If you would rather have a |
-| | window item stay the size it started with then use ``FIXED_MINSIZE``. |
-+---------------------------------------------------------------------+-----------------------------------------------------------------------------+
-| ``RESERVE_SPACE_EVEN_IF_HIDDEN`` | Normally `Sizers` don't allocate space for hidden windows or other items. |
-| | This flag overrides this behavior so that sufficient space is allocated for |
-| .. versionadded:: 2.8.8 | the window even if it isn't visible. This makes it possible to dynamically |
-| | show and hide controls without resizing parent dialog, for example. |
-| | Available since version 2.8.8 |
-+---------------------------------------------------------------------+-----------------------------------------------------------------------------+
-| ``ALIGN_CENTER`` **or** ``ALIGN_CENTRE`` | The ``ALIGN*`` flags allow you to specify the alignment of the item |
-+---------------------------------------------------------------------+ within the space allotted to it by the sizer, adjusted for the border if |
-| ``ALIGN_LEFT`` | any. |
-+---------------------------------------------------------------------+ |
-| ``ALIGN_RIGHT`` | |
-+---------------------------------------------------------------------+ |
-| ``ALIGN_TOP`` | |
-+---------------------------------------------------------------------+ |
-| ``ALIGN_BOTTOM`` | |
-+---------------------------------------------------------------------+ |
-| ``ALIGN_CENTER_VERTICAL`` **or** ``ALIGN_CENTRE_VERTICAL`` | |
-+---------------------------------------------------------------------+ |
-| ``ALIGN_CENTER_HORIZONTAL`` **or** ``ALIGN_CENTRE_HORIZONTAL`` | |
-+---------------------------------------------------------------------+-----------------------------------------------------------------------------+
-
-|
-
++---------------------------------------------------------------------+-----------------------------------------------------------------------------+
+| Sizer Flag | Description |
++=====================================================================+=============================================================================+
+| ``TOP`` | These flags are used to specify which side(s) of the sizer |
++---------------------------------------------------------------------+ item the border width will apply to. |
+| ``BOTTOM`` | |
++---------------------------------------------------------------------+ |
+| ``LEFT`` | |
++---------------------------------------------------------------------+ |
+| ``RIGHT`` | |
++---------------------------------------------------------------------+ |
+| ``ALL`` | |
++---------------------------------------------------------------------+-----------------------------------------------------------------------------+
+| ``EXPAND`` | The item will be expanded to fill the space assigned to |
+| | the item. |
++---------------------------------------------------------------------+-----------------------------------------------------------------------------+
+| ``SHAPED`` | The item will be expanded as much as possible while also |
+| | maintaining its aspect ratio |
++---------------------------------------------------------------------+-----------------------------------------------------------------------------+
+| ``FIXED_MINSIZE`` | Normally `Sizers` will use |
+| | :meth:`Window.GetAdjustedBestSize` to |
+| | determine what the minimal size of window items should be, and will use that|
+| | size to calculate the layout. This allows layouts to adjust when an item |
+| | changes and its best size becomes different. If you would rather have a |
+| | window item stay the size it started with then use ``FIXED_MINSIZE``. |
++---------------------------------------------------------------------+-----------------------------------------------------------------------------+
+| ``RESERVE_SPACE_EVEN_IF_HIDDEN`` | Normally `Sizers` don't allocate space for hidden windows or other items. |
+| | This flag overrides this behavior so that sufficient space is allocated for |
+| .. versionadded:: 2.8.8 | the window even if it isn't visible. This makes it possible to dynamically |
+| | show and hide controls without resizing parent dialog, for example. |
+| | Available since version 2.8.8 |
++---------------------------------------------------------------------+-----------------------------------------------------------------------------+
+| ``ALIGN_CENTER`` **or** ``ALIGN_CENTRE`` | The ``ALIGN*`` flags allow you to specify the alignment of the item |
++---------------------------------------------------------------------+ within the space allotted to it by the sizer, adjusted for the border if |
+| ``ALIGN_LEFT`` | any. |
++---------------------------------------------------------------------+ |
+| ``ALIGN_RIGHT`` | |
++---------------------------------------------------------------------+ |
+| ``ALIGN_TOP`` | |
++---------------------------------------------------------------------+ |
+| ``ALIGN_BOTTOM`` | |
++---------------------------------------------------------------------+ |
+| ``ALIGN_CENTER_VERTICAL`` **or** ``ALIGN_CENTRE_VERTICAL`` | |
++---------------------------------------------------------------------+ |
+| ``ALIGN_CENTER_HORIZONTAL`` **or** ``ALIGN_CENTRE_HORIZONTAL`` | |
++---------------------------------------------------------------------+-----------------------------------------------------------------------------+
+
+|
+
diff --git a/docs/sphinx/rest_substitutions/tables/VScrolledWindow.1.rst b/docs/sphinx/rest_substitutions/tables/VScrolledWindow.1.rst
index e52adb49..3e54a563 100644
--- a/docs/sphinx/rest_substitutions/tables/VScrolledWindow.1.rst
+++ b/docs/sphinx/rest_substitutions/tables/VScrolledWindow.1.rst
@@ -1,18 +1,18 @@
-======================================= ==============================================================================================================================================================================================================================================================================
-`GetFirstVisibleLine()` Deprecated for :meth:`~VarVScrollHelper.GetVisibleRowsBegin`
-`GetLastVisibleLine()` Deprecated for :meth:`~VarVScrollHelper.GetVisibleRowsEnd` This function originally had a slight design flaw in that it was possible to return ``sys.maxint-1`` (ie: a large positive number) if the scroll position was 0 and the first line wasn't completely visible.
-`GetLineCount()` Deprecated for :meth:`~VarVScrollHelper.GetRowCount`
-`HitTest(x, y)`
-`HitTest(pt)` Deprecated for :meth:`~VScrolledWindow.VirtualHitTest`.
-`OnGetLineHeight(line)` Deprecated for :meth:`~VarVScrollHelper.OnGetRowHeight`
-`OnGetLinesHint(lineMin, lineMax)` Deprecated for :meth:`~VarVScrollHelper.OnGetRowsHeightHint`
-`RefreshLine(line)` Deprecated for :meth:`~VarVScrollHelper.RefreshRow`
-`RefreshLines(from_, to_)` Deprecated for :meth:`~VarVScrollHelper.RefreshRows`
-`ScrollLines(lines)` Deprecated for :meth:`~VarVScrollHelper.ScrollRows`
-`ScrollPages(pages)` Deprecated for :meth:`~VarVScrollHelper.ScrollRowPages`
-`ScrollToLine(line)` Deprecated for :meth:`~VarVScrollHelper.ScrollToRow`
-`SetLineCount(count)` Deprecated for :meth:`~VarVScrollHelper.SetRowCount`
-======================================= ==============================================================================================================================================================================================================================================================================
-
-|
-
+======================================= ==============================================================================================================================================================================================================================================================================
+`GetFirstVisibleLine()` Deprecated for :meth:`~VarVScrollHelper.GetVisibleRowsBegin`
+`GetLastVisibleLine()` Deprecated for :meth:`~VarVScrollHelper.GetVisibleRowsEnd` This function originally had a slight design flaw in that it was possible to return ``sys.maxint-1`` (ie: a large positive number) if the scroll position was 0 and the first line wasn't completely visible.
+`GetLineCount()` Deprecated for :meth:`~VarVScrollHelper.GetRowCount`
+`HitTest(x, y)`
+`HitTest(pt)` Deprecated for :meth:`~VScrolledWindow.VirtualHitTest`.
+`OnGetLineHeight(line)` Deprecated for :meth:`~VarVScrollHelper.OnGetRowHeight`
+`OnGetLinesHint(lineMin, lineMax)` Deprecated for :meth:`~VarVScrollHelper.OnGetRowsHeightHint`
+`RefreshLine(line)` Deprecated for :meth:`~VarVScrollHelper.RefreshRow`
+`RefreshLines(from_, to_)` Deprecated for :meth:`~VarVScrollHelper.RefreshRows`
+`ScrollLines(lines)` Deprecated for :meth:`~VarVScrollHelper.ScrollRows`
+`ScrollPages(pages)` Deprecated for :meth:`~VarVScrollHelper.ScrollRowPages`
+`ScrollToLine(line)` Deprecated for :meth:`~VarVScrollHelper.ScrollToRow`
+`SetLineCount(count)` Deprecated for :meth:`~VarVScrollHelper.SetRowCount`
+======================================= ==============================================================================================================================================================================================================================================================================
+
+|
+
diff --git a/sphinxtools/constants.py b/sphinxtools/constants.py
index 33afcb1b..ebaead80 100644
--- a/sphinxtools/constants.py
+++ b/sphinxtools/constants.py
@@ -1,252 +1,252 @@
-# -*- coding: utf-8 -*-
-#!/usr/bin/env python
-
-#---------------------------------------------------------------------------
-# Name: sphinxtools/constants.py
-# Author: Andrea Gavana
-#
-# Created: 30-Nov-2010
-# Copyright: (c) 2011 by Total Control Software
-# License: wxWindows License
-#---------------------------------------------------------------------------
-
-# Standard library imports
-import os
-import re
-import datetime
-
-# Phoenix-specific imports
-import buildtools.version as version
-from buildtools.config import phoenixDir, wxDir
-
-# List of strings that should be ignored when creating inline literals
-# such as ``ID_ANY`` or ``HORIZONtAL``, with double backticks
-IGNORE = ['wxPython', 'wxWidgets', 'wxOSX', 'wxMGL', 'wxDFB', 'wxMAC', 'wxGTK', 'wxGTK2', 'wxUniversal',
- 'OS', 'X', 'OSX', 'DFB', 'MAC', 'GTK', 'GTK2', 'MSW', 'wxMSW', 'X11', 'OS2', 'MS', 'XP', 'GTK+',
- 'UI', 'GUI', '--', 'OTOH', 'GDI+', 'API', 'NT', 'RTL', 'GDI', '3D', 'MDI']
-
-# C++ stuff to Python/ReST stuff
-VALUE_MAP = {'true': '``True``',
- 'false': '``False``',
- '``NULL``': '``None``',
- 'NULL': '``None``',
- 'L{OSX}': '`OSX`',
- 'ctor': 'constructor',
- }
-
-# This is a list of instances in Phoenix (i.e., without documentation strings), and
-# For the sake of beauty of the docs they get the inline literal treatment (double backticks)
-CONSTANT_INSTANCES = ['NullAcceleratorTable', 'TheApp', 'DefaultPosition', 'DefaultSize',
- 'DefaultCoord', 'Coord', 'TheBrushList', 'TheColourDatabase',
- 'NullFont', 'NullBrush', 'NullPalette', 'NullPen', 'EmptyString',
- 'TheFontList', 'NullIcon', 'NullBitmap', 'constructor', 'ThePenList',
- 'DefaultValidator', 'String.Capitalize']
-
-# Phoenix full version
-VERSION = '%d.%d.%d' % (version.VER_MAJOR, version.VER_MINOR, version.VER_RELEASE)
-
-# Things to chop away when ReST-ifying the docstrings
-PUNCTUATION = '!"#$%\'()*,./:;<=>?@\\^{|}~'
-
-# Conversion between XML sections and ReST sections
-SECTIONS = [('return' , ':returns:'),
- ('since' , '.. versionadded::'),
- ('deprecated', '.. deprecated::'),
- ('warning' , '.. warning::'),
- ('remarks' , '.. note::'),
- ('remark' , '.. note::'),
- ('available' , '.. availability::'),
- ('note' , '.. note::'),
- ('see' , '.. seealso::'),
- ('todo' , '.. todo::')]
-
-
-# List of things to remove/ignore (there may be more)
-REMOVED_LINKS = ['Library:', 'Category:', 'Predefined objects/pointers:']
-
-# Dictionary mapping the etg module name to the real Phoenix module name
-# This needs to be kept up to date when other stuff comes in (i.e., wx.grid,
-# wx.html and so on)
-MODULENAME_REPLACE = {'_core' : '',
- '_dataview': 'dataview.',
- '_adv' : '',
- }
-
-# Other C++ specific things to strip away
-CPP_ITEMS = ['*', '&', 'const', 'unsigned', '(size_t)', 'size_t', 'void']
-
-# Serie of paths containing the input data for Sphinx and for the scripts
-# building the ReST docs:
-
-# The location of the Phoenix main folder
-PHOENIXROOT = phoenixDir()
-
-# The location of the Sphinx main folder
-SPHINXROOT = os.path.join(PHOENIXROOT, 'docs', 'sphinx')
-
-# Where the snippets found in the XML docstrings live (There are C++, unconverted and
-# converted Python snippets in 3 sub-folders
-SNIPPETROOT = os.path.join(SPHINXROOT, 'rest_substitutions', 'snippets')
-
-# A folder where some of the difficult-to-translate-to-ReST tables are. There are 3 of
-# them up to now, for various reasons:
-# 1. The wx.Sizer flags table is a grid table, very difficult to ReSTify automatically
-# 2. The wx.ColourDatabase table of colour comes up all messy when ReSTified from XML
-# 3. The "wxWidgets 2.8 Compatibility Functions" table for wx.VScrolledWindow
-TABLEROOT = os.path.join(SPHINXROOT, 'rest_substitutions', 'tables')
-
-# Folder where to save the inheritance diagrams for the classes
-INHERITANCEROOT = os.path.join(SPHINXROOT, '_static', 'images', 'inheritance')
-
-# Folder where to save the images found in the wxWidgets overviews or in the XML
-# docstrings
-OVERVIEW_IMAGES_ROOT = os.path.join(SPHINXROOT, '_static', 'images', 'overviews')
-
-# Folder where to save the widgets screenshots (full-size, no thumbnails here)
-WIDGETS_IMAGES_ROOT = os.path.join(SPHINXROOT, '_static', 'images', 'widgets', 'fullsize')
-
-# Folder for the icons used for titles, sub-titles and so on for the Sphinx documentation
-SPHINX_IMAGES_ROOT = os.path.join(SPHINXROOT, '_static', 'images', 'sphinxdocs')
-
-
-# The Doxygen root for the XML docstrings
-xmlsrcbase = 'docs/doxygen/out/xml'
-WXWIN = wxDir()
-XMLSRC = os.path.join(WXWIN, xmlsrcbase)
-
-DOXYROOT = os.path.join(WXWIN, 'docs', 'doxygen')
-
-# Dictionary copied over from tweaker_tools
-MAGIC_METHODS = {
- 'operator!=' : '__ne__',
- 'operator==' : '__eq__',
- 'operator+' : '__add__',
- 'operator-' : '__sub__',
- 'operator*' : '__mul__',
- 'operator/' : '__div__',
- 'operator+=' : '__iadd__',
- 'operator-=' : '__isub__',
- 'operator*=' : '__imul__',
- 'operator/=' : '__idiv__',
- 'operator bool' : '__int__', # Why not __nonzero__?
- # TODO: add more
- }
-
-SECTIONS_EXCLUDE = {'TextCtrl': ('|phoenix_title| TextCtrl and ``C++`` Streams', '|phoenix_title| Event Handling')}
-
-# A regex to split a string keeping the whitespaces
-RE_KEEP_SPACES = re.compile(r'(\s+)')
-
-# A list of things used in the post-processing of the HTML files generated by Sphinx
-# This list is used only to insert a HTML horizontal line ( ) after each method/function
-# description
-HTML_REPLACE = ['module', 'function', 'method', 'class', 'classmethod', 'staticmethod', 'attribute']
-
-# Today's date representation for the Sphinx HTML docs
-TODAY = datetime.date.today().strftime('%d %B %Y')
-
-# Inheritance diagram external hyperlinks
-
-PYTHON_DOCS = 'http://docs.python.org/library/'
-NUMPY_DOCS = 'http://docs.scipy.org/doc/numpy/reference/generated/'
-
-EXTERN_INHERITANCE = {'UserDict.' : PYTHON_DOCS,
- 'ctypes.' : PYTHON_DOCS,
- 'code.' : PYTHON_DOCS,
- 'exceptions.': PYTHON_DOCS,
- 'threading.' : PYTHON_DOCS,
- 'numpy.' : NUMPY_DOCS
- }
-
-# wx.lib and other pure-Python stuff
-
-class Enumeration(object):
-
- def __init__(self, name, enumList):
-
- self.__doc__ = name
- lookup = { }
- reverseLookup = { }
- i = 0
- uniqueNames = [ ]
- uniqueValues = [ ]
-
- for item in enumList:
- x = item.upper()
- uniqueNames.append(x)
- uniqueValues.append(i)
- lookup[x] = i
- reverseLookup[i] = x
- i = i + 1
-
- self.lookup = lookup
- self.reverseLookup = reverseLookup
-
- def __getattr__(self, attr):
-
- if not self.lookup.has_key(attr):
- raise AttributeError
-
- return self.lookup[attr]
-
- def whatis(self, value):
-
- return self.reverseLookup[value]
-
-
-CONSTANT_RE = re.compile('^([\w\s,]+)=', re.M)
-
-EXCLUDED_ATTRS = ['__builtins__', '__doc__', '__name__', '__file__', '__path__',
- '__module__', '__all__']
-
-TYPE_DESCRIPTION = ['library',
- 'package',
- 'py_module', 'pyd_module', 'pyc_module', 'pyw_module',
- 'klass',
- 'function',
- 'method', 'static_method', 'class_method', 'instance_method',
- 'method_descriptor', 'builtin_method', 'builtin_function',
- 'property',
- 'booltype', 'classtype', 'complextype', 'dictproxytype', 'dicttype', 'filetype',
- 'floattype', 'instancetype', 'inttype', 'lambdatype', 'listtype', 'longtype',
- 'nonetype', 'objecttype', 'slicetype', 'strtype', 'tracebacktype', 'tupletype',
- 'typetype', 'unicodetype', 'unknowntype', 'xrangetype']
-
-object_types = Enumeration('Object_Types', TYPE_DESCRIPTION)
-
-MODULE_TO_ICON = [(".py", object_types.PY_MODULE, "Py_Module"), (".pyd", object_types.PYD_MODULE, "Pyd_Module"),
- (".pyc", object_types.PYC_MODULE, "Pyc_Module"), (".pyw", object_types.PYW_MODULE, "Pyw_Module"),
- (".so", object_types.PYD_MODULE, "Pyd_Module")]
-
-# wx.tools and other stuff
-
-DOXY_2_REST = [('@author:', '\n.. moduleauthor:: '),
- ('@deprecated:', '\n.. deprecated:: '),
- ('@param', ':param'),
- ('@var', ':param'),
- ('@keyword', ':keyword'),
- ('@kwarg', ':keyword'),
- ('@note:', '\n.. note:: '),
- ('@package:', '\n**Package:** '),
- ('@package', '\n**Package:** '),
- ('@postcondition:', '\n:postcondition: '),
- ('@pre:', '\n:precondition: '),
- ('@precondition:', '\n:precondition: '),
- ('@requires:', '\n:requires: '),
- ('@returns:', '\n:returns: '),
- ('@return:', '\n:returns: '),
- ('@returns', '\n:returns: '),
- ('@return', '\n:returns: '),
- ('@rtype:', '\n:rtype: '),
- # ('@section', XXX), Deal with this separately
- ('@see:', '\n.. seealso:: '),
- ('@status:', '\n.. todo:: '),
- ('@summary:', '\n**Summary:** '),
- ('@throws:', '\n:raise: '),
- ('@todo:', '\n.. todo:: '),
- ('@verbatim ', ''), # TODO This one
- ('@verbatim', ''), # TODO This one
- ('@endverbatim ', ''), # TODO This one
- ('@endverbatim', ''), # TODO This one
- ('@version:', '\n:version: ')]
-
+# -*- coding: utf-8 -*-
+#!/usr/bin/env python
+
+#---------------------------------------------------------------------------
+# Name: sphinxtools/constants.py
+# Author: Andrea Gavana
+#
+# Created: 30-Nov-2010
+# Copyright: (c) 2011 by Total Control Software
+# License: wxWindows License
+#---------------------------------------------------------------------------
+
+# Standard library imports
+import os
+import re
+import datetime
+
+# Phoenix-specific imports
+import buildtools.version as version
+from buildtools.config import phoenixDir, wxDir
+
+# List of strings that should be ignored when creating inline literals
+# such as ``ID_ANY`` or ``HORIZONtAL``, with double backticks
+IGNORE = ['wxPython', 'wxWidgets', 'wxOSX', 'wxMGL', 'wxDFB', 'wxMAC', 'wxGTK', 'wxGTK2', 'wxUniversal',
+ 'OS', 'X', 'OSX', 'DFB', 'MAC', 'GTK', 'GTK2', 'MSW', 'wxMSW', 'X11', 'OS2', 'MS', 'XP', 'GTK+',
+ 'UI', 'GUI', '--', 'OTOH', 'GDI+', 'API', 'NT', 'RTL', 'GDI', '3D', 'MDI']
+
+# C++ stuff to Python/ReST stuff
+VALUE_MAP = {'true': '``True``',
+ 'false': '``False``',
+ '``NULL``': '``None``',
+ 'NULL': '``None``',
+ 'L{OSX}': '`OSX`',
+ 'ctor': 'constructor',
+ }
+
+# This is a list of instances in Phoenix (i.e., without documentation strings), and
+# For the sake of beauty of the docs they get the inline literal treatment (double backticks)
+CONSTANT_INSTANCES = ['NullAcceleratorTable', 'TheApp', 'DefaultPosition', 'DefaultSize',
+ 'DefaultCoord', 'Coord', 'TheBrushList', 'TheColourDatabase',
+ 'NullFont', 'NullBrush', 'NullPalette', 'NullPen', 'EmptyString',
+ 'TheFontList', 'NullIcon', 'NullBitmap', 'constructor', 'ThePenList',
+ 'DefaultValidator', 'String.Capitalize']
+
+# Phoenix full version
+VERSION = '%d.%d.%d' % (version.VER_MAJOR, version.VER_MINOR, version.VER_RELEASE)
+
+# Things to chop away when ReST-ifying the docstrings
+PUNCTUATION = '!"#$%\'()*,./:;<=>?@\\^{|}~'
+
+# Conversion between XML sections and ReST sections
+SECTIONS = [('return' , ':returns:'),
+ ('since' , '.. versionadded::'),
+ ('deprecated', '.. deprecated::'),
+ ('warning' , '.. warning::'),
+ ('remarks' , '.. note::'),
+ ('remark' , '.. note::'),
+ ('available' , '.. availability::'),
+ ('note' , '.. note::'),
+ ('see' , '.. seealso::'),
+ ('todo' , '.. todo::')]
+
+
+# List of things to remove/ignore (there may be more)
+REMOVED_LINKS = ['Library:', 'Category:', 'Predefined objects/pointers:']
+
+# Dictionary mapping the etg module name to the real Phoenix module name
+# This needs to be kept up to date when other stuff comes in (i.e., wx.grid,
+# wx.html and so on)
+MODULENAME_REPLACE = {'_core' : '',
+ '_dataview': 'dataview.',
+ '_adv' : '',
+ }
+
+# Other C++ specific things to strip away
+CPP_ITEMS = ['*', '&', 'const', 'unsigned', '(size_t)', 'size_t', 'void']
+
+# Serie of paths containing the input data for Sphinx and for the scripts
+# building the ReST docs:
+
+# The location of the Phoenix main folder
+PHOENIXROOT = phoenixDir()
+
+# The location of the Sphinx main folder
+SPHINXROOT = os.path.join(PHOENIXROOT, 'docs', 'sphinx')
+
+# Where the snippets found in the XML docstrings live (There are C++, unconverted and
+# converted Python snippets in 3 sub-folders
+SNIPPETROOT = os.path.join(SPHINXROOT, 'rest_substitutions', 'snippets')
+
+# A folder where some of the difficult-to-translate-to-ReST tables are. There are 3 of
+# them up to now, for various reasons:
+# 1. The wx.Sizer flags table is a grid table, very difficult to ReSTify automatically
+# 2. The wx.ColourDatabase table of colour comes up all messy when ReSTified from XML
+# 3. The "wxWidgets 2.8 Compatibility Functions" table for wx.VScrolledWindow
+TABLEROOT = os.path.join(SPHINXROOT, 'rest_substitutions', 'tables')
+
+# Folder where to save the inheritance diagrams for the classes
+INHERITANCEROOT = os.path.join(SPHINXROOT, '_static', 'images', 'inheritance')
+
+# Folder where to save the images found in the wxWidgets overviews or in the XML
+# docstrings
+OVERVIEW_IMAGES_ROOT = os.path.join(SPHINXROOT, '_static', 'images', 'overviews')
+
+# Folder where to save the widgets screenshots (full-size, no thumbnails here)
+WIDGETS_IMAGES_ROOT = os.path.join(SPHINXROOT, '_static', 'images', 'widgets', 'fullsize')
+
+# Folder for the icons used for titles, sub-titles and so on for the Sphinx documentation
+SPHINX_IMAGES_ROOT = os.path.join(SPHINXROOT, '_static', 'images', 'sphinxdocs')
+
+
+# The Doxygen root for the XML docstrings
+xmlsrcbase = 'docs/doxygen/out/xml'
+WXWIN = wxDir()
+XMLSRC = os.path.join(WXWIN, xmlsrcbase)
+
+DOXYROOT = os.path.join(WXWIN, 'docs', 'doxygen')
+
+# Dictionary copied over from tweaker_tools
+MAGIC_METHODS = {
+ 'operator!=' : '__ne__',
+ 'operator==' : '__eq__',
+ 'operator+' : '__add__',
+ 'operator-' : '__sub__',
+ 'operator*' : '__mul__',
+ 'operator/' : '__div__',
+ 'operator+=' : '__iadd__',
+ 'operator-=' : '__isub__',
+ 'operator*=' : '__imul__',
+ 'operator/=' : '__idiv__',
+ 'operator bool' : '__int__', # Why not __nonzero__?
+ # TODO: add more
+ }
+
+SECTIONS_EXCLUDE = {'TextCtrl': ('|phoenix_title| TextCtrl and ``C++`` Streams', '|phoenix_title| Event Handling')}
+
+# A regex to split a string keeping the whitespaces
+RE_KEEP_SPACES = re.compile(r'(\s+)')
+
+# A list of things used in the post-processing of the HTML files generated by Sphinx
+# This list is used only to insert a HTML horizontal line ( ) after each method/function
+# description
+HTML_REPLACE = ['module', 'function', 'method', 'class', 'classmethod', 'staticmethod', 'attribute']
+
+# Today's date representation for the Sphinx HTML docs
+TODAY = datetime.date.today().strftime('%d %B %Y')
+
+# Inheritance diagram external hyperlinks
+
+PYTHON_DOCS = 'http://docs.python.org/library/'
+NUMPY_DOCS = 'http://docs.scipy.org/doc/numpy/reference/generated/'
+
+EXTERN_INHERITANCE = {'UserDict.' : PYTHON_DOCS,
+ 'ctypes.' : PYTHON_DOCS,
+ 'code.' : PYTHON_DOCS,
+ 'exceptions.': PYTHON_DOCS,
+ 'threading.' : PYTHON_DOCS,
+ 'numpy.' : NUMPY_DOCS
+ }
+
+# wx.lib and other pure-Python stuff
+
+class Enumeration(object):
+
+ def __init__(self, name, enumList):
+
+ self.__doc__ = name
+ lookup = { }
+ reverseLookup = { }
+ i = 0
+ uniqueNames = [ ]
+ uniqueValues = [ ]
+
+ for item in enumList:
+ x = item.upper()
+ uniqueNames.append(x)
+ uniqueValues.append(i)
+ lookup[x] = i
+ reverseLookup[i] = x
+ i = i + 1
+
+ self.lookup = lookup
+ self.reverseLookup = reverseLookup
+
+ def __getattr__(self, attr):
+
+ if not self.lookup.has_key(attr):
+ raise AttributeError
+
+ return self.lookup[attr]
+
+ def whatis(self, value):
+
+ return self.reverseLookup[value]
+
+
+CONSTANT_RE = re.compile('^([\w\s,]+)=', re.M)
+
+EXCLUDED_ATTRS = ['__builtins__', '__doc__', '__name__', '__file__', '__path__',
+ '__module__', '__all__']
+
+TYPE_DESCRIPTION = ['library',
+ 'package',
+ 'py_module', 'pyd_module', 'pyc_module', 'pyw_module',
+ 'klass',
+ 'function',
+ 'method', 'static_method', 'class_method', 'instance_method',
+ 'method_descriptor', 'builtin_method', 'builtin_function',
+ 'property',
+ 'booltype', 'classtype', 'complextype', 'dictproxytype', 'dicttype', 'filetype',
+ 'floattype', 'instancetype', 'inttype', 'lambdatype', 'listtype', 'longtype',
+ 'nonetype', 'objecttype', 'slicetype', 'strtype', 'tracebacktype', 'tupletype',
+ 'typetype', 'unicodetype', 'unknowntype', 'xrangetype']
+
+object_types = Enumeration('Object_Types', TYPE_DESCRIPTION)
+
+MODULE_TO_ICON = [(".py", object_types.PY_MODULE, "Py_Module"), (".pyd", object_types.PYD_MODULE, "Pyd_Module"),
+ (".pyc", object_types.PYC_MODULE, "Pyc_Module"), (".pyw", object_types.PYW_MODULE, "Pyw_Module"),
+ (".so", object_types.PYD_MODULE, "Pyd_Module")]
+
+# wx.tools and other stuff
+
+DOXY_2_REST = [('@author:', '\n.. moduleauthor:: '),
+ ('@deprecated:', '\n.. deprecated:: '),
+ ('@param', ':param'),
+ ('@var', ':param'),
+ ('@keyword', ':keyword'),
+ ('@kwarg', ':keyword'),
+ ('@note:', '\n.. note:: '),
+ ('@package:', '\n**Package:** '),
+ ('@package', '\n**Package:** '),
+ ('@postcondition:', '\n:postcondition: '),
+ ('@pre:', '\n:precondition: '),
+ ('@precondition:', '\n:precondition: '),
+ ('@requires:', '\n:requires: '),
+ ('@returns:', '\n:returns: '),
+ ('@return:', '\n:returns: '),
+ ('@returns', '\n:returns: '),
+ ('@return', '\n:returns: '),
+ ('@rtype:', '\n:rtype: '),
+ # ('@section', XXX), Deal with this separately
+ ('@see:', '\n.. seealso:: '),
+ ('@status:', '\n.. todo:: '),
+ ('@summary:', '\n**Summary:** '),
+ ('@throws:', '\n:raise: '),
+ ('@todo:', '\n.. todo:: '),
+ ('@verbatim ', ''), # TODO This one
+ ('@verbatim', ''), # TODO This one
+ ('@endverbatim ', ''), # TODO This one
+ ('@endverbatim', ''), # TODO This one
+ ('@version:', '\n:version: ')]
+
diff --git a/sphinxtools/inheritance.py b/sphinxtools/inheritance.py
index f6bc88ae..a1e15ead 100644
--- a/sphinxtools/inheritance.py
+++ b/sphinxtools/inheritance.py
@@ -25,146 +25,146 @@ ENOENT = getattr(errno, 'ENOENT', 0)
EPIPE = getattr(errno, 'EPIPE', 0)
-class InheritanceDiagram(object):
- """
- Given a list of classes, determines the set of classes that they inherit
- from all the way to the root "object", and then is able to generate a
- graphviz dot graph from them.
- """
-
- def __init__(self, classes, main_class=None):
-
- if main_class is None:
- self.class_info, self.specials = classes
- self.class_info = self.class_info.values()
- else:
- self.class_info, self.specials = self._class_info(classes)
-
- self.main_class = main_class
-
-
- def _class_info(self, classes):
- """Return name and bases for all classes that are ancestors of
- *classes*.
-
- *parts* gives the number of dotted name parts that is removed from the
- displayed node names.
- """
-
- all_classes = {}
- specials = []
-
- def recurse(cls):
- nodename, fullname = self.class_name(cls)
-
- baselist = []
- all_classes[cls] = (nodename, fullname, baselist)
-
- for base in cls.__bases__:
- baselist.append(self.class_name(base)[0])
- if base not in all_classes:
- recurse(base)
-
- for cls in classes:
- recurse(cls)
- specials.append(self.class_name(cls)[1])
-
- return all_classes.values(), specials
-
-
- def class_name(self, cls):
- """Given a class object, return a fully-qualified name.
-
- This works for things I've tested in matplotlib so far, but may not be
- completely general.
- """
-
- module = cls.__module__
-
- if module == '__builtin__':
- fullname = cls.__name__
- else:
- fullname = '%s.%s' % (module, cls.__name__)
-
- name_parts = fullname.split('.')
- if 'wx._' in fullname:
- nodename = fullname = name_parts[-1]
- else:
- # Just the last 2 parts
+class InheritanceDiagram(object):
+ """
+ Given a list of classes, determines the set of classes that they inherit
+ from all the way to the root "object", and then is able to generate a
+ graphviz dot graph from them.
+ """
+
+ def __init__(self, classes, main_class=None):
+
+ if main_class is None:
+ self.class_info, self.specials = classes
+ self.class_info = self.class_info.values()
+ else:
+ self.class_info, self.specials = self._class_info(classes)
+
+ self.main_class = main_class
+
+
+ def _class_info(self, classes):
+ """Return name and bases for all classes that are ancestors of
+ *classes*.
+
+ *parts* gives the number of dotted name parts that is removed from the
+ displayed node names.
+ """
+
+ all_classes = {}
+ specials = []
+
+ def recurse(cls):
+ nodename, fullname = self.class_name(cls)
+
+ baselist = []
+ all_classes[cls] = (nodename, fullname, baselist)
+
+ for base in cls.__bases__:
+ baselist.append(self.class_name(base)[0])
+ if base not in all_classes:
+ recurse(base)
+
+ for cls in classes:
+ recurse(cls)
+ specials.append(self.class_name(cls)[1])
+
+ return all_classes.values(), specials
+
+
+ def class_name(self, cls):
+ """Given a class object, return a fully-qualified name.
+
+ This works for things I've tested in matplotlib so far, but may not be
+ completely general.
+ """
+
+ module = cls.__module__
+
+ if module == '__builtin__':
+ fullname = cls.__name__
+ else:
+ fullname = '%s.%s' % (module, cls.__name__)
+
+ name_parts = fullname.split('.')
+ if 'wx._' in fullname:
+ nodename = fullname = name_parts[-1]
+ else:
+ # Just the last 2 parts
nodename = '.'.join(name_parts[-2:])
if fullname.startswith('wx.'):
fullname = fullname[3:]
-
- return nodename, fullname
-
-
- # These are the default attrs for graphviz
- default_graph_attrs = {
- 'rankdir': 'LR',
- 'size': '"8.0, 12.0"',
- }
- default_node_attrs = {
- 'shape': 'box',
- 'fontsize': 10,
- 'height': 0.3,
- 'fontname': 'Vera Sans, DejaVu Sans, Liberation Sans, '
- 'Arial, Helvetica, sans',
- 'style': '"setlinewidth(0.5)"',
- }
- default_edge_attrs = {
- 'arrowsize': 0.5,
- 'style': '"setlinewidth(0.5)"',
- }
-
- def _format_node_attrs(self, attrs):
- return ','.join(['%s=%s' % x for x in attrs.items()])
-
- def _format_graph_attrs(self, attrs):
- return ''.join(['%s=%s;\n' % x for x in attrs.items()])
-
- def generate_dot(self, class_summary, name="dummy", graph_attrs={}, node_attrs={}, edge_attrs={}):
- """Generate a graphviz dot graph from the classes that were passed in
- to __init__.
-
- *name* is the name of the graph.
-
- *graph_attrs*, *node_attrs*, *edge_attrs* are dictionaries containing
- key/value pairs to pass on as graphviz properties.
- """
-
- inheritance_graph_attrs = dict(fontsize=9, ratio='auto', size='""', rankdir="LR")
- inheritance_node_attrs = {"align": "center", 'shape': 'box',
- 'fontsize': 10, 'height': 0.3,
- 'fontname': 'Vera Sans, DejaVu Sans, Liberation Sans, '
- 'Arial, Helvetica, sans', 'style': '"setlinewidth(0.5)"',
- 'labelloc': 'c', 'fontcolor': 'grey45'}
-
- inheritance_edge_attrs = {'arrowsize': 0.5, 'style': '"setlinewidth(0.5)"', "color": "black"}
-
- g_attrs = self.default_graph_attrs.copy()
- n_attrs = self.default_node_attrs.copy()
- e_attrs = self.default_edge_attrs.copy()
- g_attrs.update(inheritance_graph_attrs)
- n_attrs.update(inheritance_node_attrs)
- e_attrs.update(inheritance_edge_attrs)
-
- res = []
- res.append('digraph %s {\n' % name)
- res.append(self._format_graph_attrs(g_attrs))
-
- for name, fullname, bases in self.class_info:
- # Write the node
- this_node_attrs = n_attrs.copy()
-
- if fullname in self.specials:
- this_node_attrs['fontcolor'] = 'black'
- this_node_attrs['color'] = 'blue'
- this_node_attrs['style'] = 'bold'
-
- if self.main_class is None:
- newname, fullname = Wx2Sphinx(name)
- else:
- newname = name
+
+ return nodename, fullname
+
+
+ # These are the default attrs for graphviz
+ default_graph_attrs = {
+ 'rankdir': 'LR',
+ 'size': '"8.0, 12.0"',
+ }
+ default_node_attrs = {
+ 'shape': 'box',
+ 'fontsize': 10,
+ 'height': 0.3,
+ 'fontname': 'Vera Sans, DejaVu Sans, Liberation Sans, '
+ 'Arial, Helvetica, sans',
+ 'style': '"setlinewidth(0.5)"',
+ }
+ default_edge_attrs = {
+ 'arrowsize': 0.5,
+ 'style': '"setlinewidth(0.5)"',
+ }
+
+ def _format_node_attrs(self, attrs):
+ return ','.join(['%s=%s' % x for x in attrs.items()])
+
+ def _format_graph_attrs(self, attrs):
+ return ''.join(['%s=%s;\n' % x for x in attrs.items()])
+
+ def generate_dot(self, class_summary, name="dummy", graph_attrs={}, node_attrs={}, edge_attrs={}):
+ """Generate a graphviz dot graph from the classes that were passed in
+ to __init__.
+
+ *name* is the name of the graph.
+
+ *graph_attrs*, *node_attrs*, *edge_attrs* are dictionaries containing
+ key/value pairs to pass on as graphviz properties.
+ """
+
+ inheritance_graph_attrs = dict(fontsize=9, ratio='auto', size='""', rankdir="LR")
+ inheritance_node_attrs = {"align": "center", 'shape': 'box',
+ 'fontsize': 10, 'height': 0.3,
+ 'fontname': 'Vera Sans, DejaVu Sans, Liberation Sans, '
+ 'Arial, Helvetica, sans', 'style': '"setlinewidth(0.5)"',
+ 'labelloc': 'c', 'fontcolor': 'grey45'}
+
+ inheritance_edge_attrs = {'arrowsize': 0.5, 'style': '"setlinewidth(0.5)"', "color": "black"}
+
+ g_attrs = self.default_graph_attrs.copy()
+ n_attrs = self.default_node_attrs.copy()
+ e_attrs = self.default_edge_attrs.copy()
+ g_attrs.update(inheritance_graph_attrs)
+ n_attrs.update(inheritance_node_attrs)
+ e_attrs.update(inheritance_edge_attrs)
+
+ res = []
+ res.append('digraph %s {\n' % name)
+ res.append(self._format_graph_attrs(g_attrs))
+
+ for name, fullname, bases in self.class_info:
+ # Write the node
+ this_node_attrs = n_attrs.copy()
+
+ if fullname in self.specials:
+ this_node_attrs['fontcolor'] = 'black'
+ this_node_attrs['color'] = 'blue'
+ this_node_attrs['style'] = 'bold'
+
+ if self.main_class is None:
+ newname, fullname = Wx2Sphinx(name)
+ else:
+ newname = name
if class_summary is None:
# Phoenix base classes, assume there is always a link
@@ -179,108 +179,108 @@ class InheritanceDiagram(object):
full_page = FormatExternalLink(fullname, inheritance=True)
if full_page:
this_node_attrs['URL'] = full_page
-
- res.append(' "%s" [%s];\n' %
- (newname, self._format_node_attrs(this_node_attrs)))
-
- # Write the edges
- for base_name in bases:
-
- this_edge_attrs = e_attrs.copy()
- if fullname in self.specials:
- this_edge_attrs['color'] = 'red'
-
- if self.main_class is None:
- base_name, dummy = Wx2Sphinx(base_name)
-
- res.append(' "%s" -> "%s" [%s];\n' %
- (base_name, newname,
- self._format_node_attrs(this_edge_attrs)))
- res.append('}\n')
- return ''.join(res)
-
-
- # ----------------------------------------------------------------------- #
-
- def MakeInheritanceDiagram(self, class_summary=None):
- """
- Actually generates the inheritance diagram as a PNG file plus the corresponding
- MAP file for mouse navigation over the inheritance boxes.
-
- These two files are saved into the ``INHERITANCEROOT`` folder (see `sphinxtools/constants.py`
+
+ res.append(' "%s" [%s];\n' %
+ (newname, self._format_node_attrs(this_node_attrs)))
+
+ # Write the edges
+ for base_name in bases:
+
+ this_edge_attrs = e_attrs.copy()
+ if fullname in self.specials:
+ this_edge_attrs['color'] = 'red'
+
+ if self.main_class is None:
+ base_name, dummy = Wx2Sphinx(base_name)
+
+ res.append(' "%s" -> "%s" [%s];\n' %
+ (base_name, newname,
+ self._format_node_attrs(this_edge_attrs)))
+ res.append('}\n')
+ return ''.join(res)
+
+
+ # ----------------------------------------------------------------------- #
+
+ def MakeInheritanceDiagram(self, class_summary=None):
+ """
+ Actually generates the inheritance diagram as a PNG file plus the corresponding
+ MAP file for mouse navigation over the inheritance boxes.
+
+ These two files are saved into the ``INHERITANCEROOT`` folder (see `sphinxtools/constants.py`
for more information).
:param `class_summary`: if not ``None``, used to identify if a class is actually been
- wrapped or not (to avoid links pointing to non-existent pages).
-
- :rtype: `tuple`
-
- :returns: a tuple containing the PNG file name and a string representing the content
- of the MAP file (with newlines stripped away).
-
- .. note:: The MAP file is deleted as soon as its content has been read.
- """
-
- static_root = INHERITANCEROOT
-
- if self.main_class is not None:
- filename = self.main_class.name
- else:
- dummy, filename = Wx2Sphinx(self.specials[0])
-
- outfn = os.path.join(static_root, filename + '_inheritance.png')
- mapfile = outfn + '.map'
-
- if os.path.isfile(outfn) and os.path.isfile(mapfile):
- fid = open(mapfile, 'rt')
- map = fid.read()
- fid.close()
- return os.path.split(outfn)[1], map.replace('\n', ' ')
-
- code = self.generate_dot(class_summary)
-
- # graphviz expects UTF-8 by default
- if isinstance(code, unicode):
- code = code.encode('utf-8')
-
- dot_args = ['dot']
-
- if os.path.isfile(outfn):
- os.remove(outfn)
- if os.path.isfile(mapfile):
- os.remove(mapfile)
-
- dot_args.extend(['-Tpng', '-o' + outfn])
- dot_args.extend(['-Tcmapx', '-o' + mapfile])
-
- try:
-
- p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE)
-
- except OSError, err:
-
- if err.errno != ENOENT: # No such file or directory
- raise
-
- print '\nERROR: Graphviz command `dot` cannot be run (needed for Graphviz output), check your ``PATH`` setting'
-
- try:
- # Graphviz may close standard input when an error occurs,
- # resulting in a broken pipe on communicate()
- stdout, stderr = p.communicate(code)
-
- except OSError, err:
-
- # in this case, read the standard output and standard error streams
- # directly, to get the error message(s)
- stdout, stderr = p.stdout.read(), p.stderr.read()
- p.wait()
-
- if p.returncode != 0:
- print '\nERROR: Graphviz `dot` command exited with error:\n[stderr]\n%s\n[stdout]\n%s\n\n' % (stderr, stdout)
-
- fid = open(mapfile, 'rt')
- map = fid.read()
- fid.close()
-
- return os.path.split(outfn)[1], map.replace('\n', ' ')
+ wrapped or not (to avoid links pointing to non-existent pages).
+
+ :rtype: `tuple`
+
+ :returns: a tuple containing the PNG file name and a string representing the content
+ of the MAP file (with newlines stripped away).
+
+ .. note:: The MAP file is deleted as soon as its content has been read.
+ """
+
+ static_root = INHERITANCEROOT
+
+ if self.main_class is not None:
+ filename = self.main_class.name
+ else:
+ dummy, filename = Wx2Sphinx(self.specials[0])
+
+ outfn = os.path.join(static_root, filename + '_inheritance.png')
+ mapfile = outfn + '.map'
+
+ if os.path.isfile(outfn) and os.path.isfile(mapfile):
+ fid = open(mapfile, 'rt')
+ map = fid.read()
+ fid.close()
+ return os.path.split(outfn)[1], map.replace('\n', ' ')
+
+ code = self.generate_dot(class_summary)
+
+ # graphviz expects UTF-8 by default
+ if isinstance(code, unicode):
+ code = code.encode('utf-8')
+
+ dot_args = ['dot']
+
+ if os.path.isfile(outfn):
+ os.remove(outfn)
+ if os.path.isfile(mapfile):
+ os.remove(mapfile)
+
+ dot_args.extend(['-Tpng', '-o' + outfn])
+ dot_args.extend(['-Tcmapx', '-o' + mapfile])
+
+ try:
+
+ p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE)
+
+ except OSError, err:
+
+ if err.errno != ENOENT: # No such file or directory
+ raise
+
+ print '\nERROR: Graphviz command `dot` cannot be run (needed for Graphviz output), check your ``PATH`` setting'
+
+ try:
+ # Graphviz may close standard input when an error occurs,
+ # resulting in a broken pipe on communicate()
+ stdout, stderr = p.communicate(code)
+
+ except OSError, err:
+
+ # in this case, read the standard output and standard error streams
+ # directly, to get the error message(s)
+ stdout, stderr = p.stdout.read(), p.stderr.read()
+ p.wait()
+
+ if p.returncode != 0:
+ print '\nERROR: Graphviz `dot` command exited with error:\n[stderr]\n%s\n[stdout]\n%s\n\n' % (stderr, stdout)
+
+ fid = open(mapfile, 'rt')
+ map = fid.read()
+ fid.close()
+
+ return os.path.split(outfn)[1], map.replace('\n', ' ')
diff --git a/sphinxtools/librarydescription.py b/sphinxtools/librarydescription.py
index ced8c236..797c4e4f 100644
--- a/sphinxtools/librarydescription.py
+++ b/sphinxtools/librarydescription.py
@@ -1,1047 +1,1047 @@
-import sys
-import os
-import operator
-import re
-import cPickle
-
-from StringIO import StringIO
-
-from inspect import getmro, getclasstree, getdoc, getcomments
-
-from utilities import MakeSummary, ChopDescription, WriteSphinxOutput
-from utilities import FindControlImages, FormatExternalLink
-from constants import object_types, MODULE_TO_ICON, DOXY_2_REST, SPHINXROOT
-import templates
-
-EPYDOC_PATTERN = re.compile(r'\S+{\S+}', re.DOTALL)
-
-reload(sys)
-sys.setdefaultencoding("utf-8")
-
-
-def make_class_tree(tree):
-
- class_tree = []
-
- if isinstance(tree, list):
- for node in tree:
- class_tree.append(make_class_tree(node))
- else:
- name = tree[0].__name__
- class_tree.append(name)
-
- return class_tree
-
-
-def generic_summary(libraryItem, stream):
-
- write_toc = True
- add_tilde = [True, True]
-
- if libraryItem.kind in [object_types.LIBRARY, object_types.PACKAGE]:
- list1 = libraryItem.GetItemByKind(object_types.PACKAGE)
- list2 = libraryItem.GetItemByKind(object_types.PY_MODULE, object_types.PYW_MODULE)
-
- templ = [templates.TEMPLATE_PACKAGE_SUMMARY, templates.TEMPLATE_MODULE_SUMMARY]
- refs = ['mod', 'mod']
-
- elif libraryItem.kind in range(object_types.PY_MODULE, object_types.PYW_MODULE+1):
- list1 = libraryItem.GetItemByKind(object_types.FUNCTION)
- list2 = libraryItem.GetItemByKind(object_types.KLASS, recurse=True)
-
- templ = [templates.TEMPLATE_STD_FUNCTION_SUMMARY, templates.TEMPLATE_STD_CLASS_SUMMARY]
- refs = ['func', 'ref']
- add_tilde = [True, False]
-
- elif libraryItem.kind == object_types.KLASS:
- write_toc = False
- list1 = libraryItem.GetItemByKind(object_types.METHOD, object_types.INSTANCE_METHOD)
- list2 = libraryItem.GetItemByKind(object_types.PROPERTY)
-
- templ = [templates.TEMPLATE_METHOD_SUMMARY, templates.TEMPLATE_PROPERTY_SUMMARY]
- refs = ['meth', 'attr']
- add_tilde = [True, True]
-
- else:
- raise Exception('Invalid library item: %s'%libraryItem.GetShortName())
-
- toctree = ''
-
- for index, sub_list in enumerate([list1, list2]):
- table = []
- for item in sub_list:
-
- if item.is_redundant:
- continue
-
- item_docs = ReplaceWxDot(item.docs)
- item_docs = KillEpydoc(item, item_docs)
- docs = ChopDescription(item_docs)
- table.append((item.name, docs))
-
- if item.kind != object_types.FUNCTION:
- toctree += ' %s\n'%item.name
-
- if table:
- summary = MakeSummary(table, templ[index], refs[index], add_tilde[index])
- stream.write(summary)
-
- if toctree and write_toc:
- stream.write(templates.TEMPLATE_TOCTREE%toctree)
- stream.write('\n\n')
-
-
-def MakeSphinxFile(name):
-
- return os.path.join(os.getcwd(), 'docs', 'sphinx', '%s.txt'%name)
-
-
-def ReplaceWxDot(text):
-
- # Double ticks with 'wx.' in them
- text = re.sub(r'``wx\.(.*?)``', r'``\1`` ', text)
-
- # Signle ticks with 'wx.' in them... try and referencing them
- text = re.sub(r'`wx\.(.*?)`', r'`\1` ', text)
-
- # Masked is funny...
- text = text.replace(' ', '')
-
- space_added = False
- for old, new in DOXY_2_REST:
-
- if old not in text:
- continue
-
- if new in [':keyword', ':param']:
- if not space_added:
- space_added = True
- new_with_newline = '\n%s'%new
- text = text.replace(old, new_with_newline, 1)
-
- text = text.replace(old, new)
-
- lines = text.splitlines(True)
- newtext = ''
-
- for line in lines:
- if '@section' not in line:
- newtext += line
- continue
-
- # Extract the section header
- splitted = line.split()
- header = ' '.join(splitted[2:])
- header = header.strip()
-
- newtext += header + '\n'
- newtext += '-'*len(header) + '\n\n'
-
- # Try and replace True with ``True`` and False with ``False``
- # ``None`` gives trouble sometimes...
-
- for keyword in ['True', 'False']:
- newtext = re.sub(r'\s%s\s'%keyword, ' ``%s`` '%keyword, newtext)
-
- return newtext
-
-
-def GetTopLevelParent(klass):
-
- parent = klass.parent
-
- if not parent:
- return klass
-
- parents = [parent]
-
- while parent:
- parent = parent.parent
- parents.append(parent)
-
- return parents[-2]
-
-
-def FindInHierarchy(klass, newlink):
-
- library = GetTopLevelParent(klass)
- return library.FindItem(newlink)
-
-
-def FindBestLink(klass, newlink):
-
- parent_class = klass.parent
-
- if klass.kind in range(object_types.FUNCTION, object_types.INSTANCE_METHOD):
- if parent_class.GetShortName() == newlink:
- return ':class:`%s`'%newlink
- else:
- child_names = [sub.GetShortName() for sub in parent_class.children]
- if newlink in child_names:
- index = child_names.index(newlink)
- child = parent_class.children[index]
-
- if child.kind in range(object_types.PACKAGE, object_types.PYW_MODULE+1):
- return ':mod:`~%s`'%child.name
- elif child.kind in range(object_types.FUNCTION, object_types.INSTANCE_METHOD):
- return ':meth:`~%s`'%child.name
- elif child.kind == object_types.KLASS:
- return ':class:`~%s`'%child.name
- else:
- return ':attr:`~%s`'%child.name
-
- full_loop = FindInHierarchy(klass, newlink)
-
- if full_loop:
- return full_loop
-
- return ':ref:`%s`'%newlink
-
-
-def KillEpydoc(klass, newtext):
-
- epydocs = re.findall(EPYDOC_PATTERN, newtext)
-
- if not epydocs:
- return newtext
-
- newepydocs = epydocs[:]
-
- for item in epydocs:
- if '#{' in item:
- # this is for masked stuff
- newepydocs.remove(item)
-
- if not newepydocs:
- return newtext
-
- for regex in newepydocs:
-
- start = regex.index('{')
- end = regex.index('}')
-
- if 'U{' in regex:
- # Simple link, leave it as it is
- newlink = regex[start+1:end]
-
- elif 'C{' in regex:
- # It's an inclined text, but we can attach some
- # class reference to it
- newlink = regex[start+1:end]
-
- if 'wx.' in regex or 'wx' in regex:
- newlink = newlink.replace('wx.', '')
- newlink = newlink.replace('wx', '')
- newlink = ':class:`%s`'%newlink.strip()
- else:
- newlink = '`%s`'%newlink
-
- elif 'I{' in regex:
- # It's an inclined text
- newlink = regex[start+1:end]
- newlink = ' `%s` '%newlink
-
- elif 'L{' in regex:
- # Some kind of link, but we can't figure it out
- # very easily from here... just use :ref:
- newlink = regex[start+1:end]
-
- if newlink.upper() == newlink:
- # Use double backticks
- newlink = '``%s``'%newlink
- else:
- # Try and reference it
- bestlink = FindBestLink(klass, newlink)
- if bestlink:
- newlink = bestlink
-
- else:
- # Something else, don't bother for the moment
- continue
-
- newtext = newtext.replace(regex, newlink)
-
- return newtext
-
-
-class ParentBase(object):
-
- def __init__(self, name, kind):
-
- self.name = name
- self.kind = kind
-
- self.docs = u''
- self.comments = u''
-
- self.is_redundant = False
-
- self.children = []
-
-
- def Add(self, klass):
-
- if u'lambda' in klass.name:
- return
-
- for child in self.children:
- if child.name == klass.name:
- return
-
- klass.parent = self
- self.children.append(klass)
-
-
- def Save(self):
-
- if self.GetShortName().startswith('__test') or '.extern.' in self.name:
- self.is_redundant = True
-
- self.children = sorted(self.children, key=lambda k: (getattr(k, "order"), getattr(k, "name").lower()))
-
- if self.docs is None:
- self.docs = u''
-
- if self.comments is None or not self.comments.strip():
- self.comments = u''
-
- for child in self.children:
- child.Save()
-
-
- def GetImage(self):
-
- return self.kind
-
-
- def GetName(self):
-
- return self.name
-
-
- def GetShortName(self):
-
- return self.name.split(".")[-1]
-
-
- def GetObject(self):
-
- return self.obj_type
-
-
- def GetChildren(self):
-
- return self.children
-
-
- def GetChildrenCount(self, recursively=True):
- """
- Gets the number of children of this item.
-
- :param bool `recursively`: if ``True``, returns the total number of descendants,
- otherwise only one level of children is counted.
- """
-
- count = len(self.children)
-
- if not recursively:
- return count
-
- total = count
-
- for n in xrange(count):
- total += self.children[n].GetChildrenCount()
-
- return total
-
-
- def GetKindCount(self, minObj, maxObj=None):
-
- if maxObj is None:
- maxObj = minObj
-
- count = 0
- for child in self.children:
- if minObj <= child.kind <= maxObj:
- count += 1
-
- return count
-
-
- def GetItemByKind(self, minObj, maxObj=None, recurse=False):
-
- if maxObj is None:
- maxObj = minObj
-
- items = []
- for child in self.children:
- if minObj <= child.kind <= maxObj:
- items.append(child)
-
- if recurse:
- items = items + child.GetItemByKind(minObj, maxObj, recurse)
-
- return items
-
-
- def ToRest(self, class_summary):
-
- pass
-
-
-class Library(ParentBase):
-
- def __init__(self, name):
-
- ParentBase.__init__(self, name, object_types.LIBRARY)
-
- self.parent = None
- self.filename = u''
- self.order = 0
- self.obj_type = u"Library"
- self.python_version = u''
-
- self.sphinx_file = MakeSphinxFile(name)
- self.base_name = name
-
-
- def GetShortName(self):
-
- return self.name
-
-
- def Walk(self, obj, class_summary):
-
- if obj == self:
- obj.ToRest(class_summary)
-
- # must have at least root folder
- children = obj.GetChildren()
-
- if not children:
- return
-
- # check each name
- for child in children:
-
- if child.is_redundant:
- continue
-
- child.ToRest(class_summary)
-
- # recursively scan other folders, appending results
- self.Walk(child, class_summary)
-
-
- def FindItem(self, newlink, obj=None):
-
- if obj is None:
- obj = self
-
- # must have at least root folder
- children = obj.GetChildren()
- bestlink = ''
-
- if not children:
- return bestlink
-
- # check each name
- for child in children:
-
- if child.is_redundant:
- continue
-
- parts = child.name.split('.')
- dotname = '.'.join(parts[-2:])
- if child.name.endswith(newlink) and (child.GetShortName() == newlink or dotname == newlink):
- if child.kind in range(object_types.PACKAGE, object_types.PYW_MODULE+1):
- return ':mod:`~%s`'%child.name
- elif child.kind in range(object_types.FUNCTION, object_types.INSTANCE_METHOD+1):
- return ':meth:`~%s`'%child.name
- elif child.kind == object_types.KLASS:
- return ':class:`~%s`'%child.name
- else:
- return ':attr:`~%s`'%child.name
-
- bestlink = self.FindItem(newlink, child)
-
- if bestlink:
- return bestlink
-
- return bestlink
-
-
- def GetPythonVersion(self):
-
- return self.python_version
-
-
- def ToRest(self, class_summary):
-
- print '\n\nReST-ifying %s...\n\n'%self.base_name
- stream = StringIO()
-
- header = templates.TEMPLATE_DESCRIPTION%(self.base_name, self.base_name)
- stream.write(header)
-
- newtext = ReplaceWxDot(self.docs)
- newtext = KillEpydoc(self, newtext)
-
- stream.write(newtext + '\n\n')
-
- generic_summary(self, stream)
- WriteSphinxOutput(stream, self.sphinx_file)
-
-
- def ClassesToPickle(self, obj, class_dict):
-
- # must have at least root folder
- children = obj.GetChildren()
-
- if not children:
- return class_dict
-
- # check each name
- for child in children:
- if child.kind == object_types.KLASS:
- if child.is_redundant:
- continue
-
- class_dict[child.name] = (child.method_list, child.bases, ChopDescription(child.docs))
-
- # recursively scan other folders, appending results
- class_dict = self.ClassesToPickle(child, class_dict)
-
- return class_dict
-
-
- def Save(self):
-
- ParentBase.Save(self)
-
- class_dict = {}
- class_dict = self.ClassesToPickle(self, class_dict)
-
- pickle_file = os.path.join(SPHINXROOT, 'class_summary.lst')
-
- if os.path.isfile(pickle_file):
- fid = open(pickle_file, 'rb')
- items = cPickle.load(fid)
- fid.close()
- else:
- items = {}
-
- items.update(class_dict)
- fid = open(pickle_file, 'wb')
- cPickle.dump(items, fid)
- fid.close()
-
-
-class Module(ParentBase):
-
- def __init__(self, name, kind):
-
- ParentBase.__init__(self, name, kind)
-
- self.filename = u''
- self.sphinx_file = MakeSphinxFile(name)
-
- if kind == object_types.PACKAGE:
- self.obj_type = u"Package"
- self.order = kind
- return
-
- self.order = object_types.PY_MODULE
-
- for dummy, icon, description in MODULE_TO_ICON:
- if icon == kind:
- self.obj_type = description
- break
-
- self.inheritance_diagram = None
-
-
- def ToRest(self, class_summary):
-
- if self.is_redundant:
- return
-
- stream = StringIO()
-
- label = 'Module'
- if self.kind == object_types.PACKAGE:
- label = 'Package'
-
- stream.write('.. module:: %s\n\n'%self.name)
- stream.write('.. currentmodule:: %s\n\n'%self.name)
- stream.write('.. highlight:: python\n\n')
-
- header = templates.TEMPLATE_DESCRIPTION%(self.name, '%s'%self.GetShortName())
-
- stream.write(header)
-
- newtext = ReplaceWxDot(self.docs)
- newtext = KillEpydoc(self, newtext)
-
- stream.write(newtext + '\n\n')
-
- spacer = ' '*self.name.count('.')
-
- if self.kind != object_types.PACKAGE:
- print '%s - %s (module)'%(spacer, self.name)
- if self.inheritance_diagram:
- png, map = self.inheritance_diagram.MakeInheritanceDiagram(class_summary)
- short_name = self.GetShortName()
- image_desc = templates.TEMPLATE_INHERITANCE % ('module', short_name, png, short_name, map)
- stream.write(image_desc)
- else:
- print '%s - %s (package)'%(spacer, self.name)
-
- generic_summary(self, stream)
-
- functions = self.GetItemByKind(object_types.FUNCTION)
-
- count = 0
- for fun in functions:
- if not fun.is_redundant:
- count = 1
- break
-
- if count > 0:
- stream.write('\n\nFunctions\n------------\n\n')
-
- for fun in functions:
- if fun.is_redundant:
- continue
- fun.Write(stream)
-
- WriteSphinxOutput(stream, self.sphinx_file)
-
-
- def Save(self):
-
- ParentBase.Save(self)
-
- if self.GetShortName().startswith('__test') or '.extern.' in self.name:
- self.is_redundant = True
-
-
-class Class(ParentBase):
-
- def __init__(self, name, obj):
-
- ParentBase.__init__(self, name, object_types.KLASS)
-
- try:
- subs = obj.__subclasses__()
- except (AttributeError, TypeError):
- subs = []
-
- sups = list(obj.__bases__)
-
- sortedSubClasses = []
- sortedSupClasses = []
-
- for item in sups:
- item = repr(item)
-
- sup = item.replace("", "").replace("= 0:
- init = self.children.pop(pop)
- self.children.insert(0, init)
-
- self.signature = self.signature.replace('wx.', '')
- self.signature = self.signature.rstrip(':').lstrip('class ')
-
- if ' def __init__' in self.signature:
- index = self.signature.index(' def __init__')
- self.signature = self.signature[0:index]
-
- self.signature = self.signature.strip()
-
- if len(self.signature) < 2:
- self.is_redundant = True
-
- if self.GetShortName().startswith('__test') or '.extern.' in self.name:
- self.is_redundant = True
-
- if self.is_redundant:
- return
-
- methods = self.GetItemByKind(object_types.METHOD, object_types.INSTANCE_METHOD)
- method_list = []
-
- for meth in methods:
- if not meth.is_redundant:
- method_list.append(meth.GetShortName())
-
- self.method_list = method_list
- self.bases = self.superClasses
-
-
-class ChildrenBase(object):
-
- def __init__(self, name, kind):
-
- self.name = name
- self.kind = kind
-
- self.order = 4
-
- self.docs = u''
- self.comments = u''
-
- self.is_redundant = False
-
-## self.id = NewId()
-
-
- def GetImage(self):
-
- return self.kind
-
-
- def GetName(self):
-
- return self.name
-
-
- def GetShortName(self):
-
- return self.name.split(".")[-1]
-
-
- def GetChildren(self):
-
- return []
-
-
- def GetChildrenCount(self, recursively=True):
-
- return 0
-
-
- def GetObject(self):
-
- return self.obj_type
-
-
- def Save(self):
-
- if self.docs is None:
- self.docs = u''
-
- if self.comments is None or not self.comments.strip():
- self.comments = u''
-
-
- def ToRest(self, class_summary):
-
- pass
-
-
-class Method(ChildrenBase):
-
- def __init__(self, name, kind):
-
- ChildrenBase.__init__(self, name, kind)
-
- self.order = 5
-
- self.arguments = []
- self.signature = u''
-
- self.obj_type = u"Method/Function"
-
-
- def Save(self):
-
- ChildrenBase.Save(self)
-
- newargs = []
- if self.arguments and any(self.arguments[0]):
- for name, repr_val, eval_val in self.arguments:
- repr_val = (repr_val is not None and [repr_val] or [""])[0]
- eval_val = (eval_val is not None and [eval_val] or [""])[0]
- newargs.append((name, repr_val, eval_val))
-
- self.arguments = newargs
-
- self.signature = self.signature.replace('wx.', '')
- self.signature = self.signature.rstrip(':').lstrip()
-
- if self.signature.startswith('def '):
- self.signature = self.signature[4:]
-
- if '@staticmethod' in self.signature:
- self.kind = object_types.STATIC_METHOD
- elif '@classmethod' in self.signature:
- self.kind = object_types.CLASS_METHOD
-
- if ' def ' in self.signature:
- index = self.signature.index(' def ')
- self.signature = self.signature[index+5:].strip()
-
- if '*' in self.signature:
- self.signature = self.signature.replace('*', r'\*')
-
- if not self.signature.strip():
- self.is_redundant = True
-
-
- def Write(self, stream):
-
- if self.is_redundant:
- return
-
- if self.kind == object_types.FUNCTION:
- stream.write('.. function:: %s\n\n'%self.signature)
- indent = 3*' '
- else:
- if self.kind == object_types.STATIC_METHOD:
- stream.write(' .. staticmethod:: %s\n\n'%self.signature)
- elif self.kind == object_types.CLASS_METHOD:
- stream.write(' .. classmethod:: %s\n\n'%self.signature)
- else:
- stream.write(' .. method:: %s\n\n'%self.signature)
- indent = 6*' '
-
- if not self.docs.strip():
- stream.write('\n')
- return
-
- text = ''
- newdocs = ReplaceWxDot(self.docs)
-
- for line in newdocs.splitlines(True):
- text += indent + line
-
- text = KillEpydoc(self, text)
- text += '\n\n\n'
- stream.write(text)
-
-
-class Property(ChildrenBase):
-
- def __init__(self, name, item):
-
- ChildrenBase.__init__(self, name, object_types.PROPERTY)
-
- self.getter = self.setter = self.deleter = ""
-
- try:
- if item.fget:
- self.getter = item.fget.__name__
- if item.fset:
- self.setter = item.fset.__name__
- if item.fdel:
- self.deleter = item.fdel.__name__
- except AttributeError:
- # Thank you for screwing it up, Cython...
- if item.fget:
- self.getter = item.fget.__class__.__name__
- if item.fset:
- self.setter = item.fset.__class__.__name__
- if item.fdel:
- self.deleter = item.fdel.__class__.__name__
-
- self.docs = getdoc(item)
- self.comments = getcomments(item)
-
- self.obj_type = u"Property"
- self.order = 6
-
-
- def Write(self, stream, class_name):
-
- if self.is_redundant:
- return
-
- docs = ''
- for item in [self.setter, self.getter, self.deleter]:
- if item and 'lambda' not in item and not item.startswith('_'):
- if docs:
- docs += ', :meth:`~%s.%s` '%(class_name, item)
- else:
- docs += ':meth:`~%s.%s` '%(class_name, item)
-
- if docs:
- docs = 'See %s'%docs
-
- stream.write(' .. attribute:: %s\n\n'%self.GetShortName())
- stream.write(' %s\n\n\n'%docs)
-
-
-class Attribute(ChildrenBase):
-
- def __init__(self, name, specs, value):
-
- specs = unicode(specs)
- start, end = specs.find("'"), specs.rfind("'")
- specs = specs[start+1:end]
-
- strValue = repr(value)
- uspecs = specs.upper()
-
- try:
- kind = getattr(object_types, uspecs)
- except AttributeError:
- try:
- uspecs = uspecs + u"TYPE"
- kind = getattr(object_types, uspecs)
- except AttributeError:
- kind = object_types.UNKNOWNTYPE
-
- try:
- reprValue = repr(value.__class__)
- except (NameError, AttributeError):
- reprValue = ""
-
- if u"class" in strValue or u"class" in reprValue:
- kind = object_types.INSTANCETYPE
-
- ChildrenBase.__init__(self, name, kind)
-
- self.value = strValue
- self.specs = specs
-
- try:
- self.docs = getdoc(value)
- except (NameError, AttributeError):
- self.docs = u''
-
- self.obj_type = u"Attribute"
- self.order = 7
-
-
- def ToRest(self, class_summary):
-
- pass
-
+import sys
+import os
+import operator
+import re
+import cPickle
+
+from StringIO import StringIO
+
+from inspect import getmro, getclasstree, getdoc, getcomments
+
+from utilities import MakeSummary, ChopDescription, WriteSphinxOutput
+from utilities import FindControlImages, FormatExternalLink
+from constants import object_types, MODULE_TO_ICON, DOXY_2_REST, SPHINXROOT
+import templates
+
+EPYDOC_PATTERN = re.compile(r'\S+{\S+}', re.DOTALL)
+
+reload(sys)
+sys.setdefaultencoding("utf-8")
+
+
+def make_class_tree(tree):
+
+ class_tree = []
+
+ if isinstance(tree, list):
+ for node in tree:
+ class_tree.append(make_class_tree(node))
+ else:
+ name = tree[0].__name__
+ class_tree.append(name)
+
+ return class_tree
+
+
+def generic_summary(libraryItem, stream):
+
+ write_toc = True
+ add_tilde = [True, True]
+
+ if libraryItem.kind in [object_types.LIBRARY, object_types.PACKAGE]:
+ list1 = libraryItem.GetItemByKind(object_types.PACKAGE)
+ list2 = libraryItem.GetItemByKind(object_types.PY_MODULE, object_types.PYW_MODULE)
+
+ templ = [templates.TEMPLATE_PACKAGE_SUMMARY, templates.TEMPLATE_MODULE_SUMMARY]
+ refs = ['mod', 'mod']
+
+ elif libraryItem.kind in range(object_types.PY_MODULE, object_types.PYW_MODULE+1):
+ list1 = libraryItem.GetItemByKind(object_types.FUNCTION)
+ list2 = libraryItem.GetItemByKind(object_types.KLASS, recurse=True)
+
+ templ = [templates.TEMPLATE_STD_FUNCTION_SUMMARY, templates.TEMPLATE_STD_CLASS_SUMMARY]
+ refs = ['func', 'ref']
+ add_tilde = [True, False]
+
+ elif libraryItem.kind == object_types.KLASS:
+ write_toc = False
+ list1 = libraryItem.GetItemByKind(object_types.METHOD, object_types.INSTANCE_METHOD)
+ list2 = libraryItem.GetItemByKind(object_types.PROPERTY)
+
+ templ = [templates.TEMPLATE_METHOD_SUMMARY, templates.TEMPLATE_PROPERTY_SUMMARY]
+ refs = ['meth', 'attr']
+ add_tilde = [True, True]
+
+ else:
+ raise Exception('Invalid library item: %s'%libraryItem.GetShortName())
+
+ toctree = ''
+
+ for index, sub_list in enumerate([list1, list2]):
+ table = []
+ for item in sub_list:
+
+ if item.is_redundant:
+ continue
+
+ item_docs = ReplaceWxDot(item.docs)
+ item_docs = KillEpydoc(item, item_docs)
+ docs = ChopDescription(item_docs)
+ table.append((item.name, docs))
+
+ if item.kind != object_types.FUNCTION:
+ toctree += ' %s\n'%item.name
+
+ if table:
+ summary = MakeSummary(table, templ[index], refs[index], add_tilde[index])
+ stream.write(summary)
+
+ if toctree and write_toc:
+ stream.write(templates.TEMPLATE_TOCTREE%toctree)
+ stream.write('\n\n')
+
+
+def MakeSphinxFile(name):
+
+ return os.path.join(os.getcwd(), 'docs', 'sphinx', '%s.txt'%name)
+
+
+def ReplaceWxDot(text):
+
+ # Double ticks with 'wx.' in them
+ text = re.sub(r'``wx\.(.*?)``', r'``\1`` ', text)
+
+ # Signle ticks with 'wx.' in them... try and referencing them
+ text = re.sub(r'`wx\.(.*?)`', r'`\1` ', text)
+
+ # Masked is funny...
+ text = text.replace(' ', '')
+
+ space_added = False
+ for old, new in DOXY_2_REST:
+
+ if old not in text:
+ continue
+
+ if new in [':keyword', ':param']:
+ if not space_added:
+ space_added = True
+ new_with_newline = '\n%s'%new
+ text = text.replace(old, new_with_newline, 1)
+
+ text = text.replace(old, new)
+
+ lines = text.splitlines(True)
+ newtext = ''
+
+ for line in lines:
+ if '@section' not in line:
+ newtext += line
+ continue
+
+ # Extract the section header
+ splitted = line.split()
+ header = ' '.join(splitted[2:])
+ header = header.strip()
+
+ newtext += header + '\n'
+ newtext += '-'*len(header) + '\n\n'
+
+ # Try and replace True with ``True`` and False with ``False``
+ # ``None`` gives trouble sometimes...
+
+ for keyword in ['True', 'False']:
+ newtext = re.sub(r'\s%s\s'%keyword, ' ``%s`` '%keyword, newtext)
+
+ return newtext
+
+
+def GetTopLevelParent(klass):
+
+ parent = klass.parent
+
+ if not parent:
+ return klass
+
+ parents = [parent]
+
+ while parent:
+ parent = parent.parent
+ parents.append(parent)
+
+ return parents[-2]
+
+
+def FindInHierarchy(klass, newlink):
+
+ library = GetTopLevelParent(klass)
+ return library.FindItem(newlink)
+
+
+def FindBestLink(klass, newlink):
+
+ parent_class = klass.parent
+
+ if klass.kind in range(object_types.FUNCTION, object_types.INSTANCE_METHOD):
+ if parent_class.GetShortName() == newlink:
+ return ':class:`%s`'%newlink
+ else:
+ child_names = [sub.GetShortName() for sub in parent_class.children]
+ if newlink in child_names:
+ index = child_names.index(newlink)
+ child = parent_class.children[index]
+
+ if child.kind in range(object_types.PACKAGE, object_types.PYW_MODULE+1):
+ return ':mod:`~%s`'%child.name
+ elif child.kind in range(object_types.FUNCTION, object_types.INSTANCE_METHOD):
+ return ':meth:`~%s`'%child.name
+ elif child.kind == object_types.KLASS:
+ return ':class:`~%s`'%child.name
+ else:
+ return ':attr:`~%s`'%child.name
+
+ full_loop = FindInHierarchy(klass, newlink)
+
+ if full_loop:
+ return full_loop
+
+ return ':ref:`%s`'%newlink
+
+
+def KillEpydoc(klass, newtext):
+
+ epydocs = re.findall(EPYDOC_PATTERN, newtext)
+
+ if not epydocs:
+ return newtext
+
+ newepydocs = epydocs[:]
+
+ for item in epydocs:
+ if '#{' in item:
+ # this is for masked stuff
+ newepydocs.remove(item)
+
+ if not newepydocs:
+ return newtext
+
+ for regex in newepydocs:
+
+ start = regex.index('{')
+ end = regex.index('}')
+
+ if 'U{' in regex:
+ # Simple link, leave it as it is
+ newlink = regex[start+1:end]
+
+ elif 'C{' in regex:
+ # It's an inclined text, but we can attach some
+ # class reference to it
+ newlink = regex[start+1:end]
+
+ if 'wx.' in regex or 'wx' in regex:
+ newlink = newlink.replace('wx.', '')
+ newlink = newlink.replace('wx', '')
+ newlink = ':class:`%s`'%newlink.strip()
+ else:
+ newlink = '`%s`'%newlink
+
+ elif 'I{' in regex:
+ # It's an inclined text
+ newlink = regex[start+1:end]
+ newlink = ' `%s` '%newlink
+
+ elif 'L{' in regex:
+ # Some kind of link, but we can't figure it out
+ # very easily from here... just use :ref:
+ newlink = regex[start+1:end]
+
+ if newlink.upper() == newlink:
+ # Use double backticks
+ newlink = '``%s``'%newlink
+ else:
+ # Try and reference it
+ bestlink = FindBestLink(klass, newlink)
+ if bestlink:
+ newlink = bestlink
+
+ else:
+ # Something else, don't bother for the moment
+ continue
+
+ newtext = newtext.replace(regex, newlink)
+
+ return newtext
+
+
+class ParentBase(object):
+
+ def __init__(self, name, kind):
+
+ self.name = name
+ self.kind = kind
+
+ self.docs = u''
+ self.comments = u''
+
+ self.is_redundant = False
+
+ self.children = []
+
+
+ def Add(self, klass):
+
+ if u'lambda' in klass.name:
+ return
+
+ for child in self.children:
+ if child.name == klass.name:
+ return
+
+ klass.parent = self
+ self.children.append(klass)
+
+
+ def Save(self):
+
+ if self.GetShortName().startswith('__test') or '.extern.' in self.name:
+ self.is_redundant = True
+
+ self.children = sorted(self.children, key=lambda k: (getattr(k, "order"), getattr(k, "name").lower()))
+
+ if self.docs is None:
+ self.docs = u''
+
+ if self.comments is None or not self.comments.strip():
+ self.comments = u''
+
+ for child in self.children:
+ child.Save()
+
+
+ def GetImage(self):
+
+ return self.kind
+
+
+ def GetName(self):
+
+ return self.name
+
+
+ def GetShortName(self):
+
+ return self.name.split(".")[-1]
+
+
+ def GetObject(self):
+
+ return self.obj_type
+
+
+ def GetChildren(self):
+
+ return self.children
+
+
+ def GetChildrenCount(self, recursively=True):
+ """
+ Gets the number of children of this item.
+
+ :param bool `recursively`: if ``True``, returns the total number of descendants,
+ otherwise only one level of children is counted.
+ """
+
+ count = len(self.children)
+
+ if not recursively:
+ return count
+
+ total = count
+
+ for n in xrange(count):
+ total += self.children[n].GetChildrenCount()
+
+ return total
+
+
+ def GetKindCount(self, minObj, maxObj=None):
+
+ if maxObj is None:
+ maxObj = minObj
+
+ count = 0
+ for child in self.children:
+ if minObj <= child.kind <= maxObj:
+ count += 1
+
+ return count
+
+
+ def GetItemByKind(self, minObj, maxObj=None, recurse=False):
+
+ if maxObj is None:
+ maxObj = minObj
+
+ items = []
+ for child in self.children:
+ if minObj <= child.kind <= maxObj:
+ items.append(child)
+
+ if recurse:
+ items = items + child.GetItemByKind(minObj, maxObj, recurse)
+
+ return items
+
+
+ def ToRest(self, class_summary):
+
+ pass
+
+
+class Library(ParentBase):
+
+ def __init__(self, name):
+
+ ParentBase.__init__(self, name, object_types.LIBRARY)
+
+ self.parent = None
+ self.filename = u''
+ self.order = 0
+ self.obj_type = u"Library"
+ self.python_version = u''
+
+ self.sphinx_file = MakeSphinxFile(name)
+ self.base_name = name
+
+
+ def GetShortName(self):
+
+ return self.name
+
+
+ def Walk(self, obj, class_summary):
+
+ if obj == self:
+ obj.ToRest(class_summary)
+
+ # must have at least root folder
+ children = obj.GetChildren()
+
+ if not children:
+ return
+
+ # check each name
+ for child in children:
+
+ if child.is_redundant:
+ continue
+
+ child.ToRest(class_summary)
+
+ # recursively scan other folders, appending results
+ self.Walk(child, class_summary)
+
+
+ def FindItem(self, newlink, obj=None):
+
+ if obj is None:
+ obj = self
+
+ # must have at least root folder
+ children = obj.GetChildren()
+ bestlink = ''
+
+ if not children:
+ return bestlink
+
+ # check each name
+ for child in children:
+
+ if child.is_redundant:
+ continue
+
+ parts = child.name.split('.')
+ dotname = '.'.join(parts[-2:])
+ if child.name.endswith(newlink) and (child.GetShortName() == newlink or dotname == newlink):
+ if child.kind in range(object_types.PACKAGE, object_types.PYW_MODULE+1):
+ return ':mod:`~%s`'%child.name
+ elif child.kind in range(object_types.FUNCTION, object_types.INSTANCE_METHOD+1):
+ return ':meth:`~%s`'%child.name
+ elif child.kind == object_types.KLASS:
+ return ':class:`~%s`'%child.name
+ else:
+ return ':attr:`~%s`'%child.name
+
+ bestlink = self.FindItem(newlink, child)
+
+ if bestlink:
+ return bestlink
+
+ return bestlink
+
+
+ def GetPythonVersion(self):
+
+ return self.python_version
+
+
+ def ToRest(self, class_summary):
+
+ print '\n\nReST-ifying %s...\n\n'%self.base_name
+ stream = StringIO()
+
+ header = templates.TEMPLATE_DESCRIPTION%(self.base_name, self.base_name)
+ stream.write(header)
+
+ newtext = ReplaceWxDot(self.docs)
+ newtext = KillEpydoc(self, newtext)
+
+ stream.write(newtext + '\n\n')
+
+ generic_summary(self, stream)
+ WriteSphinxOutput(stream, self.sphinx_file)
+
+
+ def ClassesToPickle(self, obj, class_dict):
+
+ # must have at least root folder
+ children = obj.GetChildren()
+
+ if not children:
+ return class_dict
+
+ # check each name
+ for child in children:
+ if child.kind == object_types.KLASS:
+ if child.is_redundant:
+ continue
+
+ class_dict[child.name] = (child.method_list, child.bases, ChopDescription(child.docs))
+
+ # recursively scan other folders, appending results
+ class_dict = self.ClassesToPickle(child, class_dict)
+
+ return class_dict
+
+
+ def Save(self):
+
+ ParentBase.Save(self)
+
+ class_dict = {}
+ class_dict = self.ClassesToPickle(self, class_dict)
+
+ pickle_file = os.path.join(SPHINXROOT, 'class_summary.lst')
+
+ if os.path.isfile(pickle_file):
+ fid = open(pickle_file, 'rb')
+ items = cPickle.load(fid)
+ fid.close()
+ else:
+ items = {}
+
+ items.update(class_dict)
+ fid = open(pickle_file, 'wb')
+ cPickle.dump(items, fid)
+ fid.close()
+
+
+class Module(ParentBase):
+
+ def __init__(self, name, kind):
+
+ ParentBase.__init__(self, name, kind)
+
+ self.filename = u''
+ self.sphinx_file = MakeSphinxFile(name)
+
+ if kind == object_types.PACKAGE:
+ self.obj_type = u"Package"
+ self.order = kind
+ return
+
+ self.order = object_types.PY_MODULE
+
+ for dummy, icon, description in MODULE_TO_ICON:
+ if icon == kind:
+ self.obj_type = description
+ break
+
+ self.inheritance_diagram = None
+
+
+ def ToRest(self, class_summary):
+
+ if self.is_redundant:
+ return
+
+ stream = StringIO()
+
+ label = 'Module'
+ if self.kind == object_types.PACKAGE:
+ label = 'Package'
+
+ stream.write('.. module:: %s\n\n'%self.name)
+ stream.write('.. currentmodule:: %s\n\n'%self.name)
+ stream.write('.. highlight:: python\n\n')
+
+ header = templates.TEMPLATE_DESCRIPTION%(self.name, '%s'%self.GetShortName())
+
+ stream.write(header)
+
+ newtext = ReplaceWxDot(self.docs)
+ newtext = KillEpydoc(self, newtext)
+
+ stream.write(newtext + '\n\n')
+
+ spacer = ' '*self.name.count('.')
+
+ if self.kind != object_types.PACKAGE:
+ print '%s - %s (module)'%(spacer, self.name)
+ if self.inheritance_diagram:
+ png, map = self.inheritance_diagram.MakeInheritanceDiagram(class_summary)
+ short_name = self.GetShortName()
+ image_desc = templates.TEMPLATE_INHERITANCE % ('module', short_name, png, short_name, map)
+ stream.write(image_desc)
+ else:
+ print '%s - %s (package)'%(spacer, self.name)
+
+ generic_summary(self, stream)
+
+ functions = self.GetItemByKind(object_types.FUNCTION)
+
+ count = 0
+ for fun in functions:
+ if not fun.is_redundant:
+ count = 1
+ break
+
+ if count > 0:
+ stream.write('\n\nFunctions\n------------\n\n')
+
+ for fun in functions:
+ if fun.is_redundant:
+ continue
+ fun.Write(stream)
+
+ WriteSphinxOutput(stream, self.sphinx_file)
+
+
+ def Save(self):
+
+ ParentBase.Save(self)
+
+ if self.GetShortName().startswith('__test') or '.extern.' in self.name:
+ self.is_redundant = True
+
+
+class Class(ParentBase):
+
+ def __init__(self, name, obj):
+
+ ParentBase.__init__(self, name, object_types.KLASS)
+
+ try:
+ subs = obj.__subclasses__()
+ except (AttributeError, TypeError):
+ subs = []
+
+ sups = list(obj.__bases__)
+
+ sortedSubClasses = []
+ sortedSupClasses = []
+
+ for item in sups:
+ item = repr(item)
+
+ sup = item.replace("", "").replace("= 0:
+ init = self.children.pop(pop)
+ self.children.insert(0, init)
+
+ self.signature = self.signature.replace('wx.', '')
+ self.signature = self.signature.rstrip(':').lstrip('class ')
+
+ if ' def __init__' in self.signature:
+ index = self.signature.index(' def __init__')
+ self.signature = self.signature[0:index]
+
+ self.signature = self.signature.strip()
+
+ if len(self.signature) < 2:
+ self.is_redundant = True
+
+ if self.GetShortName().startswith('__test') or '.extern.' in self.name:
+ self.is_redundant = True
+
+ if self.is_redundant:
+ return
+
+ methods = self.GetItemByKind(object_types.METHOD, object_types.INSTANCE_METHOD)
+ method_list = []
+
+ for meth in methods:
+ if not meth.is_redundant:
+ method_list.append(meth.GetShortName())
+
+ self.method_list = method_list
+ self.bases = self.superClasses
+
+
+class ChildrenBase(object):
+
+ def __init__(self, name, kind):
+
+ self.name = name
+ self.kind = kind
+
+ self.order = 4
+
+ self.docs = u''
+ self.comments = u''
+
+ self.is_redundant = False
+
+## self.id = NewId()
+
+
+ def GetImage(self):
+
+ return self.kind
+
+
+ def GetName(self):
+
+ return self.name
+
+
+ def GetShortName(self):
+
+ return self.name.split(".")[-1]
+
+
+ def GetChildren(self):
+
+ return []
+
+
+ def GetChildrenCount(self, recursively=True):
+
+ return 0
+
+
+ def GetObject(self):
+
+ return self.obj_type
+
+
+ def Save(self):
+
+ if self.docs is None:
+ self.docs = u''
+
+ if self.comments is None or not self.comments.strip():
+ self.comments = u''
+
+
+ def ToRest(self, class_summary):
+
+ pass
+
+
+class Method(ChildrenBase):
+
+ def __init__(self, name, kind):
+
+ ChildrenBase.__init__(self, name, kind)
+
+ self.order = 5
+
+ self.arguments = []
+ self.signature = u''
+
+ self.obj_type = u"Method/Function"
+
+
+ def Save(self):
+
+ ChildrenBase.Save(self)
+
+ newargs = []
+ if self.arguments and any(self.arguments[0]):
+ for name, repr_val, eval_val in self.arguments:
+ repr_val = (repr_val is not None and [repr_val] or [""])[0]
+ eval_val = (eval_val is not None and [eval_val] or [""])[0]
+ newargs.append((name, repr_val, eval_val))
+
+ self.arguments = newargs
+
+ self.signature = self.signature.replace('wx.', '')
+ self.signature = self.signature.rstrip(':').lstrip()
+
+ if self.signature.startswith('def '):
+ self.signature = self.signature[4:]
+
+ if '@staticmethod' in self.signature:
+ self.kind = object_types.STATIC_METHOD
+ elif '@classmethod' in self.signature:
+ self.kind = object_types.CLASS_METHOD
+
+ if ' def ' in self.signature:
+ index = self.signature.index(' def ')
+ self.signature = self.signature[index+5:].strip()
+
+ if '*' in self.signature:
+ self.signature = self.signature.replace('*', r'\*')
+
+ if not self.signature.strip():
+ self.is_redundant = True
+
+
+ def Write(self, stream):
+
+ if self.is_redundant:
+ return
+
+ if self.kind == object_types.FUNCTION:
+ stream.write('.. function:: %s\n\n'%self.signature)
+ indent = 3*' '
+ else:
+ if self.kind == object_types.STATIC_METHOD:
+ stream.write(' .. staticmethod:: %s\n\n'%self.signature)
+ elif self.kind == object_types.CLASS_METHOD:
+ stream.write(' .. classmethod:: %s\n\n'%self.signature)
+ else:
+ stream.write(' .. method:: %s\n\n'%self.signature)
+ indent = 6*' '
+
+ if not self.docs.strip():
+ stream.write('\n')
+ return
+
+ text = ''
+ newdocs = ReplaceWxDot(self.docs)
+
+ for line in newdocs.splitlines(True):
+ text += indent + line
+
+ text = KillEpydoc(self, text)
+ text += '\n\n\n'
+ stream.write(text)
+
+
+class Property(ChildrenBase):
+
+ def __init__(self, name, item):
+
+ ChildrenBase.__init__(self, name, object_types.PROPERTY)
+
+ self.getter = self.setter = self.deleter = ""
+
+ try:
+ if item.fget:
+ self.getter = item.fget.__name__
+ if item.fset:
+ self.setter = item.fset.__name__
+ if item.fdel:
+ self.deleter = item.fdel.__name__
+ except AttributeError:
+ # Thank you for screwing it up, Cython...
+ if item.fget:
+ self.getter = item.fget.__class__.__name__
+ if item.fset:
+ self.setter = item.fset.__class__.__name__
+ if item.fdel:
+ self.deleter = item.fdel.__class__.__name__
+
+ self.docs = getdoc(item)
+ self.comments = getcomments(item)
+
+ self.obj_type = u"Property"
+ self.order = 6
+
+
+ def Write(self, stream, class_name):
+
+ if self.is_redundant:
+ return
+
+ docs = ''
+ for item in [self.setter, self.getter, self.deleter]:
+ if item and 'lambda' not in item and not item.startswith('_'):
+ if docs:
+ docs += ', :meth:`~%s.%s` '%(class_name, item)
+ else:
+ docs += ':meth:`~%s.%s` '%(class_name, item)
+
+ if docs:
+ docs = 'See %s'%docs
+
+ stream.write(' .. attribute:: %s\n\n'%self.GetShortName())
+ stream.write(' %s\n\n\n'%docs)
+
+
+class Attribute(ChildrenBase):
+
+ def __init__(self, name, specs, value):
+
+ specs = unicode(specs)
+ start, end = specs.find("'"), specs.rfind("'")
+ specs = specs[start+1:end]
+
+ strValue = repr(value)
+ uspecs = specs.upper()
+
+ try:
+ kind = getattr(object_types, uspecs)
+ except AttributeError:
+ try:
+ uspecs = uspecs + u"TYPE"
+ kind = getattr(object_types, uspecs)
+ except AttributeError:
+ kind = object_types.UNKNOWNTYPE
+
+ try:
+ reprValue = repr(value.__class__)
+ except (NameError, AttributeError):
+ reprValue = ""
+
+ if u"class" in strValue or u"class" in reprValue:
+ kind = object_types.INSTANCETYPE
+
+ ChildrenBase.__init__(self, name, kind)
+
+ self.value = strValue
+ self.specs = specs
+
+ try:
+ self.docs = getdoc(value)
+ except (NameError, AttributeError):
+ self.docs = u''
+
+ self.obj_type = u"Attribute"
+ self.order = 7
+
+
+ def ToRest(self, class_summary):
+
+ pass
+
diff --git a/sphinxtools/modulehunter.py b/sphinxtools/modulehunter.py
index 71d5a12e..4117ede2 100644
--- a/sphinxtools/modulehunter.py
+++ b/sphinxtools/modulehunter.py
@@ -1,662 +1,662 @@
-# -*- coding: utf-8 -*-
-
-# Describe classes, methods and functions in a module.
-# Works with user-defined modules, all Python library
-# modules, including built-in modules.
-
-import os
-import sys
-import glob
-import types
-import cPickle
-import imp
-import traceback
-import pkgutil
-
-import __builtin__
-
-from buildtools.config import phoenixDir
-
-from inspect import getargspec, ismodule, getdoc, getmodule, getcomments, isfunction
-from inspect import ismethoddescriptor, getsource, ismemberdescriptor, isgetsetdescriptor
-from inspect import isbuiltin, isclass, getfile, ismethod
-
-from librarydescription import Library, Module, Class
-from librarydescription import Method, Property, Attribute
-
-import inheritance
-
-from constants import object_types, EXCLUDED_ATTRS, MODULE_TO_ICON
-from constants import CONSTANT_RE
-
-reload(sys)
-sys.setdefaultencoding("utf-8")
-
-try:
- import wx
-except ImportError:
-
- wxPath = ''
- basePath = ''
-
- for path in sys.path:
- if 'wx-' in path:
- dummy, newPath = os.path.split(path)
- if newPath > wxPath:
- wxPath = newPath
- basePath = dummy
-
- if not wxPath:
- raise Exception('Unable to find the wx package')
-
- sys.path.insert(0, os.path.join(basePath, wxPath))
-
-import wx
-
-print '\nUSING VERSION: %s\n'%wx.VERSION_STRING
-
-
-if hasattr(os.path, "relpath"):
- relpath = os.path.relpath # since Python 2.6
-else:
- def relpath(path, start=os.path.curdir):
- """Return a relative version of a path"""
-
- if not path:
- raise ValueError("no path specified")
-
- start_list = os.path.abspath(start).split(os.path.sep)
- path_list = os.path.abspath(path).split(os.path.sep)
-
- # Work out how much of the filepath is shared by start and path.
- i = len(os.path.commonprefix([start_list, path_list]))
-
- rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
- if not rel_list:
- return os.path.curdir
-
- return os.path.join(*rel_list)
-
-
-def format_traceback():
-
- t, v = sys.exc_info()[:2]
- message = "".join(traceback.format_exception_only(t, v)).replace("\n", " ")
- return message.strip()
-
-
-def format_method(method):
-
- method = method.strip()
-
- if "def " not in method:
- return None, None
-
- indx1, indx2, indx3 = method.index("def "), method.index("("), method.rindex(")")
- name = method[indx1+4:indx2]
- signature = method[indx2+1:indx3]
-
- if "\n" in signature:
- sig = signature.split("\n")
- params = ""
- for s in sig:
- params += s.strip() + " "
- params = params.rstrip()
- else:
- params = signature
-
- return name, params
-
-
-def analyze_params(obj, signature):
-
- params = signature.split(",")
- if "self" in params:
- params.remove("self")
- signature = ",".join(params)
-
- param_tuple = []
-
- if not params:
- return signature, param_tuple
-
- try:
- arginfo = getargspec(obj)
- except TypeError:
- arginfo = None
-
- pevals = {}
-
- if arginfo:
- args = arginfo[0]
- argsvar = arginfo[1]
-
- if arginfo[3]:
-
- dl = len(arginfo[3])
- al = len(args)
- defargs = args[al-dl:al]
- info = arginfo[3]
-
- for d, i in zip(defargs, info):
- pevals[d] = i
-
- for par in params:
- p = par.strip()
- pvalue = peval = None
-
- if "=" in p:
- all_values = p.split("=")
- pname, pvalue = all_values[0].strip(), "=".join(all_values[1:]).strip()
- pvalue = pvalue.strip()
- if pname in pevals:
- try:
- peval = unicode(pevals[pname])
- except UnicodeDecodeError:
- peval = repr(pevals[pname])
- except TypeError:
- peval = u''
- else:
- pname = p
-
- param_tuple.append((pname, pvalue, peval))
-
- return signature, param_tuple
-
-
-def get_constructor(source):
-
- description = ""
- hasComma = False
-
- for line in source.split("\n"):
-
- if '#' in line:
- line = line[0:line.index('#')].strip()
-
- if ":" in line:
- hasComma = True
- commaPos = line.index(":")
-
- if ('"""' in line or "'''" in line) and hasComma:
- break
-
- if hasComma and ' def ' in line:
- defPos = line.index(' def ')
- if defPos > commaPos:
- break
-
- description += " " + line.strip()
-
- if "):" in line or ") :" in line or ") :" in line:
- break
-
- return description
-
-
-def inspect_source(method_class, obj, source):
-
- description = get_constructor(source)
- name, params = format_method(description)
-
- if name is None:
- return
-
- signature, param_tuple = analyze_params(obj, params)
-
- method_class.arguments = param_tuple
- method_class.signature = description.strip()
-
- if "classmethod " in description or is_classmethod(obj):
- method_class.kind = object_types.CLASS_METHOD
- elif "staticmethod " in description:
- method_class.kind = object_types.STATIC_METHOD
-
-
-def is_classmethod(instancemethod):
- " Determine if an instancemethod is a classmethod. "
-
- if hasattr(instancemethod, 'im_self'):
- return instancemethod.im_self is not None
-
- return False
-
-
-def describe_func(obj, parent_class, module_name):
- """
- Describe the function object passed as argument.
- If this is a method object, the second argument will
- be passed as True.
- """
-
- try:
- name = obj.__name__
- except AttributeError:
- # Funny comtypes...
- return
-
- if name.startswith("_") and "__init__" not in name:
- return
-
- name = parent_class.name + "." + name
-
- docs = getdoc(obj)
- comments = getcomments(obj)
-
- if isfunction(obj):
- method = object_types.FUNCTION
- elif ismethod(obj):
- method = object_types.METHOD
- elif ismethoddescriptor(obj):
- method = object_types.METHOD_DESCRIPTOR
-
- if isinstance(obj, types.MethodType):
- method = object_types.INSTANCE_METHOD
-
- try:
- source_code = getsource(obj)
- except (IOError, TypeError):
- source_code = ""
-
- klass = Method(name, method)
- klass.docs = docs
-
- klass_module = getmodule(obj)
- if klass_module and klass_module.__name__ != module_name:
- klass.is_redundant = True
-
- if source_code:
- inspect_source(klass, obj, source_code)
- klass.number_lines = "%d"%len(source_code.split("\n"))
-
- if isinstance(obj, staticmethod):
- klass.method = method = object_types.STATIC_METHOD
-
- try:
- if method in [object_types.METHOD, object_types.METHOD_DESCRIPTOR, object_types.INSTANCE_METHOD]:
- code = obj.im_func.func_code
- elif method == object_types.STATIC_METHOD:
- code = obj.im_func.func_code
- else:
- code = obj.func_code
- except AttributeError:
- code = None
-
- if code is not None:
- klass.firstlineno = "%d"%code.co_firstlineno
-
- parent_class.Add(klass)
-
-
-def describe_class(obj, module_class, module_name, constants):
- """
- Describe the class object passed as argument,
- including its methods.
- """
-
- class_name = obj.__name__
-
- if class_name == "object":
- return
-
- class_name = module_class.name + "." + class_name
-
- docs = getdoc(obj)
- comments = getcomments(obj)
-
- obj_dict = obj.__dict__
-
- klass = Class(class_name, obj)
-
- count = 0
-
- for name in obj_dict:
-
- if name.startswith("_") and "__init__" not in name:
- continue
-
- if name in EXCLUDED_ATTRS:
- continue
-
- try:
- item = getattr(obj, name)
- except AttributeError:
- # Thanks to ReportLab for this funny exception...
- continue
-
- if ismodule(item):
- continue
-
- if ismemberdescriptor(item) or isgetsetdescriptor(item):
- continue
-
- if isbuiltin(item):
- count += 1
- elif ismethod(item) or isfunction(item) or ismethoddescriptor(item) or \
- isinstance(item, types.MethodType):
- count += 1
- describe_func(item, klass, module_name)
- elif isclass(item):
- count += 1
- describe_class(item, klass, module_name, constants)
- else:
- name = class_name + "." + name
- if isinstance(item, property):
- item_class = Property(name, item)
- klass.Add(item_class)
-
- item_module = getmodule(obj)
- if item_module and item_module.__name__ != module_name:
- item_class.is_redundant = True
-
- else:
- item_class = Attribute(name, type(item), item)
- klass.Add(item_class)
-
- if constants:
- item_class.is_redundant = name not in constants
-
- count += 1
-
- klass.docs = docs
- klass.comments = comments
-
- klass_module = getmodule(obj)
- if klass_module and klass_module.__name__ != module_name:
- klass.is_redundant = True
- else:
- klass.inheritance_diagram = inheritance.InheritanceDiagram([obj], klass)
-
- module_class.Add(klass)
-
- try:
- source_code = getsource(obj)
- except (IOError, TypeError):
- source_code = ""
-
- if source_code:
- description = get_constructor(source_code)
- if '(' not in description and ':' in description:
- description = description[0:description.index(':')]
-
- klass.signature = description.strip()
- klass.number_lines = '%d'%len(source_code.split("\n"))
-
-
-def describe_module(module, kind, constants=[]):
- """
- Describe the module object passed as argument
- including its classes and functions.
- """
-
- module_name = module.__name__
-
- if kind == object_types.LIBRARY:
- klass = Library(module_name)
- else:
- klass = Module(module_name, kind)
-
- klass.docs = getdoc(module)
- klass.comments = getcomments(module)
-
- klass.filename = module.__file__
- inheritance_diagram = []
-
- count = 0
-
- for name in dir(module):
-
- if name in EXCLUDED_ATTRS:
- continue
-
- obj = getattr(module, name)
-
- if ismodule(obj):
- continue
-
- if ismemberdescriptor(obj) or isgetsetdescriptor(obj):
- continue
-
- if isclass(obj):
- count += 1
- describe_class(obj, klass, module_name, constants)
-
- if obj.__module__ == module.__name__:
- inheritance_diagram.append(obj)
-
- elif isbuiltin(obj):
- count += 1
- elif ismethod(obj) or isfunction(obj) or ismethoddescriptor(obj) or \
- isinstance(obj, types.MethodType):
- count +=1
- describe_func(obj, klass, module_name)
- else:
- attribute = Attribute(module_name + "." + name, type(obj), obj)
- klass.Add(attribute)
-
- if constants:
- attribute.is_redundant = name not in constants
-
- if kind not in [object_types.PACKAGE, object_types.LIBRARY]:
- if inheritance_diagram and len(inheritance_diagram) < 20:
- klass.inheritance_diagram = inheritance.InheritanceDiagram(inheritance_diagram, klass)
-
- return klass, count
-
-
-def Import(init_name, import_name, full_process=True):
-
- directory, module_name = os.path.split(init_name)
- dirname = os.path.dirname(directory)
-
- if not full_process:
- path = list(sys.path)
- sys.path.insert(0, dirname)
-
- f = None
-
- try:
-
- f, filename, description = imp.find_module(import_name, [dirname])
- mainmod = imp.load_module(import_name, f, filename, description)
-
- except (ImportError, NameError):
-
- message = format_traceback()
- message += ' Please check that the "Import command" text box is correctly filled'
- print "Error: %s"%message
-
- if not full_process:
- sys.path = path[:]
-
- return
-
- if f:
- f.close()
-
- if not full_process:
- sys.path = path[:]
- try:
- version = mainmod.__version__
- except AttributeError:
- try:
- version = mainmod.__VERSION__
- except AttributeError:
- print "Warning: Library '%s' has no __version__ or __VERSION__ attribute. Please specify it in the 'Import command' textbox"%import_name
- return
-
- print version
-
- return mainmod
-
-
-def PrintProgress(name, looped_names):
-
- looped_names.append(name)
- if len(looped_names) == 4:
- message = ", ".join(looped_names)
- looped_names = []
- print message
-
- return looped_names
-
-
-
-def FindModuleType(filename):
-
- splitext = os.path.splitext(filename)[0]
- for extension, icon, description in MODULE_TO_ICON:
- if os.path.isfile(splitext + extension):
- return icon
-
-
-def SubImport(import_string, module, parent_class, ispkg):
-
- try:
- submod = __import__(import_string, fromlist=[module])
- except:
- # pubsub and Editra can be funny sometimes...
- message = "Unable to import module/package '%s.%s'.\n Exception was: %s"%(import_string, module, format_traceback())
- print "\nWARNING: %s\n"%message
- return None, 0
-
- if not ismodule(submod):
- return None, 0
-
- filename = getfile(submod)
-
- subpath = os.path.dirname(filename)
- if subpath not in sys.path:
- sys.path.append(subpath)
-
- if ispkg:
- kind = object_types.PACKAGE
- else:
- kind = FindModuleType(filename)
-
- constants = []
-
- if kind in [object_types.PY_MODULE, object_types.PACKAGE]:
-
- contents = open(filename, "rt").read()
- consts = CONSTANT_RE.findall(contents)
-
- for c in consts:
- if "," in c:
- c = c.split(",")
- constants.extend([v.strip() for v in c])
- else:
- constants.append(c.strip())
-
- module_class, count = describe_module(submod, kind=kind, constants=constants)
- parent_class.Add(module_class)
-
- return module_class, count
-
-
-def ToRest(import_name):
-
- sphinxDir = os.path.join(phoenixDir(), 'docs', 'sphinx')
- pickle_file = os.path.join(sphinxDir, 'wx%s.pkl'%import_name)
-
- fid = open(pickle_file, 'rb')
- library_class = cPickle.load(fid)
- fid.close()
-
- fid = open(os.path.join(sphinxDir, 'class_summary.lst'), 'rb')
- class_summary = cPickle.load(fid)
- fid.close()
-
- library_class.Walk(library_class, class_summary)
-
-
-def ModuleHunter(init_name, import_name, version):
-
- sphinxDir = os.path.join(phoenixDir(), 'docs', 'sphinx')
- pickle_file = os.path.join(sphinxDir, 'wx%s.pkl'%import_name)
-
- if os.path.isfile(pickle_file):
- ToRest(import_name)
- return
-
- path = list(sys.path)
-
- directory, module_name = os.path.split(init_name)
- path = list(sys.path)
-
- sys.path.insert(0, os.path.dirname(directory))
-
- mainmod = Import(init_name, import_name)
-
- if mainmod is None:
- return
-
- message = "Importing main library '%s'..."%import_name
- print "Message: %s"%message
-
- module_name = os.path.splitext(getfile(mainmod))[0] + ".py"
- contents = open(module_name, "rt").read()
- constants = CONSTANT_RE.findall(contents)
-
- library_class, count = describe_module(mainmod, kind=object_types.LIBRARY, constants=constants)
- library_class.name = "%s-%s"%(import_name, version)
-
- message = "Main library '%s' imported..."%library_class.name
- print "Message: %s"%message
-
- message = "Importing sub-modules and sub-packages...\n"
- print "Message: %s"%message
-
- looped_names = []
- ancestors_dict = {import_name: library_class}
-
- for importer, module_name, ispkg in pkgutil.walk_packages(path=[directory],
- prefix=import_name+".",
- onerror=lambda x: None):
-
- import_string = module_name
- splitted = module_name.split(".")
-
- fromlist = splitted[-1]
- parent_name = ".".join(splitted[0:-1])
-
- parent_class = ancestors_dict[parent_name]
- module_class, count = SubImport(import_string, fromlist, parent_class, ispkg)
-
- if module_class is None:
- continue
-
- looped_names = PrintProgress(module_name, looped_names)
-
- if module_name not in ancestors_dict:
- ancestors_dict[module_name] = module_class
-
- major, minor, micro, release = sys.version_info[0:-1]
- pythonVersion = u"%d.%d.%d-%s"%(major, minor, micro, release)
-
- library_class.python_version = pythonVersion
- library_class.Save()
-
- sys.path[:] = path # restore
-
- fid = open(pickle_file, 'wb')
- cPickle.dump(library_class, fid)
- fid.close()
-
- ToRest(import_name)
-
-
-if __name__ == "__main__":
-
- argv = sys.argv[1:]
-
- if len(argv) == 2:
- init_name, import_name = argv
- Import(init_name, import_name, full_process=False)
- else:
- init_name, import_name, version, save_dir = argv
- ModuleHunter(init_name, import_name, version, save_dir)
-
-
-
+# -*- coding: utf-8 -*-
+
+# Describe classes, methods and functions in a module.
+# Works with user-defined modules, all Python library
+# modules, including built-in modules.
+
+import os
+import sys
+import glob
+import types
+import cPickle
+import imp
+import traceback
+import pkgutil
+
+import __builtin__
+
+from buildtools.config import phoenixDir
+
+from inspect import getargspec, ismodule, getdoc, getmodule, getcomments, isfunction
+from inspect import ismethoddescriptor, getsource, ismemberdescriptor, isgetsetdescriptor
+from inspect import isbuiltin, isclass, getfile, ismethod
+
+from librarydescription import Library, Module, Class
+from librarydescription import Method, Property, Attribute
+
+import inheritance
+
+from constants import object_types, EXCLUDED_ATTRS, MODULE_TO_ICON
+from constants import CONSTANT_RE
+
+reload(sys)
+sys.setdefaultencoding("utf-8")
+
+try:
+ import wx
+except ImportError:
+
+ wxPath = ''
+ basePath = ''
+
+ for path in sys.path:
+ if 'wx-' in path:
+ dummy, newPath = os.path.split(path)
+ if newPath > wxPath:
+ wxPath = newPath
+ basePath = dummy
+
+ if not wxPath:
+ raise Exception('Unable to find the wx package')
+
+ sys.path.insert(0, os.path.join(basePath, wxPath))
+
+import wx
+
+print '\nUSING VERSION: %s\n'%wx.VERSION_STRING
+
+
+if hasattr(os.path, "relpath"):
+ relpath = os.path.relpath # since Python 2.6
+else:
+ def relpath(path, start=os.path.curdir):
+ """Return a relative version of a path"""
+
+ if not path:
+ raise ValueError("no path specified")
+
+ start_list = os.path.abspath(start).split(os.path.sep)
+ path_list = os.path.abspath(path).split(os.path.sep)
+
+ # Work out how much of the filepath is shared by start and path.
+ i = len(os.path.commonprefix([start_list, path_list]))
+
+ rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
+ if not rel_list:
+ return os.path.curdir
+
+ return os.path.join(*rel_list)
+
+
+def format_traceback():
+
+ t, v = sys.exc_info()[:2]
+ message = "".join(traceback.format_exception_only(t, v)).replace("\n", " ")
+ return message.strip()
+
+
+def format_method(method):
+
+ method = method.strip()
+
+ if "def " not in method:
+ return None, None
+
+ indx1, indx2, indx3 = method.index("def "), method.index("("), method.rindex(")")
+ name = method[indx1+4:indx2]
+ signature = method[indx2+1:indx3]
+
+ if "\n" in signature:
+ sig = signature.split("\n")
+ params = ""
+ for s in sig:
+ params += s.strip() + " "
+ params = params.rstrip()
+ else:
+ params = signature
+
+ return name, params
+
+
+def analyze_params(obj, signature):
+
+ params = signature.split(",")
+ if "self" in params:
+ params.remove("self")
+ signature = ",".join(params)
+
+ param_tuple = []
+
+ if not params:
+ return signature, param_tuple
+
+ try:
+ arginfo = getargspec(obj)
+ except TypeError:
+ arginfo = None
+
+ pevals = {}
+
+ if arginfo:
+ args = arginfo[0]
+ argsvar = arginfo[1]
+
+ if arginfo[3]:
+
+ dl = len(arginfo[3])
+ al = len(args)
+ defargs = args[al-dl:al]
+ info = arginfo[3]
+
+ for d, i in zip(defargs, info):
+ pevals[d] = i
+
+ for par in params:
+ p = par.strip()
+ pvalue = peval = None
+
+ if "=" in p:
+ all_values = p.split("=")
+ pname, pvalue = all_values[0].strip(), "=".join(all_values[1:]).strip()
+ pvalue = pvalue.strip()
+ if pname in pevals:
+ try:
+ peval = unicode(pevals[pname])
+ except UnicodeDecodeError:
+ peval = repr(pevals[pname])
+ except TypeError:
+ peval = u''
+ else:
+ pname = p
+
+ param_tuple.append((pname, pvalue, peval))
+
+ return signature, param_tuple
+
+
+def get_constructor(source):
+
+ description = ""
+ hasComma = False
+
+ for line in source.split("\n"):
+
+ if '#' in line:
+ line = line[0:line.index('#')].strip()
+
+ if ":" in line:
+ hasComma = True
+ commaPos = line.index(":")
+
+ if ('"""' in line or "'''" in line) and hasComma:
+ break
+
+ if hasComma and ' def ' in line:
+ defPos = line.index(' def ')
+ if defPos > commaPos:
+ break
+
+ description += " " + line.strip()
+
+ if "):" in line or ") :" in line or ") :" in line:
+ break
+
+ return description
+
+
+def inspect_source(method_class, obj, source):
+
+ description = get_constructor(source)
+ name, params = format_method(description)
+
+ if name is None:
+ return
+
+ signature, param_tuple = analyze_params(obj, params)
+
+ method_class.arguments = param_tuple
+ method_class.signature = description.strip()
+
+ if "classmethod " in description or is_classmethod(obj):
+ method_class.kind = object_types.CLASS_METHOD
+ elif "staticmethod " in description:
+ method_class.kind = object_types.STATIC_METHOD
+
+
+def is_classmethod(instancemethod):
+ " Determine if an instancemethod is a classmethod. "
+
+ if hasattr(instancemethod, 'im_self'):
+ return instancemethod.im_self is not None
+
+ return False
+
+
+def describe_func(obj, parent_class, module_name):
+ """
+ Describe the function object passed as argument.
+ If this is a method object, the second argument will
+ be passed as True.
+ """
+
+ try:
+ name = obj.__name__
+ except AttributeError:
+ # Funny comtypes...
+ return
+
+ if name.startswith("_") and "__init__" not in name:
+ return
+
+ name = parent_class.name + "." + name
+
+ docs = getdoc(obj)
+ comments = getcomments(obj)
+
+ if isfunction(obj):
+ method = object_types.FUNCTION
+ elif ismethod(obj):
+ method = object_types.METHOD
+ elif ismethoddescriptor(obj):
+ method = object_types.METHOD_DESCRIPTOR
+
+ if isinstance(obj, types.MethodType):
+ method = object_types.INSTANCE_METHOD
+
+ try:
+ source_code = getsource(obj)
+ except (IOError, TypeError):
+ source_code = ""
+
+ klass = Method(name, method)
+ klass.docs = docs
+
+ klass_module = getmodule(obj)
+ if klass_module and klass_module.__name__ != module_name:
+ klass.is_redundant = True
+
+ if source_code:
+ inspect_source(klass, obj, source_code)
+ klass.number_lines = "%d"%len(source_code.split("\n"))
+
+ if isinstance(obj, staticmethod):
+ klass.method = method = object_types.STATIC_METHOD
+
+ try:
+ if method in [object_types.METHOD, object_types.METHOD_DESCRIPTOR, object_types.INSTANCE_METHOD]:
+ code = obj.im_func.func_code
+ elif method == object_types.STATIC_METHOD:
+ code = obj.im_func.func_code
+ else:
+ code = obj.func_code
+ except AttributeError:
+ code = None
+
+ if code is not None:
+ klass.firstlineno = "%d"%code.co_firstlineno
+
+ parent_class.Add(klass)
+
+
+def describe_class(obj, module_class, module_name, constants):
+ """
+ Describe the class object passed as argument,
+ including its methods.
+ """
+
+ class_name = obj.__name__
+
+ if class_name == "object":
+ return
+
+ class_name = module_class.name + "." + class_name
+
+ docs = getdoc(obj)
+ comments = getcomments(obj)
+
+ obj_dict = obj.__dict__
+
+ klass = Class(class_name, obj)
+
+ count = 0
+
+ for name in obj_dict:
+
+ if name.startswith("_") and "__init__" not in name:
+ continue
+
+ if name in EXCLUDED_ATTRS:
+ continue
+
+ try:
+ item = getattr(obj, name)
+ except AttributeError:
+ # Thanks to ReportLab for this funny exception...
+ continue
+
+ if ismodule(item):
+ continue
+
+ if ismemberdescriptor(item) or isgetsetdescriptor(item):
+ continue
+
+ if isbuiltin(item):
+ count += 1
+ elif ismethod(item) or isfunction(item) or ismethoddescriptor(item) or \
+ isinstance(item, types.MethodType):
+ count += 1
+ describe_func(item, klass, module_name)
+ elif isclass(item):
+ count += 1
+ describe_class(item, klass, module_name, constants)
+ else:
+ name = class_name + "." + name
+ if isinstance(item, property):
+ item_class = Property(name, item)
+ klass.Add(item_class)
+
+ item_module = getmodule(obj)
+ if item_module and item_module.__name__ != module_name:
+ item_class.is_redundant = True
+
+ else:
+ item_class = Attribute(name, type(item), item)
+ klass.Add(item_class)
+
+ if constants:
+ item_class.is_redundant = name not in constants
+
+ count += 1
+
+ klass.docs = docs
+ klass.comments = comments
+
+ klass_module = getmodule(obj)
+ if klass_module and klass_module.__name__ != module_name:
+ klass.is_redundant = True
+ else:
+ klass.inheritance_diagram = inheritance.InheritanceDiagram([obj], klass)
+
+ module_class.Add(klass)
+
+ try:
+ source_code = getsource(obj)
+ except (IOError, TypeError):
+ source_code = ""
+
+ if source_code:
+ description = get_constructor(source_code)
+ if '(' not in description and ':' in description:
+ description = description[0:description.index(':')]
+
+ klass.signature = description.strip()
+ klass.number_lines = '%d'%len(source_code.split("\n"))
+
+
+def describe_module(module, kind, constants=[]):
+ """
+ Describe the module object passed as argument
+ including its classes and functions.
+ """
+
+ module_name = module.__name__
+
+ if kind == object_types.LIBRARY:
+ klass = Library(module_name)
+ else:
+ klass = Module(module_name, kind)
+
+ klass.docs = getdoc(module)
+ klass.comments = getcomments(module)
+
+ klass.filename = module.__file__
+ inheritance_diagram = []
+
+ count = 0
+
+ for name in dir(module):
+
+ if name in EXCLUDED_ATTRS:
+ continue
+
+ obj = getattr(module, name)
+
+ if ismodule(obj):
+ continue
+
+ if ismemberdescriptor(obj) or isgetsetdescriptor(obj):
+ continue
+
+ if isclass(obj):
+ count += 1
+ describe_class(obj, klass, module_name, constants)
+
+ if obj.__module__ == module.__name__:
+ inheritance_diagram.append(obj)
+
+ elif isbuiltin(obj):
+ count += 1
+ elif ismethod(obj) or isfunction(obj) or ismethoddescriptor(obj) or \
+ isinstance(obj, types.MethodType):
+ count +=1
+ describe_func(obj, klass, module_name)
+ else:
+ attribute = Attribute(module_name + "." + name, type(obj), obj)
+ klass.Add(attribute)
+
+ if constants:
+ attribute.is_redundant = name not in constants
+
+ if kind not in [object_types.PACKAGE, object_types.LIBRARY]:
+ if inheritance_diagram and len(inheritance_diagram) < 20:
+ klass.inheritance_diagram = inheritance.InheritanceDiagram(inheritance_diagram, klass)
+
+ return klass, count
+
+
+def Import(init_name, import_name, full_process=True):
+
+ directory, module_name = os.path.split(init_name)
+ dirname = os.path.dirname(directory)
+
+ if not full_process:
+ path = list(sys.path)
+ sys.path.insert(0, dirname)
+
+ f = None
+
+ try:
+
+ f, filename, description = imp.find_module(import_name, [dirname])
+ mainmod = imp.load_module(import_name, f, filename, description)
+
+ except (ImportError, NameError):
+
+ message = format_traceback()
+ message += ' Please check that the "Import command" text box is correctly filled'
+ print "Error: %s"%message
+
+ if not full_process:
+ sys.path = path[:]
+
+ return
+
+ if f:
+ f.close()
+
+ if not full_process:
+ sys.path = path[:]
+ try:
+ version = mainmod.__version__
+ except AttributeError:
+ try:
+ version = mainmod.__VERSION__
+ except AttributeError:
+ print "Warning: Library '%s' has no __version__ or __VERSION__ attribute. Please specify it in the 'Import command' textbox"%import_name
+ return
+
+ print version
+
+ return mainmod
+
+
+def PrintProgress(name, looped_names):
+
+ looped_names.append(name)
+ if len(looped_names) == 4:
+ message = ", ".join(looped_names)
+ looped_names = []
+ print message
+
+ return looped_names
+
+
+
+def FindModuleType(filename):
+
+ splitext = os.path.splitext(filename)[0]
+ for extension, icon, description in MODULE_TO_ICON:
+ if os.path.isfile(splitext + extension):
+ return icon
+
+
+def SubImport(import_string, module, parent_class, ispkg):
+
+ try:
+ submod = __import__(import_string, fromlist=[module])
+ except:
+ # pubsub and Editra can be funny sometimes...
+ message = "Unable to import module/package '%s.%s'.\n Exception was: %s"%(import_string, module, format_traceback())
+ print "\nWARNING: %s\n"%message
+ return None, 0
+
+ if not ismodule(submod):
+ return None, 0
+
+ filename = getfile(submod)
+
+ subpath = os.path.dirname(filename)
+ if subpath not in sys.path:
+ sys.path.append(subpath)
+
+ if ispkg:
+ kind = object_types.PACKAGE
+ else:
+ kind = FindModuleType(filename)
+
+ constants = []
+
+ if kind in [object_types.PY_MODULE, object_types.PACKAGE]:
+
+ contents = open(filename, "rt").read()
+ consts = CONSTANT_RE.findall(contents)
+
+ for c in consts:
+ if "," in c:
+ c = c.split(",")
+ constants.extend([v.strip() for v in c])
+ else:
+ constants.append(c.strip())
+
+ module_class, count = describe_module(submod, kind=kind, constants=constants)
+ parent_class.Add(module_class)
+
+ return module_class, count
+
+
+def ToRest(import_name):
+
+ sphinxDir = os.path.join(phoenixDir(), 'docs', 'sphinx')
+ pickle_file = os.path.join(sphinxDir, 'wx%s.pkl'%import_name)
+
+ fid = open(pickle_file, 'rb')
+ library_class = cPickle.load(fid)
+ fid.close()
+
+ fid = open(os.path.join(sphinxDir, 'class_summary.lst'), 'rb')
+ class_summary = cPickle.load(fid)
+ fid.close()
+
+ library_class.Walk(library_class, class_summary)
+
+
+def ModuleHunter(init_name, import_name, version):
+
+ sphinxDir = os.path.join(phoenixDir(), 'docs', 'sphinx')
+ pickle_file = os.path.join(sphinxDir, 'wx%s.pkl'%import_name)
+
+ if os.path.isfile(pickle_file):
+ ToRest(import_name)
+ return
+
+ path = list(sys.path)
+
+ directory, module_name = os.path.split(init_name)
+ path = list(sys.path)
+
+ sys.path.insert(0, os.path.dirname(directory))
+
+ mainmod = Import(init_name, import_name)
+
+ if mainmod is None:
+ return
+
+ message = "Importing main library '%s'..."%import_name
+ print "Message: %s"%message
+
+ module_name = os.path.splitext(getfile(mainmod))[0] + ".py"
+ contents = open(module_name, "rt").read()
+ constants = CONSTANT_RE.findall(contents)
+
+ library_class, count = describe_module(mainmod, kind=object_types.LIBRARY, constants=constants)
+ library_class.name = "%s-%s"%(import_name, version)
+
+ message = "Main library '%s' imported..."%library_class.name
+ print "Message: %s"%message
+
+ message = "Importing sub-modules and sub-packages...\n"
+ print "Message: %s"%message
+
+ looped_names = []
+ ancestors_dict = {import_name: library_class}
+
+ for importer, module_name, ispkg in pkgutil.walk_packages(path=[directory],
+ prefix=import_name+".",
+ onerror=lambda x: None):
+
+ import_string = module_name
+ splitted = module_name.split(".")
+
+ fromlist = splitted[-1]
+ parent_name = ".".join(splitted[0:-1])
+
+ parent_class = ancestors_dict[parent_name]
+ module_class, count = SubImport(import_string, fromlist, parent_class, ispkg)
+
+ if module_class is None:
+ continue
+
+ looped_names = PrintProgress(module_name, looped_names)
+
+ if module_name not in ancestors_dict:
+ ancestors_dict[module_name] = module_class
+
+ major, minor, micro, release = sys.version_info[0:-1]
+ pythonVersion = u"%d.%d.%d-%s"%(major, minor, micro, release)
+
+ library_class.python_version = pythonVersion
+ library_class.Save()
+
+ sys.path[:] = path # restore
+
+ fid = open(pickle_file, 'wb')
+ cPickle.dump(library_class, fid)
+ fid.close()
+
+ ToRest(import_name)
+
+
+if __name__ == "__main__":
+
+ argv = sys.argv[1:]
+
+ if len(argv) == 2:
+ init_name, import_name = argv
+ Import(init_name, import_name, full_process=False)
+ else:
+ init_name, import_name, version, save_dir = argv
+ ModuleHunter(init_name, import_name, version, save_dir)
+
+
+
\ No newline at end of file
diff --git a/sphinxtools/postprocess.py b/sphinxtools/postprocess.py
index 84292501..37c7e547 100644
--- a/sphinxtools/postprocess.py
+++ b/sphinxtools/postprocess.py
@@ -1,725 +1,725 @@
-# -*- coding: utf-8 -*-
-#!/usr/bin/env python
-
-#---------------------------------------------------------------------------
-# Name: sphinxtools/postprocess.py
-# Author: Andrea Gavana
-#
-# Created: 30-Nov-2010
-# Copyright: (c) 2011 by Total Control Software
-# License: wxWindows License
-#---------------------------------------------------------------------------
-
-# Standard library imports
-import os
-import re
-import cPickle
-import glob
-import random
-import subprocess
-
-# Phoenix-specific imports
-import templates
-from buildtools.config import copyIfNewer, writeIfChanged, newer
-
-from utilities import Wx2Sphinx
-from constants import HTML_REPLACE, TODAY, SPHINXROOT, SECTIONS_EXCLUDE
-from constants import CONSTANT_INSTANCES, WIDGETS_IMAGES_ROOT, SPHINX_IMAGES_ROOT
-
-
-def MakeHeadings():
- """
- Generates the "headings.inc" file containing the substitution reference
- for the small icons used in the Sphinx titles, sub-titles and so on.
-
- The small icons are stored into the ``SPHINX_IMAGES_ROOT`` folder.
-
- .. note:: The "headings.inc" file is created in the ``SPHINXROOT`` folder
- (see `sphinxtools/constants.py`).
- """
-
- images = glob.glob(SPHINX_IMAGES_ROOT + '/*.png')
- images.sort()
-
- heading_file = os.path.join(SPHINXROOT, 'headings.inc')
-
- text = ""
- for img in images:
- name = os.path.split(os.path.splitext(img)[0])[1]
- rel_path_index = img.find('_static')
- rel_path = img[rel_path_index:]
-
- width = ('overload' in name and [16] or [32])[0]
- text += templates.TEMPLATE_HEADINGS % (name, os.path.normpath(rel_path), width)
-
- writeIfChanged(heading_file, text)
-
-# ----------------------------------------------------------------------- #
-
-def SphinxIndexes(sphinxDir):
- """
- This is the main function called after the `etg` process has finished.
-
- It class other functions to generate the standalone functions page, the
- main class index and some clean-up/maintenance of the generated ReST
- files.
- """
-
- pklfiles = glob.glob(sphinxDir + '/*.pkl')
-
- for file in pklfiles:
- if file.endswith('functions.pkl'):
- ReformatFunctions(file)
- elif 'classindex' in file:
- MakeClassIndex(sphinxDir, file)
-
- BuildEnumsAndMethods(sphinxDir)
-
-
-# ----------------------------------------------------------------------- #
-
-def BuildEnumsAndMethods(sphinxDir):
- """
- This function does some clean-up/refactoring of the generated ReST files by:
-
- 1. Removing the `:meth:` reference to Enums, as they are not methods, and replacing
- it with the `:ref:` role. This information is unfortunately not known when the
- main `etgtools/sphinx_generator.py` runs.
- 2. Removing the "Perl note" stuff from the text (and we should clean up the
- wxWidgets docs at the source to remove the wxPython notes as well).
- 3. Substituting the `:ref:` role for unreferenced classes (these may be classes yet
- to be ported to Phoenix or C++-specific classes which will never be ported to
- Phoenix) with simple backticks.
- 4. Some cleanup.
- """
-
- fid = open(os.path.join(sphinxDir, 'class_summary.lst'), 'rb')
- class_summary = cPickle.load(fid)
- fid.close()
-
- unreferenced_classes = {}
-
- textfiles = glob.glob(sphinxDir + '/*.txt')
- enum_files = glob.glob(sphinxDir + '/*.enumeration.txt')
-
- enum_base = [os.path.split(os.path.splitext(enum)[0])[1] for enum in enum_files]
- enum_base = [enum.replace('.enumeration', '') for enum in enum_base]
-
- enum_dict = {}
-
- for enum in enum_base:
- enum_dict[':meth:`%s`'%enum] = ':ref:`%s`'%enum
-
- for input in textfiles:
-
- fid = open(input, 'rt')
- orig_text = text = fid.read()
- fid.close()
-
- for old, new in enum_dict.items():
- text = text.replace(old, new)
-
- widget_name = os.path.split(os.path.splitext(input)[0])[1]
-
- if widget_name in SECTIONS_EXCLUDE:
- start, end = SECTIONS_EXCLUDE[widget_name]
- if start in text and end in text:
- lindex = text.index(start)
- rindex = text.index(end)
- text = text[0:lindex] + text[rindex:]
-
- # Replace the "Perl Note" stuff, we don't need it
- newtext = ''
- for line in text.splitlines():
- if 'perl note' in line.lower():
- continue
- newtext += line + '\n'
-
- text = newtext
-
- text = FindInherited(input, class_summary, enum_base, text)
- text, unreferenced_classes = RemoveUnreferenced(input, class_summary, enum_base, unreferenced_classes, text)
-
- text = text.replace('wx``', '``')
- text = text.replace('wx.``', '``')
- text = text.replace('non-NULL', 'not ``None``')
- text = text.replace(',,', ',').replace(', ,', ',')
-
- if 'DocstringsGuidelines' not in input:
- # Leave the DocstringsGuidelines.txt file alone on these ones
- text = text.replace(':note:', '.. note::')
- text = text.replace(':see:', '.. seealso::')
-
- text = text.replace('`String`&', 'string')
- text = text.replace('See also\n', '.. seealso:: ')
-
- # Avoid Sphinx warnings on wx.TreeCtrl
- text = text.replace('**( `', '** ( `')
- # Replace EmptyString stuff
- text = text.replace('EmptyString', "''")
-
- # Replace ArrayXXX stuff...
-
- for cpp in ['ArrayString()', 'ArrayInt()', 'ArrayDouble()']:
- text = text.replace(cpp, '[]')
-
- text = TooltipsOnInheritance(text, class_summary)
-
- if text != orig_text:
- fid = open(input, 'wt')
- fid.write(text)
- fid.close()
-
- if not unreferenced_classes:
- return
-
- warn = '\n\nWARNING: there are %d instances of referenced classes/enums, via the `:ref:` role, which\n' \
- 'are not in the list of available classes (these may be classes yet to be ported to Phoenix\n' \
- 'or C++-specific classes which will never be ported to Phoenix).\n\n' \
- '*sphinxgenerator* has replaced the `:ref:` role for them with simple backticks, i.e.:\n\n' \
- ' :ref:`MissingClass` ==> `MissingClass`\n\n' \
- 'to avoid warning from Sphinx and Docutils, and saved a list of their occurrences into\n' \
- 'the text file "unreferenced_classes.inc" together with the ReST file names where they\n' \
- 'appear.\n\n'
-
- keys = unreferenced_classes.keys()
- keys.sort()
-
- fid = open(os.path.join(SPHINXROOT, 'unreferenced_classes.inc'), 'wt')
- fid.write('\n')
- fid.write('='*50 + ' ' + '='*50 + '\n')
- fid.write('%-50s %-50s\n'%('Reference', 'File Name(s)'))
- fid.write('='*50 + ' ' + '='*50 + '\n')
-
- for key in keys:
- fid.write('%-50s %-50s\n'%(key, ', '.join(unreferenced_classes[key])))
-
- fid.write('='*50 + ' ' + '='*50 + '\n')
- fid.close()
-
- print warn%(len(keys))
-
-
-# ----------------------------------------------------------------------- #
-
-def FindInherited(input, class_summary, enum_base, text):
-
- # Malformed inter-links
- regex = re.findall(r'\S:meth:\S+', text)
- for regs in regex:
- newreg = regs[0] + ' ' + regs[1:]
- text = text.replace(regs, newreg)
-
- regex = re.findall(r':meth:\S+', text)
-
- for regs in regex:
-
- hasdot = '.' in regs
- hastilde = '~' in regs
-
- if regs.count('`') < 2:
- continue
-
- full_name = regs[regs.index('`')+1:regs.rindex('`')]
- full_name = full_name.replace('~', '')
-
- curr_class = dummy = os.path.split(os.path.splitext(input)[0])[1]
-
- if hasdot:
- newstr = full_name.split('.')
- curr_class, meth_name = '.'.join(newstr[0:-1]), newstr[-1]
- else:
- meth_name = full_name
-
- if meth_name == curr_class:
- newtext = ':ref:`%s`'%meth_name
- text = text.replace(regs, newtext, 1)
- continue
-
-
-## elif meth_name in enum_base:
-## newtext = ':ref:`%s`'%meth_name
-## text = text.replace(regs, newtext, 1)
-## continue
-
-
- if meth_name in CONSTANT_INSTANCES:
- text = text.replace(regs, '``%s``'%meth_name, 1)
- continue
-
- if curr_class not in class_summary:
- continue
-
- methods, bases, short_description = class_summary[curr_class]
-
- if meth_name in methods:
- continue
-
- newstr = ''
-
- for cls in bases:
- if cls not in class_summary:
- continue
-
- submethods, subbases, subshort = class_summary[cls]
-
- if meth_name in submethods:
- if not hasdot:
- newstr = ':meth:`~%s.%s`'%(cls, meth_name)
- elif not hastilde:
- newstr = ':meth:`%s.%s`'%(cls, meth_name)
- elif hasdot:
- newstr = ':meth:`~%s.%s`'%(cls, meth_name)
- else:
- newstr = ':meth:`%s.%s`'%(cls, meth_name)
-
- break
-
- if newstr:
- text = text.replace(regs, newstr, 1)
-
- return text
-
-
-# ----------------------------------------------------------------------- #
-
-def RemoveUnreferenced(input, class_summary, enum_base, unreferenced_classes, text):
-
- regex = re.findall(':ref:`(.*?)`', text)
-
- for reg in regex:
- if reg in class_summary or reg in enum_base:
- continue
-
- if ' ' in reg or '-' in reg:
- # Leave the items with spaces/dash alone, as they are
- # Overview pages
- continue
-
- if reg not in unreferenced_classes:
- unreferenced_classes[reg] = []
-
- split = os.path.split(input)[1]
- if split not in unreferenced_classes[reg]:
- unreferenced_classes[reg].append(split)
-
- text = text.replace(':ref:`%s`'%reg, '`%s`'%reg, 1)
-
- return text, unreferenced_classes
-
-
-# ----------------------------------------------------------------------- #
-
-def ReformatFunctions(file):
-
- text_file = os.path.splitext(file)[0] + '.txt'
- local_file = os.path.split(file)[1]
-
- if not newer(file, text_file):
- return
-
- fid = open(file, 'rb')
- functions = cPickle.load(fid)
- fid.close()
-
- if local_file.count('.') == 1:
- # Core functions
- label = 'Core'
- else:
- label = local_file.split('.')[0:-2][0]
-
- names = functions.keys()
- names = [name.lower() for name in names]
- names.sort()
-
- text = templates.TEMPLATE_FUNCTION_SUMMARY % (label, label)
-
- letters = []
- for fun in names:
- upper = fun[0].upper()
- if upper not in letters:
- letters.append(upper)
-
- text += ' | '.join([':ref:`%s <%s %s>`'%(letter, label, letter) for letter in letters])
- text += '\n\n\n'
-
- names = functions.keys()
- names = sorted(names, key=str.lower)
-
- for letter in letters:
- text += '.. _%s %s:\n\n%s\n^\n\n'%(label, letter, letter)
- for fun in names:
- if fun[0].upper() != letter:
- continue
-
- text += '* :func:`%s`\n'%fun
-
- text += '\n\n'
-
- text += 'Functions\n=============\n\n'
-
- for fun in names:
- text += functions[fun] + '\n'
-
- writeIfChanged(text_file, text)
-
-# ----------------------------------------------------------------------- #
-
-def MakeClassIndex(sphinxDir, file):
-
- text_file = os.path.splitext(file)[0] + '.txt'
- local_file = os.path.split(file)[1]
-
- if not newer(file, text_file):
- return
-
- fid = open(file, 'rb')
- classes = cPickle.load(fid)
- fid.close()
-
- if local_file.count('.') == 1:
- # Core functions
- label = 'Core'
- module = ''
- enumDots = 1
- else:
- label = local_file.split('.')[0:-2][0]
- module = label
- enumDots = 2
-
- enum_files = glob.glob(sphinxDir + '/%s*.enumeration.txt'%module)
- enum_base = [os.path.split(os.path.splitext(enum)[0])[1] for enum in enum_files]
-
- names = classes.keys()
- names.sort()
-
- text = ''
- if module:
- text += '\n\n.. module:: %s\n\n'%module
-
- text += templates.TEMPLATE_CLASS_INDEX % (label, label)
-
- text += 80*'=' + ' ' + 80*'=' + '\n'
- text += '%-80s **Short Description**\n'%'**Class**'
- text += 80*'=' + ' ' + 80*'=' + '\n'
-
- for cls in names:
- text += '%-80s %s\n'%(':ref:`%s`'%Wx2Sphinx(cls)[1], classes[cls])
-
- text += 80*'=' + ' ' + 80*'=' + '\n\n'
-
- contents = []
- for cls in names:
- contents.append(Wx2Sphinx(cls)[1])
-
- for enum in enum_base:
- if enum.count('.') == enumDots:
- contents.append(enum)
-
- contents.sort()
-
- toctree = ''
- for item in contents:
- toctree += ' %s\n'%item
-
- text += templates.TEMPLATE_TOCTREE%toctree
-
- writeIfChanged(text_file, text)
-
-
-# ----------------------------------------------------------------------- #
-
-def GenGallery():
-
- link = ''
-
- link_template = """\
-
%s
-
-
-
-
-
- """
-
- image_folder = WIDGETS_IMAGES_ROOT
- platforms = ['wxmsw', 'wxgtk', 'wxmac']
-
- image_files = {}
-
- pwd = os.getcwd()
-
- for folder in platforms:
- plat_folder = os.path.join(image_folder, folder)
- os.chdir(plat_folder)
-
- image_files[folder] = glob.glob('*.png')
-
- os.chdir(pwd)
-
- txt_files = glob.glob(SPHINXROOT + '/*.txt')
- html_files = {}
-
- for text in txt_files:
- simple = os.path.split(os.path.splitext(text)[0])[1]
- possible = simple.split('.')[-1]
- possible = possible.lower()
- html_files[possible + '.png'] = simple + '.html'
-
- keys = html_files.keys()
- keys.sort()
-
- text = ''
-
- for key in keys:
- possible_png = key
- html = html_files[possible_png]
-
- rand_list = range(3)
- random.shuffle(rand_list)
-
- for plat_index in rand_list:
- platform = platforms[plat_index]
- plat_images = image_files[platform]
-
- if possible_png in plat_images:
- text += link_template%(html, os.path.splitext(html)[0], html, platform, possible_png, os.path.splitext(html)[0])
- text += '\n'
- break
-
- gallery = os.path.join(SPHINXROOT, '_templates', 'gallery.html')
- writeIfChanged(gallery, templates.TEMPLATE_GALLERY % text)
-
-
-# ----------------------------------------------------------------------- #
-
-def AddPrettyTable(text):
- """ Unused at the moment. """
-
- newtext = """
-
"""
- newtext2 = """
- """
-
- text = text.replace('', newtext)
- text = text.replace('', newtext2)
-
- othertext = """class="pretty-table">"""
-
- text = text.replace('class="docutils">', othertext)
- text = text.replace('class="last docutils">', othertext)
-
- return text
-
-
-# ----------------------------------------------------------------------- #
-
-def ClassToFile(line):
-
- if '–' not in line:
- return line
-
- if 'href' in line and '' in line and '(' in line and ')' in line:
- indx1 = line.index('href=')
- if 'title=' in line:
- indx2 = line.rindex('title=')
- paramdesc = line[indx1+6:indx2-2]
-
- if '.html#' in paramdesc:
- newparamdesc = paramdesc[:]
- lower = paramdesc.index('#') + 1
-
- letter = paramdesc[lower]
- if letter.isupper():
- newparamdesc = newparamdesc[0:lower] + letter.lower() + newparamdesc[lower+1:]
- newparamdesc = newparamdesc.replace(letter, letter.lower(), 1)
- line = line.replace(paramdesc, newparamdesc)
-
- return line
-
-
-# ----------------------------------------------------------------------- #
-
-def AddJavaScript(text):
-
- jsCode = """\
-
- """
-
- index = text.rfind('