Hello NG,
I would like to announce my latest child, CustomTreeCtrl.
CustomTreeCtrl is a class that mimics the behavior of wx.TreeCtrl, 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 control.
Apart of the base functionalities of CustomTreeCtrl (described below), in addition to the standard wx.TreeCtrl behavior this class supports:
-
CheckBox-type items;
-
RadioButton-type items;
-
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 an item;
-
Default selection style, gradient (horizontal/vertical) selection style and Windows Vista selection style;
-
Customized drag and drop images built on the fly;
-
Setting the CustomTreeCtrl item buttons to a personalized imagelist;
-
Setting the CustomTreeCtrl 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 CustomTreeCtrl 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 one, 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 CustomTreeCtrl 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 long, 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.3/2.4 and wxPython 2.6.3.2. 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.
You can find the source, the demo, the epydoc-generated documentation and some screenshots in the usual place:
http://xoomer.virgilio.it/infinity77/eng/freeware.html#customtree
Or, if you prefer in italian:
http://xoomer.virgilio.it/infinity77/ita/freeware.html#customtree
Enjoy, and happy wxPythoning
Andrea.
P.S. Please don’t tell me it’s not Pythonic… it doesn’t mean anything to me, plus the code is heavily based on the C++ generic wxWidgets implementation
···
–
“Imagination Is The Only Weapon In The War Against Reality.”