Friday, September 10, 2010
Search   GO
|

 
 
 
archive
blog
Nov 29

Written by: Steve
29 November 2009

Do you know, I've tried writing this blog post five times now? After six months, almost 3,300 lines of code and a pretty detailed developer's manual that was a real chore labour of love to write, you'd think I'd have some idea how I was going to announce the launch of Data Tree!

Oh yes, that's right. It's finally launched and available from the Download page.

Blimey, it's been a journey. I've been tinkering on and off with Rev in my spare time for about two years and this was my fourth attempt at writing a tree library. Ever since I first downloaded the Studio trial, I was thwarted in my attempts to write an application because there was no tree control. "Dammit Janet," I thought. "I'll have to write one myself."

I thought it would be easy. I've got a great grounding in HyperTalk (you should see what I achieved when I were a teenager) but each time I tried to write the tree, I was thwarted. It was either too slow, too complicated, didn't look right or a tangle of insane spaghetti code.

Any new language, even if it's based upon something that you already know takes time to learn, to appreciate how it's optimised and to overcome its foibles. And then when things are going well, it's all to easy to add to it... like an appearance manager, so I could cater for Windows. A line needs to be drawn else it never gets released!

Well, we're there now and I think Rev's capabilities feel a little bit more complete.

If you want to build Data Tree into your own applications, a nag-free licence can be bought for just £30. Unfortunately, I don't have a the time or means to build a fancy-pants online shopping experience, so PayPal will have to do.

Here's how it'll work:

  1. If you haven't done so already, create yourself an account with my site and verify it when the 'hello' email arrives.
  2. Use the form on the contact page to send me a message. Please use the same email address as you registered with and include your actual name and site user name in the body of the message.
  3. I'll then use PayPal to issue you with an invoice that will contain a link to make payment.
  4. Once I receive the funds, I'll add the licence to your account and email you to notify you of this.
  5. Finally, you can log back in again and fetch the nag-free licence from the download page.

Simple! And now for my usual list of fixes, tweaks and additions. 


New messages: rawKeyDownOnTree and rawKeyUpOnTree
Trees can now receive keyboard input when they are the active control, in the form of the above two messages. See the manual for more info. 


New messages: nodeClick
At the moment, when the user clicks on a tree, you can be sent both nodeDown and nodeUp messages. However, if some of your nodes set the direct click property to true but others to false (or left empty), you'll have to catch both events to deliver appropriate responses to the user.

Now, some would argue (me included) that this is fine because you're handling the correct message for the kind of node that has been clicked on. Also, by segregating the responses, I think that code in the tree becomes a bit more readable. However, others argue that it's not really that efficient writing two handlers to catch mouse events.

So what's the solution? Well, I've introduced a nodeClick event that is sent whenever a node highlights in a tree. Thus you do not need to worry about handling separate nodeDown and nodeUp messages when you have a mixed direct click tree.

The nodeClick event is also sent when the dt_activateNode command is issued to a tree. 


Fixed bug: nodeUp message being sent with no parameters when 'direct click' property was set to true
When you set the direct click property, the tree gets a nodeDown message but never a nodeUp message. This is intended behaviour because the tree should carry out some immediate action when it highlights on nodeDown and there is no need to handle nodeUp. However, previously, it was also getting a nodeUp message but no parameter information was being sent.

A better description of how direct click affects nodeDown and nodeUp has been included within the relevant sections of the manual.


Improvement: changes to dt_activateNode
When you issue this command and the node is out of view, the tree will scroll to find it (provided that it is not within a collapsed parent node). If it's already visible, no scrolling will take place.

As mentioned above, a nodeClick message will also be sent with a button id of 1 (a simulated left click). 


Improvement: plays much nicer with the IDE
Basically, what it says above. Rather than using behaviours, the library uses frontScripts to intercept various messages (you can catch more events than behaviours allow). One of the downsides of using a frontScript is that your own code can really confuse the hell out of the IDE.

I already had a lot of code in the library to avoid crashing the IDE but I found that there were still occasions where my library could cause a crash and cause Rev to completely lock up.

Now, this may be because I was working with the library in an unencrypted state and so Rev would open up my scripts to show me the errors of my ways. This might also explain why I've not had any complaints from the 100 or so people that have downloaded the betas but to be extra safe, if the IDE is about to crash, the worst that'll happen now is that a modeless error window will appear. You'll be able to safely save and exit your script editing. Note that if you try to dismiss the window before closing the script editor, it'll keep on reappearing.


Documentation: improved formatting for Windows
And finally, as per my previous blog post, I was a little bit horrified that the manual and various windows that make up the library didn't look as nice on Windows as on the Mac. So I've written some code to improve the presentation for Windows. It should all look yummy now!

Tags:

2 comments so far...

This looks great

Hi Steven,

first of all, this looks very promissing. Currently I have not got the time to check it out in detail, but it looks like a very good job.

Keep up the good work!

Malte

By derbrill on   02 December 2009

This could be just what I am looking for

Hi Steve,

I am currently working on an application that needs a TreeView (can't help but call it that because of my Windows background) type of control. I will download the trial version and if all goes well get a licence. Two controls I regularly use are trees and grids. As I already have the grid covered, your Data Tree will be the other missing element that will save me a lot of time.

Scott.

By runrevplanet on   08 December 2009

Your name:
Title:
Comment:
Add Comment    Cancel  
  
Powered by WebRing.
 
Copyright ©2008-2009 theworcestersource.com | Terms of Use | Privacy Statement