Commit Graph

984 Commits

Author SHA1 Message Date
Anna Petrasova
28b7ba5794 Fix Python 3.10 in lib.plot
Fixes drawing lines
2021-12-29 23:23:33 -05:00
Scott Talbert
aa3dca0e40 Fix additional Python 3.10 issues with AGW FlatNotebook 2021-12-27 19:48:55 -05:00
Robin Dunn
e53b09aea7 Revert "New button type: ShowHideToggleButton." 2021-12-15 18:10:12 -08:00
Robin Dunn
1432d933a5 Merge pull request #1980 from TEParsons/showHideToggleButton
New button type: ShowHideToggleButton.
2021-12-15 18:07:04 -08:00
Todd
f3a5e7cb98 Add docstring for show/hide toggle button 2021-12-14 15:33:30 +00:00
Robin Dunn
de0a4415c0 Merge pull request #2048 from komoto48g/feature-scrpnl
Add self-guard in scrolledpanel:_SetupAfter
2021-12-13 21:03:49 -08: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
Robin Dunn
74e5be8b2f Merge pull request #2033 from jmoraleda/customizable_pdf_button_panel
Enable customization of layout of pdfviewer button panel
2021-12-13 20:39:58 -08:00
Robin Dunn
272990b131 Merge pull request #1997 from cclauss/codespell
Fix typos discovered by codespell
2021-12-13 20:16:39 -08:00
komoto
b699b2823c Add self-guard in scrolledpanel:_SetupAfter 2021-12-08 00:08:28 +09: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
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
Jorge Moraleda
672ec886b8 Enable customization of layout of pdfviewer button panel 2021-11-21 18:11:14 -08: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
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
Christian Clauss
25ba122168 Fix typos discovered by codespell 2021-08-07 18:55:49 +02: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
Todd
151683f603 New button type: ShowHideToggleButton.
Like a ToggleButton, but with an associated "menu", a Window or Sizer which is shown/hidden when button is toggled. Includes methods for setting active and inactive fore/background colours.
2021-04-01 16:56:54 +01: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
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