Troi Dialog 3.1
Friday 28th June, 2002
Troi Dialog 3.1 is a plug-in for FileMaker Pro that allows you to add your own user-defined dialogs to your database solutions. This latest release is yet another example of the sort of functionality that FileMaker needs to roll into its next whole-number upgrade.
As with any FileMaker plug-in, installation is simply a matter of dropping a file into the FileMaker Extensions folder. Once installed, you can access the functionality provided by the plug-in from within any FileMaker calculation. In practice, this is most likely to occur from within a script, and, as most externals return a result (or at least an error message), this is usually done using a Set Field script step.
All external functions can take just one text parameter. If you want to pass more than one value to an external function, then some sort of text delimiter is required within the text. With Troi, this is usually the bar character, ‘|’, although this can often be changed to a user-defined value, depending on the plug-in.
The main addition in this latest version of the Dialog plug-in lets you dynamically create a dialog containing up to five different controls plus four submission buttons. Each of these controls can be a plain text box, a bulleted password text box, a pop-up menu, or a checkbox. The controls can also be given a label, and for text boxes, you can decide which text box is active when the dialog opens.
As you might guess, this takes a lot more argument passing than might easily be achieved in a single external function call. In fact, Troi provides four functions to set up parameters the dialogs might use: one to create and bring up the dialog, with a further three to get hold of the results.
To set the labels for each of the possible five controls, you call ‘TrDl-SetLabels’ with a bar-delimited list of labels. If any of the controls are to be pop-ups, then you need to call the ‘TrDl-Popup’ with the pop-up identifier, and a return delimited list of values, one for each pop-up to be defined. This makes it easy to use FileMaker value lists and have FileMaker create them dynamically from existing record data.
If your dialog is to contain text fields, you may want to prefill them with existing or example data. A call to ‘TrDl-SetInput’, lets you set the input text for any of the five controls. Finally, you can decide exactly where you want the dialog to appear using ‘TrDl-SetPosition’. Of course, you don’t need to call all these functions every time, as the plug-in remembers settings between uses.
This means if you only want to use one dialog in your solution, then it’s only necessary to run these functions once, when your document opens. To bring up the dialog, you call ‘TrDl-InputDialog’ with the text and types of controls that you want in your dialog, the switches to say which field is the active field, and the names of your (possible) four submission buttons.
In previous versions, a dialog returned a string, with the button selected and any data the user entered or selected. While this is still the case, to save you writing string parsing code, there are now two new functions - TrDl-GetButton' and ‘TrDl-GetInput’ - that return the button choice and user data respectively. You can also specify whether to return the button number or the button name.
All this may sound like overkill, but this gives you much greater freedom when designing your solutions (keeping the garbage in, garbage out to a minimum). While it’s still possible to create a dialog using just the ‘TrDl-InputDialog’, the older ‘TrDl-DoDialog’ is also kept for simple dialogs and backwards compatibility.
As well as this useful new feature set, Troi has also tweaked its existing functions. For example, you can now specify the width and height of List dialogs, and the new starting field switches now also apply to old-style ‘TrDl-DoDialog’ boxes.
This upgrade will be a welcome addition to any FileMaker developer’s armoury. But there’s always room for improvement. For example, it still can’t manage the selection of multiple items in List dialogs. The Mac OS has had this feature for some time and surely it’s possible for the list function to give back a return-delimited list of values from a List dialog.
Now that we have an easily customisable dialog, it’s odd that you can’t have, say, three radio buttons in a row, or five radio buttons in one box. And given Troi’s excellent Ranges plug-in, it seems strange that there’s no calendar-style dialog included in the package. With any luck these issues will be addressed in version 4.0.
This is an upgrade definitely worth including in the FileMaker developer’s armory. But of course there’s always room for improvement.
|Get Further Info|
|Pros||Customisable dialog + Easier argument parsing + Cross platform|
|Cons||No multi-item selection in list boxes|
|Originally Published||MacUser, Volume: 18, Issue: 12, p26|