diff --git a/docs/sphinx/rest_substitutions/overviews/command_overview.rst b/docs/sphinx/rest_substitutions/overviews/command_overview.rst index 508b7c75..51bf2d60 100644 --- a/docs/sphinx/rest_substitutions/overviews/command_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/command_overview.rst @@ -1,65 +1,65 @@ -.. include:: headings.inc - - -.. _command overview: - -================================================= -|phoenix_title| **Command Overview** -================================================= - - -:class:`Command` is a base class for modelling an application command, which is an action usually -performed by selecting a menu item, pressing a toolbar button or any other means provided by -the application to change the data or view. - -Instead of the application functionality being scattered around if statements and functions in -a way that may be hard to read and maintain, the functionality for a command is explicitly represented -as an object which can be manipulated by a framework or application. - -When a user interface event occurs, the application submits a command to a :class:`CommandProcessor` -object to execute and store. - -The wxPython document/view framework handles Undo and Redo by use of :class:`Command` and :class:`CommandProcessor` -objects. You might find further uses for :class:`Command`, such as implementing a macro facility that -stores, loads and replays commands. - -An application can derive a new class for every command, or, more likely, use one class parameterized -with an integer or string command identifier. - - -.. _commandprocessor overview: - -================================================= -|phoenix_title| **CommandProcessor Overview** -================================================= - - -:class:`CommandProcessor` is a class that maintains a history of :class:`Command` instances, with -undo/redo functionality built-in. Derive a new class from this if you want different behaviour. - - -.. _filehistory overview: - -================================================= -|phoenix_title| **FileHistory Overview** -================================================= - -:class:`FileHistory` encapsulates functionality to record the last few files visited, and to allow -the user to quickly load these files using the list appended to the File menu. Although :class:`FileHistory` -is used by :class:`DocManager`, it can be used independently. You may wish to derive from it to allow -different behaviour, such as popping up a scrolling list of files. - -By calling :meth:`FileHistory.UseMenu` you can associate a file menu with the file history. The menu will -then be used for appending filenames that are added to the history. - -.. note:: - - Please notice that currently if the history already contained filenames when UseMenu() is called (e.g. when - initializing a second MDI child frame), the menu is not automatically initialized with the existing filenames - in the history and so you need to call :meth:`FileHistory.AddFilesToMenu` after UseMenu() explicitly in order - to initialize the menu with the existing list of MRU files (otherwise an assertion failure is raised in debug builds). - -The filenames are appended using menu identifiers in the range ``ID_FILE1`` to ``ID_FILE9``. - - - +.. include:: headings.inc + + +.. _command overview: + +================================================= +|phoenix_title| **Command Overview** +================================================= + + +:class:`Command` is a base class for modelling an application command, which is an action usually +performed by selecting a menu item, pressing a toolbar button or any other means provided by +the application to change the data or view. + +Instead of the application functionality being scattered around if statements and functions in +a way that may be hard to read and maintain, the functionality for a command is explicitly represented +as an object which can be manipulated by a framework or application. + +When a user interface event occurs, the application submits a command to a :class:`CommandProcessor` +object to execute and store. + +The wxPython document/view framework handles Undo and Redo by use of :class:`Command` and :class:`CommandProcessor` +objects. You might find further uses for :class:`Command`, such as implementing a macro facility that +stores, loads and replays commands. + +An application can derive a new class for every command, or, more likely, use one class parameterized +with an integer or string command identifier. + + +.. _commandprocessor overview: + +================================================= +|phoenix_title| **CommandProcessor Overview** +================================================= + + +:class:`CommandProcessor` is a class that maintains a history of :class:`Command` instances, with +undo/redo functionality built-in. Derive a new class from this if you want different behaviour. + + +.. _filehistory overview: + +================================================= +|phoenix_title| **FileHistory Overview** +================================================= + +:class:`FileHistory` encapsulates functionality to record the last few files visited, and to allow +the user to quickly load these files using the list appended to the File menu. Although :class:`FileHistory` +is used by :class:`DocManager`, it can be used independently. You may wish to derive from it to allow +different behaviour, such as popping up a scrolling list of files. + +By calling :meth:`FileHistory.UseMenu` you can associate a file menu with the file history. The menu will +then be used for appending filenames that are added to the history. + +.. note:: + + Please notice that currently if the history already contained filenames when UseMenu() is called (e.g. when + initializing a second MDI child frame), the menu is not automatically initialized with the existing filenames + in the history and so you need to call :meth:`FileHistory.AddFilesToMenu` after UseMenu() explicitly in order + to initialize the menu with the existing list of MRU files (otherwise an assertion failure is raised in debug builds). + +The filenames are appended using menu identifiers in the range ``ID_FILE1`` to ``ID_FILE9``. + + + diff --git a/docs/sphinx/rest_substitutions/overviews/dataobject_overview.rst b/docs/sphinx/rest_substitutions/overviews/dataobject_overview.rst index 750c574d..6c60dedd 100644 --- a/docs/sphinx/rest_substitutions/overviews/dataobject_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/dataobject_overview.rst @@ -1,49 +1,49 @@ -.. include:: headings.inc - - -.. _dataobject overview: - -================================================= -|phoenix_title| **DataObject Overview** -================================================= - -This overview discusses data transfer through clipboard or drag and drop. In wxPython, these two ways to transfer -data (either between different applications or inside one and the same) are very similar which allows to implement -both of them using almost the same code - or, in other words, if you implement drag and drop support for your -application, you get clipboard support for free and vice versa. - -At the heart of both clipboard and drag and drop operations lies the :class:`DataObject` class. The objects of this -class (or, to be precise, classes derived from it) represent the data which is being carried by the mouse during -drag and drop operation or copied to or pasted from the clipboard. :class:`DataObject` is a "smart" piece of data -because it knows which formats it supports (see `GetFormatCount` and `GetAllFormats`) and knows how to render itself -in any of them (see `GetDataHere`). It can also receive its value from the outside in a format it supports if it -implements the `SetData` method. Please see the documentation of this class for more details. - -Both clipboard and drag and drop operations have two sides: the source and target, the data provider and the data -receiver. These which may be in the same application and even the same window when, for example, you drag some text -from one position to another in a word processor. Let us describe what each of them should do. - - -The data provider (source) duties ---------------------------------- - -The data provider is responsible for creating a :class:`DataObject` containing the data to be transferred. Then it -should either pass it to the clipboard using :meth:`Clipboard.SetData` function or to :class:`DropSource` and call -:meth:`DropSource.DoDragDrop` function. - -A small difference is that in the case of clipboard operation, the application usually knows in advance whether it -copies or cuts (i.e. copies and deletes) data - in fact, this usually depends on which menu item the user chose. -But for drag and drop it can only know it after :meth:`DropSource.DoDragDrop` returns (from its return value). - - -The data receiver (target) duties ---------------------------------- - -To receive (paste in usual terminology) data from the clipboard, you should create a :class:`DataObject` derived -class which supports the data formats you need and pass it as argument to :meth:`Clipboard.GetData`. If it returns -``False``, no data in (any of) the supported format(s) is available. If it returns ``True``, the data has been -successfully transferred to :class:`DataObject`. - -For drag and drop case, the :meth:`DropTarget.OnData` virtual function will be called when a data object is dropped, -from which the data itself may be requested by calling :meth:`DropTarget.GetData` method which fills the data object. - +.. include:: headings.inc + + +.. _dataobject overview: + +================================================= +|phoenix_title| **DataObject Overview** +================================================= + +This overview discusses data transfer through clipboard or drag and drop. In wxPython, these two ways to transfer +data (either between different applications or inside one and the same) are very similar which allows to implement +both of them using almost the same code - or, in other words, if you implement drag and drop support for your +application, you get clipboard support for free and vice versa. + +At the heart of both clipboard and drag and drop operations lies the :class:`DataObject` class. The objects of this +class (or, to be precise, classes derived from it) represent the data which is being carried by the mouse during +drag and drop operation or copied to or pasted from the clipboard. :class:`DataObject` is a "smart" piece of data +because it knows which formats it supports (see `GetFormatCount` and `GetAllFormats`) and knows how to render itself +in any of them (see `GetDataHere`). It can also receive its value from the outside in a format it supports if it +implements the `SetData` method. Please see the documentation of this class for more details. + +Both clipboard and drag and drop operations have two sides: the source and target, the data provider and the data +receiver. These which may be in the same application and even the same window when, for example, you drag some text +from one position to another in a word processor. Let us describe what each of them should do. + + +The data provider (source) duties +--------------------------------- + +The data provider is responsible for creating a :class:`DataObject` containing the data to be transferred. Then it +should either pass it to the clipboard using :meth:`Clipboard.SetData` function or to :class:`DropSource` and call +:meth:`DropSource.DoDragDrop` function. + +A small difference is that in the case of clipboard operation, the application usually knows in advance whether it +copies or cuts (i.e. copies and deletes) data - in fact, this usually depends on which menu item the user chose. +But for drag and drop it can only know it after :meth:`DropSource.DoDragDrop` returns (from its return value). + + +The data receiver (target) duties +--------------------------------- + +To receive (paste in usual terminology) data from the clipboard, you should create a :class:`DataObject` derived +class which supports the data formats you need and pass it as argument to :meth:`Clipboard.GetData`. If it returns +``False``, no data in (any of) the supported format(s) is available. If it returns ``True``, the data has been +successfully transferred to :class:`DataObject`. + +For drag and drop case, the :meth:`DropTarget.OnData` virtual function will be called when a data object is dropped, +from which the data itself may be requested by calling :meth:`DropTarget.GetData` method which fills the data object. + diff --git a/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst b/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst index 3bafa170..636998f7 100644 --- a/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst +++ b/docs/sphinx/rest_substitutions/overviews/tipprovider_overview.rst @@ -1,55 +1,55 @@ -.. include:: headings.inc - - -.. _tipprovider overview: - -========================================== -|phoenix_title| **TipProvider Overview** -========================================== - -Many "modern" Windows programs have a feature (some would say annoyance) of presenting the user tips at program startup. - -While this is probably useless to the advanced users of the program, the experience shows that the tips may be -quite helpful for the novices and so more and more programs now do this. For a wxPython programmer, implementing this -feature is extremely easy. To show a tip, it is enough to just call :func:`ShowTip` function like this:: - - if showTipsAtStartup: - - tipProvider = wx.CreateFileTipProvider("tips.txt", 0) - wx.ShowTip(windowParent, tipProvider) - del tipProvider - - -Of course, you need to get the text of the tips from somewhere - in the example above, the text is supposed to be in the -file `tips.txt` from where it is read by the tip provider. The tip provider is just an object of a class deriving from :class:`~adv.TipProvider`. -It has to implement one pure virtual function of the base class, `GetTip`. In the case of the tip provider created by -:func:`CreateFileTipProvider`, the tips are just the lines of the text file. - -If you want to implement your own tip provider (for example, if you wish to hardcode the tips inside your program), you -just have to derive another class from :class:`~adv.TipProvider` and pass a pointer to the object of this class to func:`ShowTip` - then -you don't need :func:`CreateFileTipProvider` at all. - -You will probably want to save somewhere the index of the tip last shown - so that the program doesn't always show the same -tip on startup. As you also need to remember whether to show tips or not (you shouldn't do it if the user unchecked -"Show tips on startup" checkbox in the dialog), you will probably want to store both the index of the last shown tip -(as returned by :meth:`~adv.TipProvider.GetCurrentTip` and the flag telling whether to show the tips at startup at all. - -In a `tips.txt` file, lines that begin with a ``#`` character are considered comments and are automatically skipped. Blank -lines and lines only having spaces are also skipped. - -You can easily add runtime-translation capacity by placing each line of the `tips.txt` file inside the usual translation -function. For example, your `tips.txt` file would look like this:: - - _("This is my first tip") - _("This is my second tip") - - -Now add your `tips.txt` file into the list of files that gettext searches for translatable strings. The tips will thus get -included into your generated .po file catalog and be translated at runtime along with the rest of your application's translatable strings. - -.. note:: - - Each line in the `tips.txt` file needs to strictly begin with exactly the 3 characters of underscore-parenthesis-doublequote, - and end with doublequote-parenthesis, as shown above. Also, remember to escape any doublequote characters within the tip - string with a backslash-doublequote. - +.. include:: headings.inc + + +.. _tipprovider overview: + +========================================== +|phoenix_title| **TipProvider Overview** +========================================== + +Many "modern" Windows programs have a feature (some would say annoyance) of presenting the user tips at program startup. + +While this is probably useless to the advanced users of the program, the experience shows that the tips may be +quite helpful for the novices and so more and more programs now do this. For a wxPython programmer, implementing this +feature is extremely easy. To show a tip, it is enough to just call :func:`ShowTip` function like this:: + + if showTipsAtStartup: + + tipProvider = wx.CreateFileTipProvider("tips.txt", 0) + wx.ShowTip(windowParent, tipProvider) + del tipProvider + + +Of course, you need to get the text of the tips from somewhere - in the example above, the text is supposed to be in the +file `tips.txt` from where it is read by the tip provider. The tip provider is just an object of a class deriving from :class:`~adv.TipProvider`. +It has to implement one pure virtual function of the base class, `GetTip`. In the case of the tip provider created by +:func:`CreateFileTipProvider`, the tips are just the lines of the text file. + +If you want to implement your own tip provider (for example, if you wish to hardcode the tips inside your program), you +just have to derive another class from :class:`~adv.TipProvider` and pass a pointer to the object of this class to func:`ShowTip` - then +you don't need :func:`CreateFileTipProvider` at all. + +You will probably want to save somewhere the index of the tip last shown - so that the program doesn't always show the same +tip on startup. As you also need to remember whether to show tips or not (you shouldn't do it if the user unchecked +"Show tips on startup" checkbox in the dialog), you will probably want to store both the index of the last shown tip +(as returned by :meth:`~adv.TipProvider.GetCurrentTip` and the flag telling whether to show the tips at startup at all. + +In a `tips.txt` file, lines that begin with a ``#`` character are considered comments and are automatically skipped. Blank +lines and lines only having spaces are also skipped. + +You can easily add runtime-translation capacity by placing each line of the `tips.txt` file inside the usual translation +function. For example, your `tips.txt` file would look like this:: + + _("This is my first tip") + _("This is my second tip") + + +Now add your `tips.txt` file into the list of files that gettext searches for translatable strings. The tips will thus get +included into your generated .po file catalog and be translated at runtime along with the rest of your application's translatable strings. + +.. note:: + + Each line in the `tips.txt` file needs to strictly begin with exactly the 3 characters of underscore-parenthesis-doublequote, + and end with doublequote-parenthesis, as shown above. Also, remember to escape any doublequote characters within the tip + string with a backslash-doublequote. + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/AppConsole.SetCLocale.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/AppConsole.SetCLocale.1.py index cf6b25ab..7d2135a5 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/AppConsole.SetCLocale.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/AppConsole.SetCLocale.1.py @@ -1,2 +1,2 @@ - - setlocale(LC_ALL, "") + + setlocale(LC_ALL, "") diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.NewFromPNGData.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.NewFromPNGData.2.py index f8857638..1a9388d0 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.NewFromPNGData.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Bitmap.NewFromPNGData.2.py @@ -1,2 +1,2 @@ - - wx.Image.AddHandler(wx.PNGHandler) + + wx.Image.AddHandler(wx.PNGHandler) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.1.py index cdedab13..e4448974 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.1.py @@ -1,9 +1,9 @@ - - # Create a control for post code entry. - postcode = wx.TextCtrl(self, -1, "") - - # And set its initial and minimal size to be big enough for - # entering 5 digits. - postcode.SetInitialSize( - postcode.GetSizeFromTextSize( - postcode.GetTextExtent("99999"))) + + # Create a control for post code entry. + postcode = wx.TextCtrl(self, -1, "") + + # And set its initial and minimal size to be big enough for + # entering 5 digits. + postcode.SetInitialSize( + postcode.GetSizeFromTextSize( + postcode.GetTextExtent("99999"))) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.2.py index cdedab13..e4448974 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/Control.GetSizeFromTextSize.2.py @@ -1,9 +1,9 @@ - - # Create a control for post code entry. - postcode = wx.TextCtrl(self, -1, "") - - # And set its initial and minimal size to be big enough for - # entering 5 digits. - postcode.SetInitialSize( - postcode.GetSizeFromTextSize( - postcode.GetTextExtent("99999"))) + + # Create a control for post code entry. + postcode = wx.TextCtrl(self, -1, "") + + # And set its initial and minimal size to be big enough for + # entering 5 digits. + postcode.SetInitialSize( + postcode.GetSizeFromTextSize( + postcode.GetTextExtent("99999"))) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.AddColumnsItems.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.AddColumnsItems.1.py index 08b25378..8da5d12a 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.AddColumnsItems.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.AddColumnsItems.1.py @@ -1,13 +1,13 @@ - - def ColumnItems(self): - - menu = wx.Menu() - menu.Append(100, "Some custom command") - menu.AppendSeparator() - self.AddColumnsItems(menu, 200) - rc = self.GetPopupMenuSelectionFromUser(menu, pt) - - if rc >= 200: - # ... toggle visibility of the column rc-200 ... - ToggleVisibility() - + + def ColumnItems(self): + + menu = wx.Menu() + menu.Append(100, "Some custom command") + menu.AppendSeparator() + self.AddColumnsItems(menu, 200) + rc = self.GetPopupMenuSelectionFromUser(menu, pt) + + if rc >= 200: + # ... toggle visibility of the column rc-200 ... + ToggleVisibility() + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.Create.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.Create.1.py index c9f81cd4..13800295 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.Create.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.Create.1.py @@ -1,2 +1,2 @@ - - wx.HD_DEFAULT_STYLE & ~wx.HD_ALLOW_REORDER + + wx.HD_DEFAULT_STYLE & ~wx.HD_ALLOW_REORDER diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.UpdateColumnWidthToFit.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.UpdateColumnWidthToFit.1.py index 4c124419..4469053e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.UpdateColumnWidthToFit.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrl.UpdateColumnWidthToFit.1.py @@ -1,40 +1,40 @@ - - class MyHeaderColumn(wx.HeaderColumn): - - def __init__(self): - - wx.HeaderColumn.__init__(self) - - - def SetWidth(self, width): - - self.width = width - - - def GetWidth(self): - - return self.width - - - class MyHeaderCtrl(wx.HeaderCtrl): - - def __init__(self, parent): - - wx.HeaderCtrl.__init__(self, parent) - self.cols = [] - - - def GetColumn(idx): - - return self.cols[idx] - - - def UpdateColumnWidthToFit(self, idx, widthTitle): - - # ... compute minimal width for column idx ... - widthContents = self.CalculateMinWidth(idx) - self.cols[idx].SetWidth(max(widthContents, widthTitle)) - - return True - - + + class MyHeaderColumn(wx.HeaderColumn): + + def __init__(self): + + wx.HeaderColumn.__init__(self) + + + def SetWidth(self, width): + + self.width = width + + + def GetWidth(self): + + return self.width + + + class MyHeaderCtrl(wx.HeaderCtrl): + + def __init__(self, parent): + + wx.HeaderCtrl.__init__(self, parent) + self.cols = [] + + + def GetColumn(idx): + + return self.cols[idx] + + + def UpdateColumnWidthToFit(self, idx, widthTitle): + + # ... compute minimal width for column idx ... + widthContents = self.CalculateMinWidth(idx) + self.cols[idx].SetWidth(max(widthContents, widthTitle)) + + return True + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrlSimple.HideColumn.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrlSimple.HideColumn.1.py index a4030721..853cd378 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrlSimple.HideColumn.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/HeaderCtrlSimple.HideColumn.1.py @@ -1,2 +1,2 @@ - - self.ShowColumn(idx, False) + + self.ShowColumn(idx, False) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.1.py index 049f80d3..b5868ac2 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.1.py @@ -1,19 +1,19 @@ - - items = ["meat", "fish", "fruits", "beer"] - order = [3, 0, 1, 2] - - dlg = wx.RearrangeDialog(None, - "You can also uncheck the items you don't like " - "at all.", - "Sort the items in order of preference", - order, items) - - if dlg.ShowModal() == wx.ID_OK: - order = dlg.GetOrder() - for n in order: - if n >= 0: - wx.LogMessage("Your most preferred item is \"%s\""%n) - break - - - + + items = ["meat", "fish", "fruits", "beer"] + order = [3, 0, 1, 2] + + dlg = wx.RearrangeDialog(None, + "You can also uncheck the items you don't like " + "at all.", + "Sort the items in order of preference", + order, items) + + if dlg.ShowModal() == wx.ID_OK: + order = dlg.GetOrder() + for n in order: + if n >= 0: + wx.LogMessage("Your most preferred item is \"%s\""%n) + break + + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.AddExtraControls.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.AddExtraControls.1.py index e8498fc2..8fda359e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.AddExtraControls.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeDialog.AddExtraControls.1.py @@ -1,19 +1,19 @@ - - class MyRearrangeDialog(wx.RearrangeDialog): - - def __init__(self, parent): - - wx.RearrangeDialog.__init__(self, parent) - - panel = wx.Panel(self) - sizer = wx.BoxSizer(wx.HORIZONTAL) - sizer.Add(wx.StaticText(panel, wx.ID_ANY, - "Column width in pixels:")) - sizer.Add(wx.TextCtrl(panel, wx.ID_ANY, "")) - panel.SetSizer(sizer) - self.AddExtraControls(panel) - - - # ... code to update the text control with the currently selected - # item width and to react to its changes omitted ... - + + class MyRearrangeDialog(wx.RearrangeDialog): + + def __init__(self, parent): + + wx.RearrangeDialog.__init__(self, parent) + + panel = wx.Panel(self) + sizer = wx.BoxSizer(wx.HORIZONTAL) + sizer.Add(wx.StaticText(panel, wx.ID_ANY, + "Column width in pixels:")) + sizer.Add(wx.TextCtrl(panel, wx.ID_ANY, "")) + panel.SetSizer(sizer) + self.AddExtraControls(panel) + + + # ... code to update the text control with the currently selected + # item width and to react to its changes omitted ... + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeList.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeList.1.py index dc305375..b1dbdf0d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeList.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/RearrangeList.1.py @@ -1,2 +1,2 @@ - - order = [0] # checked item #0 + + order = [0] # checked item #0 diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/RichMessageDialog.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/RichMessageDialog.1.py index 52bcd4eb..a221a13d 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/RichMessageDialog.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/RichMessageDialog.1.py @@ -1,13 +1,13 @@ - - def ShowDialog(self): - - if dont_show: - return - - dlg = wx.RichMessageDialog(self, "Welcome to my wonderful program!") - dlg.ShowCheckBox("Don't show welcome dialog again") - dlg.ShowModal() # return value ignored as we have "Ok" only anyhow - - if dlg.IsCheckBoxChecked(): - # ... make sure we won't show it again the next time ... - dont_show = True + + def ShowDialog(self): + + if dont_show: + return + + dlg = wx.RichMessageDialog(self, "Welcome to my wonderful program!") + dlg.ShowCheckBox("Don't show welcome dialog again") + dlg.ShowModal() # return value ignored as we have "Ok" only anyhow + + if dlg.IsCheckBoxChecked(): + # ... make sure we won't show it again the next time ... + dont_show = True diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py index f9d8c96e..96dcfaea 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.CreateEditorCtrl.1.py @@ -1,6 +1,6 @@ - - - # Some integer... - l = value - return wx.SpinCtrl(parent, wx.ID_ANY, "", - labelRect.GetTopLeft(), labelRect.GetSize(), 0, 0, 100, l) + + + # Some integer... + l = value + return wx.SpinCtrl(parent, wx.ID_ANY, "", + labelRect.GetTopLeft(), labelRect.GetSize(), 0, 0, 100, l) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py index 7bec360a..c410bbeb 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewCustomRenderer.GetValueFromEditorCtrl.1.py @@ -1,6 +1,6 @@ - - - # sc is a wx.SpinCtrl - l = sc.GetValue() - value = l - return True + + + # sc is a wx.SpinCtrl + l = sc.GetValue() + value = l + return True diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewListCtrl.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewListCtrl.1.py index ff4b09bb..c9abaa19 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewListCtrl.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/dataview.DataViewListCtrl.1.py @@ -1,11 +1,11 @@ - - listctrl = wx.dataview.DataViewListCtrl(parent, wx.ID_ANY) - - listctrl.AppendToggleColumn("Toggle") - listctrl.AppendTextColumn("Text") - - data = [True, "row 1"] - listctrl.AppendItem(data) - - data = [False, "row 3"] - listctrl.AppendItem(data) + + listctrl = wx.dataview.DataViewListCtrl(parent, wx.ID_ANY) + + listctrl.AppendToggleColumn("Toggle") + listctrl.AppendTextColumn("Text") + + data = [True, "row 1"] + listctrl.AppendItem(data) + + data = [False, "row 3"] + listctrl.AppendItem(data) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.AdjustPagebreak.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.AdjustPagebreak.1.py index b067fb1a..edc6dab7 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.AdjustPagebreak.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.AdjustPagebreak.1.py @@ -1,4 +1,4 @@ - - ret_value, kp = container.AdjustPagebreak(p, kp, ph) - while ret_value: - ret_value, kp = container.AdjustPagebreak(p, kp, ph) + + ret_value, kp = container.AdjustPagebreak(p, kp, ph) + while ret_value: + ret_value, kp = container.AdjustPagebreak(p, kp, ph) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.Draw.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.Draw.1.py index 2cc77edd..7d3c1f7e 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.Draw.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.Draw.1.py @@ -1,3 +1,3 @@ - - - dc.DrawText("hello", x + cell.PosX, y + cell.PosY) + + + dc.DrawText("hello", x + cell.PosX, y + cell.PosY) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.DrawInvisible.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.DrawInvisible.1.py index e8035d96..4051f4be 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.DrawInvisible.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlCell.DrawInvisible.1.py @@ -1,3 +1,3 @@ - - - dc.DrawText("hello", x + cell.PosX, y + cell.PosY) + + + dc.DrawText("hello", x + cell.PosX, y + cell.PosY) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.1.py index 5b424507..49559212 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.1.py @@ -1,2 +1,2 @@ - - SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) + + SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.2.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.2.py index 5b424507..49559212 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.2.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlContainerCell.SetWidthFloat.2.py @@ -1,2 +1,2 @@ - - SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) + + SetWidthFloat(-50, wx.html.HTML_UNITS_PIXELS) diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.CanRead.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.CanRead.1.py index 438693d7..2d99d163 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.CanRead.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.CanRead.1.py @@ -1,7 +1,7 @@ - - def CanRead(file): - - # file is a wx.FSFile in this case... - return (file.GetMimeType() == "application/x-ugh") - - + + def CanRead(file): + + # file is a wx.FSFile in this case... + return (file.GetMimeType() == "application/x-ugh") + + diff --git a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.ReadFile.1.py b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.ReadFile.1.py index 6822c26b..b21e96bc 100644 --- a/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.ReadFile.1.py +++ b/docs/sphinx/rest_substitutions/snippets/python/converted/html.HtmlFilter.ReadFile.1.py @@ -1,6 +1,6 @@ - - def ReadFile(file): - - # file is a wx.FSFile in this case... - return "
- How are you? -
This is centered...
- Oops+ How are you? +
This is centered...
+ Oops