revUp - Updates and news for the LiveCode community
Issue 132 | April 5th 2012 Contact the Editor | How to Contribute

Data Tree 2.0 Beta
New features available to test in this handy LiveCode plugin

by Damien Girard

With the acquisition of DataTree, NativeSoft has one more very interesting product in its wallet. DataTree is a TreeView control for LiveCode. With DataTree you can quickly and easily create beautiful expanding tree objects inside your application.

New features of DataTree 2.0

Performance improvement

With the development of NativeGeometry and NativeDoc, NativeSoft acquired a lot of experience in how to optimize LiveCode code and do things as fast as possible. This means that DataTree has been heavily optimized, some algorithms are completely re-written and others vastly improved. The results are:
  • Almost 200% faster when creating a tree of 1200 nodes with the array method.
  • Collapsing and expanding operations on a 1200 nodes tree are now instantaneous.
  • It is possible to collapse and extend the tree even if the tree is not fully drawn.
Overall, DataTree 2.0 removes the feeling of slowness when you are using really large trees.

Drag and drop

DataTree 2.0 introduces drag and drop between trees:

E:\Documents Damien\NativeSoft\Articles\dragdrop.png

DataTree 2.0 makes drag and drop easy, with just a few properties you can control how your tree and nodes act, and with the events “nodeDragStart”, “nodeDragEnter” etc... you can finely control your drag and drop operation.

Checkboxes

E:\Documents Damien\NativeSoft\Articles\checkbox.png

DataTree 2.0 adds support for checkboxes. With the new event “checkBoxNode” you can easily handle node check state changes.

Badges

E:\Documents Damien\NativeSoft\Articles\badges.png

DataTree 2.0 brings also a “badge” feature, with this you can display the number of elements unread for example, in a similar way to applications like “Mail” on MacOS X or "Outlook" on Windows.

Tooltips

E:\Documents Damien\NativeSoft\Articles\tooltips.png

DataTree 2.0 support tooltips. If enabled the tree will display a tooltip for long labels or will display your custom tooltip.

Commands

Each node has now a “command” property.
The content of the command property is passed to the control during events (eg. nodeDown, nodeUp, expandNode etc...). You can use this property to help provide an appropriate response to the user's action.

Example:

on nodeUp pButton,pNodeID,pCommand 
       switch pCommand 
              case "playlist" 
                    -- user has clicked on a playlist node 
                    ... statements here 
                    break 
              case "device" 
                    -- user has clicked on a device node 
                    ... statements here 
                    break 
       end switch 
end nodeUp 

Windows Vista/7 theme

 E:\Documents Damien\NativeSoft\Articles\windows7theme.png

DataTree now support Windows Vista/7 expand/collapse icons. When hovering over the expand/collapse icon its highlight will change.

Easier use of the library and deployment

DataTree 2.0 now behaves like NativeGeometry, to bundle DataTree inside your application you just need to place the following line inside your main stack:

On savingStandalone
               -- Bundling DataTree
               dt_SavingStandalone 
End SavingStandalone

Also DataTree 2.0 now looks like other NativeSoft products:

DataTree 2.0 has been documented using NativeDoc, in addition to the excellent manual already available for DataTree.

And much more under the hood!

A lot of code has changed from DataTree 10 to improve the performance and features of this plugin. However the API has not been changed between DataTree 1.0 and 2.0, so you will be able to migrate your application instantly to DataTree 2.0 once released.

Beta!

DataTree 2.0 is now in beta, you can download it using the new NativeSoft Web Installer: http://www.nativesoft.net/downloads/NativeSoft_Web_Installer.rev
Please reports any bugs found on the NativeSoft quality center: http://quality.nativesoft.net

About the Author

Damien Girard started programming at 7. He began writing LiveCode solutions at 12. Now he works for a company as an embedded Linux expert and C/C++/C#/LiveCode programmer. He continues to release extensions for LiveCode in his spare time.

 

Main Menu

What's New

Simulcast for $149 this week only