DOC60E97
DOC60E97
DOC60E97
Page 1
Copyright
Visual Extend is a product from Devigus Engineering Ltd, CH-6343 Rotkreuz/Zug. Any reuse of VFX
related material needs the written permission of Devigus Engineering Ltd, also VFX related
publications must have the copyright notice of Devigus Engineering Ltd.
Visual Extend 6.0 User Manual Lets be more productive! Page 3
INTRODUCTION......................................................................................................................................7
OVERVIEW.................................................................................................................................................7
APPLICATIONS CREATED USING VISUAL EXTEND.......................................................................................7
KEY FEATURES..........................................................................................................................................8
INCLUDED TOOLS....................................................................................................................................10
VFX Class Library.............................................................................................................................10
VFX Wizards and Builders.................................................................................................................10
VFX Developer Productivity Tools....................................................................................................12
INSTALLATION......................................................................................................................................13
HARDWARE AND SOFTWARE REQUIREMENTS..........................................................................................13
THE VFX 6.0 INSTALLATION...................................................................................................................13
SETUP THE VISUAL FOXPRO ENVIRONMENT FOR VFX 6.0.....................................................................14
VERY IMPORTANT NOTE ABOUT THE DEFAULT DIRECTORY WHILE WORKING........................................16
NOTE ABOUT THE TEMPLATE CLASSES SETTING.....................................................................................16
NOTE ABOUT THE CREATION OF NEW FORMS USING THE VFX FORM WIZARD......................................16
NOTE FOR DEVELOPERS OF NON-ENGLISH APPLICATIONS........................................................................16
INSTALLATION FILES OVERVIEW..............................................................................................................17
TROUBLE SHOOTING GUIDE...........................................................................................................18
..................................................................................................................27
Tools Menu.........................................................................................................................................27
Window Menu.....................................................................................................................................27
Standard Office-Like Toolbar............................................................................................................28
Final Word about Office Compatibility.............................................................................................28
THE DATABASE TOOLS............................................................................................................................29
THE USER LIST........................................................................................................................................30
THE ERROR TRACKING............................................................................................................................31
THE SYSTEM LOCKS................................................................................................................................32
THE VFX RESOURCE FILE.......................................................................................................................33
Visual Extend 6.0 User Manual Lets be more productive! Page 4
Introduction
Overview
Visual Extend 6.0 is an Application Development Framework for Software Developers working with
Microsoft Visual FoxPro Version 6.0. Visual Extend includes Builders which assist the Software
Developer in its daily work and dramatically speed up the software development process without
sacrifying any of the Visual FoxPro features. With Visual Extend, Visual FoxPro becomes a real Rapid
Application Development Tool for both Desktop and Client Server Database Application Development.
Visual FoxPro is an outstanding Software Development Environment. Thanks to its Object Orientation
and OLE Capabilities, the Software Developers dream of easy code reuse of either personally
developed, or third party modules becomes true. But starting to develop its own Software Development
Environment around Visual FoxPro from scratch is a major undertaking. Not only that its difficult to
develop a solid Class Library as a Foundation Class for all to be developed Applications. Its also rather
time consuming to use these Classes and manually fill in the right Properties and Methods in the
Property Sheet while developing new Applications all over again.
Visual Extend for Visual FoxPro fills exactly this gap by bringing a complete Application Development
Framework to the Visual FoxPro Software Developer Community. Thanks to the modular design of
Visual Extend, every Software Developer can decide whether to use all or only some parts of the Visual
Extend Application Development Framework. The Object Orientation of Visual Extend allows the
Developers to subclass existing Visual Extend Classes to further customize or enhance their preferred
Development Environment.
Visual Extend is not just a Foundation Class Library. Its much more. Visual Extend provides the
Software Developer with a powerful Foundation Class Library with equally powerful Builders for a
maximum of productivity gain. Visual Extend includes the following components:
Modular, Microsoft Compliant Visual Extend Foundation Class Library with extensive
Application Development Support
Visual Extend Wizards and fully reentrant Builders for Application, Form, Grid, Childgrid,
Picklist, PickTextbox and OneToMany Forms
Other Visual Extend Developer Productivity Tools like a Developer Menu, Application
Manager, Class Switcher and Visual Object Name Picker
Key Features
Software Developers using Visual Extend will appreciate the following features:
Application Wizard for the automatic generation of new Applications in the language of your choice.
After just a few seconds, your distribution ready Visual FoxPro Application is prepared!
Fully reentrance of all VFX Builders (Form Builder, OneToMany Form Builder, Table Form Builder,
Grid Builder, Child Grid Builder, PickTextBox Builder) which makes it easy to make changes on
already created forms using the VFX Builders!
Use the Visual FoxPro Environment whenever you want without loosing the reentrance feature of
the VFX Builders as long as you add/remove all controls using the VFX builders!
Visual Extend 6.0 User Manual Lets be more productive! Page 8
The complete Application Development Framework covers already all user interface elements in
English, French, German, Italian and Spanish. Start a new Application in the language of your
choice without translating a single word of the Visual Extend Application Development Framework
Builders for Standard Forms including Master and Child Form technique (Calling and Called By)
Builder for Power Grids
Builder for all your Picklist needs
Builders for classical OneToMany Forms as well as advanced OneToMany Forms including Tab
Dialog for the Master and another Tab Dialog for multiple Childs all on one Form
All Builders get the Field Descriptions and other properties automatically from the Data Dictionary
Form Builders will automatically size any Textbox Controls according current Field Length
VFX is Codebook compliant
Use the VFX form builders on own VFX based form classes and control classes
Run forms directly from form designer
Toolbar Navigation or Navigation Buttons on form as well as Win95/ NT4.0 compliant Toolbar
Language Setup builder
Messagebox Builder
Application Manager
Easy subclassing of the application class and setup of the environment class
Easy setup of app specific main toolbars
Linked child form techniques
VFX helps you to create your Visual FoxPro Applications in a higher quality in much less time and
therefore increases your productivity dramatically. And all this without loosing any of the Visual FoxPro
Features you like and use. Lets be more productive with Visual Extend for Visual FoxPro!
Visual Extend 6.0 User Manual Lets be more productive! Page 9
Included Tools
How to start: If you follow the installation instructions you can call
the VFX builders using the right mouse anytime when the
corresponding object has been selected.
VFX LangSetup Builder LANGBLDR.APP Automizes the generation of the code for the VFX LangSetup method.
Great help for creation of a milti lingual application.
All VFX 6.0 Form, Grid and Picklist Builders are now fully reentrant! This means that during the
Development cycle, you can call them as many times as needed without losing any of the settings which
have already been defined. Also changes done after the original generation of your forms within Visual
FoxPro will be read by the Builders the next time you call them.
NOTE: Make sure to use the VFX Form Builder as long as possible for adding and removing of any
controls (defined through the selected fields). This allows you to profit the most from the high
productivity the builders provide!
Visual Extend 6.0 User Manual Lets be more productive! Page 10
Because of the very open approach of the VFX builders, advanced users might find it useful that the
code the builders use is located in a dbf file VFX60\LIB\BUILDER\VFXCODE.DBF. That makes it very
easy if you want the builders to use your custom code. Warning: making changes to this code table
requires advanced knowledge of VFX.
Visual Extend 6.0 User Manual Lets be more productive! Page 11
Installation
NOTE: If you downloaded the files vfx6vfp6.exe and vfx6vfp6.w02 make sure that the extension of the
second installation file is .w02! If you download using older Versions of Netscape Navigator, the ending
w02 is unfortunately not defaulted in your file save as dialog.
Make sure to install VFX 6.0 with the installation program we provide into a new directory, do not
install VFX 6.0 in the same directory as earlier versions of VFX!
VFX 6.0 comes with no hardware copy protection. We decided to replace the HASP hardware copy
protection with a Registration Key and Activation Key software only based security system. You can
install VFX 6.0 and when you start the VFX builders, a dialog tells you your personal Registration Key.
All you have to do, is to register your copy online on our VFX Registration Web and we will eMail your
Activation Key which you can enter on your system. We deliver two different types of Activation Keys:
One which is limited to 30 days and another which is unlimited.
Note that you cannot copy the VFX installation from one PC to another without requesting a new
Activation Key. Your Registration Key is based on your PC and is unique. Every VFX user will have a
distinct unique Registration Key and therefore needs to register online on our web to get the Activation
Key in order to be able to work with the VFX Builders. The only way to get an Activation Key is by
registering on our registration site on the web
http://www.devigus.com/vfxreg/
We are convinced that in todays world where things change dramatically fast, the shortened payback
time of a mayor investment like VFX has been for us, the investment of both, our customers and our
own has to be protected the best possible.
We hope that you appreciate the new Software based approach and welcome you to the next generation
of VFX. The very best VFX ever!
Visual Extend 6.0 User Manual Lets be more productive! Page 13
You must Setup Visual FoxPro in order to be able to use all of the VFX 6.0 Builders. To do this, select
the Options Dialog from your Visual FoxPro Tools Menu. In the File Locations Tab set the following:
0. Start the VFP Options Dialog with the menu Tools/ Options.
1. Set the Builders: point to the VFX Builder Application named VFXBLDR.APP, which you will
find in the \VFX60\BUILDER Directory.
2. Set the Default Directory: \VFX60 (or any directory containing a VFX60 project),
3. Set the Search Path: add \VFX60\BUILDER to the search path,
Visual Extend 6.0 User Manual Lets be more productive! Page 14
Here a sample of correct settings assuming the VFX 6.0 has been installed in c:\VFX60, the default
installation directory:
Next, you may want to make sure that the VFX6.0 menu pad automatically appears whenever you start
your Visual FoxPro 6.0. We suggest the following procedure to do so:
Add this line into your CONFIG.FPW file located in your VFP6 directory:
NOTE: If you dont have a file named config.fpw just create one with notepad.
command=do(HOME()+"vfp.prg")
This line tells VFP to start the progam file vfp.prg when starting. In VFP.PRG (create this prg also
with notepad and place it also in the VFP directory) make sure to add these lines:
DOVFXMNU
If you use also xCase, add the following line at the end of your start program described above:
SET SYSMENU SAVE
DO c:\xcase\vfp5\foxcase.app
Visual Extend 6.0 User Manual Lets be more productive! Page 15
Note about the Creation of new Forms using the VFX Form Wizard
To create a new form, drag i.e. the class CDataFormPage and drop it on the new form. Since on a new
form Visual FoxPro automatically creates by default a FormSet1 and a Form1, you will have to delete
them both in the Form menu! If you are tired to create new forms this way, you should use the VFX
Form Wizard, located in the VFX 6.0 menu! This utility is probably the best reason not to use
template form setting, as described above.
The VFX home directory serves as the central location of all VFX components and is the base for all
projects you create with the VFX Application Wizard (described later in this document).
NOTE: Do not work within this project directly, it is NOT intended to be worked with directly. Use the
Application Wizard to create a new Project instead as described later in this documentation.
Visual Extend 6.0 User Manual Lets be more productive! Page 17
Error "Menu has not been defined...'" The Menu Program (VFXMENU.MPR) is not in the same
language as the Library you are currently using in your Application. Make sure that the Library (in
the \LIB Directory of your Application) is in the same Language as the currently used Menu (in the
\MENU Directory of your Application). NOTE THAT EVERY APPLICATION HAS A PRIVATE COPY
OF THE MENU! See also the notes under Attention in Getting Started. Attention VFP Bug: If you
select rebuild all from the Visual FoxPro Project Manager, Visual FoxPro generates the MPR files in the
application directory rather than in the MENU subdirectory! You must manually move them after a
rebuild all from within the Visual FoxPro Project manager. (The Visual Extend Rebuild all option
mentioned above has not this bug.)
Changes in include files don't go through: Make a change in the file which includes the Include file,
quit Visual FoxPro, delete the compiled FXP's, restart, select the correct project directory, rebuild your
project. Tip: Try also the CLEAR PROGRAM command which clears all compiled programs from
memory. If you make changes in an include file which affect a form, make sure to open the form and
save it, otherwise the changes in the include file may not affect the form. If your include file changes do
still not go through make sure to delete all FXP files and rebuild all again.
Current working directory, again and again...: Make sure that the current Directory is the Directory
of the Project you are working with! Try this: CD ?. NOTE: You better use the VFX Application
Manager to open and switch projects.
Created forms are based on the library in another directory rather than on the (expected) library
of my application: This is only a problem if you work simultanously on different projects or on
different versions of the same project. To solve incorrect links, temporarely rename the directory of your
project and open all of your forms. Open all Forms and Classes and locate the correct library from your
application when necessary and select save.
Incremental Search and other VFX Power Grid Features do not work: Make sure you called the
Grid Builder as described in the User Manual.
Incremental Search says Feature not available: You must set the buffering mode to 3, otherwise no
IDX files can be generated. You probably have it set to 5!
OneToMany Form does not refresh the childtables when I move the record in the parent: Make
sure that you setted the OneToMany Relation correctly in the form's Data Environment! All you have to
do is to drag the relation from the parent primary key to the childs foreign key. Dont set any other
properties. Tip: Make sure that you did NOT set the OneToMany propety of your OneToMany relation
in in the form's Data Environment to true. Setting this property to true mimics the SET SKIP TO
command and therefore is NOT at all what we want...
Visual Extend 6.0 User Manual Lets be more productive! Page 18
My picklist does not work with numeric fields: Make sure to set the CPickfield class property
cReturnExpr to STR(Field) rather than Field. The rest will work as with character fields.
Changes in PRGs do not go through: Issue CLEAR PROGRAM and retry. Or, better yet, set the edit
option to Compile after save! Tip: Access the properties for your code windows (prg files) with the
rightmouse click while in a code window and select properties as shown here:
Note that the Edit Properties window looks differently when you call it from a method code window
within a class library or a screen since libraries and screens will always be compiled before they will be
saved.
Project Rebuild failed: If you have some library elements in another language than the desired or have
general concerns that the project did not recompile correctly, start the rebuild all option from the VFX
application manager described above. NOTE: The include files and the menu files must be checked
manually!!! Dont expect a german version if the includes are in english,
File foxpro.h not found: Note that in the cdbkmgr.vc* and dbcxmgr.vc* the include files have been set
to c:\vfp\foxpro.h!!! Since these files do not come from Devigus Engineering, we cannot change this. Of
course you can patch this in your copies of the above libs, so did we
Objective
If you want to start a new project, you could set up the whole directory structure manually, copy all the
needed support files, like the class library, some standard forms, some configuration files, bitmaps, and
so on. Thats where the VFX Application Wizard pays off: it does the whole set up of a new project
automatically in the language of your choice. It also sets the most important application class properties
and defines the most important include file constants to reduce your manual work to a minimum.
Visual Extend 6.0 User Manual Lets be more productive! Page 19
Preparation
Close all forms and make sure you do not have open any class libraries of the VFX project. The best
thing is to quit Visual FoxPro and restart it before you run the application Wizard.
Visual Extend 6.0 User Manual Lets be more productive! Page 20
Enter the following information before you start to build your new application:
Visual Extend 6.0 User Manual Lets be more productive! Page 21
Visual Extend Directory. Locate or type the VFX home directory where all VFX support files are
located (usually \VFX60\). You only have to enter this information once.
Name. Enter the Name for your new project. Dont include any path and file extensions, just type the
name of your Project.
Directory. Locate or type the directory for your new project. If the directory does not exist, the VFX
Application Wizard will create it for you.
Application Title. Enter the Caption for your Main Application Window. This will set the constant
CAP_APPLICATION_TITLE in the include file USERTXT.H for you.
Version. Enter the Version Number used in the about dialog of your Application. This will set the
constant CAP_LBLVERSION in the include file USERTXT.H for you.
Copyright. Enter the Copyright Information used in the about dialog of your Application. This will set
the constant CAP_LBLCOPYRIGHTINFORMATION in the include file USERTXT.H for you.
Database Name. Enter the name for your database (dbc). Dont include any path and file extensions,
just type the name of your database.
Ask to Save When Close. Checking this option sets the Application Class property nAsktoSave to 1,
which defines how VFX behaves when a user closes a form or moves to another record after having
made changes to the current record.
Enable AutoEdit Mode. Checking this option sets the Application Class property nAutoEditmode to 1,
which defines that the user can start anytime to make changes without the need to change to the edit
mode before any editing can occur.
Enter on the grid means Edit. Checking this option sets the Application Class property
nEnterisEditinGrid to 1, which defines that the the Enter key while in the data grid changes to the Edit
mode.
Enable Hooks. Checking this option sets the Application Class property nEnableHook to 1, which
defines that the hooks should be activated.
Use DBCX Compliant Products. Check this option if you use other DBCX compliant products in your
application, such as the Stonefield Database Toolkit (SDT).
Toolbar Style. Select which toolbar Style Class you want to use. CAppNavBar includes the record
navigation and other editing controls in the main toolbar, CAppToolbar includes no record navigation
and not all editing controls.
Language. Select the desired language for your new project. Currently you can choose from:
English, French, German, Italian and Spanish.
Visual Extend 6.0 User Manual Lets be more productive! Page 23
On the Author, you can enter your initials to document your new project.
Copy the VFX Library. Check the Checkbox Copy the VFX Library if you want to have a copy of the
VFX Library with your project. This has the advantage, that you can move your project to whatever
directory without the need to relink broken references. NOTE: We suggest that you work with a copy of
the VFX Class Library per each project.
Generate
Select Generate and the VFX Application Wizard will create a new project according the parameters
you selected. The generation will only take a few seconds. A final message indicates that your new
application has been successfully prepared.
NOTE: Since you may want to start working on your new project immediately, the VFX Application
Wizard has automatically set the default directory to the home directory of your new project. To start the
application from the project manager, locate the main program VFXMAIN.PRG and select run.
Visual Extend 6.0 User Manual Lets be more productive! Page 24
File Menu
Using the standard File Open approach, the complexity of the menus is reduced. The user will see a
common File Open Dialog for which VFX makes a suggestion for the layout. This default can be
changed at any time by the developer to meet the application specific needs.
VFX applications have a user-specific Recently Used File List where the last four selections appear and
are only one click away from being selected again.
Edit Menu
The Edit Menu has all Data Manipulation Functions for the currently selected record as well as the
possibility to call the Find and Other Function forms. Depending on the mode of the current form
which can be either in
For detailed information regarding the functions for this, please refer to the chapter Discussion of the
VFX Data Manipulation Form later in this document.
View Menu
Here you can customize your Toolbar as well as toggle the pages in a multi tab page dialog or simply
navigate through the current set of records in a data manipulation form.
For detailed information, please refer to the Discussion of the VFX Data Manipulation Form chapter
later in this Document.
Visual Extend 6.0 User Manual Lets be more productive! Page 26
Favorites Menu
This is the VFX Favorites menu. The first option is to add the currently selected record to the favorite
menu. The second is to manage the favorites. At the bottom all currently available favorites grouped by
form are displayed as additional menu options at runtime.
Tools Menu
For further detailed information regarding the features described above, please refer to the chapter User
List, User Rights, Login, Database Tools, Audit-Trail, System Errors, System Locks, Print-Screen and
Options Dialog later in this documentation.
Window Menu
If you have multiple windows open, you will see their form captions in the Windows menu.
Visual Extend 6.0 User Manual Lets be more productive! Page 27
Preview
Besides the standard toolbar, VFX also offers the possibility to define toolbars which are associated to
individual forms. All you have to do is set up the toolbar and set the VFX form property cToolbarClass
to the name of the desired toolbar. VFX handles the rest for you automatically.
NOTE: For a detailed technical description about the usage of form-specific toolbars, please refer to
the separate VFX Technical Documentation.
In this dialog, you see in the list region titled Tables all available tables which make up your
application. In a user-friendly VFX Mover Dialog, you can select the tables you want to process.
Pack
Pack Memo
Reindex
Select OK to run the desired database maintenance action for the selected tables of your application.
NOTE: If you like the above Mover Dialog, you will be happy to hear there is a VFX Mover Class
which allows you to easily integrate Mover Dialogs into your own applications!
NOTE for SDT users: If you activate the SDT features, you will see an additional option called Repair
which will invoke the SDT repair funtionality. Also for the reindex, the SDT equivalent function will be
called when available.
Visual Extend 6.0 User Manual Lets be more productive! Page 29
The file in which user-specific information is stored, is the free table VFXUSR.DBF/CDX.
If you want to take advantage of features like long field names, you have to place this table into the
database container.
The data maintenance form based on the class CDataFormPage resp. CDataFormPageBar, will be
prepared automatically from the VFX Application Wizard.
Users can clear their VFX resource file, if they want to start over with new settings, or if they are
switching from a larger display resolution to a smaller, or simply if they arent satisfied anymore with
their user preferences for forms, grids, sort orders and picklists. To clear the VFX resource file click on
the command button called Clear Resource.
NOTE: Users cannot view or alter user accounts with a higher security level than their own. Security
levels starts with 1 (Administrator) and ends with 99 (lowest security level). Additionaly, you can define
an access string for further customization of your security needs. For additional security issues,
especially all the VFX form security features, please refer to the VFX Technical Documentation.
Visual Extend 6.0 User Manual Lets be more productive! Page 30
The data maintenance form based on the class CDataFormPage, will be prepared automatically from
the VFX Application Wizard.
The administrator can clear this list by selecting the command button called Delete All.
NOTE: For additional information, please refer to the VFX Technical Documentation.
Visual Extend 6.0 User Manual Lets be more productive! Page 31
The System Locks file in which all the system locks will be stored, using standard VFX Function calls,
is the free table VFXLOCK.DBF/CDX.
The data maintenance form based on the class CDataFormPage, will be prepared automatically from
the VFX Application Wizard.
The administrator can clear this list by clicking on the command button called Delete All.
NOTE: For additional information, please refer to the VFX Technical Documentation.
Visual Extend 6.0 User Manual Lets be more productive! Page 32
You can initialize this VFX Resource File by clicking the Clear Resource command button from the
user list form described earlier. This will delete all entries from the VFX Resource File.
VFX applications do NOT rely on FoxPro Resource Files, like FOXUSER.DBF/CDX, they use their
own VFX Resource File, which is the free table named VFXRES.DBF/CDX.
Visual Extend 6.0 User Manual Lets be more productive! Page 33
Assume you have a field called TEST in the VFXUSR table. In that case you will see a public variable
called gu_test, which will pick up the value from the field TEST, whenever the user logs on VFX writes
the content of the public variable gu_test back to the table VFXUSR whenever the user logs off.
This way, the only thing you have to do to support user-specific settings, is add a field in the table
VFXUSR.
Visual Extend 6.0 User Manual Lets be more productive! Page 34
The above form is just an example of an application specific System Options Dialog.
VFX Application Wizard makes a VFXSYS Form which inherits from the class CSystemDialog. All you
have to do is to create your fields in the VFXSYS table, put the controls on the above dialog with the
Control Source Property pointing to the variable with the prefix gs_.
Assume you have a field called TEST in the VFXSYS table. A public variable called gs_test will pick up
the value from the field TEST whenever the user logs on. VFX writes the content of the public variable
gs_test back to the table VFXSYS whenever changes via the Options dialog ocurred.
This way, the only thing you have to do to support system specific settings is add a field in the table
VFXSYS and make it available for editing in the VFXSYS form as variables with the prefix
gu_fieldname. Yes, its as easy as this. Try it out!
Visual Extend 6.0 User Manual Lets be more productive! Page 35
Select the about dialog under the menu option Help About.
To customize this About Dialog, VFX offers you the possibility to make the changes in the Include File
USERTXT.H:
NOTE: Make sure to touch the form vfxabout.scx before starting your app, otherwise the changes in the
include file might not go through and you still see the old text. If your changes still do not go through,
use the rebuild option available from the VFX application manager. This is a low level rebuild which
will always work.
Visual Extend 6.0 User Manual Lets be more productive! Page 36
You have to make changes in some of the VFX Include Files if you want to change the debugging mode
or the current language. The application wizard generates most of the constants automatically when you
generate a new application.
Define _Debug_Mode
VFX uses a constant in VFX.H which defines whether your application runs in debug mode or not. By
default the following code is placed in the VFXMAIN.PRG to call the debugmode method with a true
parameter to activate debug mode:
#ifdef _DEBUG_MODE
goProgram.DebugMode(.t.)
#endif
If you dont want Debug Mode code execution, remark the line, where the _DEBUG_MODE Constant
gets defined in the Include File VFX.H:
Define ID_Language
In the Include File VFXDEF.H the ID_Language constant defines the current language of your
application.
The first time you create your application using the VFX Application Wizard, the applications will be
generated based on your language settings in the VFX Application Wizard screen. If your application
has to be translated to another language, other than the one you are currently working on, you will have
to switch the ID_Language constant. Please refer to the chapter Create multilingual Applications using
VFX, for further details.
Define Lang_Setup
In the Include File VFX.H the Lang_Setup constant defines, whether the langsetup method will be
evaluated or not. In the LangSetup method, it will be checked whether this constant exists and only if it
exists, the LangSetup code will be evaluated. This is for speed optimization of the native forms.
Objective
Defining a form can be time consuming, especially if you have many forms with many Fields to be
displayed. Putting 20 Fields on a form forces you to put 40 objects, the TextBox, or any other control,
plus normally a Label. If you use a Foundation Class Library, you have to customize your Toolbar, or
drag the desired control from the class library and drop it on the form.With the Visual Extend Form
Builders this task has become very quick and simple.
Another big benefit of the VFX Form Builders is that they are fully reentrant. This means that you
can use them to populate changes you made in your data dictionary automatically by just reapplying the
builder and check the Use DBC Definition option. Also adding pages to the pageframe or changing the
grid columns is very easy with the reentrance feature of the VFX form builders.
Result
Please refer to the Chapter Discussion of the VFX Standard Data Manipulation Form later in this
Document to get an idea about the User Interface of the standard data manipulation forms created using
VFX.
Preparation
NOTE: If you put the information for the Field Captions, Format, Input Mask and Display Class
Library in the data dictionary, these captions will automatically be used by the VFX form and grid
builders.
IMPORTANT: Remember to delete the empty Form1 and the empty FormSet1 after your Drag and
Drop operation! (Hint: You have to move the newly generated form to see Form1 behind the VFX based
form. The FormSet1 is invisible but can also be deleted from the Form menu)
Tip: If all this seems to be to much work for you, just use the VFX Form Wizard. This Wizard generates
a new form based on the form class you select and you are immediately up and running!
Visual Extend 6.0 User Manual Lets be more productive! Page 39
IMPORTANT: Remember to define the InitialSelectedAlias in the Dataenvironment, and the Order
property on the cursor of your Data Environment.
NOTE: If you receive a message indicating that there is no builder available for the currently selected
object, or the standard Visual FoxPro Builder appears, make sure that you followed the installation
instructions in this document and that you selected the form object and not another object on the Form.
One common mistake is that you select the PageFrame Container instead the form itself. Check
the object in the Property Sheet if you are not sure whether you selected the form object.
The VFX Form Builder loads and presents a user friendly Dialog:
Form Name. Enter the name of the new Form. VFX Form Builder assigns a default form name
following the common naming conventions, beginning with frm. Of course you can give your form any
name, but we recommend that you follow the common naming conventions.
Caption. Enter the caption for your form. While you type the caption, youll see it displayed in the form
builders caption. If your form has a variable caption, depending how the Form will be called, dont
worry too much about this caption, just use a more or less descriptive caption in that case.
The form builder has three pages named Edit Pages, Grid Page and Form Options. On the Edit Pages
you define the pageframe which will be used to display and edit the fields you selected. On the Grid
Page you define the Data Grid and on the Form Options Page you set different form options.
Page Count. Enter how many Edit Pages your form will have. For some forms, one edit page will be
enough, if you have more fields, you might want to spread them over multiple pages. Depending on the
number of pages you select, you will see in the tab dialog on the form builder, a Dialog simulating these
Pages. If you setup two Edit Pages, two tabs will appear, if you select three, you will see three and so on.
Page Title. Enter the caption for the edit page you currently selected. If you want to enter the caption
for the second Page, you click the second page tab and you can enter the caption for it. VFX form
builder will instantly reflect your entry on the tab captions of the corresponding page.
Justified Tab. Check this option, if your tabs should be justified, otherwise they will be variable in the
length and will not fill the whole width of your form.
For every page defined through the Page Count option, you can select the following options:
Fields Selected. Here you see all fields you selected for the currently selected edit page. To select fields,
use the Field Assistant Window, which is a separate form which offers all fields currently available in
the data environment.
Visual Extend 6.0 User Manual Lets be more productive! Page 41
Control Type. Define for all selected fields which control type you want to use. Following control types
are available:
Control Type Description VFX Class Library
CTextBox Normal Text Box VFXOBJ.VCX
CKeyField Textbox for editing of Identification Key VFXDBOBJ.VCX
CFixField Textbox for editing field which is linked to a master VFXDBOBJ.VCX
Table. Used for forms where the form has been called
from a master form, receiving a fix value from the
master. I.e. Orders for a Customer, in that case, the
Customer Field would be a FixField, because it will
not be accessible, in the case the form has been called
from the Customer Form.
CPickField Field to enter a value which will be validated against a VFXDBOBJ.VCX
table or view including description and other
automatic information fetching.
CEditBox Edit Box for Memo Fields or other large character VFXOBJ.VCX
fields.
CComboBox Combobox. VFXOBJ.VCX
CListBox List box. VFXOBJ.VCX
CCheckBox Checkbox for logical fields. VFXOBJ.VCX
COptionGroup Option group. VFXOBJ.VCX
CSpinner Spinner Control for numerical fields. VFXOBJ.VCX
<Custom> The class you defined as display class library in <Custom>
the data dictionary (Default)
NOTE: To use your own classes, make sure to add them field by field in the DBC as display class
library!
Caption. Caption for the selected field. The default will be read from the data dictionary.
Format. Format property for the selected field. The default will be read from the data dictionary.
Input Mask. Input Mask property for the selected field. The default will be read from the data
dictionary.
Status Bar. Status Bar Message used for this field. The default will be read from the data dictionary
(property comment resp., if empty, the caption).
Read only. If a control will be used for display information only, check this checkbox.
Visual Extend 6.0 User Manual Lets be more productive! Page 42
Use Grid Page. Check this checkbox if you want a grid page on your form.
Grid Page Title. Enter the caption for the last page in your form which normally will be a grid to
display all records from within your table or view.
Grid Class. Select the grid class you want to use or use the default, which is the CGrid Class.
Fields Selected. Here you see all fields you selected for the grid. To select fields, use the Field Assistant
Window, which is a separate form which offers all fields currently available in the data environment.
Calculated Fields. Click this button to add whatever calculated field you want.
Control Type. Define for all selected fields which control type you want to use. Following control types
are available (For performance reasons we only offer VFP base classes for the grid):
Control Type Description VFP Base Class
TextBox Text Box (Default) TEXTBOX
Editbox Editbox EDITBOX
Combobox Combobox COMBOBOX
Checkbox Checkbox CHECKBOX
Header. Captions for the column headers of your grid. VFX Form Builder will automatically take the
captions from your data dictionary.
Output Mask. VFX Form Builder takes the input mask from the length of the field. You can change
the input mask to accommodate your particular needs.
Read only. If a control will be used for display information only, check this checkbox.
Visual Extend 6.0 User Manual Lets be more productive! Page 43
Incremental Search. Check this checkbox, if you want to make available the incremental search
feature for the selected column. Note that VFX creates a temporary IDX index file, if there is no CDX
index file available for this column. (with the CGrid property nMaxRec you can define, when you want
to have a message to pop up before a temporary index will be generated)
Report Name. Here you can select a report name. Whenever the user selects print or preview, this
report will be selected and printed resp. previewed. All this without the need to write code in the
method onPrint. For more sophisticated report selections.
Is Child Form. If the form you are currently creating will be called from another form, this form acts as
a child form.
NOTE: Please dont mix this up with the later described One To Many Form where you can have the
master and the child table processed on the same form. Here we are talking about this scenario: Form1
-> calls Form2, whereas Form1 could be the master form and Form2 could be the child form and in
Form2 you would see only those records which match a certain criteria, which might be the link to the
master table in Form1.
I.e. if you have a Form in which you want to provide the ability to process the orders of a customer,
check this checkbox and have VFX Form Builder automaticaly have set up the form as a child form.
This will automatically put the needed lines of code in the Init Event of the form. All you have to do is
review this init code and adapt it to your specific needs.
For further details please refer to the topic Advanced Form Features using the VFX Form Builder later
in this document.
Visual Extend 6.0 User Manual Lets be more productive! Page 44
NOTE: Although, if you have a form which will act as both, a Child Form as well as a Normal Form,
you will set it up as a Child Form. There is no need to setup two Forms for, i.e. Orders. With one form
you can perfectly handle the scenario All Orders, as well as Orders for Customer X.
For further details refer to the topic Advanced Form Features using the VFX Form Builder later in this
document.
Has More Functions. If the form you are currently creating will call other forms or actions, you have to
check this checkbox. This will automatically generate the needed code in the onMore() method of your
form. You simply have to review the onMore() code and adapt it to your specific needs. Normally you
will have a couple of actions which will be presented in a form and the user selects the desired option.
For further details refer to the topic Advanced Form Features using the VFX Form Builder later in this
document.
Has Linked Child Form. If the form you are currently creating will have child forms which should be
dynamically linked to this master form, check this option. This will automatically generate the form
method onSetChilddata which will be called automaticaly for every child form available.
Autosynch Child Form. This sets the form property lAutosynchChildform which defines, whether you
want the linked child forms synchronize automatically whenever the parent record changes or only
when the user activates the child form.
Put in Last File Menu. This sets the form property lPutinLastFile which defines whether you want to
put the form caption in the recently used file list in the File menu.
Put in Window Menu. This sets the form property lPutinWindowmenu which defines whether you want
to put the form while running in the Windows menu. See also the application class property
nWinMnuCount and the application class method RefreshWindowMenu().
Can Edit. This sets the form property lCanEdit which defines whether the user can edit records in the
current form or not.
Can Insert. This sets the form property lCanInsert which defines whether the user can insert records in
the current form or not.
Can Delete. This sets the form property lCanDelete which defines whether the user can delete records
in the current form or not.
Multi Instance. This sets the form property lMultiInstance. By default all of the forms you create with
VFX can be called multiple times (so called multi instantiation). This is a great feature, all you have to
remember to use multiinstantiation is to set the form to private data session which is the default of all
VFX forms.
However sometimes it is convenient to disable the feature of multiinstantiation. Thats why we created
the property lMultiInstance. Just set this property to true and the form can only be called once.
Close with ESC key. This sets the form property lCloseonEsc which defines whether the user can close
a form using the escape key or not.
Visual Extend 6.0 User Manual Lets be more productive! Page 45
Save/Restore positions. This sets the form property lSavePosition which defines whether you want that
all the position and other form settings are stored within the VFX Resource File.
Add Speedbar Control. This adds a Win95/ NT4.0 like form toolbar similar to this:
Auto Size Textbox. If you check this checkbox, the VFX Form Builder will automatically size the
textbox controls according the length of the field, which is defined in the Control Source. This will save
you some work in the layout phase of your form creation process.
Button Bar. If you clear this checkbox, the VFX Form Builder will automatically set the form property
lHidebuttonbar to true.
OK. Click this command button, if you want to generate your form. This will take some seconds and
the result is a Form, on which you have the desired amount of edit pages with the selected fields on
each page. If you selected more fields than would fit on a page, two columns will be created.
The form build process can be run more than once, this feature is called reentrance. Note: The
reentrance feature is only available at 100% for forms created with the VFX 5.0 form builder. If you
apply the VFX 5.0 form builders for the first time on forms ported from VFX 3.5 or which have been
designed manually, VFX 5.0 will not be able to reconstruct your labels correctly. This is because in VFX
5.0 the labels will automatically be associated with their corresponding data bound controls by storing
the control source in the tag property. This is a key necessity for the creation of reentrant builders
because the labels exist independent from the data bound controls once they have been generated. For a
maximum of reentrance guarantee its best to use the Form Builder whenever you want to add a new
field to your form.
Another big advantage of the reentrance is the fact that you can reapply changes you made within the
data dictionary (i.e. captions, format or input mask options by just calling the form builder again and
selecting the checkbox Use DBC Definitions.
Apply. Does the same as OK but does not quit the form builder dialog.
Cancel. Cancels the VFX Form Builder process. Any selections and entries will be lost.
Visual Extend 6.0 User Manual Lets be more productive! Page 46
To call the VFX Grid Builder, select the last page in your form, and select the Grid Control. To call the
Builder rightclick with your mouse and select builder. Of course you could also select the grid object in
the property sheet and select builder from within the property sheet.
Since the user interface is the same as the one used on the grid page of the form builder, for a detailed
description of all the options, please refer to the description under the topic called The VFX Form
Builder.
Visual Extend 6.0 User Manual Lets be more productive! Page 47
Result
If you use a Picklist Control on a form, it might look similar to this:
clicking on the command button next the Picklist Input Field (normally a three dot caption Icon),
doubleclicking in the Picklist Input Field or the Description, or
by pressing the Function Key F9
From the Picklist Dialog there are (like in any VFX Power Grid) features like:
doubleclicking,
pressing ENTER
selecting the OK command button
If the user wants to edit the table which is behind this picklist, he can click the command button
Maintenance and the data manipulation form for this table will be called, to add a new record, he clicks
the New button.
Visual Extend 6.0 User Manual Lets be more productive! Page 48
Incremental
search with auto
sort
To call the VFX Picklist Builder, be sure to select the picklist container control on the form.
NOTE: To select a control which is on a Page, within a Pageframe, within a Form, you have to get used
to the Visual FoxPro way of accessing controls in a container hierarchy (Click, RightClick, Edit). A
good way to check whether you are on the right object is to have a look at the property sheets current
object.
To call the Pick Field Builder, select your Picklist Control, rightclick and select Builder from the
context menu.
Visual Extend 6.0 User Manual Lets be more productive! Page 49
The VFX Picklist Builder loads and presents the following dialog:
Also this builder is fully reentrant. This means, that during the development cycle you can call this
builder as many times as needed without loosing any of the settings which have already been defined.
Pick Dialog Caption. Enter the caption for the picklist form in which the user can select the value he
wants to pick. If you omit an entry, you will get a standard message like: Please pick a value ...
Maintenance Form. If the user doesnt find the desired record in the picklist form, you might want to
offer the user the ability to directly call the data maintenance form (view mode or directly insert mode)
for the table currently being picked from. Enter the name or the data manipulation form which will be
called if the user clicks on the maintenance command button on the picklist form.
Pick Table Name. Select the name of the table or the view you want to validate and /or pick the value
from. Here you can select from all tables or views you entered in the data environment.
Pick Table Index Tag. Select the order for the picklist table.
CPickField::txtField.ControlSource. This is the control source of the picklist field. The VFX form
builder already sets this value and you will normally not have to enter or change it manually.
CPickField::txtDesc.ControlSource. Select the control source of the description field of the picklist
field. Make sure that you set a correct relation to the table you are selecting this control source from,
otherwise this control will not refresh correctly when you move the record in your main form.
Return Field Name (Code). Enter the name of the field from the picklist table or view you want to get
the value from. Do not enter any alias, since the picktable will be opened with a random alias.
Visual Extend 6.0 User Manual Lets be more productive! Page 50
Return Field Name (Description). Defines which field from the picklist will be used to get the
description of the selected record. Do not enter any alias, since the picktable will be opened with a
random alias.
Format. The VFX Pickfield Builder takes this property from the data dictionary.
Input Mask. The VFX Pickfield Builder takes this property from the data dictionary.
Status Bar Text. The VFX Pickfield Builder takes this property from the data dictionary.
User Refresh Code. Sometimes you need to have custom code in the refresh code of a picklist
container.
Work on View. If the table you are picking from is a view for which you dont want or can create an
index manually or using the cIndexExpr property, you can check this option. If you do this, you can set
the property cSQLValid to a string similar to this: select customer_id from lv_customer where
customer_id = trim(this.txtField.Value)
Auto Skip. Check this option if you want to automatically tab to the next field after selecting a value
from the picklist. This sets the CPickField property lUseTab to true.
Auto Pick. Check this option if you want to automatically call the picklist, when the user enters a
wrong value. This sets the CPickField property lAutoPick to true.
Hide Code. Check this option if you want to hide the code field in the picklist. This sets the CPickField
property lHideCode to true.
Visual Extend 6.0 User Manual Lets be more productive! Page 51
Is Key Field. Check this option if you want to define this pickfield as a key field which is only
accessible when entering a new record and then no more (like the textbox class ckeyfield). This sets the
CPickField property lHideCode to true.
OK. The selected options will be used and put in the selected picklist object.
Apply. Does the same as OK but does not quit the pickfield builder dialog.
Cancel. Cancels the VFX Pickfield Builder process. Any selections and entries will be lost.
The file open dialog reads the table VFXFOPEN.DBF. The VFX Form Builder adds a record to the
VFXFOPEN.DBF table. The Structure of the VFXFOPEN Table is:
VFXFOpen Field Description Example
ObjectID The VFX File Open Dialog has initially two Tabs (Tip: you can set PAGE1
the pagecount property of the pageframe in the vfxopen form to any
number to change the number of pages). If you want your Form to
appear on the First Tab, enter PAGE1, otherwise enter PAGE2,
PAGE3,
ObjectNo Enter a sorting order within the list. Option 1 will be on top, followed 1
by 2, ... The sort will be used within any page.
Title Enter the title text you want to see in the list region in the file open Companies
dialog.
Descr Enter the description text you want to show if the user selects this List of all
option. Companies
Form Enter the name of the form you want to call COMP
Parameter If you want to pass any Parameters to your form, you can enter them
here.
Viewlevel The userlevel which is needed to be able to view this form (1 = Admin, 1 (only
2 = Power User, 3 = User, ..) Administrators
can view this
form)
NewLevel The userlevel which is needed to be able to insert records in this form 1 (only
(1 = Admin, 2 = Power User, 3 = User, ..) Administrators
can view this
form)
EditLevel The userlevel which is needed to be able to edit records in this form (1 1 (only
= Admin, 2 = Power User, 3 = User, ..) Administrators
can view this
form)
Eraselevel The userlevel which is needed to be able to delete records in this form 1 (only
(1 = Admin, 2 = Power User, 3 = User, ..) Administrators
can view this
form)
Visual Extend 6.0 User Manual Lets be more productive! Page 52
In the VFX form builder we already had a look at the checkbox called Has More Functions. If you
check this checkbox, the VFX form builder generates the following code in the forms onMore() method:
lparameters tnPassThrough
lcCalledBy = ""
lcFixFieldValue = ""
lcCaption = ""
lcFixFieldName = ""
lcFilterExpr = ""
local laFunct[1,5]
if alen(laFunct,1) = 1
tnPassThrough = 1
endif
if empty(tnPassThrough)
do form VFXMORE with laFunct, this
else
do form VFXMORE with laFunct, tnPassThrough,this
endif
goProgram.RefreshWindowMenu()
Visual Extend 6.0 User Manual Lets be more productive! Page 53
This template code can look like this if you adapt it to suit your situations specific needs:
lparameters tnPassThrough
lcCalledBy = "PARENT"
Visual Extend 6.0 User Manual Lets be more productive! Page 54
local laFunct[2,5]
lcCaption + ";" +;
lcFixFieldName + ";" +;
lcFilterExpr
*!* if alen(laFunct,1) = 1
*!* tnPassThrough = 1
*!* endif
if empty(tnPassThrough)
do form VFXMORE with laFunct, this
else
do form VFXMORE with laFunct, tnPassThrough,this
endif
goProgram.RefreshWindowMenu()
If the user wants to see which options are available for the actual record, in the current form, there are
several possibilities:
Depending on your code in the onMore() method, the user will see a dialog similar to this:
Calling the onMore() method with the parameter tnPassThrough is very useful if you want to start
directly the Option associated with a specific number. I.e. you can use this technique to eliminate the
need of code duplication if you want put the More Function Call of a specific Option also on a Toolbar.
If you call a form, pass the needed parameters to the Init Method of this form. Since the parameters
passed to any method arent automatically visible to all the other methods of the same form, VFX forms
store the needed parameter information in individual properties.
Here is the Init() code the VFX Form Builder generates, as a template for your specific needs:
lparameters tcArg
local lInitOk
if !empty(tcArg)
if getArgCount(tcArg) <> 0
this.lPutInLastFile = .f.
***********************************************************************
** Set who has called you
if this.cCalledBy = "<CalledBy>"
*******************************************************************
** Disable CPickField that are Fix Fields for this form
*{PickFieldList}*
endif
endif
endif
this.SetQueryArg()
lInitOk =eval(this.class+"::init(tcArg)")
********************************************************
** Insert your extra initialization code here
return lInitOk
Visual Extend 6.0 User Manual Lets be more productive! Page 57
This template code can look like this, if you adapt it to suit your specific needs:
lparameters tcArg
local lInitOk
if !empty(tcArg)
if getArgCount(tcArg) <> 0
this.lPutInLastFile = .f.
***********************************************************************
** Set who has called you
if this.cCalledBy = "PARENT"
*******************************************************************
** Disable CPickField that are Fix Fields for this form
ThisForm.pgfPageFrame.Page1.cntParentid.lFixField = .t.
endif
endif
endif
this.SetQueryArg()
lInitOk =eval(this.class+"::init(tcArg)")
********************************************************
** Insert your extra initialization code here
return lInitOk
The VFX function getArg() checks the parameter string and detects the individual parts of the
parameter string. The individual parts are separated by semicolons. In the case of cFixFieldValue, you
can even have a string, which has within its part @ characters which defines that there are multiple
items for this parameter. This sounds more complicated than it is.
Have a look at an example. The passed parameter can have the following composition if we call the
contact form for a specific company:
The individual parts of this string are stored in the provided form properties in order to be usable within
the whole form. Lets have a look at the form properties which store the information passed through the
parameter string tcArg:
VFX Form Property Description Example
cCalledBy String to identify how the form has been COMP
called.
cFixFieldValue The value of the field from the master 1234567890
table (primary key in the parent table).
cFixFieldName The name of the field in the child table CONT_COMP_ID
which defines the one to many relation and
which will receive the above passed value
when adding new records (foreign key in
the child table).
cFilterExpr The (ideally) Rushmore optimizable filter UPPER(CONT_COMP_ID)=
condition to display only the records '1234567890'
matching the master record criteria.
NOTE: Be aware of a serious VFP bug in VFP 3.0 and 5.0: The rushmore optimization does sometimes
fail if you are working with a rushmore optimizable filter and a grid. Therefore we provide an
alternative solution which is more complicated behind the sceens, using the SET KEY TO command
instead of the SET FILTER TO command.
For huge amount of data the approach using views might be the better choice. The VFX mechanics
work basically the same. In the case the child table is a view, you dont have to pass the filter
expression.
Visual Extend 6.0 User Manual Lets be more productive! Page 59
With modular design of the VFX class library, you have the possibility to interact after a new record has
been added, to the table or view. VFX offers, among many other features, a method called
onPostInsert() which gets triggered just after a new record has been added. Normally for all the core
events, VFX offers methods which are automatically triggered just before, while, and after the event. In
the case of inserting a record you have the following methods
onPreInsert()
onInsert()
onPostInsert()
There is also a property which defines whether the current user can insert a record , called lCanInsert.
NOTE: For additional information, please refer to the VFX Technical Documentation.
To generate an identification key, you could place a code similar to this in the onPostInsert() method of
your form, which calls the function GetNewId() with a parameter identifying the situation for which you
generated the key.
CDataFormPage::onPostInsert()
thisForm.pgfPageFrame.Page2.txtComp_ID.Value = GetNewId('COMP_ID')
The information about the generated key will be stored in the VFXSYSID table.
NOTE: Note the scope resolution operator :: which will be used to call the onPostInsert method of the
master class CDataFormPage. If you dont include this code, you will loose the inheritance from the
master form for this specific method. Depending on the situation you might want this or not. Normally
you want the master code to be executed before you call your form specific code.
For a complete discussion of the GetNewId function, please refer to the VFX Technical Documentation.
Visual Extend 6.0 User Manual Lets be more productive! Page 60
What next
To become more familiar with the VFX form builder, generate some simple forms and try to increase
the complexity by generating forms that call other forms, as well as forms that will be called from other
forms.
Once you are familiar with the standard VFX data manipulation form, you might want to make the
move to the one to many data manipulation form.
Visual Extend 6.0 User Manual Lets be more productive! Page 61
Result
Please refer to the chapter Discussion of the VFX One To Many Data Manipulation Form later in this
document to get an idea about the user interface of one to many forms created, using VFX.
Preparation
In order to create a one to many form, you must be familiar with the basics of database design and
especially, with the one to many relations where you have a given master record and multiple child
records. A good example for a master child relation is the Order (Master) and Items (Child) situation, of
any order and invoicing system.
NOTE: If you dont want to assure the referential integrity (RI) manually using VFX methods like
OnPostDelete(), its a good practice, to generate the RI code in the data dictionary before you generate
one to many forms. If you dont do this, you will have to write manually the code for the deletion of
master records which have child records and in the case where you allow the change of key fields, even
the update code as well.
IMPORTANT: Remember to delete the empty Form1 and the empty FormSet1 after your Drag and
Drop operation! (Hint: You have to move the newly generated form to see Form1 behind the VFX based
form. The FormSet1 is invisible but can also be deleted from the Form menu)
Tip: If all this seems to be to much work for you, just use the VFX Form Wizard. This Wizard generates
a new form based on the form class you select and you are immediately up an running!
Visual Extend 6.0 User Manual Lets be more productive! Page 62
The VFX OneToMany Form Builder assists you in generating sophisticated one to many forms with
almost no coding. If you setup the one to many relation from the master table to the child table (in the
case of multiple child tables which all depend from the same master table you might have more than
one child table, each linked with the master table through a relation) you can generate one to many
forms as easy as standard VFX data manipulation forms.
IMPORTANT: Remember to define the initially selected alias, order property, and the one to many
relation from the master to the child in the data environment, otherwise your form may not run as you
expect!
NOTE: If you receive a message indicating that there is no builder available for the currently selected
object, or if the standard Visual FoxPro Builder appears, make sure that you followed the installation
instructions in this document and that you selected the form object and not another object on the form.
One common mistake is that you select the PageFrame container instead the form itself. Check the
object in the property sheet if you are not sure whether you have selected the Form Object.
Form Name. See description in the chapter The VFX Form Builder.
Then you have a page frame with the pages Edit Pages, Parent Grid Page, Form Options and Child
Grids which are explained here:
On the page named Edit Pages you see the same user interface like in the VFX Fom Builder described
earlier in this documentation. Here you define the edit pages for the master (also called parent) table.
On the page named Parent Grid Page you see the same user interface like in the VFX Form Builder
described earlier in this documentation. Here you define the Grid Page of the master (also called parent)
table:
Visual Extend 6.0 User Manual Lets be more productive! Page 64
On the page named Form Options you see the same user interface like in the VFX Form Builder
described earlier in this documentation. Here you define the Options for the OneToMany Form:
Visual Extend 6.0 User Manual Lets be more productive! Page 65
On the page named Child Grids you define how your child grid(s) will look like:
Page Count. Enter how many Child Grid Pages your form will have. For most of the OneToMany
Forms, one child grid page will be enough, if you have more child tables, you might want to spread
them over multiple pages. Depending on the number of pages you select, you will see in the tab dialog
on the form builder, a Dialog simulating these Pages. If you setup two Edit Pages, two tabs will appear,
if you select three, you will see three and so on.
Page Title. Enter the caption for the child grid page you currently selected. If you want to enter the
caption for the second Page, you click the second page tab and you can enter the caption for it. VFX
form builder will instantly reflect your entry on the tab captions of the corresponding page.
Child Table. Select the record source for your child grid. Attention: This is very important to set, if you
dont set this property, your form will not work correctly.
Justified Tab. Check this option, if your tabs should be justified, otherwise they will be variable in the
width.
Inplace Editing. Set this option, if you want to enter data in your child grid, which is usually what you
want.
^Ins+^Canc. Check this option, if you want to have the possibility to add new records with ^Ins and to
delete records with ^Canc from the child grid.
The other options are the same like in the VFX Form Builder on the grid page.
Visual Extend 6.0 User Manual Lets be more productive! Page 66
onPreInsert()
onInsert()
onPostInsert()
In the OnPostInsert() method of the child grid, you have to replace the child table field which makes up
the link to the master table typically with a code like this:
The Child Grid Builder has the following user interface: On the first tab called Grid, you can customize
the child grid as described earlier:
Visual Extend 6.0 User Manual Lets be more productive! Page 67
On the second tab called options, you can edit the method code for the replace of the field in the child
table which must store the value of the parent field.
NOTE: The reason why the VFX Builder can not automatically generate this OnPostInsert() code is
that you might have the situation, where you have a combined key or other situations, where you have
to replace more than one field in the child table. For now, this Replace code will have to be generated
manually. In future Versions of VFX we will integrate even more ease of use.
Visual Extend 6.0 User Manual Lets be more productive! Page 68
The VFX Pick Text Box Builder offers a similar user interface like the normal VFX Pick Field Builder
and is also fully reentrant:
Visual Extend 6.0 User Manual Lets be more productive! Page 69
Objective
The VFX LangSetup Builder automizes the creation of the needed code within the Langsetup method.
You will need this, if you have to supply your application in more than one language. The goal of this
builder is to extract all potential captions, tooltiptext and Status Bar messages, generating unique
constants and putting them into the VFXMSG table, the master table for all include files. After this
process, you can use the VFX message editor, described later in this documentation, to translate the text
in the different languages. You have the choice between runtime localization and design time
localization.
We at Devigus Engineering Ltd. developed already a lot of multilingual applications, since in our small
(but beautyful) country with only 7 million habitants, we speak already four different languages
(German, French, Italian and Reto Rumantch). In the past, we developed runtime and design time
localizations and prefer designtime localization for the following reasons: Speed, standard Windows
Dialogs are language specific and last but not least, almost all OCX (new called ActiveX) are language
specific. Switching your application on the fly therefore is much more a marketing gimmick than
anything else. But feel free to do both using VFX, or, of course also other tools, if you need even more
features.
After the generation, you will see the code which has been generated for the LangSetup method. If you
checked the Overwrite Code Checkbox, the generated code will be written in the LangSetup method of
the currently open form in design mode. The caption codes will be put into the VFX message table
where you can edit and translate them into other languages.
Automatically generated
code for the LangSetup
Method. Note that the
constants will
automatically be inserted
into the VFXMSG table
if you select Overwrite
Code.
Visual Extend 6.0 User Manual Lets be more productive! Page 71
Define Lang_Setup
In the Include File VFX.H the Lang_Setup constant defines, whether the langsetup method will be
evaluated or not. In the LangSetup method, it will be checked whether this constant exists and only if it
exists, the LangSetup code will be evaluated. This is for speed optimization of the native forms.
#DEFINE _LANG_SETUP .T.
Visual Extend 6.0 User Manual Lets be more productive! Page 72
Objective
The VFX Messagebox Builder is a handy utility to create messageboxes (and wait windows) on the fly
while coding. The messagebox builder not only assists you in the generation of the line of code for the
messagebox (or wait window) but greatly reduces the work to provide the captions in the VFX message
table from where you can edit and translate them into the different languages. The VFX message editor
is described in detail later in this documentation.
Message
Identification
Original Text
Translations in the
various languages.
Hint: Uee Drag an
Drop to put the
original text into the
desired language as
starting point for your
translation
To paste the code needed for a messagebox is easy and straight forward. Just select the style you want,
which icon, preview your artwork and select copy to put the code into the clipboard from where you can
paste it into your code. Tip: Also if you do not create multilingual applications, you can use the
messagebox builder. In this case just create a dummy message which you do not really use, thats all.
Visual Extend 6.0 User Manual Lets be more productive! Page 74
Objective
The VFX Message Editor is the central place to manage and translate all messages and other language
specific text elements such as captions, tooltip texts and status bar messages. From within the VFX
Message Editor you can create all the needed include files (USERTEXT.H and USERMSG.H).
Message
Identification
Original Text
Translations in the
various languages.
Useful filtering Hint: Uee Drag an
functions Drop to put the
allowing you to original text into the
see only messages desired language as
or other (captions, starting point for your
tooltip text and translation
status bar
messages).
If you are in edit or insert mode, the caption of the form changes and the toolbar controls are
synchronized automatically:
NOTE: For input of massive data, you can directly call CTRL+N while already in insert mode. This
allows incomparable fast data input for multiple records. For the same handling optimization reason,
the table navigation keys are available also while in edit or insert mode.
Depending on the setting of the application class property nAutoEdit, resp. the form property lAutoEdit
the user can start typing and the form switches to the edit mode like shown here:
Visual Extend 6.0 User Manual Lets be more productive! Page 77
Form Status
marked in the
caption
Incremental Search
Using the VFX Grid Builder, you can define, for which columns you want to have the Incremental
Search capability enabled. This allows your user to type the characters, numbers or even date while in
any column and VFX automatically sorts by this column and positions on the first match. During the
Incremental Search, the searched item is displayed in the forms caption and corrections can easily be
made using the Backspace key.
Visual Extend 6.0 User Manual Lets be more productive! Page 79
No visualization
Underlining the caption
Using different colors
See the appendix update and release notes for additional information.
Visual Extend 6.0 User Manual Lets be more productive! Page 80
In this example,
there are two child
grids to the above
parent. You could
also have the field
controls on another
tab or below the
child grid.
records of the current master record are rejected. If you select save changes, all changes applied to the
master and to all child records of the current master will be saved.
Full featured
picklist as
described
earlier.
Call the Picklist while in the Child Grid easily by Doubleclicking or with
the Keyboard Shortcut F9.
*--Result: The Public Array _gaMoverList contains the selected items, use it
* and release this Public Array after you have done.
After the creation of the object loMover you have complete control over it and can set any property and
call any method you want.
NOTE: For a detailed technical description of the VFX Class Library including all properties and
methods, please refer to the separate VFX Technical Documentation.
Visual Extend 6.0 User Manual Lets be more productive! Page 83
CAppBar, and
CAppNavBar
The first is the standard toolbar and the second the one which you may use if you do not want to have
the navigation and other buttons on the form.
CAppBar:
CAppBar will be used, if you are working with the VFX forms with the navigation and other buttons on
the form.
CAppNavBar:
CAppNavBar will be used, if you are working with the VFX forms without the navigation and other
buttons on the form.
To switch from one main toolbar to another is as simple as switching one property in the application
class in VFXMAIN.PRG:
************************************************************
** CAppToolBar - Tooolbar without Navigation Buttons
** CAppNavBar - Tooolbar with Navigation Buttons
cMainToolBar = "CAppNavBar"
Visual Extend 6.0 User Manual Lets be more productive! Page 84
Select New while in the project manager on the class tab or on any class library object, you will see the
following Dialog:
Class Name: Enter the name of the new class. Assume we call it CMyToolbar.
Based On: Click the three dot button, and in the following Open Dialog, select the Class CAppbar (or
CAppNavBar from the VFX Class Library APPL.VCX.
NOTE: If you decided that the VFX Application Wizard should copy all needed class library files to
each of your new projects, you should pick the copy of the VFX library files from your current project.
This eliminates the risk of links you are not aware of, which might cause problems later on when
updating specific library files or moving the entire project!
Visual Extend 6.0 User Manual Lets be more productive! Page 85
From: The reference to the VFX Library File called APPL.VCX will automatically be displayed.
Store In: If your application specific library file does not yet exist, just type in the full path and name,
otherwise pick it using the three dot button (GetFile Dialog).
Add a Separator
Start with a separator, which separates the last standard Icon from the first application-specific on the
main toolbar.
Use this icon from the Visual FoxPro Form Control Toolbar and drop it on your toolbar as needed.
Click Event: Add the command which you want to execute, whenever this command button will be
clicked. Assume we want to run a form. In this case we place the code
goProgram.RunForm("CUSTOMER")
Picture: Select a BMP or ICO file to use on your toolbar command button.
NOTE: Make sure to put the desired code into the refresh event of every toolbar icon (or the toolbar
directly) for proper refresh of your icons. If you call a modal form, VFX will automatically disable all
toolbar icons, but its up to you to reactivate the toolbar icons again. This could happen with the
following code in the refresh event:
this.enabled = this.parent.cmdopen.enabled
The above code would automatically syncronize the toolbar icon with the state of the file open toolbar
icon, which will always be synchronized with the actual state of the application.
You dont have to worry about point one and point two.
The user interface of the existing functionality in the Visual Extend class library and all of its dialogs
exists in five languages and you dont have to translate a single word. To create an application in
German, Englisch, French, Italian or Spanish. If you need the Visual Extend class library in another
language, you can easily extend VFX by your own.
We would appreciate it, if you would send us your translations of the VFX messages
(VFXMSG.DBF/CDX/FPT) in another language than German, Englisch, French, Italian or
Spanish so we could make them available to other developers as well. Thank you.
Use the USERTXT.H, resp. USERMSG.H include files which are generated from the VFX Message
Editor to manage and store all language specific user interface elements from your application. The
repository for messages as well as captions, tooltip text and status bar messages is the table
VFXMSG.DBF. In this table you find also all VFX messages and captions which already have
been translated.
In your application define constants rather than the text strings directly. i.e. use WAIT WINDOW
Loc_Text1 rather than WAIT WINDOW MyText.
Use the USERDEF.TXT include file for application specific constants which are the same for all
languages for better organisation of your localization work.
Use the VFX LangSetup Builder to create the VFX form method called LangSetup() to place the
localization code by adding your captions, tooltip texts and so on into this method using define
constants. (The VFX LangSetup Builder automatically generates the LangSetup code and updates
the VFXMSG.DBF message and caption table).
Translate your text into the different languages using the VFX Message Editor. The VFX Message
Editor then generates the include files for the different languages in the \INCLUDE\LanguageDir
directory whereas LanguageDir represents the directory name for the language you plan to translate.
(As mentioned above, the VFX specific language includes have already been translated into various
languages and you dont have to translate a single word from them.)
If you have a specific menu, do the same with the menu otherwise use the already translated VFX
Menus.
To build your application for another language, define the ID_LANGUAGE constant in the
VFXDEF.H include file and copy the include files from the \INCLUDE\LanguageDir back into the
current \INCLUDE directory of your project and the menu MNX/MNT file from the
\MENU\LanguageDir directory into the \MENU directory.
Visual Extend 6.0 User Manual Lets be more productive! Page 89
Rebuild all and test your translated application. You will receive a separate EXE File for every
Language.
Visual Extend 6.0 User Manual Lets be more productive! Page 90
Thanks to all VFX customers for the great feedback provided so far.