Commit Graph

853 Commits

Author SHA1 Message Date
Robin Dunn
81d331b864 docstring tweaks 2019-08-26 20:51:16 -07:00
Robin Dunn
8a5df76dba fix typo 2019-08-20 11:53:19 -07:00
Robin Dunn
f7ff075f45 Various fixes and tweaks to go with the wxWidgets update 2019-07-31 12:20:00 -07:00
Robin Dunn
de4d1d811a Merge pull request #1301 from wxWidgets/fix-overlay-crash
Fix overlay crash
2019-07-08 21:34:15 -07:00
Robin Dunn
86b361d938 Merge pull request #1272 from Metallicow/sizer-fixes
Fix some sizer issues with wxPy4.1
2019-07-08 21:05:12 -07:00
Robin Dunn
581f094f04 Merge pull request #1268 from tycode/dropdown-button-text-not-rendering
Fix AUI dropdown button not rendering text when icon is wx.NullBitmap
2019-07-08 20:57:39 -07:00
Robin Dunn
e0366971fb Fix probable copy/paste error 2019-07-08 14:01:47 -07:00
Robin Dunn
f93e835c68 The wx.WS_EX_VALIDATE_RECURSIVELY extended style flag is obsolete 2019-06-28 23:08:49 -07:00
Metallicow
e442736ee3 Fix some sizer issues with wxPy4.1 2019-06-20 19:46:45 -05:00
Rob Rolls
7e3844710d Fix AUI dropdown button not rendering text when icon is wx.NullBitmap 2019-06-18 18:52:44 +01:00
Robin Dunn
4d336e13ba Merge pull request #1246 from Nyral/label_multiple_edit_fix
Fixes #1235: CustomTreeCtrl edit label remains stuck forever
2019-06-04 15:32:47 -07:00
Nyral
1618e28513 #1235 Added condition to check that an edit control doesn't already exist 2019-06-01 23:16:30 +03:00
Robin Dunn
7924b3b48d A few fixes from Jorge Moraleda 2019-05-31 21:21:06 -07:00
Robin Dunn
e74c9b2c10 Use an overlay to highlight widgets when running on GTK3 2019-05-29 19:18:50 -07:00
ricpol
6088d873f8 fixes and tests for CDate.py 2019-05-25 18:53:04 +02:00
ricpol
5a5e821424 fixed CalenDlg to make it work with the other updates 2019-05-25 17:11:24 +02:00
ricpol
f74f4dde34 give up calendar to avoid possible import shadowing 2019-05-25 16:59:39 +02:00
ricpol
0ea38e43d8 smart date setting in SetDate 2019-05-25 16:12:38 +02:00
ricpol
e2023a1fbc setter APIs now actually set valid dates 2019-05-24 19:41:06 +02:00
ricpol
b7641ca656 fixed bug in key navigation when crossing DST boundary 2019-05-24 14:40:29 +02:00
ricpol
a9e2b1884f key navigation now sets date, emits event 2019-05-24 12:48:30 +02:00
ricpol
b8ff38317f fixed EVT_PAINT bug in cross-month key navigation 2019-05-23 18:11:53 +02:00
ricpol
d551696dde rely on datetime, calendar instead of CDate module 2019-05-23 12:57:03 +02:00
Robin Dunn
1c51bc0de8 Merge pull request #1200 from pkienzle/master
python 2/3 compatible file handling in wx.py
2019-05-13 21:28:34 -07:00
Robin Dunn
2f6e88ffee Merge pull request #1202 from pkienzle/issue-1156-pywxrc
Fix wx/tools/pywxrc for py2/3 compatibility. Refs 1156.
2019-05-13 21:25:56 -07:00
Robin Dunn
384cc82709 Compensation for scrollbar width on GTK is no longer needed.
(cherry picked from commit 8b88b13cb1)
2019-05-13 19:45:47 -07:00
Paul Kienzle
092bb845d5 Fix wx/tools/pywxrc for py2/3 compatibility. Refs 1156. 2019-04-14 13:45:08 -04:00
Paul Kienzle
37a575c1fb python 2/3 compatible file handling. Refs #1193. 2019-04-13 02:19:52 -04:00
kg-2
f8add4de3f Update FCObjects.py
raises a ValueError instead of an AttributeError b/c self.Image is never set
2019-01-02 19:08:40 -08:00
Robin Dunn
999bf9f92b Merge pull request #1096 from Metallicow/aui-fixes-Dec2018
Aui fixes dec2018
(cherry picked from commit d3deff2ed8)
2018-12-21 14:45:49 -08:00
Robin Dunn
cb1488a295 Merge pull request #1111 from a358003542/master
toasterbox.py
2018-12-21 14:20:37 -08:00
Robin Dunn
7876de4a32 Merge pull request #1110 from jensgoe/fix_newline_tokenize
ignore newline added by Tokenize module since Python 3.6
2018-12-21 14:18:15 -08:00
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
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
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