mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
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:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user