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.
This commit is contained in:
cbeytas
2018-11-21 14:29:45 -05:00
parent 98cc99e11c
commit 5f5e1fbd5b
2 changed files with 6 additions and 4 deletions

View File

@@ -6824,10 +6824,11 @@ class CustomTreeCtrl(wx.ScrolledWindow):
# Rightmost alignment of windows
wndx = w - item.GetWindowSize().x - 2 + xa
if wnd.GetPosition() != (wndx, ya):
wnd.Move(wndx, ya, flags=wx.SIZE_ALLOW_MINUS_ONE)
# Force window visible after any position changes were made.
if not wnd.IsShown():
wnd.Show()
if wnd.GetPosition() != (wndx, ya):
wnd.SetPosition((wndx, ya))
if separator:
oldPen = dc.GetPen()

View File

@@ -3052,10 +3052,11 @@ class TreeListMainWindow(CustomTreeCtrl):
if item.GetHeight() > item.GetWindowSize(i)[1]:
ya += (item.GetHeight() - item.GetWindowSize(i)[1])//2
if wnd.GetPosition() != (wndx, ya):
wnd.Move(wndx, ya, flags=wx.SIZE_ALLOW_MINUS_ONE)
# Force window visible after any position changes were made.
if not wnd.IsShown():
wnd.Show()
if wnd.GetPosition() != (wndx, ya):
wnd.SetPosition((wndx, ya))
x_colstart += col_w
dc.DestroyClippingRegion()