From ea4b9b8fc52639015c05fa22f377a892c87c51bf Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 7 Jun 2016 16:44:52 -0700 Subject: [PATCH] updates for fullnames in the docstrings --- wx/lib/buttons.py | 126 ++++++++++++++++++++++++--------------------- wx/tools/pywxrc.py | 4 +- 2 files changed, 68 insertions(+), 62 deletions(-) diff --git a/wx/lib/buttons.py b/wx/lib/buttons.py index ad1a37a1..4d6ce67e 100644 --- a/wx/lib/buttons.py +++ b/wx/lib/buttons.py @@ -135,20 +135,21 @@ class GenButton(wx.Control): """ Default class constructor. - :param Window `parent`: parent window. Must not be ``None``; + :param wx.Window `parent`: parent window. Must not be ``None``; :param integer `id`: window identifier. A value of -1 indicates a default value; :param string `label`: the button text label; - :param `pos`: the control position. A value of (-1, -1) indicates a default position, - chosen by either the windowing system or wxPython, depending on platform; - :type `pos`: tuple or :class:`Point` + :param `pos`: the control position. A value of (-1, -1) indicates a default + position, chosen by either the windowing system or wxPython, depending on + platform; + :type `pos`: tuple or :class:`wx.Point` :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform; - :type `size`: tuple or :class:`Size` + :type `size`: tuple or :class:`wx.Size` :param integer `style`: the button style; - :param Validator `validator`: the validator associated with the button; + :param wx.Validator `validator`: the validator associated with the button; :param string `name`: the button name. - .. seealso:: :class:`Button` for a list of valid window styles. + .. seealso:: :class:`wx.Button` for a list of valid window styles. """ cstyle = style @@ -202,8 +203,9 @@ class GenButton(wx.Control): Given the current font and bezel width settings, calculate and set a good size. - :param `size`: an instance of :class:`Size` or ``None``, in which case the wxPython - ``DefaultSize`` is used instead. + :param `size`: an instance of :class:`wx.Size` or ``None``, + in which case the wxPython + ``wx.DefaultSize`` is used instead. """ if size is None: @@ -219,9 +221,9 @@ class GenButton(wx.Control): Overridden base class virtual. Determines the best size of the button based on the label and bezel size. - :return: An instance of :class:`Size`. + :return: An instance of :class:`wx.Size`. - .. note:: Overridden from :class:`Control`. + .. note:: Overridden from :class:`wx.Control`. """ w, h, useMin = self._GetLabelSize() @@ -246,7 +248,7 @@ class GenButton(wx.Control): """ Can this window be given focus by mouse click? - .. note:: Overridden from :class:`Control`. + .. note:: Overridden from :class:`wx.Control`. """ return self.IsShown() and self.IsEnabled() @@ -255,11 +257,11 @@ class GenButton(wx.Control): def GetDefaultAttributes(self): """ Overridden base class virtual. By default we should use - the same font/colour attributes as the native :class:`Button`. + the same font/colour attributes as the native :class:`wx.Button`. - :return: an instance of :class:`VisualAttributes`. + :return: an instance of :class:`wx.VisualAttributes`. - .. note:: Overridden from :class:`Control`. + .. note:: Overridden from :class:`wx.Control`. """ return wx.Button.GetClassDefaultAttributes() @@ -270,7 +272,7 @@ class GenButton(wx.Control): Overridden base class virtual. Buttons usually don't inherit the parent's colours. - .. note:: Overridden from :class:`Control`. + .. note:: Overridden from :class:`wx.Control`. """ return False @@ -282,7 +284,7 @@ class GenButton(wx.Control): :param bool `enable`: ``True`` to enable the button, ``False`` to disable it. - .. note:: Overridden from :class:`Control`. + .. note:: Overridden from :class:`wx.Control`. """ if enable != self.IsEnabled(): @@ -352,9 +354,9 @@ class GenButton(wx.Control): """ Sets the :class:`GenButton` background colour. - :param `colour`: a valid :class:`Colour` object. + :param `colour`: a valid :class:`wx.Colour` object. - .. note:: Overridden from :class:`Control`. + .. note:: Overridden from :class:`wx.Control`. """ wx.Control.SetBackgroundColour(self, colour) @@ -363,11 +365,11 @@ class GenButton(wx.Control): def SetForegroundColour(self, colour): """ - Sets the :class:`GenButton` foreground colour. + Sets the :class:`wx.GenButton` foreground colour. - :param `colour`: a valid :class:`Colour` object. + :param `colour`: a valid :class:`wx.Colour` object. - .. note:: Overridden from :class:`Control`. + .. note:: Overridden from :class:`wx.Control`. """ wx.Control.SetForegroundColour(self, colour) @@ -376,18 +378,22 @@ class GenButton(wx.Control): def SetDefault(self): """ - This sets the :class:`GenButton` to be the default item for the panel or dialog box. + This sets the :class:`GenButton` to be the default item for + the panel or dialog box. - .. note:: Under Windows, only dialog box buttons respond to this function. As normal - under Windows and Motif, pressing return causes the default button to be depressed - when the return key is pressed. See also :meth:`Window.SetFocus` which sets the - keyboard focus for windows and text panel items, and :meth:`TopLevelWindow.SetDefaultItem`. + .. note:: Under Windows, only dialog box buttons respond to this function. + As normal under Windows and Motif, pressing return causes the + default button to be depressed when the return key is pressed. See + also :meth:`wx.Window.SetFocus` which sets the keyboard focus for + windows and text panel items, and + :meth:`wx.TopLevelWindow.SetDefaultItem`. - .. note:: Note that under Motif, calling this function immediately after creation of a button - and before the creation of other buttons will cause misalignment of the row of buttons, - since default buttons are larger. To get around this, call :meth:`SetDefault` after you - have created a row of buttons: wxPython will then set the size of all buttons currently - on the panel to the same size. + .. note:: Note that under Motif, calling this function immediately after + creation of a button and before the creation of other buttons will + cause misalignment of the row of buttons, since default buttons are + larger. To get around this, call :meth:`wx.SetDefault` after you + have created a row of buttons: wxPython will then set the size of + all buttons currently on the panel to the same size. """ tlw = wx.GetTopLevelParent(self) @@ -467,7 +473,7 @@ class GenButton(wx.Control): """ Handles the ``wx.EVT_PAINT`` event for :class:`GenButton`. - :param `event`: a :class:`PaintEvent` event to be processed. + :param `event`: a :class:`wx.PaintEvent` event to be processed. """ (width, height) = self.GetClientSize() @@ -491,7 +497,7 @@ class GenButton(wx.Control): """ Handles the ``wx.EVT_SIZE`` event for :class:`GenButton`. - :param `event`: a :class:`SizeEvent` event to be processed. + :param `event`: a :class:`wx.SizeEvent` event to be processed. """ self.Refresh() @@ -500,7 +506,7 @@ class GenButton(wx.Control): def GetBackgroundBrush(self, dc): """ - Returns the current :class:`Brush` to be used to draw the button background. + Returns the current :class:`wx.Brush` to be used to draw the button background. :param DC `dc`: the device context used to draw the button background. """ @@ -534,7 +540,7 @@ class GenButton(wx.Control): """ Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`GenButton`. - :param `event`: a :class:`MouseEvent` event to be processed. + :param `event`: a :class:`wx.MouseEvent` event to be processed. """ if not self.IsEnabled(): @@ -551,7 +557,7 @@ class GenButton(wx.Control): """ Handles the ``wx.EVT_LEFT_UP`` event for :class:`GenButton`. - :param `event`: a :class:`MouseEvent` event to be processed. + :param `event`: a :class:`wx.MouseEvent` event to be processed. """ if not self.IsEnabled() or not self.HasCapture(): @@ -571,7 +577,7 @@ class GenButton(wx.Control): """ Handles the ``wx.EVT_MOTION`` event for :class:`GenButton`. - :param `event`: a :class:`MouseEvent` event to be processed. + :param `event`: a :class:`wx.MouseEvent` event to be processed. """ if not self.IsEnabled() or not self.HasCapture(): @@ -598,7 +604,7 @@ class GenButton(wx.Control): """ Handles the ``wx.EVT_SET_FOCUS`` event for :class:`GenButton`. - :param `event`: a :class:`FocusEvent` event to be processed. + :param `event`: a :class:`wx.FocusEvent` event to be processed. """ self.hasFocus = True @@ -610,7 +616,7 @@ class GenButton(wx.Control): """ Handles the ``wx.EVT_KILL_FOCUS`` event for :class:`GenButton`. - :param `event`: a :class:`FocusEvent` event to be processed. + :param `event`: a :class:`wx.FocusEvent` event to be processed. """ self.hasFocus = False @@ -622,7 +628,7 @@ class GenButton(wx.Control): """ Handles the ``wx.EVT_KEY_DOWN`` event for :class:`GenButton`. - :param `event`: a :class:`KeyEvent` event to be processed. + :param `event`: a :class:`wx.KeyEvent` event to be processed. """ if self.hasFocus and event.GetKeyCode() == ord(" "): @@ -636,7 +642,7 @@ class GenButton(wx.Control): """ Handles the ``wx.EVT_KEY_UP`` event for :class:`GenButton`. - :param `event`: a :class:`KeyEvent` event to be processed. + :param `event`: a :class:`wx.KeyEvent` event to be processed. """ if self.hasFocus and event.GetKeyCode() == ord(" "): @@ -664,15 +670,15 @@ class GenBitmapButton(GenButton): :param Bitmap `bitmap`: the button bitmap; :param `pos`: the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform; - :type `pos`: tuple or :class:`Point` + :type `pos`: tuple or :class:`wx.Point` :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform; - :type `size`: tuple or :class:`Size` + :type `size`: tuple or :class:`wx.Size` :param integer `style`: the button style; :param Validator `validator`: the validator associated to the button; :param string `name`: the button name. - .. seealso:: :class:`Button` for a list of valid window styles. + .. seealso:: :class:`wx.Button` for a list of valid window styles. """ self.bmpDisabled = None @@ -686,7 +692,7 @@ class GenBitmapButton(GenButton): """ Returns the bitmap for the button's normal state. - :rtype: :class:`Bitmap` + :rtype: :class:`wx.Bitmap` .. seealso:: :meth:`SetBitmapLabel` """ @@ -698,7 +704,7 @@ class GenBitmapButton(GenButton): """ Returns the bitmap for the button's disabled state, which may be invalid. - :rtype: :class:`Bitmap` + :rtype: :class:`wx.Bitmap` .. seealso:: :meth:`SetBitmapDisabled` """ @@ -710,7 +716,7 @@ class GenBitmapButton(GenButton): """ Returns the bitmap for the button's focused state, which may be invalid. - :rtype: :class:`Bitmap` + :rtype: :class:`wx.Bitmap` .. seealso:: :meth:`SetBitmapFocus` """ @@ -722,7 +728,7 @@ class GenBitmapButton(GenButton): """ Returns the bitmap for the button's pressed state, which may be invalid. - :rtype: :class:`Bitmap` + :rtype: :class:`wx.Bitmap` .. seealso:: :meth:`SetBitmapSelected` """ @@ -843,15 +849,15 @@ class GenBitmapTextButton(GenBitmapButton): :param string `label`: the button text label; :param `pos`: the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform; - :type `pos`: tuple or :class:`Point` + :type `pos`: tuple or :class:`wx.Point` :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform; - :type `size`: tuple or :class:`Size` + :type `size`: tuple or :class:`wx.Size` :param integer `style`: the button style; :param Validator `validator`: the validator associated to the button; :param string `name`: the button name. - .. seealso:: :class:`Button` for a list of valid window styles. + .. seealso:: :class:`wx.Button` for a list of valid window styles. """ GenBitmapButton.__init__(self, parent, id, bitmap, pos, size, style, validator, name) @@ -890,6 +896,7 @@ class GenBitmapTextButton(GenBitmapButton): hasMask = bmp.GetMask() is not None else: bw = bh = 0 # no bitmap -> size is zero + hasMask = False dc.SetFont(self.GetFont()) if self.IsEnabled(): @@ -915,7 +922,8 @@ class GenBitmapTextButton(GenBitmapButton): class __ToggleMixin(object): """ - A mixin that allows to transform :class:`GenButton` in the corresponding toggle button. + A mixin that allows to transform :class:`GenButton` in the corresponding + toggle button. """ def SetToggle(self, flag): @@ -947,7 +955,7 @@ class __ToggleMixin(object): """ Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`GenButton` when used as toggle button. - :param `event`: a :class:`MouseEvent` event to be processed. + :param `event`: a :class:`wx.MouseEvent` event to be processed. """ if not self.IsEnabled(): @@ -964,7 +972,7 @@ class __ToggleMixin(object): """ Handles the ``wx.EVT_LEFT_UP`` event for :class:`GenButton` when used as toggle button. - :param `event`: a :class:`MouseEvent` event to be processed. + :param `event`: a :class:`wx.MouseEvent` event to be processed. """ if not self.IsEnabled() or not self.HasCapture(): @@ -981,7 +989,7 @@ class __ToggleMixin(object): """ Handles the ``wx.EVT_KEY_DOWN`` event for :class:`GenButton` when used as toggle button. - :param `event`: a :class:`KeyEvent` event to be processed. + :param `event`: a :class:`wx.KeyEvent` event to be processed. """ event.Skip() @@ -991,7 +999,7 @@ class __ToggleMixin(object): """ Handles the ``wx.EVT_MOTION`` event for :class:`GenButton` when used as toggle button. - :param `event`: a :class:`MouseEvent` event to be processed. + :param `event`: a :class:`wx.MouseEvent` event to be processed. """ if not self.IsEnabled(): @@ -1018,7 +1026,7 @@ class __ToggleMixin(object): """ Handles the ``wx.EVT_KEY_UP`` event for :class:`GenButton` when used as toggle button. - :param `event`: a :class:`KeyEvent` event to be processed. + :param `event`: a :class:`wx.KeyEvent` event to be processed. """ if self.hasFocus and event.GetKeyCode() == ord(" "): @@ -1061,7 +1069,7 @@ class __ThemedMixin(object): Handles the ``wx.EVT_ENTER_WINDOW`` and ``wx.EVT_LEAVE_WINDOW`` events for :class:`GenButton` when used as a themed button. - :param `event`: a :class:`MouseEvent` event to be processed. + :param `event`: a :class:`wx.MouseEvent` event to be processed. """ self.Refresh() diff --git a/wx/tools/pywxrc.py b/wx/tools/pywxrc.py index 2ec5ab94..75872caf 100644 --- a/wx/tools/pywxrc.py +++ b/wx/tools/pywxrc.py @@ -31,10 +31,8 @@ Usage: python pywxrc.py -h -o, --output output filename, or - for stdout """ -import sys, os, getopt, glob, re, cPickle +import sys, os, getopt, glob, re import xml.dom.minidom as minidom -import wx -import wx.xrc from wx.lib.six import print_ #----------------------------------------------------------------------