Commit Graph

1127 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
Scott Talbert
9a8a9b019c Merge pull request #2026 from carolfs/master
Fixed integer division in Python 3
2021-11-29 21:22:26 -05:00
Scott Talbert
f42bea0927 Merge pull request #2005 from gwhitney/setscrollbar_types
fix: Correct types of arguments to ScrolledWindow.SetScrollbars
2021-11-29 21:20:30 -05:00
Scott Talbert
2bbf0cc423 Merge pull request #1953 from jmoraleda/fix_auiframemanager_regression
Fix regression in aui framemanager introduced in last commit
2021-11-21 16:28:46 -05:00
Scott Talbert
7776c773da Merge pull request #1931 from jmoraleda/fix_auibar_regression
Fix regression in auibar introduced in last commit
2021-11-21 16:26:28 -05:00
Scott Talbert
1c1540ff44 Merge pull request #1940 from Lollixzc/patch-1
Correct typo in eventwatcher.py
2021-11-19 19:32:44 -05:00
Scott Talbert
07f54c1f37 Merge pull request #2003 from swt2c/pyprogress_msw
Fix PyProgress on MSW by avoiding invalid sizer flags
2021-11-19 17:58:05 -05:00
Scott Talbert
b40ab0f806 Update Cython version to fix NanoSVG issues with Python 3.10 2021-11-18 15:23:00 -05:00
Carolina Feher da Silva
0d449626d6 Fixed integer division in Python 3 2021-11-16 01:24:31 +00:00
Glen Whitney
3eb9eb32dc fix: Correct types of arguments to ScrolledWindow.SetScrollbars 2021-08-31 11:06:27 -07:00
Scott Talbert
d2807efb45 Fix PyProgress on MSW by avoiding invalid sizer flags
Fixes #1985.
2021-08-20 21:06:44 -04:00
Jorge Moraleda
d1325de5a0 Fix regression in aui framemanager introduced in commit 2760cbe0 which mistakenly reverted the fix introduced in commit d0577746 2021-04-22 19:12:18 -07:00
Lollixzc
381d32ce8c Correct typo in eventwatcher.py
I noticed a typo when using the bundled eventwatcher the demos. I think this should be correct
2021-03-27 22:24:16 +01:00
Jorge Moraleda
3d05abea47 Fix regression in auibar introduced in commit e32ba711 which mistakenly reverted the fix introduced in commit e059ec1a 2021-03-07 15:10:05 -08:00
Robin Dunn
c3d4881bfd Fix an invalid escape sequence warning 2021-01-20 13:10:33 -08:00
Kevin Schlosser
ec12b059d7 Fixes transparency in the docking guides for wx.lib.agw.aui
wx.Region no longer selects all non transparent pixels when a wxBitmap is passed to the constructor. In order to get the region made properly a color bust also be supplied. As luck would have it the way the docking guide images were made we are able to do this because there is only a single color that we needed to use.
2021-01-18 15:26:05 -08:00
Scott Talbert
eb0156fed3 Adjust CubeColourDialog's SpinCtrl width when on GTK3
Fixes #1891.
2021-01-18 15:25:33 -08:00
Kevin Schlosser
40e454d179 Fixes floating point math in wx.lib.agw.aui
wx.lib.agw.aui was never converted to run on Python 3 and as a result the division operator forces a conversion of the used values to a float. Floats cannot be used in functions like `range`. This caused quite number of things to not function properly and produce tracebacks.

The other thing is when wx.lib.agw.aui was written pixels could not be rendered using coordinates that were floats so now passing floats could cause rendering alignment problems because the layout of the various bits were done so in a manner that would have the alignment correct using integers.
2021-01-18 15:25:33 -08:00
cbeytas
7b02c88a28 Merge branch 'master' into treefixes 2021-01-10 03:04:29 +00:00
Robin Dunn
4ab028d7c3 Use a global wx.DataFormat 2021-01-07 14:52:34 -08:00
Robin Dunn
c8e25b79e1 Run SIP via its Python interface rather than as a separate subprocess 2021-01-05 11:01:25 -08:00
Robin Dunn
e198659b25 Merge pull request #1857 from jmoraleda/Issue1856
AuiToolBar checks that it has not been Destroyed by the most recent a…
2020-12-18 16:29:58 -08:00
Robin Dunn
aa2f657441 Merge pull request #1873 from jmoraleda/issue_1872
Ensure variable is created before referencing it in aui framemanager.
2020-12-18 16:24:21 -08:00
Jorge Moraleda
d0577746ed Ensure variable is created before referencing it in aui framemanager. 2020-12-12 12:39:26 -08:00
Eric Poulsen
5da1fd2d89 fix for negative number entry 2020-12-05 16:17:37 -08:00
Jorge Moraleda
e059ec1af9 AuiToolBar checks that it has not been Destroyed by the most recent action before doing any post-processing for the action 2020-11-25 19:54:11 -08:00
Robin Dunn
1a8d0fa9bb Check for existing mouse capture before doing a capture/release 2020-11-18 14:13:51 -08:00
Robin Dunn
e4bd88b0d9 Merge pull request #1848 from jmoraleda/issue_1361
Update AuiManager when a dummy center pane is added. This fixes #1361
2020-11-18 13:41:23 -08:00
Jorge Moraleda
cb711169ed Update AuiManager when a dummy center pane is added. This fixes #1361 2020-11-17 17:47:43 -08:00
Michael Eager
566dd8f35f Merge branch 'master' into refactor-thumbnailctrl 2020-11-16 15:32:52 -08:00
eager
0a03c37a26 Fixes from code review. 2020-10-28 09:57:09 -07:00
eager
81c0461233 Refactor ThumbnailCtrl, create stand-alone ScrolledThumbnail widget
ThumbnailCtrl is more of a image browser demo application than a widget,
in that it reads files from a directory, selects which files to display,
deletes files, displays the source directory path in a text ctrl, etc.
This makes it unlikely that it could be used in any other application,
for example, to provide thumbnails of files with different file types
than the ones hard-coded in the class.

ThumbnailCtrl delegates most of its operations to ScrolledThumbnail
which actually implements a scrolled window of thumbnails, a Thumb class,
which contains information about a thumbnail, and an ImageHandler class,
which manipulates images.  There was poor isolation of functionality
between these classes, violating object-oriented design, with one class
making changes to the internal data of another class.  Additionally, there
was substantial non-functional code, as well as code which did not
function correctly.

This refactoring maintains the functionality and interfaces of
ThumbnailCtrl, except for those which were unused.  Existing uses of
the thumbnailctrl package should work without modification.  A new package,
scrolledthumbnail, contains the functionality for a scrolled window
containing thumbnails, an extendable Thumb class, and image manipulation
classes.  The scrolledthumbnail package can be used in other applications,
independent of the ThumbnailCtrl class, and without the functional
restrictions of that application.

Detailed changes:

ThumbnailCtrl.py (demo program):
 - Always import from wx.lib.agw
 - Optional code to use PIL instead of native image handling
 - Add setting for thumbnail width and height
 - Increase size of demo window

thumbnailctrl.py:
 - Move Thumb, ScrolledThumbnail, ImageHandler to scrolledthumbnail.py
 - Remove EVT_THUMBNAILS_CAPTION_CHANGED (unused)
 - Add EVT_THUMBNAILS_CHAR to respond to keystrokes
 - Remove image processing code
 - Add scrolling dialog for delete files
 - Move directory processing from ScrolledThumbnail
 - Move file delete processing from ScrolledThumbnail
 - List all files to be deleted in scrolling dialog
 - Remove unused or unimplemented methods and options

scrolledthumbnail.py:
 - Move Thumb, ScrolledThumbnail, ImageHander classes from thumbnailctrl.py
 - Add documentation for ScrolledThumbnail widget
 - Add example program which does not use ThumbnailCtrl
 - New EVT_THUMBNAILS_CHAR event for key press
 - Remove unused options and dead code
 - Add Rotate() to PILImageHandler and NativeImageHandler
 - Throw event EVT_THUMBNAILS_CHAR for keystroke on thumbnail
 - Fix failure to rotate images correctly
 - Redisplay window when thumb size changed
 - Simplify logic
 - Remove popup dialog when rotating images
2020-10-28 09:56:35 -07:00
Metallicow
8d4f8e733c Reduce flicker in throbber. Use BufferedPaintDC 2020-10-27 19:03:10 -05:00
Robin Dunn
1842b2bc9a Merge branch 'master' into webview-edge 2020-10-14 13:02:12 -07:00
Robin Dunn
9bef374ecf Give a warning about CheckListCtrlMixin's redundancy 2020-10-13 15:56:04 -07:00
Robin Dunn
bf34a1e276 Fix indentation issue 2020-10-13 14:18:03 -07:00
Robin Dunn
88dd4e2f30 Use key-up on MSW and key-down on others. Only skip for keys not handled by the event handler. 2020-10-12 12:46:15 -07:00
Metallicow
a2f316edcf fix small typo in mixin sample example 2020-10-12 12:45:08 -07:00
Metallicow
94ccec7aca Update and fixes per Robins REQz
Robins requested changes found here #1695
Also added current and pressed bitmaps to mixin.
2020-10-12 12:45:08 -07:00
Metallicow
81843a627f Add wx.lib.checkbox
Sphinx Formatting and other stuff per Robins REQz
2020-10-12 12:45:08 -07:00
Metallicow
c81865ddbb revert disabled flag in unchecked checkbox func
I believe this one looks right now
2020-10-12 12:45:08 -07:00
Metallicow
037dcb96f4 Add PurePython Checkbox
Mostly ported from the wxPyWiki impl and also is a mixin to get bitmaps if desired if hacking on other widgets.
2020-10-12 12:45:08 -07:00
Robin Dunn
8a04577f95 Pin cython version to aid in consistency across platforms 2020-10-09 10:04:13 -07:00
Robin Dunn
9db9d72ed4 Merge pull request #1806 from StefanBruens/more_test_fixes
More test fixes
2020-10-08 21:00:32 -07:00
Robin Dunn
f413ead0b2 Merge pull request #1759 from Metallicow/AUI_DOCKART_HINT_WINDOW_BORDER_COLOUR
Add agw.aui.AUI_DOCKART_HINT_WINDOW_BORDER_COLOUR theming
2020-10-08 20:59:36 -07:00
Stefan Brüns
62cda454f1 Do not specify invalid alignment in BoxSizer flags
Specyfing a horizontal alignment in a wxHORIZONTAL layed out BoxSizer
is pointless, and doing so throws an exception:

wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_RIGHT)"
failed at ./src/common/sizer.cpp(2133) in DoInsert():
Horizontal alignment flags are ignored in horizontal sizers
2020-10-02 17:56:43 +02:00
Robin Dunn
ed834e7640 Copy the new sip.h 2020-09-16 16:15:17 -07:00
Robin Dunn
05ae56ab2a Merge pull request #1792 from maddox32/master
avoid sizer assert agw/PyProgress
2020-09-10 13:36:45 -07:00
maddox32
cbe476df0b Remove superflous if 2020-09-10 19:35:54 +02:00
maddox32
1ee432bfab Avoid sizer flag assert 2020-09-10 19:35:05 +02:00