Commit Graph

4062 Commits

Author SHA1 Message Date
wanze
b10595e713 toasterbox.py 2018-12-13 15:15:53 +08:00
jensgoe
714a9a222d ignore newline added by Tokenize module since Python 3.6 (fixes #1109) 2018-12-12 16:00:46 +01:00
jensgoe
5d80f94f21 fixed argument assignment 2018-12-05 14:12:16 +01:00
Robin Dunn
e5d24078fd Merge pull request #1087 from cbeytas/master
Fix bugs in CustomTreeCtrl and HyperTreeList
2018-11-30 14:55:02 -08:00
Robin Dunn
1f735769a1 Merge pull request #1082 from Metallicow/Fix-Image-Issues
Fix image issues
2018-11-30 14:52:26 -08:00
Robin Dunn
cfed8387fd Merge pull request #1088 from mickp/FixSortForDisplay
Don't try to compare Colours in SortForDisplay.
2018-11-30 14:48:41 -08:00
Robin Dunn
78196de84e Merge pull request #1090 from swt2c/remove_hardcode_spin
Remove hard-coded sizes from wx.SpinButton and wx.SpinCtrlDouble in demo
(cherry picked from commit 475d533888)
2018-11-30 14:45:40 -08:00
Robin Dunn
ccd9874d1c Merge pull request #1083 from swt2c/fix_pubsub_test
Fix pubsub provider test - restore expected whitespace
(cherry picked from commit f797aec0e6)
2018-11-30 14:45:22 -08:00
Robin Dunn
a023509f9b Merge pull request #1081 from swt2c/fix_filectrl_tests
Fix filectrl tests - wait a little longer to ensure event loop runs
(cherry picked from commit f7d6303690)
2018-11-30 14:44:56 -08:00
Robin Dunn
ad25565baa Merge pull request #1080 from swt2c/fix_dataview_test
Fix dataview test on Python 2
(cherry picked from commit d565a3500f)
2018-11-30 14:44:39 -08:00
Robin Dunn
ba3a638839 Merge pull request #1079 from swt2c/skip_unimplemented_tests
Skip unimplemented tests instead of failing them
(cherry picked from commit 66049df936)
2018-11-30 14:44:24 -08:00
cbeytas
714ac142e7 Add GetCount method to HyperTreeList
Was missing from the monkey-patched method list.
2018-11-29 23:00:25 -05:00
cbeytas
72d5646f17 Fix DeleteChildren in HyperTreeList
The TreeListItem.DeleteChildren() method iterates over the list of a
parent item's children (self._children) and calls tree.Delete(child)
on each one (hypertreelist.py line 1365):
	for child in list(self._children):
		child.DeleteChildren(tree)
		if tree:
			tree.Delete(child)

The TreeListMainWindow.Delete(item) method however removes the child
from its parent's list directly (hypertreelist.py line 2546):
	parent = item.GetParent()
	if parent:
		parent.GetChildren().remove(item)  # remove by value

This ends up modifying the list as we are iterating over it. The end
result is that every other child and its children do not get cleaned up
properly before being deleted. The biggest issue being that any windows
belonging to the children won't be destroyed, and instead orphaned in
the control.
2018-11-29 22:52:49 -05:00
Mick Phillips
2560dc3c7a Don't try to compare Colours.
If any two elements of self._value are equal, sorted tries to sort by the next element in the zipped tuples, resulting in
TypeError: '<' not supported between instances of 'Colour' and 'Colour'
Specifying a key to sort only by the first element prevents this.
2018-11-23 12:48:39 +00:00
cbeytas
f6e7064b55 Fix bad window position on add
If a window is created and added to CustomTreeCtrl or HyperTreeList its initial position will be incorrect and if the item it was added to is hidden (child of collapsed item) the window will be shown in an incorrect spot (usually 0,0 i.e. top-left of control).
2018-11-22 21:39:51 -05:00
cbeytas
c06fef9ccb Comment mistake 2018-11-21 19:36:59 -05:00
cbeytas
d1361f3d0b Fix bug in HyperTreeList and CustomTreeCtrl demos
Throws ValueError: chr() arg not in range(256) if any special key is
pressed while editing text control.
2018-11-21 15:17:23 -05:00
cbeytas
fb10da6aab Fix typo in CustomTreeCtrl and HyperTreeList demos
Context menu "Change Item Icons" would throw an exception due to typo.
2018-11-21 14:46:06 -05:00
cbeytas
7a8789347e Properly update tree when windows added or removed
In CustromTreeCtrl and HyperTreeList when a window is added or deleted
from an item the row height can change causing the entire tree to
change shape. This sets the _dirty flag so the tree gets recalcualted
during the next Idle handler.
In HyperTreeList deleting an item didn't properly remove it from the
_itemWithWindow list.
2018-11-21 14:45:03 -05:00
cbeytas
e11848f735 Fix hide items in HypreTreeList
Hiding items was only partially implemented and very buggy.
This feature does not exist in CustomTreeCtrl but I see no reason why
it couldn't be added in the future. This fix requires the arrow key fixes
in order for arrow keys to work reliably in a tree with hidden items.
Hidden items always report they are disabled and not expanded.

Also updates the demo of HyperTreeList to add hide options to context
menu so the feature can be tested.
2018-11-21 14:43:07 -05:00
cbeytas
46dfbacfed Fix item window positions on scroll with arrow keys
Fix item window positions on scroll with arrow keys (Issue #1059).

Affects CustomTreeCtrl and HyperTreeList.
Child window positions don't get updated when using the arrow keys to
move up/down through the tree on most platforms (msw, osx, gtk3).
It seemed to only work in gtk2.8.

Switching from using the SetScrollbars() method to the Scroll() method
repositions child windows more reliably.
2018-11-21 14:38:38 -05:00
cbeytas
5196fff16b Add DeleteItemWindow method to HyperTreeList
Missing method. It's best to discourage calling methods directly on
TreeListItem objects since often the tree won't be updated properly.
2018-11-21 14:32:23 -05:00
cbeytas
dbf22d7f02 Set window positions during CalculatePositions
In CustomTreeCtrl and HyperTreeList the `CalculatePositions` method
scans the tree and recalculates positions of all items. It is called
whenever the tree topology changes and also in the `OnInternalIdle()`
handler when the `self._dirty` flag is set.

The `CalculateLevel` method must also position child windows properly
to avoid glitches when the tree is drawn. Previously, child window
positions would only be updated when their item's row was painted.
Since the tree is drawn top to bottom the old window position could
occlude painting of previous rows until the position was updated,
leaving blank patches in the tree. This is most visible when the
TR_ROW_LINES style is used.

Also adds a 2-pixel margin to HyperTreeList OnPaint() method.
This is done to match the 2-pixel margin added in the
`CalculatePositions` method:
```y, x_colstart = 2, 0```
CustomTreeCtrl also does the same thing. Avoids needless
repositioning of child windows.
2018-11-21 14:31:40 -05:00
cbeytas
f280855a03 Set wx.Locale to avoid assertion errors
If customtreectrl.py or hypertreelist.py modules are run the latest
wxPython versions will throw Assertion errors if the locale is not set.

wxAssertionError: C++ assertion "strcmp(setlocale(LC_ALL, NULL), "C")
== 0" failed at ..\..\src\common\intl.cpp(1579) in wxLocale::GetInfo():
You probably called setlocale() directly instead of using wxLocale and
now there is a mismatch between C/C++ and Windows locale.
Things are going to break, please only change locale by creating
wxLocale objects to avoid this!
2018-11-21 14:30:17 -05:00
cbeytas
5f5e1fbd5b Fix window positioning during draw
In CustomTreeCtrl and HyperTreeList the `SetPosition` method is used
to adjust window positions. This can't set a Y value of -1 and instead
leaves the window at its last position. Use the `Move` method instead.
Also made sure this positioning is done before a possible call to the
`Show` method which prevents some flicker.
2018-11-21 14:29:45 -05:00
cbeytas
98cc99e11c Fix up/down/end/home keys and add PgUp/PgDn
CustromTreeCtrl key handling fixes:
UP key not working if previous item's children were disabled.
DOWN key not working if the next parent was disabled.
END not working when the last item in the tree is disabled.
HOME not working if the top item in the tree was disabled.

Adds handling for PageUp and PageDown keys.
Previously CustomTreeCtrl would let these keys be handled by the
ScrolledWindow subclass which scrolls by a page but doesn't update the
selection. This change moves the selection to the first/last visible
item, or by an entire page if the first/last visible item is already
selected. This mimics native control handling and avoids disabled items.

Adds two methods: GetPrevShown() and GetNextShown().
2018-11-21 14:28:06 -05:00
cbeytas
ed2e8eac5e Guard against unlinked items in CustomTreeCtrl
The GetNextSibling() and GetPrevSibling() methods in CustomTreeCtrl
will throw an exception if the item has been deleted from the tree.
This happens whenever an item is deleted but the selection isn't
updated. The exception will be thrown on the next key press. Can be
observed easily in the HyperTreeList demo.
2018-11-21 14:24:50 -05:00
cbeytas
87b100649e Fix exception when no selection in HyperTreeList
If a HyperTreeList is created with only the root item present, and not
selected, an exception will be thrown if any key is pressed.
GetFirstVisibleItem() returns None, even though the root item is
present and visible. Only an issue if the TR_MULTIPLE flag is set.
2018-11-21 14:16:50 -05:00
cbeytas
435d228196 Add additional key handling to customtreectrl
Allow use of numpad +. -. and * keys as well as the Windows menu key in
addition to regular keys.
Fix wrong method call to self.ExpandAll(), now self.ExpandAllChildren().
Note: The code still compares against ord('+') and ord('*') which isn't
valid for wx keycodes and will never evaluate properly.
If the user presses the plus '+' button, on most keyboard this will
result in an ord('=') keycode with the SHIFT modifier set.
2018-11-21 14:01:10 -05:00
cbeytas
b2067d1d61 Fix line drawn through root item in customtreectrl
Regression caused by PR #886
`on_the_right` is used as positional argument where `separator` is
expected causing a line to be drawn through root item.
This change specifies keyword arguments explicitly.
2018-11-21 13:59:43 -05:00
cbeytas
5706dc2501 Update docstrings for CustomTreeCtrl/HyperTreeList
Warnings about accessing some GenericTreeItem methods directly.
Some documentation updates and notes on some methods.
2018-11-21 13:57:59 -05:00
Metallicow
230bf5d6d3 Optimize All PNGs Nov2018
Since I had to fix a image issue and optimize it. I decided to rerun FileOptimizer 13.30.2393 over all pngs. Small bytes for some that had been optimized before, but this comit covers all pngs that may have been missed in the past. Maybe revisit running them all again in 2 years. Total time to process all pngs: approx 8 hours.
As technology improves this will only get better/faster when downloading, loading in browser, embedded, etc...
2018-11-13 16:08:12 -06:00
Metallicow
794c694169 Fix size of image to match others. Should fix layout issue 2018-11-13 09:43:10 -06:00
Robin Dunn
79ddece4e9 Use forward slashes in sphinx output
(cherry picked from commit 7b3a62102c)
2018-11-08 20:31:30 -08:00
Robin Dunn
74bc4b4f03 Merge pull request #1077 from Metallicow/ColourCubeDialog-box-flickering
Fix flickering with boxes/lines drawn on colorcube/wheel images

(cherry picked from commit 15dd7c7cec)
2018-11-08 20:20:46 -08:00
Robin Dunn
106f2aa733 Merge pull request #1076 from Metallicow/HyperTreeList-Fix
Fix dc.DrawRectangleRect to dc.DrawRectangle

(cherry picked from commit 3aa4f289e9)
2018-11-08 20:10:13 -08:00
Robin Dunn
68dcd7872a Merge pull request #1066 from garibarba/master
Fix bug due to type mismatch.
2018-11-08 19:55:21 -08:00
Robin Dunn
122d28fc4c Add Python 3.7 to the classifiers
(cherry picked from commit 6b6f2a932f)
2018-11-08 15:29:35 -08:00
Robin Dunn
586f9ccd22 Add Enabled property for wx.MenuItem
(cherry picked from commit af7f52b640)
2018-11-01 17:06:46 -07:00
Robin Dunn
d8ca61588d Merge pull request #1069 from RobinD42/fix-issue1068
Fixed the wrappers for wx.html.HtmlWindow.OnOpeningURL

(cherry picked from commit 05f871e9f7)
2018-10-31 18:43:28 -07:00
Guillermo González de Garibay
a71f32768d Merge remote-tracking branch 'upstream/master' 2018-10-30 09:02:48 +01:00
Robin Dunn
ceb2f46720 Merge pull request #1065 from RobinD42/fix-issue1061
Transfer ownership of the wx.aui.AuiNotbook.SetArtProvider art parameter

(cherry picked from commit a55e4ec45d)
2018-10-29 22:18:23 -07:00
Robin Dunn
653d91b372 Merge pull request #1064 from RobinD42/fix-issue1060
Ensure sip knows the pure virtuals are present in wx.html.HtmlPrintout

(cherry picked from commit 17f52dfd14)
2018-10-29 22:18:08 -07:00
Robin Dunn
882401e9d9 Merge pull request #1063 from RobinD42/fix-issue997
Various updates for wxJoystick

(cherry picked from commit 12f20a4018)
2018-10-29 19:01:24 -07:00
Robin Dunn
36f8cb79bf Merge pull request #1058 from RobinD42/fix-issue1032
Ensure colours set in TreeItemAttr are instances of wx.Colour

(cherry picked from commit 8bfe2199dc)
2018-10-26 18:18:22 -07:00
Robin Dunn
e92d572267 Merge pull request #1057 from RobinD42/fix-issue1025
fix test suite errors in wx/py/tests

(cherry picked from commit ebb3de75ed)
2018-10-26 18:17:52 -07:00
Robin Dunn
33b13b441b Merge pull request #1056 from RobinD42/fix-issue1024
Fix AUI sample to properly use a range of wx.WindowIDRefs

(cherry picked from commit f38671044c)
2018-10-26 18:17:37 -07:00
Robin Dunn
b9eb746f40 Merge pull request #1055 from RobinD42/fix-issue1013
Fix tickmarks when there is a negative bounds

(cherry picked from commit 24a455acb3)
2018-10-26 18:17:24 -07:00
Robin Dunn
cf7995027a Merge pull request #1038 from jgehw/optical-appearance-fix
fix optical grid appearance
2018-10-24 19:57:47 -07:00
Robin Dunn
da9f69c380 Merge pull request #1050 from mesalu/fix_1049
CustomTreeCtrl and HyperTreeList fixes
2018-10-24 19:36:41 -07:00