View Full Version : Success with big-league hierarchical menu using ActiveX TreeControl with A5V9!


04-24-2008, 09:17 PM
Success with big-league hierarchical menu using ActiveX TreeControl with Alpha Five V9!

Alpha Five V9 offers a native tree control which is ideally suited for building hierarchies where the underlying data is repeating, for example:
Country | State | City.

Alpha Five’s control, however, does not easily handle two other common hierarchical tasks: building deep application menus and handling recursive data.

Because so many of you have assisted and helped me as I put my toe into the AlphaFive waters, I wanted to report success with the application menu task using a third party ActiveX control and show you the final result built using A5V9.

I created a simple table with the following field definitions:
Sort key | Tab position | Text | Form

I then populated this table with sample data from the world’s largest ERP system as a challenge to both the third party control and to A5V9.

When I double click on a transaction on the menu, identified using the square box icon, the appropriate form smoothly launches in A5.

Sometimes what appears to be complex turns out to be fairly simple, as I found in this case.

A5V9 offers an interesting tool in its new Accordian supercontrol, but this control only permits expansion to one subordinate level. Use of this control requires
fairly expert knowledge of XDialog.

A5V9 also offers multiple buttons controls, which have been the typical solution to menu structures. The challenge with these are their maintenance and inflexibility.

My solution is extremely flexible. By changing the data in the underlying table, my menu can immediately reflect the structure I want for my application.
Additionally, I have one menu for the entire application; no splitting it up and trying to remember the organization of the pieces. And finally, my solution has an additional benefit: it allows me to develop an application and give my end user, the ability to modify the menu to suit his needs.

You may note several important differences. The background of the control is colored, and not white as only permitted by A5V9. More importantly, as the tree is expanded, the icons change position (little gray triangles in lieu of + and -, open and closed folders), and the color dynamically gets lighter. So its always easy to see when you return to a menu where you have been.

You will notice that I did not clutter my tree with “cutsey” icons and for good reason: with large applications you simply run out of good icons early in the game and the result is decoration with little meaning.

For me, the Office 2007 “Ribbon” was the straw that broke the camel’s back. Microsoft Access 2007 was touted as easy to use, yet to create menus you had to master XML. Give me a bloody break. It is impossible to anticipate all the places a user may jump to from a given form.

My open and closed icons were from www.glyphlabs.com, which I found to be of high quality, consistent graphic appearance, and modestly priced.

I used IconEdit Pro to create the gray right and bottom arrows and the square box icon to launch a transaction.

The tree control I used was ctTree from DBI Technologies. This is one of a handful of firms committed to maintaining high quality ActiveX controls, when most software houses have capitulated to .net. I found a bug in the mask color of the Plus picture property back in December, demonstrated that it occurred also with MS Access not just A5, and within four days, they had fixed it and sent me the patch. Talk about responsive!

Any of you guys are interested in playing with this, I’ll post my code in the code library. I think DBI Tech offers a free 30 day trial period if you wish to play with it.

My next project: bringing A5 out of the tab control dark ages.

Doug Page
04-24-2008, 09:36 PM
I know you've been playing with this a long time. Very well done Bob.

Thanks for sharing!

04-24-2008, 10:01 PM
I agree - very well done! Thanks for sharing!

Tim Kiebert
04-24-2008, 11:04 PM
Yep, very nice,well done. Would certainly be interested in that code library entry.

04-24-2008, 11:55 PM
Great Job, I am going to try it. And, you are right, I have used DBI before, they do a good job.

04-25-2008, 02:12 AM
Wow that does look stunning, I was just looking at an app that uses something similar but otherwise looks like it could have been written in Alpha5 :)

(They do appear to be using these components, as the browse component looks like the examples on the DBI page - of course all that is native in A5 now!)

04-26-2008, 07:16 PM

Everything now appears to be working correctly. I have documented this project in a 16 page MS word document, including all code and screen prints of control settings, available in the Code Archive with the title "How to create a dynamic hierarchical menu"

Bob McGaffic

Raymond Lyons
04-27-2008, 03:19 AM

Great job and nicely documented. However, rather than the Code Archive (or maybe in addition to it?), might I suggest that LearnAlpha.com might be better place for such an extensively documented contribution.