20 Commits

Author SHA1 Message Date
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
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
9f2cc54b48 Update copyright years 2020-03-10 11:41:39 -07:00
Kevin Schlosser
da89035e82 corrects moving of the text in the ctrl when resize occurs.
This was caused by the use of GetClientSize being used when the control is constructed and then event.GetSize() when a size event took place. These 2 methods eturn different values and causes the text to shift. After this issue was solved another issue existed. there is a border around the control. this border is not directly specified to be drawn when the widget is rendered. the dc defaults to a white pen with a width of 1. a pen is not set before drawing the box. so the white pen there for gets used. This white border is not taken into consideration when the text is drawn and causes the text to be offset slightly. this corrects the offset issue. There is also no calculation in place to determine the actual width and actual height of each character and without having that it is more like a guess to figure out exactly where to draw the characters to have them be centered correctly inside of the box. I kept the same mechanism in place and made an adjustment to fix this issue i believe. I do think that the current wat it is being done makes the code a tad more difficult to read and could be simplified. This is something I may take care of in a future PR.
2019-12-22 01:43:34 -07:00
Robin Dunn
b77c88a280 Merge tag 'wxPython-4.0.2' into wxPy-4.0.x
(cherry picked from commit 4c56c39e52)
2018-06-17 22:04:22 -07:00
Robin Dunn
ebde977c82 Fix scrolling regression in DynamicSashWindow 2018-01-25 16:25:34 -08:00
Metallicow
c76384d458 Trim trailing whitespace *.py files 2018-01-16 08:47:07 -06:00
Robin Dunn
bb275cb617 Switch gizmos.TreeListCtrl to be essentially just HyperTreeList with a new name. 2018-01-05 19:46:50 -08:00
Robin Dunn
640641e1b0 More TreeListCtrl WIP 2017-12-12 20:53:40 -08:00
Robin Dunn
50a89814b8 More TreeListCtrl WIP 2017-12-06 17:36:19 -08:00
Robin Dunn
51b39e65b5 Starting to add TreeListCtrl 2017-11-17 14:39:16 -08:00
Robin Dunn
808c108a3c Put the "m" back on the "_names" 2017-11-13 14:34:08 -08:00
Robin Dunn
72f712454b Draw the sash with wx.Overlay on Macs 2017-11-04 11:51:18 -07:00
Robin Dunn
b5aa9fbad5 Fix motion event x,y positions 2017-11-02 11:02:28 -07:00
Robin Dunn
7080da06a8 Typos and renumber the DSR enum 2017-11-01 18:22:15 -07:00
Robin Dunn
22847f200f Port wxDynamicSashWindow and friends from wxCode 2017-11-01 16:06:26 -07:00
Robin Dunn
82a7a73363 Create() needs to return a value 2017-10-30 21:30:08 -07:00
Robin Dunn
e6c16cf455 Support 2-phase create, add unittests 2017-10-30 12:42:38 -07:00
Robin Dunn
2233deb830 Some docstring updates 2017-10-30 11:58:37 -07:00
Robin Dunn
17643e9cd1 Port the LEDNumberCtrl from wxCode/gizmos in Classic 2017-10-27 17:21:59 -07:00