Hi All,
to celebrate my birthday ( ), I am happy to announce my latest
child, HyperTreeList.
HyperTreeList is a class that mimics the behaviour of
wx.gizmos.TreeListCtrl, with almost the same base functionalities plus
some more enhancements. This class does not rely on the native
control, as it is a full owner-drawn tree-list control.
HyperTreeList is somewhat an hybrid between CustomTreeCtrl and
wx.gizmos.TreeListCtrl.
In addition to the standard wx.gizmos.TreeListCtrl behaviour, this
class supports:
* CheckBox-type items: checkboxes are easy to handle, just selected or
unselected state with no particular issues in handling the item's children;
* RadioButton-type items: since I elected to put radiobuttons in
HyperTreeList, I
needed some way to handle them, that made sense. So, I used the following
approach:
- All peer-nodes that are radiobuttons will be mutually
exclusive. In other words,
only one of a set of radiobuttons that share a common parent
can be checked
at once. If a radiobutton node becomes checked, then all of its peer
radiobuttons must be unchecked;
- If a radiobutton node becomes unchecked, then all of its child
nodes will
become inactive.
* Hyperlink-type items: they look like an hyperlink, with the proper
mouse cursor on
hovering.
* Multiline text items.
* Enabling/disabling items (together with their plain or grayed out icons).
* Whatever non-toplevel widget can be attached next to a tree item.
* Whatever non-toplevel widget can be attached next to a list item.
* Column headers are fully customizable in terms of icons, colour,
font, alignment etc...
* Default selection style, gradient (horizontal/vertical) selection
style and Windows
Vista selection style.
* Customized drag and drop images built on the fly.
* Setting the HyperTreeList item buttons to a personalized imagelist.
* Setting the HyperTreeList check/radio item icons to a personalized imagelist.
* Changing the style of the lines that connect the items (in terms of
wx.Pen styles).
* Using an image as a HyperTreeList background (currently only in "tile" mode).
And a lot more. Check the demo for an almost complete review of the
functionalities.
The demo by itself is *very* huge, as I wanted to show the basic
functionalities and the new ones, as completely as possible (even if
the demo does not show all the possibilities). In the demo, you can
use the options on the left wx.ScrolledWindow and the right mouse
button on the HyperTreeList to activate other methods.
I appreciate any comment, suggestion, idea and bug report (patches are
far more welcomed ). Noting that the code by itself is quite huge,
it is highly possible that some bug is loudly laughing at me and I
didn't spot it.
I tested the code on Windows XP, Python 2.5 and wxPython 2.8.3/2.8.4
pre-release. It should work also with older version of wxPython, but I
am not sure. I have no idea of its behavior on GTK and Mac, though I
am expecting (as usual) a gazillion of problems on that amazing
platform that is Mac. If someone is able to run it on other platforms
than Windows, I would like to ask him/her if he/she can please send me
some screenshots of it.
Note: the docs are still incomplete, but I will finish them as soon as
I fix the major bugs that some kind volunteers will find in my code.
You can find the source, the demo and some screenshots in the usual place:
http://xoomer.alice.it/infinity77/eng/freeware.html#hypertreelist
wxPython rules
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/