Commit Graph

20 Commits

Author SHA1 Message Date
Scott Talbert
b2199e299a plotcanvas: avoid trying to adjust scrollbars if nothing drawn
For example, if Clear() is called on a plotcanvas, _adjustScrollbars()
will not work, so avoid trying to do it if nothing is drawn currently.
2022-01-11 19:56:28 -05:00
Anna Petrasova
92ca5c55a6 Fix invisible text in lib.plot with dark theme
This fixes invisible white text on white background with dark themes.
2021-12-29 23:29:44 -05:00
Robin Dunn
d9725119d7 Merge pull request #2039 from swt2c/pygauge_py3.10
Fix a bunch of Python 3.10 issues with pure-Python classes and demos
2021-12-13 20:54:44 -08:00
Scott Talbert
173d079681 Fix a bunch of Python 3.10 issues with pure-Python classes and demos
In Python 3.10, a change[1] was implemented where extension functions
that take integer arguments will no longer silently accept non-integer
arguments (e.g., floats) that can only be converted to integers with a
loss of precision.  This PR fixes most of these issues in the pure-Python
classes and demos by explicitly converting the parameters to int before
passing them to wxWidgets.  There is loss of precision, but this was
happening before (automatically) anyway as most wxWidgets DeviceContext
functions operate using integers.

Additionally, the PR fixes a few sizing issues, mostly with SpinCtrls being
too small on GTK3.

This is an example of the relevant exception:
Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/wx/lib/agw/pygauge.py", line 355, in OnPaint
    r.width = w
TypeError: 'float' object cannot be interpreted as an integer

Fixes #2038.

[1] https://bugs.python.org/issue37999
2021-12-01 14:19:00 -05:00
Christian Clauss
25ba122168 Fix typos discovered by codespell 2021-08-07 18:55:49 +02:00
Robin Dunn
732ff6752b Revert "Spelling fixes in wx.lib"
This reverts commit c00b8950da.
The spelling changes were a bit too aggressive.
2020-08-31 13:01:31 -07:00
Robin Dunn
c00b8950da Spelling fixes in wx.lib 2020-07-14 12:53:31 -07:00
Robin Dunn
171df70a43 Fix SyntaxWarnings 2019-11-14 12:22:45 -08:00
Robin Dunn
5b91b8443e Decouple showScrollbars property from the actual showing/hiding of the scrollbar widgets. Instead it indicates whether the scrollbars are allowed to be shown if _adjustScrollbars() determines that they are needed.
Also fix issues with calculating scrolled view positions when scrolling with the scrollbars.
2019-11-13 12:00:32 -08:00
Robin Dunn
d86795d884 Don't use the string module. Do use the new file dialog style flags. 2017-09-12 15:38:49 -07:00
Robin Dunn
77de0cfb7d Merge branch 'refactor-lib.plot-part3' of https://github.com/dougthor42/Phoenix into dougthor42-refactor-lib.plot-part3 2017-09-08 09:20:11 -07:00
Robin Dunn
81f8c41a24 Fix missing imports needed for drawing the legend 2017-09-06 16:54:03 -07:00
Douglas Thor
845d7b6ba2 Fixed display of negative-length ticks
+ Changed default ticks to negative (extent out of plot rather an into plot).
+ Fixed tickLength setter - was setting unused self._tickWitch value
+ Added tickLengthPrinterScale property
+ axis values and labels should no longer overlap if tick lengths are negative.
2016-11-28 16:37:15 -08:00
Douglas Thor
0f90e02dcd Refactor if in _Draw(); use parens not \
+ Fixed typo in top-side ticks.
2016-11-28 16:37:12 -08:00
Douglas Thor
600cfb4d6c Miscellaneous cleanup, moved pairwise to utils.py 2016-11-28 14:53:35 -08:00
Douglas Thor
8832bb7880 Documentation fixes.
+ added deprecation note to docstring of PolyPoint.setLogScale
+ Replaced PendingDeprecation decorator with function.
  + This fixes the documentation having `wrapper(*args, **kwargs)`
+ Fixed some minor errors due to package conversion
+ Updated sphinx x-refs to reflect new package structure.
2016-11-28 14:40:59 -08:00
Douglas Thor
98edefdf8c Fixed bug with PlotPrintout in plotcanvas.py 2016-11-28 14:40:59 -08:00
Douglas Thor
15a8b2d13b Documentation updates
+ Sphinx cross-references and pylint: disable
+ Added __docformat__ and import comments
2016-07-07 09:13:20 -07:00
Douglas Thor
81244b6a7e Renamed plot.py to polyobjects.py
+ Moved DisplaySide, scale_and_shift_point, and set_displayside to utils.py
  + renamed _DisplaySide to DisplaySide
  + renamed _set_displayside to set_displayside
+ updated imports to reflect package rename
+ changed format of imports in __init__.py to be more PEP8-like.
+ updated numpy import exception
+ whitespace cleanups.
2016-07-07 09:13:20 -07:00
Douglas Thor
a8be4a9e1e Moved PlotCanvas to its own module: plotcanvas.py 2016-07-07 09:13:19 -07:00