About HSTreeViewHSTreeView is a fork of TreeViewAdv 1.2.3.0 by Andrey Gliznetsov at sourceforge.net/projects/treeviewadv/. I initially created this fork because Andrey wasn't answering my e-mails when I wanted to get involved in the project. But then, he finally answered, but we don't seem to agree on what's a good object model. I'm not sure if the two projects will someday be merged, but meanwhile, I implement features I need here, in hstreeview. The differences between the original version and HSTreeView are: Object ModelTreeViewAdv, TreeNodeAdv and TreeColumn are now loosely coupled. In Andrey's version, there were reference to TreeViewAdv in both TreeNodeAdv and TreeColumn. Code has been moved around to have a better object model. Models have been moved to Tree.Base, which doesn't have a reference to WinForms. Test UnitsTest units coverage is now much better. Being a TDD (Test Driven Development) adept, developing by first making test units feels natural to me, so I do it. I don't test drawn stuff though. It would be pretty complex and long to achieve, and for little worth. I'd also like to point out that test units is the main reason why I changed the tightly coupled object model to a loosely coupled object model. Loosely coupled objects are much easier to test then tightly coupled ones. ColumnsColumns are clickable and will generate an OnColumnClicked event. TreeViewAdv also has SortedColumn and SortedOrder properties. When set, a little arrow will be drawn in the column. TreeView also has a AutoSizeColumn() method. It resizes a column depending on its content (what normally happens when you double-click on a column divider). It is automatically invoked on column divider double-click. The standard Ctrl+NumPlus key works too (Auto resizes all columns). Node ControlsBaseTextControl now have an OnDrawtext event, from where you can change text color on-the-fly. Also, the NodeComboBox has the ability to draw a dropdown arrow even if the control is not in edition mode. SelectionThere is a much better handing of selection now. In the original version, every TreeNodeAdv kept a "IsSelected" flag. It means that if you wanted to shift select a lot of rows, it could be pretty long. Unselecting a lot of row also was pretty long. Selection is now kept as a list of index ranges (See the "Ranges" class in the code). It's much more efficient this way. On-the-fly node creationIn the original version, if the root of your TreeModel has 10000 elements, they will all be loaded upfront, even if only 30 items are displayed at once in the TreeView. Now, with the help of the ListGenerator class (It's the equivalent of a "(TreeNodeAdv(child) for child in model.GetChildren())" python line), children from Model.GetChildren() are only fetched when there is actually a need to display the child. Very nice stuff for displaying db with a lot of rows. There is a showoff tab in the SampleApp called "on-the-fly fetching". |
|
|
This site is best viewed with Opera while listening to The White Stripes |
|