Commit Graph

465 Commits

Author SHA1 Message Date
Scott Talbert
58682ecaf4 Update demos to work wxWidgets 3.1.6 2022-05-02 22:36:44 -04:00
Robin Dunn
66ec80bd21 Merge branch 'master' into update-wx 2021-12-15 18:59:03 -08:00
Robin Dunn
a843ed14f2 Merge pull request #2014 from arjones6/master
Add wxDC.DrawLinesFromBuffer to draw directly from numpy array memory using the Buffer protocol
2021-12-15 18:55:41 -08: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
arjones6
efbea6a275 dc.DrawLinesFromBuffer demo and test to intc data type. Updated documentation. 2021-12-15 11:07:18 -05:00
arjones6
232542ba3e dc.DrawLinesFromBuffer test and demo added 2021-12-14 12:47:55 -05:00
Todd
2e753e6775 Add demo for show/hide toggle button 2021-12-14 15:33:39 +00:00
Robin Dunn
9627bb8035 Merge branch 'master' into update-wx 2021-12-13 21:40:18 -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
272990b131 Merge pull request #1997 from cclauss/codespell
Fix typos discovered by codespell
2021-12-13 20:16:39 -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
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
Robin Dunn
f95f3187ad Merge branch 'master' into update-wx 2021-11-23 17:00:06 -08:00
Robin Dunn
1eef4d9390 Add InitLocale method 2021-10-26 12:35:04 -07:00
Glen Whitney
3eb9eb32dc fix: Correct types of arguments to ScrolledWindow.SetScrollbars 2021-08-31 11:06:27 -07:00
Christian Clauss
25ba122168 Fix typos discovered by codespell 2021-08-07 18:55:49 +02:00
Robin Dunn
dcf5ba7888 Switch overview text to plain text 2021-07-24 15:17:33 -07:00
Mat Kelly
274a12ded0 Fix parameters for 'More Grid Features' constructor 2021-04-23 16:08:07 -04:00
Robin Dunn
442b50ad78 Ensure the the timers are all stopped when the Timer sample is shutdown 2021-01-20 13:35:31 -08:00
Robin Dunn
13cc5db688 I think this wx.Locale() may be unnecessary now that InitLocal has been rewritten... 2021-01-18 15:38:44 -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
bb20ee8809 Fix sizer flags for joystick demo 2021-01-05 16:15:10 -08:00
Robin Dunn
12db41dad1 Ensure SIP knows about the item container pure virtuals. 2020-12-29 18:11:05 -08:00
Robin Dunn
3d1134708e wxGridCellRenderer::Draw has an implementation despite being pure virtual 2020-12-29 14:59:17 -08:00
Michael Eager
566dd8f35f Merge branch 'master' into refactor-thumbnailctrl 2020-11-16 15:32:52 -08:00
eagerm
846a4f4e4a Remove unused sizer, add spacing to controls. 2020-11-16 12:31:00 -08:00
eagerm
4bef428bce Add documentation to demo programs. 2020-11-16 12:07:45 -08:00
Robin Dunn
b27e492898 Also show wx.adv.DatePickerCtrlGeneric in the demo 2020-11-13 09:39:37 -08:00
eagerm
4c6b725479 Create ThumbDemoConfig.py from class in ScrolledThumbnail & ThumbnailCtrl
Add import statements to ScrolledThumbnail and ThumbnailCtrl.
Remove unneeded imports.
2020-11-12 09:40:00 -08:00
eagerm
d6727e5ce7 Create ThumbDemoConfig class
class ThumbDemoConfig contains the user interface and controls used
by both ScrolledThumbnail and ThumbnailCtrl.

Functions which are different between the two demos are overwridden
by each demo.
2020-11-11 12:38:54 -08:00
eagerm
6fa88e361f Reduce differences between demo/ScrolledThumbnail and demo/ThumbnailCtrl 2020-11-10 20:20:34 -08:00
eagerm
e73d5f49db Minor cleanup and fixes from code review
demo/agw/ScrolledThumbnail.py:
  Set frame size to (850, 800).
  Decrease left side of splitter.
  Use default font.
  Remove SetAutoLayout()
  Fix THUMB_OUTLINE_NONE, etc. not found.
demo/agw/Thumbnailctrl.py:
  Set frame size to (850, 800).
  Make scroll instance variable, not local.
  Replace self.TC with self.scroll.
  Decrease left side of splitter.
  Use default font.
  Remove SetAutoLayout().
2020-11-10 20:12:54 -08:00
Robin Dunn
c0341cb2b6 Merge pull request #1826 from Metallicow/Reduce-flicker-svg-demos
Reduce flicker in svg demos
2020-11-05 13:44:57 -08:00
eagerm
f511c293cc Add ScrolledThumbnail demo
New:  demo/agw/ScrolledThumbnail.py
2020-10-28 09:57:14 -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
Robin Dunn
be94264761 The Bitmap mask bug on OSX has been fixed, switch back to using the bitmap to get the shape 2020-10-22 15:36:06 -07:00
Metallicow
efec3bcca5 Reduce flicker in svg demos 2020-10-19 03:32:58 -05:00
Robin Dunn
c5c28fd811 Add wx.Image.ConvertToRegion allowing to construct a region from an image without needing to make a bitmap first. 2020-10-14 18:17:54 -07:00
Robin Dunn
1842b2bc9a Merge branch 'master' into webview-edge 2020-10-14 13:02:12 -07:00
Robin Dunn
cafa02a2f2 Remove old todo file 2020-10-13 15:57:02 -07:00
Robin Dunn
e8f394bc2c Switch the CheckListCtrlMixin demo to just use the new built-in checkbox functionality 2020-10-13 15:40:17 -07:00
Robin Dunn
84b9af5c22 Add code to test which backends are available, and show which one was selected. 2020-10-13 14:17:34 -07:00
Robin Dunn
15b5f94e3b minor demo tweaks 2020-10-13 13:22:31 -07:00
Metallicow
24877a11b1 Add wx.lib.checkbox GenericCheckBox Demo 2020-10-12 12:45:08 -07:00
Metallicow
6306a56540 Fix MessageDialog typo and apply Robins REQz 2020-10-09 09:58:45 -05:00
Metallicow
a811f20cda Fix GLCanvas Demo
Add a bit more example to the cube and the cone. Made note to DO NOT USE glut. It is old.
Folks seem to always have hard time figuring out how to load images. Added image texturing example.
Also changed cone to meshmode.
2020-10-01 00:15:01 -05:00
Jorge Moraleda
e7b86c546f Remove inconsistent layout flags that prevent XLSGrid demo from running 2020-07-21 18:00:40 -07:00
Metallicow
5ceaff1874 Convert all line endings to Unix(LF) 2020-07-19 23:56:16 -05:00