Product Review: Xplore Templates

by Dave Harms

Published 1999-02-15    Printer-friendly version

Topspeed's move from the legacy templates to ABC/OOP has brought challenges and opportunities to third party developers. The challenge is to port existing products to OOP/ABC; the opportunity is to make use of and derive from ABC classes. One of the first products to take advantage of ABC was Datamatrix's Xplore, a browse add-on that allows end-users to greatly modify the appearance and behaviour of ABC browses.

Xplore is the creation of Brian Staff, who initially wrote the product to add the ability to sort browses by clicking on headers, much the way Windows Explorer lets you sort file lists (hence the name Xplore). The good news for Clarion developers is that Xplore has been hit by some serious feature creep since then, and the name Xplore really doesn't do justice to all of the capabilities of this product. Xplore lets your users customize the appearance of their browses in almost any way imaginable, and provides useful data export and quick reporting/graphing capabilities.

Xplore was originally available for C2 legacy templates, and the three products that made up the original Xplore suite (Xplore ReFormat, Xplore ReOrder, and Xplore Column Properties) are still available from Datamatrix, though they are no longer being enhanced. The current product is the ABC version (for C4 and C5), which includes all of the features of the original suite plus quite a bit of new functionality.

Installing Xplore

Xplore is delivered as a zip file containing several Clarion source and template files, text translation files, icons, and a text file. Go directly to the text file (xplore.txt), as this will tell you where to install the various files. All the source code is included.

The documentation is a bit sparse, but it's also concise and generally sufficient to the task. You'll need to manually copy the files to the directories specified in xplore.txt – class and translation files to LIBSRC, templates to TEMPLATE, and icons to IMAGES. A proper install program and Windows help file would be a nice touch, but it's hard to complain about this in a product that otherwise offers so many features.

Using Xplore

Using Xplore with an ABC browse is simplicity itself. Simply register the Xplore template chain, open the application, and begin by registering the global template extension (XploreOOPGlobal). This template is used to set the global defaults for any browse boxes to which Xplore is applied. Most of these defaults can be overridden on a browse-by-browse basis, although several are only available here. These include hot keys for applying automatic column widths, resetting the browse back to its default appearance, toggling the highlight bar to cover the whole row (what most of us are used to) or just the current column (spreadsheet style), and invoking the popup menu, which is the primary means of using Xplore's power.

The global extension defaults tab is shown in Figure 1.

Figure 1: The Xplore global extension default tab.

Note that there are some special instructions regarding C4 and edit-in-place. Well-behaved third party products should not require you to modify Topspeed source files, since your changes may be lost the next time you upgrade Clarion. Xplore meets this criterion, with one exception. If you're using C4 and you want to use edit-in-place, you'll need to find this line in abbrowse.inc:

Felds &FieldPairsClass,PRIVATE
and change it to
Fields &FieldPairsClass,PROTECTED

in order to avoid a compile error. This is only necessary if you're using C4, and isn't a big concern since when you upgrade to C5 it won't matter that you lose the change – in C5 the Fields reference is already PROTECTED and Xplore will work just fine.

To use Xplore with a specific browse, bring up the procedure extensions list (either by clicking on the extensions button or by choosing Extensions from the procedure's popup menu on the AppGen main window). Highlight the browse to which you want to apply Xplore and click on Insert. Choose the XploreOOPBrowse extension. (You will also see the XploreOOPList extension – this is for hand-coded list boxes, not for ABC browse boxes.)

At this point you can go ahead and run your app and try out some of the nifty Xplore features. Bring up the browse and click on a column heading; the browse sorts on that column. Click again on the same column, and the browse sorts on the column in reverse order. For a file loaded list with everything in memory that's not necessarily a big deal, but this is working with a page loaded list box which means that as you scroll down and more records are retrieved, they retrieved in the order you've specified by clicking on the column header. Any filters which have been applied (either specified in the code, or obtained by QBE) remain in effect. All that's changing is the sort order. Specific fields can be disabled, if you like, and this may be advisable for large data sets where you don't already have a key on the field. Xplore is telling the ABC BrowseClass which sort orders to use, and the BrowseClass is ultimately passing this responsibility on to the view engine. If you ask the view engine to sort on a field for which it can find no usable key, it will build an index, and on a large file that can take quite a bit of time.

In addition to clicking on columns you can reposition them using drag and drop. Just grab the header and drag it left or right. You can only drag one column at a time, and only to the left or right of the adjoining column, so if you want to move it more than one column you have to drag multiple times. There is another way to deal with this as I'll discuss shortly.

Xploring Popup Menus

Xplore adds a number of items to the standard browse popup menu. Figure 2 shows a typical popup.

Figure 2: The Xplore popup menu options added to the standard browse popup.

If you choose Header Offset from the menu, you'll see a small dialog like the one shown in Figure 3.

Figure 3: Dialog box for updating browse attributes.

You can adjust the value in the spin box and see the change on screen immediately – the header will shift left or right as specified. Note that this works best with the arrow keys, as the accept loop does not continuously post NewSelection events if you hold down the spin button down with the mouse.

As the menu shows, you (and your users) can apply a wide range of formatting options to a browse, including background/foreground colors, underlining, and text justification. If you want to adjust a whole lot of things at once, choose the Properties popup menu option. This brings up the Xplore Properties window, shown in Figure 4.

Figure 4: The Xplore properties window lets you set all properties at one time.

From here you can change just about anything you like on the list box, including the font. If you adjust to, say, Arial Bold 12, in Teal, you get something like Figure 5.

Figure 5: A list box with a large, colored font.

Just tell them it's Visual Basic, only it works.

If you do this exercise, you'll need to adjust the line height (which you can do from the properties window). When you do this you change the number of lines that can be displayed on the window, which alters the number of records which the browse will keep in its queue. The browse then needs to be refreshed to display the correct number of rows. All of this is done by the ABC BrowseClass, under the command of Xplore.

There are a number of other nice formatting touches, including the ability to hide columns, to set the width of the column to the widest item of data (of those items presently displayed on screen), and to easily restore all defaults. You can also choose whether to allow different formats for each tab, where you have multiple sort orders, or to use the same format for all tabs. You can choose from several column header indicators (the marks that indicate which column is the active sort order, and whether it is ascending or descending) and you can optionally display a message if the user clicks on a header that isn't sortable.

If your browse has multiple sort orders on tabs (which is what the AppGen will create for you) you can also have Xplore drive the tab selection. If the user clicks on a particular column, you can activate that tab (which may have tab-specific controls such as a button for child records).

Xplore can do considerably more than reformat browses. On the popup menu is a submenu called Output (see Figure 6).

Figure 6: The Xplore output submenu.

Output lets you create graphs, reports, and other data based on the formatting options the user has chosen using Xplore. Graphs are simple bar charts which by default will have one bar for each unique value in the column. You can, however, specify ranges for the graphs by clicking on the extension's Columns tab and inserting a column field assignment. The column field assignment button contains a button for graphing details where you can assign numeric, date, time, and string ranges.

Figure 7: An Xplore graph of telephone number distribution, by area code.

You can also use Xplore to create mini-reports, again based on whatever fields and formatting options the user has chosen. These reports can be run on the entire data set or just those records shown on screen.

Figure 8: An Xplore report, using the on-screen format.

Two additional output options let you export data to other applications. Export to ASCII will create a CSV file and will (typically) load it into Excel (or whatever other program you have registered to receive CSV files. Export to HTML will create an HTML table of your data, like the one in Figure 9.

Figure 9: An HTML table generated by Xplore
Company First Name Last Name City State
ABC Widgets Company William Fast Chicago GA
Acme Fastners David Smith Durham GA
A & A Exports Susan White Grand Prairie LA
K Processing Mike Smith Forest Hills SC
Fidelity America Rodger Wiles Glen Burnie LA
Easi Everything Frank Forest Louisville MS
Have Everything Richie Rich Evanston GA

The Demo

A C4/C5 Xplore demo is available for download, and it has all of the capabilities described in this review. You can get it at the Xplore order page:

http://www.bmtmicro.com/catalog/xplore.html.

Look for the link under the Product Info header.

Unzip the demo to any directory you like as it's a locally compiled EXE with the necessary TPS files. You might want to print out the notes window that appears when the demo starts, as it contains useful information on Xplore's capabilities and can be a helpful supplement to the documentation, particularly with regard to graphing capabilities and using Xplore in parent-child browse pairs.

There are a few minor cosmetic glitches in the demo. The notes seem to indicate that the BrowseCustomer example already has different formats for each tab, while you have to modify the formats yourselves. An appropriate INI file included with the demo would solve this problem, although the program would have to be modified to use a local INI file rather than the Windows directory, which is where it now creates its xplrdemo.ini. As well, on most browses the display string on the lower left corner is not anchored to the bottom of the window and overlaps other window controls when the window is resized.

Support

The author's address in the notes is shown as 75310,1147@compuserve.com, which is incorrectly formatted. Change the comma to a period (the comma is for Compuserve's address format) and it's fine: 75310.1147@compuserve.com

Support is generally via the third part newsgroup at the TS news server (tsnews.clarion.com) or by email to the CompuServe account.

Xplore on the web

The web site is a bit out of date, as it lists Xplore as being for C4 and makes no mention of C5, although the product is definitely C5-compatible. Datamatrix expects to update the page soon.

Xplore Home Page http://ourworld.compuserve.com/homepages/BrianStaff/

On-line Purchase http://www.bmtmicro.com/catalog/xplore.html

Company Information

Datamatrix Software
4412 East Via Montoya
Phoenix, AZ
USA 8505

BrianStaff@compuserve.com

Summary

Pros

  • Easy to implement
  • Good control over end-user access to features
  • Output to HTML and CSV
  • Vast feature list
  • Translation support

Cons

  • Documentation is a bit sketchy
  • Web site is out of date (though soon to be updated, according to the author)
  • No install program or Windows help file.

Overall Rating: Highly Recommended

This product is a must-have for anyone who wants to give users a measure of control over the appearance/behavior of ABC browses, or allow quick printing/graphing or export to other applications.


David Harms is an independent software developer and the editor and publisher of Clarion Magazine. He is also co-author with Ross Santos of Developing Clarion for Windows Applications, published by SAMS (1995), and has written or co-written several Java books. David is a member of the American Society of Journalists and Authors (ASJA).

Printer-friendly version

 
 

Search

 

Advanced Search
Topical Index

Related Articles

Subscribe to
ClarionMag

One year: $184

(includes all back issues since '99)

Renewals from $134

Two years: $274

Renewals from $224

More Info

Subscribe Now!

ClarionMag Blog

RSS Feeds

Updates via Email

Enter your Email


Powered by FeedBlitz

Quick Links