63 Commits

Author SHA1 Message Date
Scott Talbert
e49de63539 Fix more OGL float/int conversion issues
Fixes: https://github.com/wxWidgets/Phoenix/issues/2739
2025-07-31 09:56:27 -04:00
amarinoICEg
0f57ad4105 casting drawrectangle arguments to int as required 2024-12-04 12:01:00 +01:00
Lorenzo Nebolosi
ef42749294 float -> int
DrawRectangle and DrawRoundedRectangle requires ints instead of floats
2024-11-19 17:22:00 +01:00
mprosperi
1d2eb2e39d fix float->int compatibility for py3.10+ (also fixes #2349) 2023-05-31 15:39:33 +02: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
Metallicow
542a32c17d Optimize Colour Brush Pen
Use builtin Colours, Brushes, Pens where needed. They are faster.
2020-07-19 23:48:39 -05:00
Robin Dunn
c00b8950da Spelling fixes in wx.lib 2020-07-14 12:53:31 -07:00
Per A. Brodtkorb
fc1823315b Fixes issue # 1554:
Replaced "== None" and "!= None" with "is None" and "is not None", respectively, because the former is slower and error-prone.
2020-03-23 11:53:36 +01:00
Robin Dunn
705aa63d75 Merge branch 'more-windowidref' into wxPy-4.0.x
(cherry picked from commit ada7b2fc51)
2018-06-25 19:12:00 -07:00
Robin Dunn
b1b0c9e297 wx.NewId() --> wx.ID_ANY or wx.Window.NewControlId() as appropriate 2018-06-19 10:31:56 -07:00
Robin Dunn
25a06b002c Merge pull request #755 from jwilk-forks/atan2
Simplify angle calculation in ogl.LineShape.DrawArrow()
2018-02-22 22:20:17 -08:00
Jakub Wilk
3a34b71d9a Don't use string exceptions
String exceptions have been removed in Python 2.6.
Attempting to raise them causes TypeError.
2018-02-18 21:19:54 +01:00
Jakub Wilk
013a69d856 Simplify theta calculation in ogl.LineShape.DrawArrow() 2018-02-18 21:00:40 +01:00
Robin Dunn
beec04eacd PrepareDC for the wx.MemoryDCs too 2017-12-28 16:08:50 -08:00
Robin Dunn
7e8a27e170 Clean up access to the Canvas's buffer bitmap 2017-12-28 15:59:04 -08:00
Robin Dunn
c7c2de0a1b It looks like Overlay use was started but never fully implemented. Remove it all for now. 2017-12-28 15:55:39 -08:00
Robin Dunn
583549098a Also PrepareDC for the wx.ClientDC's used for intermediate drawing 2017-12-28 15:42:34 -08:00
Robin Dunn
28cde58761 Fix OGL's ShapeCanvas to draw properly when the window is scrolled,
and to also adjust the mouse coordinates, etc.
2017-12-28 15:20:43 -08:00
Metallicow
eb3653ee27 Trim Whitespace ogl directory 2016-10-12 22:42:30 -05:00
Robin Dunn
0e79905aa0 Don't set the hourglass cursor every time the diagram is redrawn. It can get real annoying. 2016-08-04 15:14:43 -07:00
Robin Dunn
1d1fc7c187 More docstring ref fixes in wx.lib 2016-07-07 09:58:04 -07:00
Robin Dunn
cc3190e240 Lots more docstring refs fixed 2016-07-06 20:20:10 -07:00
Robin Dunn
488f29b05a Fix docstring references to wx.Bitmap 2016-07-06 18:45:16 -07:00
Robin Dunn
4175d35105 Fix docstring references to wx.Colour 2016-07-06 18:40:04 -07:00
Werner F Bruhin
42df586ecd - make Sphinx links in module doc work 2015-02-06 10:17:02 +01:00
Werner F Bruhin
2461989aa8 - added 'documented' flag, also could still do with some editing 2015-02-05 11:23:44 +01:00
Werner F Bruhin
f081eb9ba7 - remove -#!/usr/bin/env python 2015-02-05 11:08:10 +01:00
Werner F Bruhin
9bade03362 - documentation corrections 2014-06-17 13:18:14 +02:00
Werner F Bruhin
ff1ef2a1c6 - documentation corrections 2014-06-17 12:17:24 +02:00
Werner F Bruhin
77bf699847 - documentation 2014-06-17 12:16:52 +02:00
Werner F Bruhin
4c9b31c7df - documentation 2014-06-16 12:34:56 +02:00
Werner F Bruhin
672a9e0015 - documentation 2014-06-16 12:17:55 +02:00
Werner F Bruhin
16401f0bfc - some documentation corrections 2014-06-15 22:28:44 +02:00
Werner F Bruhin
7ed83f79e9 - documentation 2014-06-15 15:55:58 +02:00
Werner F Bruhin
5046f605de - documentation 2014-06-15 14:36:21 +02:00
Werner F Bruhin
1cdcab0afc - documentation corrections 2014-06-15 14:20:06 +02:00
Werner F Bruhin
7b8a7be4f5 - documentation 2014-06-15 14:19:38 +02:00
Werner F Bruhin
7a96bd6296 - KEY_SHIFT and KEY_CTRL where defined in canvas.py and composit.py moved to oglmisc.py
- added above to test_lib_ogl.py
2014-06-14 15:23:41 +02:00
Werner F Bruhin
1f3485df58 - Correct errors found by PyLint
- AdjustTop defined twice
- bottom was not defined, probably a copy/paste error
- typo for False
2014-06-14 15:15:04 +02:00
Werner F Bruhin
ca40260c8d - should AttachmentPoint be ControlPoint? 2014-06-14 15:13:42 +02:00
Werner F Bruhin
2a13b7cf98 - Typo found by PyLint 2014-06-14 15:13:06 +02:00
Werner F Bruhin
6494fcd577 - documentation 2014-06-14 10:33:35 +02:00
Werner F Bruhin
176f8ea29d - reported as errors by pyLint 2014-06-13 16:03:45 +02:00
Werner F Bruhin
19f998d760 - changed to Sphinx doc style
- needs review
2014-06-13 15:57:59 +02:00
Werner F Bruhin
afb1a4554b - remove debug print stuff and better text for DCOverlay use 2014-06-13 12:04:18 +02:00
Werner F Bruhin
0f3f407f9b - out indent the self.Draw to correct of issue with moving object
- remove debug print stuff
2014-06-13 12:03:27 +02:00
Werner F Bruhin
d8d05d6f6c - some more print to help debug
- correct typo
2014-06-13 10:33:54 +02:00