AN OVERVIEW OF DTFWIN JOHN T. DOW info@www.johntdow.com This file provides an overview of some of the features of DTFWIN. For up-to-date information, see DEVGUIDE.TXT and DTFWIN.NEW (both available for download from www.johntdow.com.) Q&A WINDOWS FEATURES AND LIMITATIONS The windows version of Q&A has the ability to present multiple forms for your existing DOS databases. These forms can easily be made to be much more presentable than is possible with DOS databases. It has a standard point-and-click user interface. For example, you can put buttons on forms that users can click on to make things happen. However, Q&A Windows has some deficiencies that have limited its usefulness by serious developers of Q&A applications. Primary among these limitations is the lack of a macro capability. DTFWIN ENHANCEMENTS TO Q&A WINDOWS DTFWIN eliminates these limitations. In fact, it does more than just that. It gives Q&A Windows much additional power. DTFWIN is a generic Windows program with extensive intrinsic knowledge about Q&A Windows and several Windows tricks up its sleeves. The purpose of DTFWIN is to enhance the capabilities of Q&A Windows through this knowledge and these tricks. This is a brief description of the capabilities of DTFWIN. Making use of the features described here requires editing not only an INI file using a text editor but possibly creating other specification files and possibly making programming changes in the Q&A databases. No programming or customization on my part is needed. When purchased, DTFWIN will have been customized so that the program has your name (e.g. USSTEEL.EXE) and an icon of your choice or design. Additional customization is only needed for application specific features that cannot be implemented using the features in the INI file or the other files used by DTFWIN. For example, DTFWIN'S ability to extract information from databases does not have the equivalent of derived columns. Therefore, if you need a pick list that is filled not only with columns from another database but also with information that has been derived from those or from other columns, customization would be required. HOW TO MAKE DTFWIN WORK FOR YOUR APPLICATION DTFWIN reads an INI file with generic parameters and a CFG file with settings that might be specific to the workstation (such as directories). Using the INI file, you can specify the size and position on the screen of DTFWIN. Databases are listed in the INI file. In addition to the database name, you can also specify the size and position on the screen of each database. The INI file defines the DTFWIN menu and what actions are to be taken upon the selection of menu items. You can even specify that certain menu items are to be grayed out unless the appropriate database is open. This is possible because DTFWIN supports a script language. For example, using this language you can specify that when a particular menu choice is selected, a particular database is to be opened, a particular form to be selected in retrieve mode, and certain values are to be placed in two fields and the cursor is to be left positioned in a third field. THE DTFWIN SCRIPT LANGUAGE The script language provides Q&A Windows with the capabilities provided to the DOS versions of Q&A via key-stroke macros. Unlike macros, you do not record scripts but type them into a file using a text editor. Unlike macros, scripts include commands that require "intelligence" on the part of DTFWIN. For example, the command to go to a particular field on a form works regardless of where that field is on the form because DTFWIN doesn't tab to it but accesses it by name. Scripts can be executed: 1) under the control of the Q&A database programming, 2) by selecting a menu choice, 3) automatically upon start up, or 4) when the user clicks a button on a Q&A Windows form. If the script language lacks a feature you need, I may be able to add it, so let me know. HOW DTFWIN MODIFIES THE APPEARANCE AND BEHAVIOR OF Q&A WINDOWS Because DTFWIN has a menu that you have customized, you will not want your users to be accessing all of the Q&A Windows menu choices directly. DTFWIN actually hides the Q&A menu, so that the only menu visible is DTFWIN's menu, which you customize. You can make standard windows message boxes with buttons (OK, Cancel, etc) and with icons (Information, Error, etc). The message boxes return information from the user to the program, so that your Q&A program can tell which button the user selected. All this is completely under the control of the programming in the Q&A database. There is built-in support for data integrity logic. If you have Q&A programming logic that sets a mandatory data field blank when conditions are not satisfied, Q&A will send control to that field when the user tries to exit from the record inappropriately. Q&A displays a message when it gets to the field that is not very helpful. DTFWIN automatically sees that message and passes control back to your programming so that you can display a more appropriate message or take other action. (This data integrity technique was described in an article I wrote that appeared in the April 1999 issues of The Quick Answer.) DTFWIN makes it possible to have multiple databases open at once. Users cannot shut down Q&A Windows or minimize it without using DTFWIN. Also, a database cannot be moved or resized. Instead, the location on the screen (relative to the DTFWIN program itself) and the size of a database are controlled by the DTFWIN according to information in the INI file. These changes to Q&A Windows make it appear to be a part of DTFWIN instead of a stand alone program. For example, if you grab DTFWIN with the mouse and move it to another location on the screen, any databases that are open are moved simultaneously, just as if it was all one big happy program. When the user exits from DTFWIN, all Q&A Windows are shut down automatically. If DTFWIN is minimized or restored, all databases are also minimized or restored. The Q&A Windows title bar has your company or organization name and your own, descriptive database name instead of the standard text. Example: instead of "Q&A [CUSTOMER.DTF]" the titlebar could be "<< Honest Abe Car Sales:Customer database >>". Pressing F1 in a field brings up the field help, not Q&A Windows help. NEW USER INTERFACE OPTIONS Q&A 5 for DOS improved the ability to communicate between a database and the user. For example, it has a message box, a simple dialog that allows the user to reply Yes or No, and the ability to put up a list box with a list of choices (e.g. Yes, No, Maybe, Always, Never). DTFWIN adds these same abilities to Q&A Windows and then some. DTFWIN can recognize when the user selects a button on the Q&A Windows form and can take appropriate action. Q&A Windows itself may or may not be allowed to see that the button was pressed. DTFWIN understands "BACK", "SAVE", and "CANCEL" buttons. You can easily add many other buttons to do whatever you want. When the user clicks on the button, the Q&A programming is notified and can take the appropriate action. For example, clicking on a button labelled "REFRESH" can trigger programming to recompute values or look up fields from other databases. The "Back" button will send the user to the previous form. A database can be designed so that 10 forms all have buttons that take them to some common form (perhaps a form with an enlarged version of a memo field) - that one form need only have a button labeled "Back" and it will automatically return to the proper form of the 10. Without DTFWIN, the database must be designed to have 10 forms because each "Back" button would have to specify exactly which form it has to return to. The "Save" button when clicked tells Q&A to save the current record to disk. (It does this by sending a Ctrl-R followed by ESC to Q&A Windows.) This is the standard behavior but it can be easily customized to do something else. The "Cancel" button is customizable. Based on pressing F12 or clicking a button next to a field, DTFWIN can launch a program of your choice and pass to it the information in that particular field. You can also run the program strictly under the control of the database programming without having the user take any action. You can use this feature to do things like opening an image viewer for a picture or running a dialer program, passing it a phone number to be dialed. Using Q&A programming logic and an external file, you can pop up a list box filled with data extracted from another database. You can also associate a list box with a particular field and the user can activate it by pressing F12 or by clicking on a button next to the field. This list box is similar to list boxes implemented by DTFDATA and DTFTALK for Q&A for DOS. However, the list box is a standard Windows list box. As an option, if the entry to be selected by the user isn't available in the list box because there was no record in the external database, the user can click on a "New" button, which will open the external database in add mode so the entry can be added. Once added, the user clicks on a "Close" button, the external database closes, and the information is returned automatically. If desired, a dialog appears to prompt the user for a string to search for the data to be loaded into the list box. (For example, the user can see a list of customers with the name SMITH.) List boxes can display more than one column of data. They are standard windows scrolling list boxes, with OK and Cancel buttons. You can select an item with the mouse by double clicking, or you can use the keyboard to scroll and then select by pressing Enter. Dates can be formatted in list boxes in various formats, including the US standard format (MM/DD/YY) and the European format (DD/MM/YY). You can also have a list box filled with data in a text file. Such a list box can have multiple columns for display and selection. Both list boxes described above can be used to display information only. In this case, the user can not select a row to be returned to the database but can only cancel the list box when he is done viewing it. Other additional enhancements to the user interface: a User Select command, similar to Q&A 5; message boxes with Yes/No/Cancel, OK/Cancel, or other button combinations; a prompt to ask for a value to be keyed in (without entering it into a field); and a popup dialog with buttons for making selections. OTHER NEW FEATURES Using the built-in data manipulation capabilities, you can post to other databases. This posting is extremely fast. It can post to multiple fields at once and even to multiple fields in multiple records at once. Using the INI file, you can tell DTFWIN to monitor special fields to take certain actions based on their values. For example, the value can be used to determine that a different form should be used, and DTFWIN will automatically switch to the appropriate form. In this case, when entering a transaction, the user could first fill in common information and then select a transaction type. Seeing the transaction type filled in, DTFWIN would then automatically select a form that is appropriate for data entry or display for that type of transaction. DTFWIN can be told the name of a database to be used to verify the user and password on start up, even before any databases are accessed. It will then remember this user and password and automatically supply them to password protected databases as the user opens them. DTFWIN has a built in capability of allowing users to go directly to a database, a form in a database, or even a field on a form in a database, just by making a selection from the "Navigation" menu item on the main menu (or wherever you elect to put it in the menu structure). This list of places the user can go to can be very long and is defined in the INI file. If your application has a number of databases with many fields, this can make the system easier to use for novices as they don't have to remember where things are. DTFWIN can automatically generate retrieve specs to keep multiple databases synchronized. Example: if a customer is selected, then on switching to the order database, it will automatically be restricted to the records placed by that customer. You can control the DTFWIN titlebar. Eg if you select a customer, you can put the customer's number and name in the DTFWIN titlebar. What if a user gets up and leaves his workstation without logging out? Automatic time out is now possible. If the user doesn't do anything for a specified period of time, DTFWIN and all the databases are automatically closed. You have the ability to send multiple e-mails, much like doing a mail merge except the result is multiple e-mails, not multiple printed pages. Q&A for Windows has a very nice free form report, but it's tricky using it to send output to a plain text file. You might want to do this if you want to generate e-mail messages, for example. DTFWIN has a TEXTWRITER command that is a simplified free form report, designed explicitly to create text files to be e-mailed or sent to other programs.