Merge branch 'cbeytas-treefixes'

This commit is contained in:
Robin Dunn
2021-01-18 15:42:05 -08:00
5 changed files with 891 additions and 371 deletions

View File

@@ -979,10 +979,14 @@ class CustomTreeCtrlDemo(wx.Panel):
self.checkvista = wx.CheckBox(pnl, -1, "Windows Vista Theme")
self.checkvista.Bind(wx.EVT_CHECKBOX, self.OnVista)
self.dragFullScreen = wx.CheckBox(pnl, -1, "Fullscreen Drag/Drop")
self.dragFullScreen.Bind(wx.EVT_CHECKBOX, self.OnDragFullScreen)
themessizer.Add(sizera, 0, wx.EXPAND)
themessizer.Add(sizerb, 0, wx.EXPAND)
themessizer.Add((0, 5))
themessizer.Add(self.checkvista, 0, wx.EXPAND|wx.ALL, 3)
themessizer.Add(self.dragFullScreen, 0, wx.EXPAND|wx.ALL, 3)
mainsizer.Add(stylesizer, 0, wx.EXPAND|wx.ALL, 5)
mainsizer.Add(colourssizer, 0, wx.EXPAND|wx.ALL, 5)
@@ -1280,6 +1284,12 @@ class CustomTreeCtrlDemo(wx.Panel):
event.Skip()
def OnDragFullScreen(self, event):
self.tree.SetDragFullScreen(event.IsChecked())
event.Skip()
#---------------------------------------------------------------------------
# CustomTreeCtrl Demo Implementation
#---------------------------------------------------------------------------
@@ -1293,8 +1303,6 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
CT.CustomTreeCtrl.__init__(self, parent, id, pos, size, style, agwStyle)
self.SetBackgroundColour(wx.WHITE)
alldata = dir(CT)
treestyles = []
@@ -1581,7 +1589,7 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
menu = wx.Menu()
item1 = menu.Append(wx.ID_ANY, "Change item background colour")
item1 = menu.Append(wx.ID_ANY, "Change Item Text")
item2 = menu.Append(wx.ID_ANY, "Modify item text colour")
menu.AppendSeparator()
@@ -1592,6 +1600,7 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
item3 = menu.Append(wx.ID_ANY, strs)
item4 = menu.Append(wx.ID_ANY, "Change item font")
item16 = menu.Append(wx.ID_ANY, "Change Item Background Colour")
menu.AppendSeparator()
if ishtml:
@@ -1621,6 +1630,9 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
item7 = menu.Append(wx.ID_ANY, "Disable item")
menu.AppendSeparator()
item14 = menu.Append(wx.ID_ANY, "Hide Item")
item15 = menu.Append(wx.ID_ANY, "Unhide All Items")
menu.AppendSeparator()
item8 = menu.Append(wx.ID_ANY, "Change item icons")
menu.AppendSeparator()
@@ -1635,7 +1647,7 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
item11 = menu.Append(wx.ID_ANY, "Prepend an item")
item12 = menu.Append(wx.ID_ANY, "Append an item")
self.Bind(wx.EVT_MENU, self.OnItemBackground, item1)
self.Bind(wx.EVT_MENU, self.OnItemText, item1)
self.Bind(wx.EVT_MENU, self.OnItemForeground, item2)
self.Bind(wx.EVT_MENU, self.OnItemBold, item3)
self.Bind(wx.EVT_MENU, self.OnItemFont, item4)
@@ -1648,11 +1660,26 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
self.Bind(wx.EVT_MENU, self.OnItemPrepend, item11)
self.Bind(wx.EVT_MENU, self.OnItemAppend, item12)
self.Bind(wx.EVT_MENU, self.OnSeparatorInsert, item13)
self.Bind(wx.EVT_MENU, self.OnHideItem, item14)
self.Bind(wx.EVT_MENU, self.OnUnhideItems, item15)
self.Bind(wx.EVT_MENU, self.OnItemBackground, item16)
self.PopupMenu(menu)
menu.Destroy()
def OnItemText(self, event):
diag = wx.TextEntryDialog(self, "Item Text", caption="Input Item Text",
value=self.GetItemText(self.current),
style=wx.OK | wx.CANCEL | wx.TE_MULTILINE)
reply = diag.ShowModal()
text = diag.GetValue()
diag.Destroy()
if reply in (wx.OK, wx.ID_OK):
self.SetItemText(self.current, text)
def OnItemBackground(self, event):
colourdata = wx.ColourData()
@@ -1724,6 +1751,22 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
self.EnableItem(self.current, False)
def OnHideItem(self, event):
self.HideItem(self.current)
event.Skip()
def OnUnhideItems(self, event):
item = self.GetRootItem()
while item:
if item.IsHidden():
self.HideItem(item, False)
item = self.GetNext(item)
event.Skip()
def OnItemIcons(self, event):
bitmaps = [self.itemdict["normal"], self.itemdict["selected"],
@@ -1972,8 +2015,7 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
self.item = event.GetItem()
if self.item:
self.log.write("Beginning Drag..." + "\n")
self.log.write("Beginning Drag... fullscreen=%s\n" % self.GetDragFullScreen())
event.Allow()
@@ -1981,16 +2023,19 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
self.item = event.GetItem()
if self.item:
self.log.write("Beginning Right Drag..." + "\n")
self.log.write("Beginning Right Drag... fullscreen=%s\n" % self.GetDragFullScreen())
event.Allow()
def OnEndDrag(self, event):
self.item = event.GetItem()
if self.item:
self.log.write("Ending Drag!" + "\n")
if self.GetDragFullScreen() is True:
wnd = wx.FindWindowAtPoint(self.ClientToScreen(event.GetPoint()))
self.log.write("Ending Drag! window=%s\n" % repr(wnd))
else:
self.item = event.GetItem()
name = self.GetItemText(self.item) if self.item else 'None'
self.log.write("Ending Drag! item=%s\n" % name)
event.Skip()

View File

@@ -1055,7 +1055,7 @@ class HyperTreeListDemo(wx.Frame):
splitter.SplitVertically(self.leftpanel, panel, 300)
splitter.SetMinimumPaneSize(120)
self.leftpanel.SetBackgroundColour(wx.WHITE)
#self.leftpanel.SetBackgroundColour(wx.WHITE)
self.leftpanel.SetScrollRate(20, 20)
self.Fit()
@@ -1339,10 +1339,14 @@ class HyperTreeListDemo(wx.Frame):
self.checkvista = wx.CheckBox(self.leftpanel, -1, "Windows Vista Theme")
self.checkvista.Bind(wx.EVT_CHECKBOX, self.OnVista)
self.dragFullScreen = wx.CheckBox(self.leftpanel, -1, "Fullscreen Drag/Drop")
self.dragFullScreen.Bind(wx.EVT_CHECKBOX, self.OnDragFullScreen)
themessizer.Add(sizera, 0, wx.EXPAND)
themessizer.Add(sizerb, 0, wx.EXPAND)
themessizer.Add((0, 5))
themessizer.Add(self.checkvista, 0, wx.EXPAND|wx.ALL, 3)
themessizer.Add(self.dragFullScreen, 0, wx.EXPAND|wx.ALL, 3)
mainsizer.Add(stylesizer, 0, wx.EXPAND|wx.ALL, 5)
mainsizer.Add(columnssizer, 0, wx.EXPAND|wx.ALL, 5)
@@ -1738,6 +1742,11 @@ class HyperTreeListDemo(wx.Frame):
event.Skip()
def OnDragFullScreen(self, event):
self.tree.SetDragFullScreen(event.IsChecked())
event.Skip()
#---------------------------------------------------------------------------
# HyperTreeList Implementation
@@ -1766,6 +1775,7 @@ class HyperTreeList(HTL.HyperTreeList):
for evt in ["EVT_TREE_GET_INFO", "EVT_TREE_SET_INFO", "EVT_TREE_ITEM_MIDDLE_CLICK",
"EVT_TREE_STATE_IMAGE_CLICK"]:
events.remove(evt)
events.extend(('EVT_LIST_COL_CLICK', 'EVT_LIST_COL_RIGHT_CLICK'))
treestyles = treestyles + [i for i in dir(wx) if i.startswith("TR_")]
treeset = {}
@@ -1776,6 +1786,8 @@ class HyperTreeList(HTL.HyperTreeList):
self.events = events
self.styles = treestyles
self.item = None
self.sortIcon = wx.HDR_SORT_ICON_NONE
self.sortColumn = 0
il = wx.ImageList(16, 16)
@@ -1906,7 +1918,8 @@ class HyperTreeList(HTL.HyperTreeList):
'EVT_TREE_ITEM_EXPANDING': self.OnItemExpanding, 'EVT_TREE_ITEM_GETTOOLTIP': self.OnToolTip,
'EVT_TREE_ITEM_MENU': self.OnItemMenu, 'EVT_TREE_ITEM_RIGHT_CLICK': self.OnRightDown,
'EVT_TREE_KEY_DOWN': self.OnKey, 'EVT_TREE_SEL_CHANGED': self.OnSelChanged,
'EVT_TREE_SEL_CHANGING': self.OnSelChanging, "EVT_TREE_ITEM_HYPERLINK": self.OnHyperLink}
'EVT_TREE_SEL_CHANGING': self.OnSelChanging, "EVT_TREE_ITEM_HYPERLINK": self.OnHyperLink,
'EVT_LIST_COL_CLICK': self.OnColClick, 'EVT_LIST_COL_RIGHT_CLICK': self.OnColRightClick}
mainframe = wx.GetTopLevelParent(self)
@@ -2100,7 +2113,7 @@ class HyperTreeList(HTL.HyperTreeList):
"itemtype": itemtype, "text": text, "pydata": pydata, "enabled": enabled}
menu = wx.Menu()
item1 = menu.Append(wx.ID_ANY, "Change Item Text")
item2 = menu.Append(wx.ID_ANY, "Modify Item Text Colour")
menu.AppendSeparator()
if isbold:
@@ -2135,6 +2148,7 @@ class HyperTreeList(HTL.HyperTreeList):
item11 = menu.Append(wx.ID_ANY, "Prepend An Item")
item12 = menu.Append(wx.ID_ANY, "Append An Item")
self.Bind(wx.EVT_MENU, self.OnItemText, item1)
self.Bind(wx.EVT_MENU, self.OnItemForeground, item2)
self.Bind(wx.EVT_MENU, self.OnItemBold, item3)
self.Bind(wx.EVT_MENU, self.OnItemFont, item4)
@@ -2154,6 +2168,23 @@ class HyperTreeList(HTL.HyperTreeList):
event.Skip()
def OnItemText(self, event):
col = wx.GetNumberFromUser("Choose column number to change text",
"Col", "Column To Modify", 0, 0,
self.GetColumnCount() - 1, self)
if col >= 0 and col < self.GetColumnCount():
diag = wx.TextEntryDialog(self, "%s Text" % self.GetColumnText(col),
caption="Input text for column %d" % col,
value=self.GetItemText(self.current,col),
style=wx.OK | wx.CANCEL | wx.TE_MULTILINE)
reply = diag.ShowModal()
text = diag.GetValue()
diag.Destroy()
if reply in (wx.OK, wx.ID_OK):
self.SetItemText(self.current, text, col)
def OnItemForeground(self, event):
colourdata = wx.ColourData()
@@ -2381,14 +2412,16 @@ class HyperTreeList(HTL.HyperTreeList):
def OnItemExpanded(self, event):
item = event.GetItem()
if item:
# Ignore wx.TreeCtrl TREE events (item=wx.TreeItemId) from item window.
if item and isinstance(item, HTL.TreeListItem):
self.log.write("OnItemExpanded: %s\n" % self.GetItemText(item))
def OnItemExpanding(self, event):
item = event.GetItem()
if item:
# Ignore wx.TreeCtrl TREE events (item=wx.TreeItemId) from item window.
if item and isinstance(item, HTL.TreeListItem):
self.log.write("OnItemExpanding: %s\n" % self.GetItemText(item))
event.Skip()
@@ -2397,14 +2430,16 @@ class HyperTreeList(HTL.HyperTreeList):
def OnItemCollapsed(self, event):
item = event.GetItem()
if item:
# Ignore wx.TreeCtrl TREE events (item=wx.TreeItemId) from item window.
if item and isinstance(item, HTL.TreeListItem):
self.log.write("OnItemCollapsed: %s" % self.GetItemText(item))
def OnItemCollapsing(self, event):
item = event.GetItem()
if item:
# Ignore wx.TreeCtrl TREE events (item=wx.TreeItemId) from item window.
if item and isinstance(item, HTL.TreeListItem):
self.log.write("OnItemCollapsing: %s\n" % self.GetItemText(item))
event.Skip()
@@ -2412,8 +2447,11 @@ class HyperTreeList(HTL.HyperTreeList):
def OnSelChanged(self, event):
self.item = event.GetItem()
if self.item:
item = event.GetItem()
# Ignore wx.TreeCtrl TREE events (item=wx.TreeItemId) from item window.
if item and isinstance(item, HTL.TreeListItem):
# This event was from the HyperTreeList and not the TreeCtrl.
self.item = item
self.log.write("OnSelChanged: %s" % self.GetItemText(self.item))
if wx.Platform == '__WXMSW__':
self.log.write(", BoundingRect: %s\n" % self.GetBoundingRect(self.item, True))
@@ -2426,9 +2464,10 @@ class HyperTreeList(HTL.HyperTreeList):
def OnSelChanging(self, event):
item = event.GetItem()
olditem = event.GetOldItem()
if item:
# Ignore wx.TreeCtrl TREE events (item=wx.TreeItemId) from item window.
if item and isinstance(item, HTL.TreeListItem):
# This event was from the HyperTreeList and not the TreeCtrl.
olditem = event.GetOldItem()
if not olditem:
olditemtext = "None"
else:
@@ -2437,13 +2476,26 @@ class HyperTreeList(HTL.HyperTreeList):
event.Skip()
def OnColClick(self, event):
column = event.GetColumn()
self.log.write("OnColClick: Column %d clicked" % column)
# Cycle through the sort icons.
if column != self.sortColumn:
self.sortIcon = wx.HDR_SORT_ICON_NONE
self.sortColumn = column
self.sortIcon = wx.HDR_SORT_ICON_DOWN if self.sortIcon == wx.HDR_SORT_ICON_UP else wx.HDR_SORT_ICON_UP
self.SetColumnSortIcon(column, self.sortIcon)
def OnColRightClick(self, event):
column = event.GetColumn()
self.log.write("OnColRightClick: Column %d clicked" % column)
self.SetColumnSortIcon(column, wx.HDR_SORT_ICON_NONE)
def OnBeginDrag(self, event):
self.item = event.GetItem()
if self.item:
self.log.write("Beginning Drag...\n")
self.log.write("Beginning Drag... fullscreen=%s\n" % self.GetDragFullScreen())
event.Allow()
@@ -2451,16 +2503,19 @@ class HyperTreeList(HTL.HyperTreeList):
self.item = event.GetItem()
if self.item:
self.log.write("Beginning Right Drag...\n")
self.log.write("Beginning Right Drag... fullscreen=%s\n" % self.GetDragFullScreen())
event.Allow()
def OnEndDrag(self, event):
self.item = event.GetItem()
if self.item:
self.log.write("Ending Drag!\n")
if self.GetDragFullScreen() is True:
wnd = wx.FindWindowAtPoint(self.ClientToScreen(event.GetPoint()))
self.log.write("Ending Drag! window=%s\n" % repr(wnd))
else:
self.item = event.GetItem()
name = self.GetItemText(self.item) if self.item else 'None'
self.log.write("Ending Drag! item=%s\n" % name)
event.Skip()

View File

@@ -160,6 +160,7 @@ def main(argv):
app = RunDemoApp(name, module, useShell)
locale = wx.Locale(wx.LANGUAGE_DEFAULT)
app.MainLoop()

View File

@@ -40,8 +40,8 @@
"""
:class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` is a class that mimics the behaviour of :class:`TreeCtrl`, with some more
enhancements.
The ``customtreectrl`` module contains the :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl` class
which mimics the behaviour of :class:`TreeCtrl`, with some more enhancements.
Description
@@ -100,6 +100,7 @@ to the standard :class:`TreeCtrl` behaviour this class supports:
style (`New in version 0.9.3`);
* Tooltips on long items when the horizontal space is low, via the ``TR_TOOLTIP_ON_LONG_ITEMS``
style (`New in version 0.9.3`).
* Hiding items
And a lot more. Check the demo for an almost complete review of the functionalities.
@@ -218,6 +219,30 @@ And to hyperlink-type items:
after the ``EVT_TREE_SEL_CHANGED`` event).
Drag and Drop
=============
A simplified drag and drop is available and can be initiated by calling
``event.Allow`` on the ``EVT_TREE_BEGIN_DRAG`` or ``EVT_TREE_BEGIN_RDRAG``
events. When the event handler returns, a ``wx.DragImage`` of the item will be
generated and the user can drag it to other items within the tree. When the
user releases the drag button a ``EVT_TREE_END_DRAG`` event will be sent and
``event.GetItem`` can be called to find out which item the drag ended at.
This simplified method is best when only a single item at a time needs to
be dragged (i.e. ``TR_MULTIPLE`` not set) and only for dragging items within
the tree control.
Alternately, the normal wxPython drag/drop can be invoked in the ``EVT_TREE_BEGIN_DRAG``
handler in which a :class:`wx.DropSource` must be generated, followed by a call
to :meth:`~wx.DropSource.DoDragDrop` which will block until the drag is finished.
This is much more flexible but more complicated to implement.
:note: The class value _DRAG_TIMER_TICKS controls how long the mouse must
linger before the drag can start. It defaults to 250 milliseconds which can
be far too long for today's quick 'swiping' generation. It can be lowered for
a more responsive drag.
Supported Platforms
===================
@@ -230,33 +255,56 @@ Supported Platforms
Window Styles
=============
This class supports the following window styles:
This class takes in a regular wxPython ``style`` and an extended ``agwStyle``.
The ``style`` can be used with normal wxPython styles such as ``wx.WANTS_CHARS``
while the ``agwStyle`` specifies the behavior of the tree itself.
It supports the following ``agwStyle`` flags:
============================== =========== ==================================================
Window Styles Hex Value Description
============================== =========== ==================================================
``TR_NO_BUTTONS`` 0x0 For convenience to document that no buttons are to be drawn.
``TR_SINGLE`` 0x0 For convenience to document that only one item may be selected at a time. Selecting another item causes the current selection, if any, to be deselected. This is the default.
``TR_HAS_BUTTONS`` 0x1 Use this style to show + and - buttons to the left of parent items.
``TR_NO_LINES`` 0x4 Use this style to hide vertical level connectors.
``TR_LINES_AT_ROOT`` 0x8 Use this style to show lines between root nodes. Only applicable if ``TR_HIDE_ROOT`` is set and ``TR_NO_LINES`` is not set.
``TR_DEFAULT_STYLE`` 0x9 The set of flags that are closest to the defaults for the native control for a particular toolkit.
``TR_TWIST_BUTTONS`` 0x10 Use old Mac-twist style buttons.
``TR_MULTIPLE`` 0x20 Use this style to allow a range of items to be selected. If a second range is selected, the current range, if any, is deselected.
``TR_EXTENDED`` 0x40 Use this style to allow disjoint items to be selected. (Only partially implemented; may not work in all cases).
``TR_HAS_VARIABLE_ROW_HEIGHT`` 0x80 Use this style to cause row heights to be just big enough to fit the content. If not set, all rows use the largest row height. The default is that this flag is unset.
``TR_EDIT_LABELS`` 0x200 Use this style if you wish the user to be able to edit labels in the tree control.
``TR_ROW_LINES`` 0x400 Use this style to draw a contrasting border between displayed rows.
``TR_HIDE_ROOT`` 0x800 Use this style to suppress the display of the root node, effectively causing the first-level nodes to appear as a series of root nodes.
``TR_FULL_ROW_HIGHLIGHT`` 0x2000 Use this style to have the background colour and the selection highlight extend over the entire horizontal row of the tree control window.
``TR_AUTO_CHECK_CHILD`` 0x4000 Only meaningful for checkbox-type items: when a parent item is checked/unchecked its children are checked/unchecked as well.
``TR_AUTO_TOGGLE_CHILD`` 0x8000 Only meaningful for checkbox-type items: when a parent item is checked/unchecked its children are toggled accordingly.
``TR_AUTO_CHECK_PARENT`` 0x10000 Only meaningful for checkbox-type items: when a child item is checked/unchecked its parent item is checked/unchecked as well.
``TR_ALIGN_WINDOWS`` 0x20000 Flag used to align windows (in items with windows) at the same horizontal position.
``TR_ALIGN_WINDOWS_RIGHT`` 0x40000 Flag used to align windows (in items with windows) to the rightmost edge of :class:`CustomTreeCtrl`.
``TR_ELLIPSIZE_LONG_ITEMS`` 0x80000 Flag used to ellipsize long items when the horizontal space for :class:`CustomTreeCtrl` is low.
``TR_TOOLTIP_ON_LONG_ITEMS`` 0x100000 Flag used to show tooltips on long items when the horizontal space for :class:`CustomTreeCtrl` is low.
============================== =========== ==================================================
================================= =========== ==================================================
Window agwStyle Flags Hex Value Description
================================= =========== ==================================================
**wx.TR_DEFAULT_STYLE** *varies* The set of flags that are closest to the defaults for the native control for a particular toolkit. Should always be used.
``wx.TR_NO_BUTTONS`` 0x0 For convenience to document that no buttons are to be drawn.
``wx.TR_SINGLE`` 0x0 For convenience to document that only one item may be selected at a time. Selecting another item causes the current selection, if any, to be deselected. This is the default.
``wx.TR_HAS_BUTTONS`` 0x1 Use this style to show + and - buttons to the left of parent items.
``wx.TR_NO_LINES`` 0x4 Use this style to hide vertical level connectors.
``wx.TR_LINES_AT_ROOT`` 0x8 Use this style to show lines between root nodes. Only applicable if ``TR_HIDE_ROOT`` is set and ``TR_NO_LINES`` is not set.
``wx.TR_TWIST_BUTTONS`` 0x10 Use old Mac-twist style buttons.
``wx.TR_MULTIPLE`` 0x20 Use this style to allow a range of items to be selected. If a second range is selected, the current range, if any, is deselected.
``wx.TR_HAS_VARIABLE_ROW_HEIGHT`` 0x80 Use this style to cause row heights to be just big enough to fit the content. If not set, all rows use the largest row height. The default is that this flag is unset.
``wx.TR_EDIT_LABELS`` 0x200 Use this style if you wish the user to be able to edit labels in the tree control.
``wx.TR_ROW_LINES`` 0x400 Use this style to draw a contrasting border between displayed rows.
``wx.TR_HIDE_ROOT`` 0x800 Use this style to suppress the display of the root node, effectively causing the first-level nodes to appear as a series of root nodes.
``wx.TR_FULL_ROW_HIGHLIGHT`` 0x2000 Use this style to have the background colour and the selection highlight extend over the entire horizontal row of the tree control window.
**Styles from customtreectrl:**
``TR_EXTENDED`` 0x40 Use this style to allow disjoint items to be selected. (Only partially implemented; may not work in all cases).
``TR_AUTO_CHECK_CHILD`` 0x4000 Only meaningful for checkbox-type items: when a parent item is checked/unchecked its children are checked/unchecked as well.
``TR_AUTO_TOGGLE_CHILD`` 0x8000 Only meaningful for checkbox-type items: when a parent item is checked/unchecked its children are toggled accordingly.
``TR_AUTO_CHECK_PARENT`` 0x10000 Only meaningful for checkbox-type items: when a child item is checked/unchecked its parent item is checked/unchecked as well.
``TR_ALIGN_WINDOWS`` 0x20000 Flag used to align windows (in items with windows) at the same horizontal position.
``TR_ALIGN_WINDOWS_RIGHT`` 0x40000 Flag used to align windows (in items with windows) to the rightmost edge of :class:`CustomTreeCtrl`.
``TR_ELLIPSIZE_LONG_ITEMS`` 0x80000 Flag used to ellipsize long items when the horizontal space for :class:`CustomTreeCtrl` is low.
``TR_TOOLTIP_ON_LONG_ITEMS`` 0x100000 Flag used to show tooltips on long items when the horizontal space for :class:`CustomTreeCtrl` is low.
================================= =========== ==================================================
The ``wx.TR_HAS_VARIABLE_LINE_HEIGHT`` style should be set if item rows might
not all be the same height. This can happen if certain rows have a larger font
size, multi-line text, or windows added to them. This style will automatically
adjust each item's height to be just big enough to show its contents.
When the ``wx.TR_HAS_VARIABLE_LINE_HEIGHT`` is not set, adding a new item with
multi-line text or with a window specified will throw an exception. However the
tree won't prevent you from adding multiline text with :meth:`~TreeListMainWindow.SetItemText`
or assigning a window with :meth:`~TreeListMainWindow.SetItemWindow` to an
existing item. It's generally a bad idea to do either of these without this
style as it will result in an ugly tree. By default the ``wx.TR_HAS_VARIABLE_LINE_HEIGHT``
is not set. This means that all item rows will use the same height. This is the
height of the largest item in the tree. If an item with a larger height is
added or revealed, ALL row heights will increase to this larger size. The
larger row height remains persistent even if the large items are hidden or
deleted. You must call :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CalculateLineHeight`
to reset the row height. This somewhat bizarre behavior is why the ``wx.TR_HAS_VARIABLE_LINE_HEIGHT``
style is almost always used.
Events Processing
@@ -636,12 +684,16 @@ def ChopText(dc, text, max_size):
.. versionadded:: 0.9.3
"""
# first check if the text fits with no problems
# first check if the text fits with no problems (converts to Unicode).
x, y, dummy = dc.GetFullMultiLineTextExtent(text)
if x <= max_size:
return text
# We cannot chop text that is UTF-8, as it could produce invalid sequences.
if isinstance(text, bytes):
# Convert UTF-8 (Phoenix's mandatory encoding) to Unicode.
text = text.decode('utf-8')
textLen = len(text)
last_good_length = 0
@@ -1650,6 +1702,7 @@ class GenericTreeItem(object):
self._enabled = True # flag to enable/disable an item
self._hypertext = False # indicates if the item is hypertext
self._visited = False # visited state for an hypertext item
self._hidden = False # hidden items are not painted
if self._type > 0:
# do not construct the array for normal items
@@ -1698,10 +1751,11 @@ class GenericTreeItem(object):
:return: A Python list containing instances of :class:`GenericTreeItem`, representing
this item's children.
:note: The returned value is a reference to the list of children
used internally by the tree. It is advised not to change this list
and to make a copy before calling other tree methods as they could
change the contents of the list.
used internally by the tree. It is advised not to change this list
and to make a copy before calling other tree methods as they could
change the contents of the list.
"""
return self._children
@@ -1795,7 +1849,8 @@ class GenericTreeItem(object):
:param integer `which`: the image kind.
:see: :meth:`~GenericTreeItem.GetImage` for a description of the `which` parameter.
:note: Call :meth:`~CustomTreeCtrl.SetItemImage` instead to refresh the tree properly.
:note: Call :meth:`CustomTreeCtrl.SetItemImage` instead to refresh the tree properly.
"""
self._images[which] = image
@@ -1808,7 +1863,8 @@ class GenericTreeItem(object):
:param integer `image`: an index within the left image list specifying the image to
use for the item in the leftmost part of the client area.
:note: Call :meth:`~CustomTreeCtrl.SetItemLeftImage` instead to refresh the tree properly.
:note: Call :meth:`CustomTreeCtrl.SetItemLeftImage` instead to refresh the tree properly.
"""
self._leftimage = image
@@ -1829,7 +1885,8 @@ class GenericTreeItem(object):
Sets whether an item has the 'plus' button.
:param bool `has`: ``True`` to set the 'plus' button on the item, ``False`` otherwise.
:note: Call :meth:`~CustomTreeCtrl.SetItemHasChildren` instead to refresh the tree properly.
:note: Call :meth:`CustomTreeCtrl.SetItemHasChildren` instead to refresh the tree properly.
"""
self._hasPlus = has
@@ -1840,7 +1897,8 @@ class GenericTreeItem(object):
Sets the item font bold.
:parameter bool `bold`: ``True`` to have a bold font item, ``False`` otherwise.
:note: Call :meth:`~CustomTreeCtrl.SetItemBold` instead to refresh the tree properly.
:note: Call :meth:`CustomTreeCtrl.SetItemBold` instead to refresh the tree properly.
"""
self._isBold = bold
@@ -1851,7 +1909,8 @@ class GenericTreeItem(object):
Sets the item font italic.
:parameter bool `italic`: ``True`` to have an italic font item, ``False`` otherwise.
:note: Call :meth:`~CustomTreeCtrl.SetItemItalic` instead to refresh the tree properly.
:note: Call :meth:`CustomTreeCtrl.SetItemItalic` instead to refresh the tree properly.
"""
self._isItalic = italic
@@ -1890,20 +1949,29 @@ class GenericTreeItem(object):
def GetHeight(self):
""" Returns the height of the item, in pixels. """
""" Returns the height of the item, in pixels.
This will be 0 when the item is first created and always 0 for hidden
items. It is updated when the item is calculated.
"""
return self._height
def GetWidth(self):
""" Returns the width of the item, in pixels. """
""" Returns the width of the item's contents, in pixels.
This is the width of the item's text plus the widths of the item's
image, checkbox, and window (if they exist).
A separator's width is the width of the entire client area.
"""
return self._width
def SetHeight(self, h):
"""
Sets the item's height.
Sets the item's height. Used internally.
:param integer `h`: an integer specifying the item's height, in pixels.
"""
@@ -1913,7 +1981,7 @@ class GenericTreeItem(object):
def SetWidth(self, w):
"""
Sets the item's width.
Sets the item's width. Used internally.
:param integer `w`: an integer specifying the item's width, in pixels.
"""
@@ -1932,7 +2000,8 @@ class GenericTreeItem(object):
on the left of text and overlapping the image. New in wxPython 4.0.4.
:raise: `Exception` if the input `item` is a separator and `wnd` is not ``None``.
:note: Always use :meth:`~CustomTreeCtrl.SetItemWindow` instead to update the tree properly.
:note: Always use :meth:`CustomTreeCtrl.SetItemWindow` instead to update the tree properly.
"""
if self.IsSeparator() and wnd is not None:
@@ -1984,7 +2053,7 @@ class GenericTreeItem(object):
def DeleteWindow(self):
""" Deletes the window associated to the item (if any). Internal use only.
:note: Always use :meth:`~CustomTreeCtrl.DeleteItemWindow` instead to update the tree properly.
:note: Always use :meth:`CustomTreeCtrl.DeleteItemWindow` instead to update the tree properly.
"""
if self._wnd:
@@ -2103,7 +2172,8 @@ class GenericTreeItem(object):
must be unchecked.
- If a radiobutton node becomes unchecked, then all of its child nodes will become
inactive.
:note: Call :meth:`~CustomTreeCtrl.SetItemType` instead to refresh the tree properly.
:note: Call :meth:`CustomTreeCtrl.SetItemType` instead to refresh the tree properly.
"""
self._type = ct_type
@@ -2114,7 +2184,8 @@ class GenericTreeItem(object):
Sets whether the item is hypertext or not.
:param bool `hyper`: ``True`` to set hypertext behaviour, ``False`` otherwise.
:note: Call :meth:`~CustomTreeCtrl.SetItemHyperText` instead to refresh the tree properly.
:note: Call :meth:`CustomTreeCtrl.SetItemHyperText` instead to refresh the tree properly.
"""
self._hypertext = hyper
@@ -2125,7 +2196,8 @@ class GenericTreeItem(object):
Sets whether an hypertext item was visited or not.
:param bool `visited`: ``True`` to set a hypertext item as visited, ``False`` otherwise.
:note: Call :meth:`~CustomTreeCtrl.SetItemVisited` instead to refresh the tree properly.
:note: Call :meth:`CustomTreeCtrl.SetItemVisited` instead to refresh the tree properly.
"""
self._visited = visited
@@ -2143,6 +2215,24 @@ class GenericTreeItem(object):
return self._hypertext
def IsHidden(self):
""" Returns whether the item is hidden or not. """
return self._hidden
def Hide(self, hide):
"""
Hides/shows the item. Internal use only.
:param `hide`: ``True`` to hide the item, ``False`` to show it.
:note: Always use :meth:`CustomTreeCtrl.HideItem` instead to update the tree properly.
"""
self._hidden = hide
def GetParent(self):
"""
Gets the item parent (another instance of :class:`GenericTreeItem` or ``None`` for
@@ -2168,7 +2258,7 @@ class GenericTreeItem(object):
def Expand(self):
""" Expands the item. Internal use only.
:note: Always use :meth:`~CustomTreeCtrl.Expand` instead to update the tree properly and send events.
:note: Always use :meth:`CustomTreeCtrl.Expand` instead to update the tree properly and send events.
"""
self._isCollapsed = False
@@ -2177,7 +2267,7 @@ class GenericTreeItem(object):
def Collapse(self):
""" Collapses the item. Internal use only.
:note: Always use :meth:`~CustomTreeCtrl.Collapse` instead to update the tree properly and send events.
:note: Always use :meth:`CustomTreeCtrl.Collapse` instead to update the tree properly and send events.
"""
self._isCollapsed = True
@@ -2188,7 +2278,8 @@ class GenericTreeItem(object):
Sets the item focus/unfocus.
:param bool `set`: ``True`` to set the focus to the item, ``False`` otherwise.
:note: Call :meth:`~CustomTreeCtrl.SelectItem` instead to update the tree properly and send events.
:note: Call :meth:`CustomTreeCtrl.SelectItem` instead to update the tree properly and send events.
"""
self._hasHilight = set
@@ -2216,11 +2307,12 @@ class GenericTreeItem(object):
def IsExpanded(self):
"""
Returns whether the item is expanded or not.
Returns whether the item is expanded or not. Hidden items always return False.
:return: ``True`` if the item is expanded, ``False`` if it is collapsed.
"""
if self.IsHidden():
return False
return not self._isCollapsed
@@ -2330,7 +2422,8 @@ class GenericTreeItem(object):
:param bool `checked`: ``True`` to check an item, ``False`` to uncheck it.
:note: This is meaningful only for checkbox-like and radiobutton-like items.
:note: Always use :meth:`~CustomTreeCtrl.CheckItem` instead to update the tree properly and send events.
:note: Always use :meth:`CustomTreeCtrl.CheckItem` instead to update the tree properly and send events.
"""
assert checked in [True, False]
self._checked = checked
@@ -2371,7 +2464,8 @@ class GenericTreeItem(object):
Enables/disables the item.
:param bool `enable`: ``True`` to enable the item, ``False`` to disable it.
:note: Call :meth:`~CustomTreeCtrl.EnableItem` instead to update the tree properly.
:note: Call :meth:`CustomTreeCtrl.EnableItem` instead to update the tree properly.
"""
self._enabled = enable
@@ -2379,11 +2473,12 @@ class GenericTreeItem(object):
def IsEnabled(self):
"""
Returns whether the item is enabled or not.
Returns whether the item is enabled or not. Hidden items always return False.
:return: ``True`` if the item is enabled, ``False`` if it is disabled.
"""
if self.IsHidden():
return False
return self._enabled
@@ -2442,7 +2537,8 @@ class GenericTreeItem(object):
Deletes the item children. Internal use only.
:param `tree`: the main :class:`CustomTreeCtrl` instance.
:note: Always use :meth:`~CustomTreeCtrl.DeleteChildren` instead to update the tree properly.
:note: Always use :meth:`CustomTreeCtrl.DeleteChildren` instead to update the tree properly.
"""
for child in self._children:
@@ -2475,7 +2571,8 @@ class GenericTreeItem(object):
:param string `text`: the new item label.
:raise: `Exception` if the item is a separator.
:note: Call :meth:`~CustomTreeCtrl.SetItemText` to refresh the tree properly.
:note: Call :meth:`CustomTreeCtrl.SetItemText` to refresh the tree properly.
"""
if self.IsSeparator():
@@ -2544,7 +2641,12 @@ class GenericTreeItem(object):
:param integer `level`: the item's level inside the tree hierarchy.
:see: :meth:`CustomTreeCtrl.HitTest() <customtreectrl.CustomTreeCtrl.HitTest>` method for the flags explanation.
:return: A 2-tuple of (item, flags). The item may be ``None``.
"""
# Hidden items are never evaluated.
if self.IsHidden():
return None, flags
# for a hidden root node, don't evaluate it, but do evaluate children
if not (level == 0 and theCtrl.HasAGWFlag(TR_HIDE_ROOT)):
@@ -2718,35 +2820,8 @@ class CustomTreeCtrl(wx.ScrolledWindow):
chosen by either the windowing system or wxPython, depending on platform;
:type `size`: tuple or :class:`wx.Size`
:param integer `style`: the underlying :class:`ScrolledWindow` style;
:param integer `agwStyle`: the AGW-specific window style for :class:`CustomTreeCtrl`. It can be a
combination of the following bits:
============================== =========== ==================================================
Window Styles Hex Value Description
============================== =========== ==================================================
``TR_NO_BUTTONS`` 0x0 For convenience to document that no buttons are to be drawn.
``TR_SINGLE`` 0x0 For convenience to document that only one item may be selected at a time. Selecting another item causes the current selection, if any, to be deselected. This is the default.
``TR_HAS_BUTTONS`` 0x1 Use this style to show + and - buttons to the left of parent items.
``TR_NO_LINES`` 0x4 Use this style to hide vertical level connectors.
``TR_LINES_AT_ROOT`` 0x8 Use this style to show lines between root nodes. Only applicable if ``TR_HIDE_ROOT`` is set and ``TR_NO_LINES`` is not set.
``TR_DEFAULT_STYLE`` 0x9 The set of flags that are closest to the defaults for the native control for a particular toolkit.
``TR_TWIST_BUTTONS`` 0x10 Use old Mac-twist style buttons.
``TR_MULTIPLE`` 0x20 Use this style to allow a range of items to be selected. If a second range is selected, the current range, if any, is deselected.
``TR_EXTENDED`` 0x40 Use this style to allow disjoint items to be selected. (Only partially implemented; may not work in all cases).
``TR_HAS_VARIABLE_ROW_HEIGHT`` 0x80 Use this style to cause row heights to be just big enough to fit the content. If not set, all rows use the largest row height. The default is that this flag is unset.
``TR_EDIT_LABELS`` 0x200 Use this style if you wish the user to be able to edit labels in the tree control.
``TR_ROW_LINES`` 0x400 Use this style to draw a contrasting border between displayed rows.
``TR_HIDE_ROOT`` 0x800 Use this style to suppress the display of the root node, effectively causing the first-level nodes to appear as a series of root nodes.
``TR_FULL_ROW_HIGHLIGHT`` 0x2000 Use this style to have the background colour and the selection highlight extend over the entire horizontal row of the tree control window.
``TR_AUTO_CHECK_CHILD`` 0x4000 Only meaningful for checkbox-type items: when a parent item is checked/unchecked its children are checked/unchecked as well.
``TR_AUTO_TOGGLE_CHILD`` 0x8000 Only meaningful for checkbox-type items: when a parent item is checked/unchecked its children are toggled accordingly.
``TR_AUTO_CHECK_PARENT`` 0x10000 Only meaningful for checkbox-type items: when a child item is checked/unchecked its parent item is checked/unchecked as well.
``TR_ALIGN_WINDOWS`` 0x20000 Flag used to align windows (in items with windows) at the same horizontal position.
``TR_ALIGN_WINDOWS_RIGHT`` 0x40000 Flag used to align windows (in items with windows) to the rightmost edge of :class:`CustomTreeCtrl`.
``TR_ELLIPSIZE_LONG_ITEMS`` 0x80000 Flag used to ellipsize long items when the horizontal space for :class:`CustomTreeCtrl` is low.
``TR_TOOLTIP_ON_LONG_ITEMS`` 0x100000 Flag used to show tooltips on long items when the horizontal space for :class:`CustomTreeCtrl` is low.
============================== =========== ==================================================
:param integer `agwStyle`: can be a combination of various bits. See
:mod:`~wx.lib.agw.customtreectrl` for a full list of flags.
:param wx.Validator `validator`: window validator;
:param string `name`: window name.
"""
@@ -2783,6 +2858,7 @@ class CustomTreeCtrl(wx.ScrolledWindow):
self._isDragging = False
self._dropTarget = self._oldSelection = None
self._dragImage = None
self._dragFullScreen = False
self._underMouse = None
# EditCtrl initial settings for editable items
@@ -2893,7 +2969,7 @@ class CustomTreeCtrl(wx.ScrolledWindow):
self.SetValidator(validator)
attr = self.GetDefaultAttributes()
attr = wx.ListCtrl.GetClassDefaultAttributes()
self.SetOwnForegroundColour(attr.colFg)
self.SetOwnBackgroundColour(attr.colBg)
@@ -3036,18 +3112,19 @@ class CustomTreeCtrl(wx.ScrolledWindow):
def GetSelection(self):
"""
Returns the current selection.
Returns the current selected item (i.e. focused item).
:return: An instance of :class:`GenericTreeItem`.
:note:
This method is valid only with the style ``TR_SINGLE`` set. Use
:meth:`~CustomTreeCtrl.GetSelections` for multiple-selections trees.
:note: Similar to GetFocusedItem of wx.TreeCtrl. Use
:meth:`~CustomTreeCtrl.GetSelections` for obtaining all items
selected in multiple-selection trees (i.e. TR_MULTIPLE flag set).
"""
return self._current
GetFocusedItem = GetSelection
def ToggleItemSelection(self, item):
"""
@@ -3746,9 +3823,16 @@ class CustomTreeCtrl(wx.ScrolledWindow):
raise Exception("Separator items can not have text")
dc = wx.ClientDC(self)
oldtext = item.GetText()
item.SetText(text)
self.CalculateSize(item, dc)
self.RefreshLine(item)
# Avoid Calculating tree unless number of lines changed (slow).
if oldtext.count('\n') != text.count('\n'):
self.CalculatePositions()
self.Refresh()
self.AdjustMyScrollbars()
else:
self.CalculateSize(item, dc)
self.RefreshLine(item)
def SetItemImage(self, item, image, which=TreeItemIcon_Normal):
@@ -4448,6 +4532,36 @@ class CustomTreeCtrl(wx.ScrolledWindow):
self.Refresh()
def GetDragFullScreen(self):
"""
Returns whether built-in drag/drop will be full screen or not.
:return: ``True`` if the drag/drop operation will be full screen, or
``False`` if only within the tree.
"""
return self._dragFullScreen
def SetDragFullScreen(self, fullScreen=False):
"""
Sets whether a drag operation will be performed full screen or not.
A full screen drag allows the user to drag outside of the tree to
other controls. When the drag is finished the destination will have
to be found manually in the ``EVT_TREE_END_DRAG`` handler with
something like:
example::
wnd = wx.FindWindowAtPoint(self.ClientToScreen(event.GetPoint()))
:param bool `fullScreen`: False (default) to drag within tree only.
"""
self._dragFullScreen = bool(fullScreen)
# -----------------------------------------------------------------------------
# item status inquiries
# -----------------------------------------------------------------------------
@@ -4455,13 +4569,16 @@ class CustomTreeCtrl(wx.ScrolledWindow):
def IsVisible(self, item):
"""
Returns whether the item is visible or not (i.e., its hierarchy is expanded
enough to show the item).
enough to show the item, and it has not been hidden).
:param `item`: an instance of :class:`GenericTreeItem`.
:return: ``True`` if the item is visible, ``False`` if it is hidden.
"""
# Hidden items are never visible.
if item.IsHidden():
return False
# An item is only visible if it's not a descendant of a collapsed item
parent = item.GetParent()
@@ -5582,6 +5699,39 @@ class CustomTreeCtrl(wx.ScrolledWindow):
wnd.Hide()
def HideItemWindows(self, item):
"""Hide all windows belonging to the item and its children."""
wnd = item.GetWindow()
if wnd:
wnd.Hide()
for child in item.GetChildren():
self.HideItemWindows(child)
def HideItem(self, item, hide=True):
"""
Hides/shows an item.
:param `item`: an instance of :class:`GenericTreeItem`;
:param `hide`: ``True`` to hide the item, ``False`` to show it.
:note: A hidden item always reports that it is collapsed and disabled.
"""
if hide == item.IsHidden():
# Item already in correct state. Don't do anything.
return
item.Hide(hide)
if hide is True and self._hasWindows:
# Hide all windows for this item and its children.
self.HideItemWindows(item)
# Refresh the tree.
self.CalculatePositions()
self.Refresh()
self.AdjustMyScrollbars()
def Unselect(self):
""" Unselects the current selection. """
@@ -6073,7 +6223,13 @@ class CustomTreeCtrl(wx.ScrolledWindow):
def CalculateLineHeight(self):
""" Calculates the height of a line. """
"""Calculates the base height for all lines in the tree.
Only used if the TR_HAS_VARIABLE_ROW_HEIGHT style is not used.
This base line height gets adjusted to the max line height
of all items as they are displayed. All rows use this largest
height until this method is called to reset it.
"""
dc = wx.ClientDC(self)
self._lineHeight = dc.GetCharHeight()
@@ -6362,6 +6518,11 @@ class CustomTreeCtrl(wx.ScrolledWindow):
def AdjustMyScrollbars(self):
""" Internal method used to adjust the :class:`ScrolledWindow` scrollbars. """
if self._freezeCount:
# Skip if frozen. Set dirty flag to adjust when thawed.
self._dirty = True
return
if self._anchor:
x, y = self._anchor.GetSize(0, 0, self)
@@ -6864,6 +7025,9 @@ class CustomTreeCtrl(wx.ScrolledWindow):
=============== =========================================
"""
# Don't paint hidden items.
if item.IsHidden():
return y
x = level*self._indent
@@ -7268,7 +7432,7 @@ class CustomTreeCtrl(wx.ScrolledWindow):
elif keyCode in (wx.WXK_RETURN, wx.WXK_SPACE, wx.WXK_NUMPAD_ENTER):
if not self.IsItemEnabled(self._current):
if not self._current or not self.IsItemEnabled(self._current):
event.Skip()
return
@@ -7685,6 +7849,13 @@ class CustomTreeCtrl(wx.ScrolledWindow):
:note: The rectangle coordinates are logical, not physical ones. So, for example,
the `x` coordinate may be negative if the tree has a horizontal scrollbar and its
position is not ``0``.
.. warning:: The ``textOnly`` flag is currently ignored and this method
always returns the rectangle including the item's image, checkbox,
and window (if they exist) along with the item's text. A separator's
bounding box stretches the width of the entire client area. The height
may be 0 for newly added items until :meth:`CustomTreeCtrl.CalculateSize`
is called while the tree is not frozen.
"""
i = item
@@ -7739,7 +7910,7 @@ class CustomTreeCtrl(wx.ScrolledWindow):
def GetEditControl(self):
"""
Returns a pointer to the edit :class:`TreeTextCtrl` if the item is being edited or
Returns a reference to the edit :class:`TreeTextCtrl` if the item is being edited or
``None`` otherwise (it is assumed that no more than one item may be edited
simultaneously).
"""
@@ -7931,7 +8102,7 @@ class CustomTreeCtrl(wx.ScrolledWindow):
# Create the custom draw image from the icons and the text of the item
self._dragImage = DragImage(self, self._current)
self._dragImage.BeginDrag(wx.Point(0,0), self)
self._dragImage.BeginDrag(wx.Point(0,0), self, fullScreen=self._dragFullScreen)
self._dragImage.Show()
self._dragImage.Move(self.CalcScrolledPosition(*pt))
@@ -7939,6 +8110,10 @@ class CustomTreeCtrl(wx.ScrolledWindow):
self._dragImage.Move(self.CalcScrolledPosition(*pt))
if self._dragFullScreen is True:
# Don't highlight target items if dragging full-screen.
return
if self._countDrag == 0 and item:
self._oldItem = item
@@ -8222,6 +8397,15 @@ class CustomTreeCtrl(wx.ScrolledWindow):
"""
if self._freezeCount:
# Skip calculate if frozen. Set dirty flag to do this when thawed.
self._dirty = True
return
if item.IsHidden():
# Hidden items have a height of 0.
item.SetHeight(0)
return
attr = item.GetAttributes()
if attr and attr.HasFont():
@@ -8336,6 +8520,9 @@ class CustomTreeCtrl(wx.ScrolledWindow):
# set its position
item.SetX(x+self._spacing)
item.SetY(y)
# hidden items don't get a height (height=0).
if item.IsHidden():
return y
height = self.GetLineHeight(item)
wnd = item.GetWindow()
@@ -8369,6 +8556,10 @@ class CustomTreeCtrl(wx.ScrolledWindow):
if not self._anchor:
return
if self._freezeCount:
# Don't calculate positions if frozen as it is CPU intensive.
self._dirty = True
return
self.absoluteWindows = {}
@@ -8500,7 +8691,9 @@ class CustomTreeCtrl(wx.ScrolledWindow):
for all controls so it is mostly just a hint to wxWidgets and not a mandatory
directive.
"""
## Note: We manage freezing ourselves because a normal call to
## Freeze() also freezes all child item windows and for
## some reason this can cause them to glitch out.
self._freezeCount = self._freezeCount + 1

File diff suppressed because it is too large Load Diff