mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
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).
This commit is contained in:
@@ -1961,9 +1961,9 @@ class GenericTreeItem(object):
|
||||
self._width = size.GetWidth()
|
||||
self._windowsize = size
|
||||
|
||||
# We don't show the window if the item is collapsed
|
||||
if not self.IsExpanded():
|
||||
self._wnd.Show(False)
|
||||
## Hide the window since the position isn't correct yet. It will
|
||||
## be shown and positioned when the item is painted.
|
||||
wnd.Show(False)
|
||||
|
||||
# The window is enabled only if the item is enabled
|
||||
self._wnd.Enable(self._enabled)
|
||||
|
||||
@@ -1669,9 +1669,9 @@ class TreeListItem(GenericTreeItem):
|
||||
# Do better strategies exist?
|
||||
wnd.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
|
||||
|
||||
# We don't show the window if the item is collapsed
|
||||
if not self.IsExpanded():
|
||||
wnd.Show(False)
|
||||
## Hide the window since the position isn't correct yet. It will
|
||||
## be shown and positioned when the item is painted.
|
||||
wnd.Show(False)
|
||||
|
||||
# The window is enabled only if the item is enabled
|
||||
wnd.Enable(self._enabled)
|
||||
|
||||
Reference in New Issue
Block a user