Monday, June 06, 2005

Hierarchical Query Menus in GTViewer

The number of available slots on the Query menu in GTViewer has been growing over the years. Originally it was 10, then it was extended to 35, then to 50, and now to 100 slots. The upgrade to 35 came with the addition of external applications which also consume menu slots and also introduced the need for Hidden Queries which use even more menu slots. The addition of Thematic Queries also weigh heavily on the slot usage since they typically use a prompt query which also takes a slot.

If nobody inferred this from what I just said, the number of query slots was increased from 50 to 100, therefore someone out there had a need for more than 50 query slots (and maybe more than one). I have noticed that more and more users are defining more and more queries and these long lists of queries sometime run off the screen. You can still select queries when the menu is bigger than the screen, it is just a pain to scroll the menu up and down to find the one you want. Back in version 4.0.x.9, a feature was introduced into GTViewer that allows you to build hierarchical menus in GTViewer, rather than the single level linear menus that have always been supported in the past. This new feature means that you can group queries and only show the group name on the Query menu. The group menu item will pop up the rest of the grouped items when it is selected. This feature is easier to show than to describe. Looking at the Electric/Gas sample data that is delivered with GTViewer, compare how a single level menu looks along side a hierarchical one:



Single Level Menu:





Hierarchical Menu:

Granted, this is a very small example, but if you have 30, 40, or 50 menu items, you can see pretty easily how the group will help. The best thing about grouping your menu items is how easy it is to do. Look below at the two versions of the [Query Info] section to see how the Electric and Gas groups were defined in the example above:

Single Level Menu:

[Query Info]
Query=query1.qry
Query=query2.qry
Query=query3.qry
Query=query4.qry
Query=query5.qry
Query=query6.qry
Query=query11.qry
Query=query7.qry
Query=query8.qry
Query=query9.qry
Query=query10.qry
Query=query12.qry
Query=query13.qry
Query=query14.qry
Query=query20.qry
Query=query21.qry
Query=query22.qry

Hierarchical Menu:

**** Note: I couldn't get the blog to show the pipe symbol correctly, so I just put "[pipe]" to indicate where the pipe symbol goes. Sorry for the confusion. ***

[Query Info]
Query=query2.qry[pipe]Electric
Query=query3.qry[pipe]Electric
Query=query4.qry[pipe]Electric
Query=query5.qry[pipe]Gas
Query=query6.qry[pipe]Gas
Query=query11.qry
Query=query7.qry
Query=query8.qry
Query=query9.qry
Query=query10.qry
Query=query12.qry
Query=query13.qry
Query=query14.qry
Query=query20.qry
Query=query21.qry
Query=query22.qry


Now with a 100 menu slots available, this feature will be more important than ever; however, even with a handful of queries, you may still find a use for this feature.

1 comment:

GTViewer - Joey Rogers said...

With GTVx 5.0, a new method has been added called QueryAvailableListEx. This method will return the group name for each menu as well as the name and id and should provide enough information to achieve the same type of menus.