Copyright: ©Devigus Engineering Ltd., CH-6300 Zug
Citation: ©Devigus Engineering Ltd., CH-6300 Zug


Visual Extend 3.5
 Visual Extend 5.01

Welcome to VFX 5.0

Introduction

Update an Release Notes

Applications created using VFX

Getting Started

Trouble Shooting Guide

Read this before you start!

Read this before you start

Tutorial and Test Application Guide

Tutorial

VFX Test Application Guide

VFX and other products

VFX and other products

Video Clips

Show me how... Video Clips

The VFX Class Library

appl	The application specific class library
vfxappl	The VFX application class library
vfxctrl	The VFX control class library
vfxform	The VFX form class library
vfxobj	The VFX base object class library
vfxoffce	The VFX Office class library
vfxtools	The VFX tools class library

Other

The Main Program

Functions

Builders

Tables

Include Files

Debugging Techniques

Who and Where

Devigus Engineering Ltd.

Devigus Engineering Homepage

Credits

Distribution, Training and Support Partners


 Introduction

Visual Extend is an Application Development Framework for Software Developers working with Microsoft Visual FoxPro Version 3.0b and 5.0(a). Visual Extend includes a Class Library and 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 ActiveX Capabilities, the Software Developer's 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 it's difficult to develop a solid Class Library as a Foundation Class for all to be developed Applications. It's 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. It's 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:

o 	Modular, Microsoft Compliant Visual Extend

Foundation Class Library with extensive

Application Development Support

o	Visual Extend Builders for Application, Form,

Grid, Picklist and One To Many Forms

o 	Other Visual Extend Developers Productivity Tools

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 FoxPro Features you like and use. Let's be more productive with Visual Extend for Visual FoxPro!

NOTE: VFX does not include a banana layer between Visual FoxPro and you, the developer. The developer works directly within VFP and has not to learn another piece of user interface, except for the builders.


 Applications created using VFX

Applications which have been developed using Visual FoxPro together with the Application Development Framework Visual Extend will have the following characteristics:

•	Ready for Office Compatible certification

•	Standard Toolbar, including optional toolbars for any form

•	Navigation, Search, New, Edit, Delete optional on form or on main toolbar

•	Multi instance of forms (optional)

•	Recently Used File List in file menu, actually open windows in window menu

•	Incremental Search including autosort in all VFX grids

•	Alternate Sort by doubleclicking on any column header in any VFX grid

•	Show actual sort in column header

•	Auto Save and Restore of size and position of any form

•	Auto Save of all grid layout changes including the current sort

•	Tooltips in the language of your application

•	Picklist control with auto-validation and optional data fetching (foreign key)

•	Picklist Form with incremental search, auto-sort, alternate sort by doubleclicking

•	Auto-save and restore of size and position of picklist forms including picklist

•	User Access Management including password encryption

•	Database Tools for packing, reindexing and repairing of local tables

•	Complete Error Tracking System

•	System Logfile

•	System Locking table for optional semaphore locking schemes

•	About Dialog

•	User friendly mover dialogs for easy selection of multiple elements

•	Powerful picklist object within childgrid

•	Automatic synch with windows system colors

•	Easy to use OneToMany forms

•	Powerful linked child forms

Key Features

Software Developers using Visual Extend will appreciate the following features:

•	Application Builder 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!

•	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

•	Form Builders will automatically size any textbox controls according current field length

•	VFX is Codebook compliant (DBCX standard), works perfectly with other DBCX compliant add ons like STONEFIELD Database Toolkit, FoxFire or others.

•	VFX is ready to use with the STONEFIELD database toolkit, just set one constant to true and you are up and running with SDT

•	All Builders get the field descriptions automatically from the data dictionary and additional information from the DBCX standard resp. directly from the STONEFIELD database toolkit.

•	Visual Extend Power Toolbar including setting of property of multiple selected objects during form design, autosize and even more

•	Use the VFX form builders on own VFX based form classes

•	Run forms directly from form designer

•	Toolbar Navigation or Navigation Buttons on form

•	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

•	Easy switch between navigation and other command buttons on the form or on the main toolbar

•	Incredible easy linked child form techniques

•	Powerful VFX class switcher for forms and controls


 Update and Release Notes

Please refer to the update and release note document provided with VFX 5.0: You can download them also directly from our homepage.

English:

upd50_e.zip (upd50_e.rtf)

German:

upd50_g.zip (upd50_g.rtf)

NOTE: The changes in the class library are documented since Version 5.0 in the file changes.rtf. You find this file also on our homepage on the VFX download page. This file contains all the class library changes and is a great additional source of information.


 Getting Started

Hardware and Software Requirements

Since VFX is an extension to the Microsoft Visual FoxPro Development System, you need a Hard- and Software Environment under which you can run Visual FoxPro. Please refer to the Visual FoxPro Hardware and Software Requirements for further information.

You must have your Microsoft Visual FoxPro properly installed  before you can start working with VFX.

Installation Steps

Please refer to the separate user manual


 Trouble Shooting Guide

Did you follow the Installation Instructions in the User Manual?

Error "MAINTITLE_LOC not found": The include files could not be found. Make sure that the current directory is the directory of the project you are working with! Tip:Try this in the command window: CD GETDIR() or in VFP 5.0: CD ?. Shut down, restart, set directory to your application directory, open project, select rebuild all, run.

Error "Menu has not been defined...'" The Menu Program (MAIN.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 VFX LIBRARY AND OTHER SUPPORT FILES, LIKE THE MENU! See also the notes under Attention in Getting Started.

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.

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 GETDIR(). NOTE: In Version 3.5 of Visual Extend you better use the VFX Application Manager.

Created forms are based on the library in the VFX directory rather than on the library of my application: This is only a problem if you are creating multilingual applications (see above). To solve the incorrect links, temporarely rename your VFX home directory and open all of your forms.  Locate the correct library from your application and rebuild of your project

Incremental Search and other VFX Power Grid Features do not work: Make sure you called the Grid Builder as described in the User Manual. Watch out for our Video Clips!

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!

OneToMany Forms are slow...: 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...

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!

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. 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…

NOTE: This Troubleshooting Guide will be updated on a regular basis. We will provide it via Compuserve in the library of the VFOX Forum, Library Vis.Class.Lib./VCX of our homepage.


 Show me how... Video Clips

Welcome to the video clips which show you how to...

NOTE: The following videos show the VFX 3.5 builders. The videos for the VFX 5.0 builders are under construction.

Create a simple data manipulation form using the VFX builders

Create a OneToMany form including foreign key pickfields using the VFX builders

Create linked parent child forms: the parent form

Create linked parent child forms: the child form

NOTE: The video clips are avi files with no sound to make the distribution easier. If you have problems seeing the video clips, make sure that you have Win95 or WinNT resp. Win3.x with installed avi support (Video for Windows Runtime). To run the video clips the file RHMPLAY.DLL must also be present either in your windows system directory or in the directory of this help file.

You can download all the needed files including the video for windows runtime also directly from our homepage.


 The Main Program - VFXMAIN.PRG

Every Visual FoxPro Application must have an entry point for an Application. The Visual Extend Application Development Framework uses a PRG program file as the wrapper program to start your application. This has several advantages. Probably the most important one is, that you can easily subclass CFoxApp and define the CEnvironment directly from within the main program, called VFXMAIN.PRG.

If you setup your new project using the VFX Application Builder you can select which name the main project (PJX/PJT) file should have, but the main program file is by default always called VFXMAIN.PRG.

In the following. the structure of the VFXMAIN program is described in detail:

Define Include Files:

#INCLUDE "INCLUDE\VFX.H"

Refox Branding Code:

**********************************************************

** ReFox 6.0 - Branding Code

if .f.

_REFOX_ =  (9876543210)

endif

Setup Environment

clear

close all

public goEnvironment

goEnvironment = createobject("CEnvironment")

if type("goEnvironment") # "O"

if type("_vfp")=="O"

_vfp.visible = .T.

endif

_screen.WindowState = 2

return .f.

endif

goEnvironment.Set()

Save VFP toolbar

public goVFPToolBar

goVFPToolBar = createobject("CVFPToolBar")

Check whether app or exe and make appropriate settings

local lcOldCaption, lcOldIcon

lcOldCaption = _screen.caption

lcOldIcon    = _screen.icon

public __VFX_RunTime

__VFX_RunTime = .f.

if ".EXE" $ upper(sys(16)) or ".APP" $ upper(sys(16))

__VFX_RunTime = .t.

set sysmenu to

_screen.caption = MAINTITLE_LOC

_screen.icon    = MAINICON_LOC

endif

Instantiates the application class

public goProgram

goProgram = createobject("CApplication", MAINTITLE_LOC)

Userlogin and start with read event

if type("goProgram") = "O"

release gcOldTalk, gcOldDir, gcOldPath, gcOldClassLib, gcOldEscape, gcOldResource

#ifdef _DEBUG_MODE

goProgram.DebugMode(.t.)

#endif

_screen.WindowState = 2

if type("_vfp")=="O"

_vfp.visible = .T.

endif

goProgram.SetLangID(ID_LANGUAGE)

if goProgram.OnUserLogin()

goProgram.Start()	&& here is the read events

goProgram.OnUserLogout()

endif

endif

Release the goProgram handle and other variables:

release goVFPToolBar

release goProgram

release goEnvironment

close all

_screen.caption = lcOldCaption

_screen.icon    = lcOldIcon

clear all

clear dlls

clear program

release all extended

return .t.


 APPL - The application specific class library

CAppNavBar	Application specific main toolbar  including navigation and other editing controls
CAppToolbar	Application specific main toolbar with no navigation and other controlscontrols


 VFXAPPL - The VFX application class library

CButtonLarge	large button template
CButtonSmall	Small Button Template
CFoxApp *	Application Class
CNavigatorbar	Office Compatible toolbar including navigation and other editing controls
COfficebar	Office Compatible toolbar
CStatusInfo	CStatusInfo
CVFPToolbar	VFP Toolbar manager class
Classes marked with * are the ones you will use the most!

Important Note: Methods and properties which are not explicitely documented in this technical reference are for internal use only and may change in upcoming versions of VFX!


 VFXCTRL - The VFX control class library

CBrowseWindow
CChildformmanager	The child form manager class
CChildGrid	Child Grid, used in OneToMany forms to handle the child data in a grid
CDataTableMgr	Data table manager class
CFieldList
CGauge	Gauge Control Class to easily display progess status of any step by step process. Use CGaugeWin if you need a ready to use Gauge Form Class.
CIDXManager	Temporary index manager
CLookup	CLookup Class
CMover	Mover Dialog Container Class. Use CMoverDialog. if you need a ready to use Mover Form Class.
CNavigator	Navigator control container, used on data manipulation forms to offer navigation and data manipulation controls on the form
CObject	Base class for all custom classes
CPickGrid	Grid used in the picklist container
CPushPin	PushPin
CRecordManager	Record manager class
CResizeControl	Class to handle the resize of controls on a form
CSpeedbar	Win95 like toolbar like container class
CToolbarButton	Toolbar button class
CToolbarControl	Toolbar control class


 VFXFORM - The VFX form class library

CAboutDialog	About dialog
CDatabaseTools	Database Tools dialog
CDataForm *	Data Manipulation base form class.
CDataFormPage *	Data Manipulation form including pageframe.
CDataFormPageBar	Data Manipulation form including pageframe and navigation and other controls on form
CGaugeWin	Gauge
CLockDialog	System Locks dialog
CLockDialogBar	CLockDialogBar
CLoginDialog	Login Dialog
CMemoForm	Memo edit form
CModalForm	CModalForm
CMoreDialog	Dialog to present possible selections
CMoverDialog	Mover Dialog form class.
COneToMany *	OneToMany data manipulation form including parent and n child grids on one form
COneToManyBar	One To Many Data Manipulation Form including navigation and other controls on the form
COpenDialog	Open Dialog, used to select and run forms
CPickDialog	Picklist Dialog to select a value from a picklist
CSearchDialog	Search Dialog to restrict the current set of records
CSplashDialog	Splash Screen
CSyserrDialog	System Errors dialog
CSyserrDialogBar	System Errors Dialog including navigation and other controls on the form
CSystemDialog	System Parameters dialog
CTableForm	Form Class for single page table maintenance
CToolbarDialog	Toolbar Selection dialog
CUserDialog	User List dialog
CUserDialogBar	User List dialog including navigation and other controls on the form
CWizard	Form class for Wizard Style user interfaces
Classes marked with * are the ones you will use the most!

Important Note: Methods and properties which are not explicitely documented in this technical reference are for internal use only and may change in upcoming versions of VFX!


 VFXOBJ - The VFX base object class library

CCheckBox	CheckBox
CComboBox	Combobox
CCommandButton	CommandButton
CCommandGroup	Commandgroup
CContainer	Container
CEditBox	EditBox
CFixField	Special textbox control, used for editing of fields in a child table which will automatically be setted based on the value of the parent key..
CForm *	Form base class used as base class for all higher level forms
CFormSet	FormSet base class
CGrid*	Grid base class
CImage	Image
CKeyField *	Special textbox control, used for editing of indentification key fields which can not be changed once inserted.
CLabel	Label
CLine	Line
CListBox	ListBox
COleBoundControl	OleBoundControl class
COptionGroup	OptionGroup
CPageFrame	PageFrame
CPickField *	PickField control, used to validate user input and offer the picklist functionality to select from a list of available items
CPickTextbox *	Picklist control used to place in a column of a child grid
CShape	Shape
CSpinner	Spinner
CTextbox	Textbox
CTimer	Timer
CToolbar	Toolbar
Classes marked with * are the ones you will use the most!

Important Note: Methods and properties which are not explicitely documented in this technical reference are for internal use only and may change in upcoming versions of VFX!


 VFXOFFCE - The VFX Office Library

Here you find two classes. One for Word97 and one for Excel97. Feel free to use it. Since it's still under development, we will document this class library later. However we are sure that our VFX customers will appreciate the availability of Office97 automation classes as soon as possible.

Thank you for your feedback. Sorry for the fact that some documentation is still in german...

In the next release of VFX, we will even include a Class for OLE Automation with Outlook. We are currently testing this class and it seems that the Outlook monster becomes a little bit less dangerous thanks to this VFX OLE Automation class.


 vfxtools - The VFX tools class library

CAboutInfo	Internal Use
CAboutNote	Internal Use
CAskViewArg*	Query arguments selection screen for C/S forms
CIntroForm	Optional Introduction Form

Classes marked with * are the ones you will use the most!


 CAskViewArg Form Class

This form is used in a C/S scenario when working with views. Whenever you work with views, you must ask the user of your aplication which data he wants to work with before you display the form. In a real C/S development scenario you must always think that the data is very far away and the transport of data costs you a lot of money, your own money to be more precise!

This form is used to collect data from the user which will be used to retrieve data with a parametrized view. If the CTextbox class property cViewParameter is used, the process to bind the textboxes which are on the CAskViewArg based form to the query parameters is automized. The Requery() method of the CAskViewArg class calls the requery of the master form which will then display the retrieved data. The CAskViewArg form class receives in the Init() method an object reference to the master form which will be stored in the property called oMasterForm.

See the following note to get up and running immediately in a C/S environment:

NOTE: See also the VFX Test Application. There is a form (see File/ Open/ Page Client Server) which shows the usage of the CAskViewArg form. Additional information you find also in the tutorial.


 Functions

VFX ships with a couple of Functions which you will find in the File VFXFUNC.PRG.

AddpageDelay

ContextHelp

ConvertToChar

ErrorMsg

GetArg

GetArgCount

GetFormParent

GetNewID

GetText

IncBase10

OnError

OnShutDown

OnSkipMenu

ReadDBCLink

SetFirstFocus

Spy

VFX_CheckUpdate

VFX_GetRelation

VFX_NeedUpdate

WriteDBCLink

XCrypt

XLock

XUnlock

VFX_UpdateError


 Builders

The following Visual Extend Builders will help you to create professional Visual FoxPro Applications in record time:

o 	Form Builder (including Multi Page)

o 	Grid Builder (reentrant)

o 	Picklist Builder (reentrant)

o 	OneToMany Builder (including Multi Page for Master and Multi Page for multiple Childs)

o 	ChildGrid Builder (reentrant)

o 	Picklist Builder for Picklists withing Child Grids (reentrant)

o 	LangSetup Builder

For the usage of these Builders, please refer to the Visual Extend user manual.


 Tables

Visual Extend uses the following internal tables:

Table	Field	Description
VFXFOPEN		Used to store the items which will show up in the File COpenDialog .
	OBJECTID	Name of the Pageframe. where this item should show up. PAGE1 for Page1, PAGE2 for Page2
	OBJECTNO	Sortorder
	TITLE	Title
	DESCR	Description of the Item, shows up when the item will be selected to further describe it.
	FORM	Name of the Form which will be started with the cFoxApp RunForm() Method. If you want to use the VFX File Open Dialog also for Form you don't want to run using the RunForm() Method, just place a Star '*' in front of the Form Name. This tells the VFX Framework to issue a DO FORM Command instead.
	PARAMETER	If you want to pass any parameters to the Form, you can write them here
VFXLOCK		Table to store the System Lockings, which you can write/ delete using the XLock() resp. the XUnlock() Functions. See Class Description CLockDialog.
	TABLE	Information, for which Table the Lock occurred.
	RECORD	Information, for which Record No the Lock occurred.
	DATE	Information about Date
	TIME	Information when the Lock occurred
	USER_NAME	Name of the user who wrote the Lock
VFXLOG		Tabe which is used for loggin of System Errors and other Events. See Class Description for CSysLog.
	TYPE	Record Type. i.e.; ERROR stands for error
	USER	User who created the log entry
	DATE	Date the log occurred
	TIME	Time the Log occurred
	ERROR	Error Number
	MESSAGE	Memofield containing the Error or other Description
	METHOD	Method, where the Error occurred, including a detailed Memory Configuration (List of all Variables which were set during error),
	TABLES	Status of all Tables which where open during the error
	CODE	Code Info
	MEMORY	Memory Footprint
	STATUS	Status Info's
VFXRES		Resource File which stores the Form and Grid Settings. To initialize the settings for a specific user, select the User List Form and select initialize. NOTE: Remember to initialize the Resource File whenever you made changes in the Grid of a Form after you run it once. Otherwise, during start up of the Form, you would receive errors while loading. Method:onLoadPostion().
	USER	Name of the User for which the record has been saved
	OBJNAME	Name of the Form
	INDEX	Index Expression
	DESCENDING	Index Descending Yes/ No
	LAYOUT	Form Layout Position
	PAGE	Last Page
	TOOLBAR	Was the Form Toolbar open Yes/No
VFXSYS		Table to store the System specific settings. See Class Description for CSystemDialog.
	MAGIC_ID	Dummy Field. Don's remove this Field.
	<AnyOtherFields>	Fields which will be used to generate gs_ Public Variables as described for the Class CSystemDialog.
VFXSYSID		Table to store the last used identification keys using the GetNewId Function.
	KEYNAME	Name for which the key has been generated. Here you might use a unique description for the field you generated the key for.
	VALUE	Last generated key
	MAXLEN	Length of the Field
VFXUSR		List of all users. See Class Description for CUser. Stores User ID, Password Add to this Table fields which then automatically will generate Public Variables with the Prefix gu_.
	USER	User ID, Char 10
	PASSWORD	Password, Char 10
	USER_NAME	User Name
	USERLEVEL	User security Level. Use the Public Variable this Field creates, called gs_USERLEVEL to define, whether a specific user can perform a specific task or not. i.e. in the Init Method of the Form you could set the Form Property lCanEdit, lCanInsert, ICanDelete to .F.if a user should not be able to Insert, Delete or Edit.
	USERACCESS	Additional Char Field which can be used to define additional User Access and/ or security informations. You can implement your own security access system around the Variables gu_USERLEVEL resp. gu_USERACCESS. In the next Version of VFX we will offer enhanced security management through a DBX approach.
	FIRSTVIEW	Define, how the first time a user starts a Form, he should see the Form. Enter the PageFrame, 1= Page 1, 2 = Page 2, ...
	LASTSEL	Memofield containing the entries used in the File Menu as Last Selection.


 Include Files

Since Include Files play an important role in VFX Application Development, let's understand what types of Include Files VFX uses:

Include File	Included by	Location	Lang.Spec	Content/ Description
VFX.H	VFXMAIN.PRG	\VFX\INCLUDE\	No	Sets the _DEBUG_MODE Constant and includes the other Include Files
FOXPRO.H	VFX.H	Visual FoxPro HomeDir	No	Standard FoxPro Definitions
VFXDEF.H	VFX.H	\VFX\INCLUDE\	No	Sets the ID_LANGUAGE constant and defines other not language specific VFX constants
VFXTXT.H	VFX.H	\VFX\INCLUDE\	Yes	Language Specific Captions and Tooltip Text used in VFX User Interface
VFXMSG.H	VFX.H	\VFX\INCLUDE\	Yes	Language Specific Messages used in VFX User Interface
USERTXT.H	VFX.H	\VFX\INCLUDE\	Yes	Language Specific Text used in your own Application
USERDEF.H	VFX.H	\VFX\INCLUDE\	No	Language independant Constants used in your own Application
USERMSG.H	VFX.H	\VFX\INCLUDE\	Yes	Language Specific Messages used in your own Application

You have to make changes in some of the VFX Include Files if you want to change the Debugging Mode or the Current Language.

Define _Debug_Mode

VFX uses a constant which defines whether your Application runs in Debug Mode or not. In your code you can put statements like

#ifdef _DEBUG_MODE

goProgram.DebugMode(.t.)

#endif

to communicate differently while in debug mode.

If you don't want Debug Mode code execution, remark  the line, where the _DEBUG_MODE Constant get's defined in the Include File VFX.H:

#INCLUDE 'FOXPRO.H'

**********************************************************

* REM _DEBUG_MODE IF YOU DON'T WANT DEBUG CODE EXECUTION

**********************************************************

*#DEFINE _DEBUG_MODE                  .T.	&& now Remarked

TIP: Of course you can also decide to call the goProgram.Debugmode() method with a parameter of true or false without changing the include file, this is the easier and quicker way since there is no need to use the VFX rebuild all button in the application manager to rebuild your project just because you wanted to change the debug mode behaviour. Just change the lines in the VFXMAIN.PRG file to this:

*#ifdef _DEBUG_MODE	(line remarked)

goProgram.DebugMode(.t.)

*#endif	(line remarked)

Define ID_Language

In the Include File VFXDEF.H the _Language_ID constant defines the current language of your Application.

#DEFINE ID_LANGUAGE                  'G'

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 will have to be translated into another language 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 in the user manual for further details.

IMPORTANT: Always compile your application after changes in your Include Files

In order to force Visual FoxPro to compile your code using the new Include Files it's necessary that you make changes to the PRG Files which have include statements since Visual FoxPro does not check whether something changed in the include files. Better yet: see the following note!

NOTE: The best way to make sure that changes in include files go really through is to use the recompile all button in the VFX Application Manager! There you are really sure that the changes take effect since this rebuild deletes all the OBJ code in forms and makes sure that also all FXP's (the compiled PRG's) will be recreated. Note that the rebuild from the VFP project manager has not the same effect as the lower level VFX rebuild all button in the VFX application manager!


 Debugging Techniques

VFX offers you an easy way to debug your applications: First, define whether your app should run in DebugMode using the Include File VFX.H:

#DEFINE _DEBUG_MODE                  .T.

After you made changes to the Include File, make sure you make a change in the file which contains the Include File (VFXMAIN.PRG) and recompile all (unless you set compile before save in the prg edit properties).

See also the VFX property lDebugMode for further information.

Once your Application runs in DebugMode, start your App, and you will see an additional menu pad called debug!

Hint: Run your debug session and issue a RESUME in the command window when you have done or a CANCEL, CLOSE ALL, CLEAR ALL if you want to abort your program execution and clean up the memory.


 Devigus Engineering Ltd.

Devigus Engineering AG

Rigistrasse 1

CH-6300 Zug

Devigus Engineering SA

5 Ch. des Moissons 5

CH-1294 Genthod

Devigus Engineering Torino

Via Cardinal Fossati 34/G

I-10141 Torino

Tel.:	+41/ 41/ 712 04 25

Fax: 	+41/ 41/ 710 75 46

Internet: deag@devigus.com

CompuServe: 100113,2676 or 100602,3150

Devigus Engineering erarbeitet Software-Lösungen von der Analyse bis zur Systemeinführung für international tätige Firmen. Mit Visual Extend stösst Devigus Engineering nun auch auf den Toolmarkt vor.

Seit 1993 ist Devigus Engineering AG zertifizierter Microsoft Solution Provider. Die Solution Providers werden von Microsoft selektioniert und regelmässig überprüft. Sie beschäftigen mehrere Microsoft Certified Professionals, Fachleute mit speziellem Know-How über Microsoft Produkte und werden von Microsoft regelmässig vorinformiert und geschult.


 Devigus Engineering Homepage

surf into

http://www.devigus.com

to get the latest informations, participate in discussions, get shareware versions, documentations, sample applications, final releases,  bug fixes, updates and sample applications!

Registered users have free download of subpoint releases. All registered users can download our sample application from the web.


 Credits

Devigus Engineering AG would like to thank the following individuals, without whose help the Visual Extend - Application Development Framework for Visual Foxpro would not be the great product it is.

Software Development and Design	Help Authoring and Doc
Arturo Devigus	Claudia Balbo Mossetto
Andrea De Paoli	Carole Mayor
Martina Köhler	Gianni V. Romero
Martin Landmann	Andrea De Paoli
	Arturo Devigus
Testing
Claudia Balbo Mossetto
Carole Mayor
Gianni V. Romero
Cesare Gilardi
Arturo Devigus
Andrea De Paoli
Martina Köhler

... and to Jürgen Wondzinski alias Woody, Peter Herzog, Hans Remiens, Dido Franceschi, Fritz Maurhofer, Thomas Bänziger, Doug Hennig and others for their ideas and comments; and our beta testers for help, patience and encouragement even in the darkest hours!


 Distribution and Training Partners

CompuServe Support USA

Andrew Kelly, CompuServe: go foxuser and watch out for him beeing active, he does a great job...

CompuServe Support Germany and Austria

Jürgen Wondzinski, CompuServe: go prolib and watch out for him beeing active, hes the ultimate VFX supporter in the old continent...

Distribution Deutschland und Österreich:

ProLib Software GmbH

Jürgen Wondzinski Alias Woody

D-83358 Seebruck

CompuServe: 100015,676

Distribution in UK:

QBS

Foxware

Distribution en France:

Sigma Logic

55, avenue des Champs Pierreux

F-92012 Nanterre Cedex

Distribuzione in Italia:

Devigus Engineering Torino

Switzerland and other countries:

Devigus Engineering Ltd.


 CFoxApp - The Application Class

Properties	Methods	Events

cFoxApp is the base class for your application specific application class CApplication which you will subclass by code in the main program VFXMAIN.PRG.

CFoxApp sets the VFP main window to maximzed, hides the system menu, displays a splash screen and, if the login process is ok, starts your application. It also offers methods like Runform() which are used as a wrapper class to run forms.

In VFXMAIN.PRG we already subclassed the CFoxApp class to make your live easier, here is a code example for VFXMAIN.PRG:

Note: For easier property switching, we already added the most often used properties in the code, so all you need to switch one property of the application class is to change the appropriate line of code directly in the VFXMAIN.PRG file.

define class CApplication as CFoxApp

** cHelpFile          = [Help File]

** cMainDatabase      = [Main Database]

** cMainMenu          = [Main Menu - Blank if none]

   cDateFormat        = [German]

   cMainForm          = [Intro]

** cMainTitle         = [Main Title]

** cIntroBitMap       = [Image used for the splash screen]

** cIntroForm         = [Class name used for the splash screen - Blank if none]

** cLoginForm         = [SCX for login dialog - Blank if none]

** lShowIntroForm     = [.T. if you want display the splash screen]

   lCentury           = .T.

   nShowGridOrderType = 2	&& Use Colors

** cAscOrderRGB       = [RGB(255,255,0)]

** cDescOrderRGB      = [RGB(255,0,0)]

** nAutoEditMode      = 1	&& 0 - None, 1 - .T., 2 - .F.

************************************************************

** cMainToolBar:  Application ToolBar

**

** CAppBar	- Tooolbar without Navigation Buttons

** CAppNavBar	- Tooolbar with    Navigation Buttons

cMainToolBar         = "CAppNavBar"

cExcludeFiles        = "DBCXREG.DBF;CDBKMETA.DBF;SDTMETA.DBF;SDTUSER.DBF"

lClearIDXMsg         = .F.

...

...

Examples

To Change Main Database	set cMainDatabase to you database
To Change Splash Screen	set cIntroBitmap to your bitmap
To Change Main Icon	set cMainIcon to  your icon
To Change Main Menu	set cMainMenu to your menu .MPR
To Change Login Form	set cLoginForm to your login form
To Change Main ToolBar	set cMainToolbar to your toolbar class
To Open a Main Form automatically	set cMainForm to your startup form
...


CFoxApp Properties

cAscOrderRGB	cMainDatabase	lOpenDialog	nRollover
cDataDir	cMainForm	lRelogonQuit	nShowGridOrderType
cDateFormat	cMainIcon	lShowIntroForm	nWinMnuCount
cDescOrderRGB	cMainMenu	lUseDesktopColor	oLastFormCreated
cEdt_Date	cMainTitle	lUseEnterAsTab	WinMnuName
cEdt_User	cMainToolBar	lUseWinUsername	WinMnuOffset
cExcludeFiles	cExtrabuffer	nAddUserToCaption
cHelpFile	FileMnuName	nAskToSave
cIns_Date	FileMnuOffset	nAutoEditMode
cIns_Usr	lCanClose	nCentury
cIntroBitMap	lCentury	nEnableHook
cIntroForm	lClearIDXmsg	nEnterisEditinGrid
cLangID	lDebugMode	nHideWhenEmpty
cLoginForm	lDisableFormResize	nIDXCount


CFoxApp Methods

AddToLastfile	OpenDatabase	RemoveToolbar	StartMainForm
AddToolbar	OpenIntroForm	RunForm	VFPToolbar
ClearAllIDX	RefreshWindowMenu	setLangID	ViewLastFileMenu
Debugmode	Release	ShowMenu
DrawBackground	ReleaseIntroForm	ShowToolbar
GetLangID	Relogon	Start


CFoxApp Events

onPostLogin	onSetEnv
onPreLogin	onSetToolbar
onQuit	onUserLogin
onResetEnv	onUserLogout
onSetDataPath


 CEnvironment - The Environment Class

Properties	Methods

The CEnvironment class is a non visual class which, for comfort reasons, is defined in code in the VFXMAIN.PRG.The CEnvironment class saves, sets and restores environmental settings. The Set() method gets called from the main program, just after the environment class has been instantiated. When the application class destroys, it automatically destroys the child objects as well. In the Destroy() method of CEnvironment, the Reset() Method will be called and resets all the saved environment settings.

See also VFXMAIN.PRG for information about the definition of the CEnvironment class as well as the notes under the onSetEnv() and onResetEnv() events for further information.

Example

In VFXMAIN.PRG, the environment class will be instantiated as follows:

...

...

public goEnvironment

goEnvironment = createobject("CEnvironment")

if type("goEnvironment") # "O"

_screen.windowstate = 2

return .f.

endif

goEnvironment.Set()

...

...

The definition of the CEnvironment class can also be found in the VFXMAIN.PRG.


CEnvironment Properties

cHelpFileName	cOldEscape	cOldNotify	cOldTalk
cOldBell	cOldExact	cOldOnShutDown	nOldMemo
cOldClassLib	cOldExclusive	cOldPath
cOldConfirm	cOldHelp	cOldProc
cOldDate	cOldIntensity	cOldResource
cOldDeleted	cOldMultilocks	cOldSafety
cOldDir	cOldNear	cOldStatus


CEnvironment Methods

Set
Reset


 CAppNavBar - the app specific toolbar with navigation

This class inherits directly from the class CNavigatorbar. It is used as application specific main toolbar. This toolbar contains navigation and editing controls. Already in the VFX Application Wizard, you have the possibility to select between two different main toolbars, one of them is the CAppNavBar class. The other one which is available is the CAppToolbar.

Use the application class property cMainToolbar to set the desired toolbar for your application. Just set this property to the name of the toolbar class you want to use as main toolbar in your application.

NOTE: Since the class library file appl.vcx/vct is an application specific component, modify the main toolbar directly in this class library file! There is no need to subclass this toolbar class any further since it has already been subclassed from the CNavigator class as described above.

Classdesigner


 CAppToolbar - The app specific toolbar

This class inherits directly from the class COfficebar. It is used as application specific main toolbar. This toolbar contains no navigation and editing controls. Already in the VFX Application Wizard, you have the possibility to select between two different main toolbars, one of them is the CToolBar class. The other one which is available is the CAppNavBar.

Use the application class property cMainToolbar to set the desired toolbar for your application. Just set this property to the name of the toolbar class you want to use as main toolbar in your application.

NOTE: Since the class library file appl.vcx/vct is an application specific component, modify the main toolbar directly in this class library file! There is no need to subclass this toolbar class any further since it has already been subclassed from the CNavigator class as described above.

Classdesigner


CButtonLarge
 CButtonLarge - Class

The CButtonLarge is a class which is based on the command button.It can be used as a template for toolbar command buttons with a size of  40x40 pixels.

This class inerits essentially all VFX properties and methods from the CCommandbutton class. The only difference (polymorphysm) of CButtonLarge is the size.


CButtonSmall
 CButtonSmall - Class

The CButtonLarge is a Class which is based on the Command Button.It can be used as a template for toolbar command buttons with a size of 23x23 pixels.

This class inerits essentially all VFX properties and methods from the CCommandbutton class. The only difference (polymorphysm) of CButtonSmall is the size.


 CNavigatorbar - The Navigation Toolbar Class

This toolbar class inherits from the COfficebar class. In addition to the functionality of the COfficebar class, it covers the feature of navigation and other items on the toolbar.

Usually you use this toolbar class, if you decide to have the VFX form classes CDataFormPage resp. COneToMany instead of CDataFormPageBar  or COneToManyBar.

Classdesigner

Example

If you want to use this toolbar, you set in the VFXMAIN.PRG the CFoxApp property cMainToolBar to "CAppNavBar".

The class CAppNavBar, is the application specific toolbar (it is located in the application specific class library file APPL.VCX) which inherits from the class CNavigatorbar.


 CStatusInfo Class

This class can be used as a label to display information about the currently selected record.


COfficebar
 COfficebar - The OC Toolbar Class

Properties	Methods

This is the Office Compatible Toolbar Class which is based on the Toolbar Class. To replace this standard Toolbar with your own, Application specific Toolbar, you can subclass this Toolbar and adapt it to your needs. To use your own Toolbar, set the CFoxApp Property cMainToolbar to your own Toolbar.

Classdesigner


COfficebar Properties

Extrabuffer
lSavePosition


COfficebar Methods

LangSetup
LoadPosition
QueryUnload
Release
SavePosition


 CVFPToolbar

The CVFPToolbar class manages the hide and restore of the Visual FoxPro toolbars when you run your own application and come back to Visual FoxPro.


 CAbout - The About Dialog Class

The about dialog form class is based on the CModalForm class and is used to display an about dialog. VFX provides already a form which is based on this class. Its name is VFXABOUT.SCX.

Classdesigner

To customize this about dialog, VFX offers you the possibility to make the changes in the Include file Usertxt.h:

…

…

#define MAINTITLE_LOC                       "Your Project Header"

#define CAP_LBLYOURAPPLICATIONNAME          "YourProject"

#define CAP_LBLVERSION                      "1.00"

#define CAP_LBLCOPYRIGHTINFORMATION         "Copyright 1996 Company"

#define CAP_LBLTRADEMARKINFORMATION         "All rights reserved"

#define CAP_LBLTHISPRODUCTISLICENSEDTO      "This product is licensed to:"

**__VFX_HEADER ** 08/06/96 08:36:46 AM

**__VFX_FOOTER **

…

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.


 CDatabaseTools - The Database Tools Class

This Class offers the functionality of Pack/ Pack Memo and Reindex of selected tables of your application. It is based on the class CModalForm.

Classdesigner

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 eqivalent function will be called when available.


 CGaugeWin - The Gauge Form Class

Methods

The Gauge Form Class is a Form which can be used to visuallize the progress of a process. It consists of a common Form with a VFX Gauge Container.

Classdesigner

Here a simple Code Example of the usage of the CGaugeWin Class:

*-------------------------------------------------------

lnMaxItems = ALEN(laTable,1)

loGauge = CREATEOBJECT('CGaugeWin', lnMaxItems)

loGauge.Show()

FOR lnItem = 1 TO lnMaxItems

   loGauge.SetValue(lnItem)

<any code...>

NEXT

loGauge.Release()

*-------------------------------------------------------


CGaugeWin Methods

LangSetup
SetMaxValue
SetMessage
SetText
SetValue


 CLockDialog - The System Lock Form Class

This is the Form Class, which is used to create the VFXLOCK Form. In this Form, the System Locks Data Manipulation occurs. This Form is based on the CDataFormPage and has no special Properties, Methods or Events.

If you generate a new Application using the VFX Application Builder, the Form VFXLOCK will automatically be ready to use.

Classdesigner


 CLogin Dialog Class

This is the Form Class, which is used to create the VFXLOGIN Form. In this Form, the user starting the Application has to enter a name and a password. This Form Class is based on the CModalForm Class and has only one special Property, called lLoginOK, to store whether the login attempt was successfull or not. No other special Methods or Events are present.

If you generate a new Application using the VFX Application Builder, the Form VFXLOGIN will automatically be ready to use.

If you login to your Application with an Empty Name, VFX assumes, that you are logging in as Administrator and sets the username automatically to ADMIN. The user ADMIN, with security rights 1 is the default user in the Table VFXUSER.

Classdesigner


 CMemoForm - The MemoField Edit Class

This is the Form Class which can be used to Edit Memo Fields. It is based on the Class CModalForm and has no special Properties, Methods or Events.

Classdesigner


 CMoreDialog - The More Selection Dialog Class

This is the Dialog Class which will be used to create the VFXMORE Dialog Form to present a list of possible choices when the user selects the Edit/ More... Command. This Form Class is based on the Class CModalForm and has only one special Method called RunForm() which does run the selected Form.

In the Form Method OnMore(), you will usually call the VFXMORE Form.

If you generate a new Application using the VFX Application Builder, the Form VFXMORE will automatically be ready to use.

Classdesigner


 CMoverDialog - The Mover Dialog Class

The VFX mover is a powerful user interface element, which you can use easily also in your applications. Good examples for the VFX movers are the VFX Builders which heavily use the mover container control for the selection of the fields.  The mover form class is based on the CModalForm class and contains the Mover Container Class.

Parameters

LPARAMETER taSource, tcCaption, taSelected

taSource: Source Array.

Pass the array which holds the source elements preferably by reference.

tcCaption: Form Caption

This caption will be used for the mover dialog form.

taSelected: Preselected Elements.

If you want to pass preselected elements to the mover, pass the selected elements as an array here. Preselected elements will be in the already selected right side of the mover when the mover pops up. You will use this in situations, where already made selections have been read from a table and are presented to the user.

Classdesigner

Here a code example of a practical use of the mover dialog form class:

LOCAL laSource[1,1], loMover

*--prepare the array of all available items

SELECT keygrp_id, keygrp_name FROM keygrp INTO ARRAY laSource

*--create the mover object based on the VFX Class CMoverDialog

loMover = CREATEOBJECT('CMoverDialog')

*--set the caption

loMover.Caption = CAP_KEYFIELDGEN

*--set the property which defines which column from the array get's displayed

loMover.cntMover.nColToView = 2

*--enable multiple selections

loMover.cntMover.lstSource.MultiSelect = .T.

*--pass the array of all available items

*  here you can also pass a second parameter if you want to define, which

*  elements from the array must appear as already selected

loMover.cntMover.SetData(@laSource)

*--show the mover dialog

loMover.Show()

*--Result: The Public Array _gaMoverList contains the selected items, use it

*  and release this Public Array after you have done.

NOTE: After the creation of the object loMover you have complete control over it and can set any property and call any method of the mover container class and its objects!


 CForm - The Form Base Class

Properties	Methods	Events

The class CForm is the base class for all VFX form classes. It's parent class is the Visual FoxPro base form class.

Classdesigner


CForm Properties

cChildFormMgrClass	lCloseOnEsc
cFormCaption	lMultiInstance
cFormName	lnHotKeyRefresh
cHookFunction	lPutInLastFile
cMenuForm	lPutInWindwoMenu
cResizeCtrlClass	lSavePosition
cToolbarClass	lUseChildForm
ExtraBuffer	lUseHook
lAutoResizeControl	lUseSysColor
lAutoSynchChildform	lShowToolbar
lCascade	nLockScreen
lCloseChildFormonExit


CForm Methods

DispBegin	Saveposition
DispEnd	SetFont
LangSetup	SetObjectFocus
LoadPosition	WaitMode
RefreshToolbar
onEventHook


CForm Events

onEventHook
onInit
onLoadPosition
onParentRefresh
onResetEnv
onSavePosition
onSetChildData
onSetEnv


 CFormSet Class

Properties

This is the VFX FormSet Class. Use this Class to create your formsets or use it as base for your formset classes.

NOTE: Do not use form sets with VFX, they are not supported at the time of this writing. Maill for formset support if needed.


CFormSet Properties

ExtraBuffer


 CGrid - The Grid Class

Properties	Methods	Events

The Grid Class is used in various VFX Form Classes. Normally the VFX Builders fill in the needed code in the Grid's Properties and Methods.


CGrid Properties

cAscOrderRGB	lProportionalFont	nMaxRec
cDescOrderRGB	lProportionalResize
Extrabuffer	lUseSetKey
lAutoSetup	nIncSearchTimeout
lEnterIsEditMode	nIncSearchTimeOut	nMaxRec


CGrid Methods

Release
Requery
onKeyEnter	onRecordMove


CGrid Events

onKeyEnter
onKeyPress
onLoadPosition
onSavePosition
onSetOrder


 CIDXManager Class

This class is used for all issues ralated with the creation and management of temporary IDX files. Internal use only.


 CLookup Class

(New topic text goes here.)


 CImage Class

Properties	Methods

This is the VFX Image Class. You can use it as is or use as a base for your own Image Classes.


CImage Properties

ExtraBuffer	lProportionalResize


CImage Methods

Hide
Refresh
Release
Show


 CKeyField Class

Properties	Methods

The KeyField Class is an evolution of the CTextbox Class. Its is used for the editing of identification key fields for which you don't want to allow changes after they have been inserted.


CKeyField Properties

cViewParameter
ExtraBuffer
lAutoSetup
lProportionalResize
lUseSysColor


CKeyField Methods

Release


 CLabel Class

Properties	Methods

This is the VFX Label Class. Use it as is or as a base for your own Classes.


CLabel Properties

ExtraBuffer
lProportionalResize
lUseSysColor


CLabel Methods

Refresh
Release


 CLine Class

Properties	Methods

This is the VFX Line Class. Use it as is or as a base for your line classes.


CLineClass Properties

ExtraBuffer	lProportionalResize


CLineClass Methods

Refresh
Release


 CListbox Class

Properties	Methods


CListbox Properties

cViewParameter
ExtraBuffer
lAutoSetup
lProportionalResize
lUseSysColor


CListbox Methods

Release


 CModalForm - The Modal Form Class

Properties	Methods	Events

The Class CModalForm is the Base Class for all Modal Forms. It is based on the Class CForm.

Class Designer:


CModalForm Properties

cFormCaption	lCloseOnEsc	uRetCode
cFormName	lMultiInstance
cMenuForm	lPutInLastFile
cToolbarClass	lPutInWindwoMenu
ExtraBuffer	lSavePosition
lAutoResizeControl	lUseChildForm
lAutoSynchChildform	nLockScreen
lCascade


CModalForm Methods

DispBegin	Saveposition
DispEnd	SetFont
LangSetup	SetObjectFocus
LoadPosition	WaitMode
RefreshToolbar


CModalForm Events

onLoadPosition
onResetEnv
onSavePosition
onSetEnv


 CNavigator Class

Properties	Methods

This is the VFX Record Set Navigation Class.

Classdesigner

The Controls within this Navigator Control call the following CDataForm Events:

OnTop, onPrev, onNext, onBottom, onSearch, onMore, onSave, onInsert, onEdit, onDelete, onUndo


CNavigator Properties

ExtraBuffer
lProportionalResize


CNavigator Methods

LangSetup
Release


 CObject Class

This is the VFX Object Custom Class, which can be used to subclass non visual classes. Using this as base class will inherit the Release Method and the ExtraBuffer Property.

The most prominent class which is based on CObject is the CFoxApp Class.


 COleBoundControl Class

Properties	Methods

This is the VFX OleBoundControl class. Use it as is or as base for your own OleBoundControl Classes.


COleBoundControl Properties

ExtraBuffer
lProportionalResize


COleBoundControl Methods

Release


 COptionGroup Class

Properties	Methods

This is the VFX OptionGroup Control class. Use it as is or as base for your own OptionGroup Classes.


COptionGroup Properties

cViewParameter
ExtraBuffer
lProportionalResize
lUseSysColor


COptionGroup Methods

Release


 CPageFrame Class

Properties	Methods

This is the PageFrame Class. It is used in the CDataFormPage as well as in the COneToMany Form Classes.

Classdesigner


CPageFrame Properties

ExtraBuffer
lUseGrid
lProportionalResize
lUseSysColor


CPageFrame Methods

Release


 CPickField Class

Properties	Methods	Events

This is the Picklist Control. It can be used for validating user input against a table as well as to provide the call of a picklist dialog where the user can pick a record.

Use the Picklist Control rather than the Ccombobox Control, whenever you have a table with a lot of records and if you want to validate user keyboard input directly.

Refer also to the User Manual for additional information about this control, especially the Picklist Builder.

Classdesigner


CPickField Properties

cDataForm	cReturnExprDesc	cViewValid	lHideCode
cFieldList	cReturnMoreExpr	ExtraBuffer	lKeyField
cFieldTitle	cReturnMoreExprVal	l3DDesc	lNullValid
cFilterExpr	cSeekValue	lAutoPick	lProportionalResize
cIndexExpr	cSQLValid	lAutoResize	lUserRefresh
cPickCaption	cTableName	lAutoSetup	lUseSysColor
cPickCursor	cTagName	lDescItalicFont	lUseTab
cPickForm	cTagNameJump	lDoValid	lWorkOnView
cReturnExpr	cViewParameter	lFixField	nValidMode
			readonly


CPickField Methods

Clear	GetMoreValue	SetCodeValue
GetCodeValue	Release	SetDescValue
GetDescValue	Requery	Valid


CPickField Events

onPick
onPostQuery
onPreQuery
onRefresh


 CPickGrid Class

Properties	Methods	Events

The PickGrid Class is used in the Picklist Form which will be called whenever the user calls the Picklist from while on a Picklist Control.


CPickGrid Properties

Extrabuffer
lAutoSetup
lProportionalFont
lProportionalResize


CPickGrid Methods

Release


CPickGrid Events

onKeyPress
onSetOrder


 CPickTextbox Class

Properties	Methods	Events

This is the Picklist Control specially designed for the use in a Grid. It can be used for validating user input against a table as well as to provide the call of a picklist dialog where the user can pick a record. See also the CPickField Class.


CPickTextbox Properties

cDataForm	cPickForm	cTagName	lNullValid
	cReturnExpr	ExtraBuffer	lProportionalResize
cFieldList	cReturnMoreExpr	lAutoSetup
cFilterExpr	cReturnMoreExprVal	lDoValid
cIndexExpr	cSeekValue	lFixField
cPickCaption	cTableName	lKeyField


CPickTextbox Methods

DoPickForm	Release
GetCodeValue	Requery
GetMoreValue	SetCodeValue


CPickTextbox Events

onPostQuery
onPreQuery


 CPushPin Class

Properties	Methods

This Control Class is based on the CCheckbox Class. It can be used to set the Visual FoxPro Form Property AlwaysOnTop. Putting this Control on a Form makes it easy to visually see the state of the AlwaysOnTop status of the Form.

Classdesigner


CPushPin Properties

Extrabuffer
lAutoSetup
lProportionalResize


CPushPin Methods

Release


 CShape Class

Properties	Methods

The Shape Class can be used to provide the same proportional resize functionality for shapes as for all other controls.


CShape Properties

Extrabuffer
lProportionalResize


CShape Methods

Refresh
Release


 CSpinner Class

Properties	Methods

This is the VFX Spinner Class.

Classdesigner


CSpinner Properties

cViewParameter
Extrabuffer
lAutoSetup
lProportionalResize
lUseSysColor


CSpinner Methods

Release


 CTextbox Class

Properties	Methods

The Textbox Class is used to create Textbox Controls. Use this class as is or as base for your own Textbox Classes.


CTextbox Properties

cViewParameter
ExtraBuffer
lAutoSetup
lProportionalResize
lUseSysColor


CTextbox Methods

Release


 CTimer Class

Properties	Methods

This is the VFX Timer Class.

Classdesigner


CTimer Properties

ExtraBuffer


CTimer Methods

Release


 CToolbar Class

Properties	Methods

This is the VFX Toolbar Class. It is used as a base class for the COfficeBar Class.


CToolbar Properties

Extrabuffer
lSavePosition


CToolbar Methods

LangSetup
LoadPosition
QueryUnload
Release
SavePosition


CDataForm - The Data Manipulation Base Class
 CDataForm - The Data Form Base Class

Properties	Methods	Events

The Class CDataForm is the base class for all data manipulation forms. It's based on the class CForm and holds all base functionality used for data manipulation.

To create DataForms without manual programming, use the corresponding Visual Extend Builder.

Classdesigner


CDataForm Properties

cCalledBy	cSearchForm	lCanInsert	lUseHook
cChildFormMgrClass	cSetKeyExpr	lCascade	lUseSetKeyAsFilter
cEmptyMessage	cSetKeyIndex	lChildForm	lUseSysColor
cFilterExpr	cSetKeyValue	lCloseChildFormonExit	lWorkOnView
cFixFieldName	cTempIndex	lCloseOnEsc	nFormStatus
cFixFieldValue	cToolbarClass	lEmpty	nLockScreen
cFormCaption	cViewIndexExpr	lFilterOn	nOldRecno
cFormName	cWorkAlias	lHideWhenEmpty	nWarningLevel
cHookFunction	cWorkTag	lMore
cIDXMgrClass	ExtraBuffer	lMultiInstance
cMenuForm	lAskToSave	lnHotKeyRefresh
cQueryArg	lAutoEdit	lPutInLastFile
cRecordMgrClass	lAutoResizeControl	lPutInWindwoMenu
cReportName	lAutoSynchChildForm	lSavePosition
cResizeCtrlClass	lCanDelete	lShowToolbar
cSearchFilterExpr	lCanEdit	lUseChildForm


CDataForm Methods

AskToSave	RecordChanged	UniqueError
ClearIDX	RecordError	UpdateError
DispBegin	RefreshToolbar	Valid
DispEnd	Requery	WaitMode
ErrorHandler	SavePosition
FieldError	SetFont
LangSetup	SetObjectFocus
LoadPosition	SetQueryArg
odbcError	TriggerError


CDataForm Events

onBottom	onLoadPosition	onPreEdit	onSearch
onChildRequery	onMore	onPreInsert	onSetChildData
onDelete	onNext	onPreQuery	onSetEnv
onEdit	onParentRefresh	onPrev	onTop
onEmptyForm	onPostEdit	onPrint	onUndo
onEventHook	onPostInit	onRecordMove	onWriteBuffer
onFormStatusChange	onPostInsert	onResetEnv
onInit	onPostQuery	onSave
onInsert	onPreDelete	onSavePosition


 CDataFormPage - The multipage Data Form Class

Properties	Methods	Events

The Class CDataFormPage is the data form class which has been designed to hold a pageframe for data management on multiple pages. It's based on the class CDataForm and holds the needed enhancements for multipage data management forms using a pageframe.

To create DataFormPages without manual programming, use the corresponding Visual Extend Builder.

Classdesigner

Remarks

The class CDataFormPageBar inherits from the class CDataFormPage and adds a navigation control on the form.

NOTE: The pageframe is part of the cDataFormPage class, you can therefore not remove it. If you don't need the pageframe, use the CDataForm or the new CTableForm class instead.


CDataFormPage Properties

cCalledBy	cSearchFilterExpr	lCanInsert	lShowToolbar
cChildFormMgrClass	cSearchForm	lCascade	lUseChildForm
cEmptyMessage	cSetKeyExpr	lChildForm	lUseHook
cFilterExpr	cSetKeyIndex	lCloseChildFormonExit	lUseSetKeyAsFilter
cFixFieldName	cSetKeyValue	lCloseOnEsc	lUseSysColor
cFixFieldValue	cToolbarClass	lEmpty	lWorkOnView
cFormCaption	cViewIndexExpr	lEnterIsEdit	nFormStatus
cFormName	cWorkAlias	lFilterOn	nLockScreen
cHookFunction	cWorkTag	lHideWhenEmpty	nOldPage
cFormName	ExtraBuffer	lMore	nOldRecno
cIDXMgrClass	lAskToSave	lMultiInstance	nPageEdit
cMenuForm	lAutoEdit	lMultiPage	nPageList
cQueryArg	lAutoResizeControl	lnHotKeyRefresh	nWarningLevel
cRecordMgrClass	lAutoSynchChildForm	lPutInLastFile
cReportname	lCanDelete	lPutInWindwoMenu
cResizeCtrlClass	lCanEdit	lSavePosition


CDataFormPage Methods

AskToSave	RecordChanged	UniqueError
ClearIDX	RecordError	UpdateError
DispBegin	RefreshToolbar	Valid
DispEnd	Requery	WaitMode
ErrorHandler	SavePosition
FieldError	SetFont
LangSetup	SetObjectFocus
LoadPosition	SetQueryArg
odbcError	TriggerError


CDataFormPage Events

onBottom	onNext	onPreQuery	onTop
onChildRequery	onNextPage	onPrev	onUndo
onDelete	onParentRefresh	onPrevPage	onWriteBuffer
onEdit	onPostDelete	onPrint
onEmptyForm	onPostEdit	onRecordMove
onEventHook	onPostInit	onResetEnv
onFormStatusChange	onPostInsert	onSave
onInit	onPostQuery	onSavePosition
onInsert	onPreDelete	onSearch
onLoadPosition	onPreEdit	onSetChildData
onMore	onPreInsert	onSetEnv


 CDataFormPageBar - CDataFormPage with Navigation on form

The class CDataFormPageBar inherits directly from the class CDataFormPage and adds the navigation controls directly on the form.

Classdesigner

Remarks

Usually you will decide to have the navigation buttons either on the form or on the main toolbar. VFX offers both possibilities.

If you have no navigation buttons on the form, you may want them to appear on the toolbar. Thats why we prepared a toolbar class which includes the navigation controls. For easier usage, we already subclassed this toolbar and put it in the project specific class library APPL.VCX. The name of this toolbar is CAppNavBar. All you have to do to use it is to set the application class property cMainToolbar to CAppNavBar. You can do this directly in VFXMAIN.PRG.

If you have navigation buttons on the form, you may want to use the prepared toolbar CAppToolbar.


 COneToMany - The OneToMany Form Class

Properties	Methods	Events

The Class COneToMany is the Data Manipulation Form Class for the creation of OneToMany Forms. It is based on the Class CDataFormPage and has been enhanced to handle advanced OneToMany Features.

To create OneToMany Forms without manual programming, use the corresponding Visual Extend Builder.

Classdesigner


COneToMany Properties

cCalledBy	cSearchFilterExpr	lCanDelete	lPutInLastFile
cChildFormMgrClass	cSearchForm	lCanEdit	lPutInWindwoMenu
cEmptyMessage	cSetKeyExpr	lCanInsert	lSavePosition
cFilterExpr	cSetKeyIndex	lCascade	lShowToolbar
cFixFieldName	cSetKeyValue	lChildForm	lUseChildForm
cFixFieldValue	cTempIndex	lCloseChildFormOnExit	lUseHook
cFormCaption	cToolbarClass	lCloseOnEsc	lUseSetKeyAsFilter
cFormName	cViewIndexExpr	lEmpty	lUseSysColor
cHookFunction	cWorkAlias	lEnterIsEdit	lWorkOnView
cIDXMgrClass	cWorkTag	lFilterOn	nFormStatus
cMenuForm	ExtraBuffer	lHideWhanEmpty	nLockScreen
cQueryArg	lAskToSave	lMore	nOldPage
cRecordMgrClass	lAutoEdit	lMultiInstance	nOldRecno
cReportName	lAutoResizeControl	lMultiPage	nPageEdit
cResizeCtrlClass	lAutoSynchChildForm	lnHotKeyRefresh	nPageList
			nWarningLevel
			oChildGrid


COneToMany Methods

AskToSave	RecordChanged	UniqueError
ClearIDX	RecordError	UpdateError
DispBegin	RefreshToolbar	Valid
DispEnd	Requery	WaitMode
ErrorHandler	SavePosition
FieldError	SetFont
LangSetup	SetObjectFocus
LoadPosition	SetQueryArg
odbcError	TriggerError


COneToMany Events

onBottom	onInsertChildData	onPreDelete	onSave
onChildRequery	onLoadPosition	onPreEdit	onSaveChildData
onDelete	onMore	onPreInsert	onSavePosition
onDeleteChildData	onNext	onPreQuery	onSearch
onEdit	onNextPage	onPrev	onSetChildData
onEmptyForm	onParentRefresh	onPrevPage	onSetEnv
onEventHook	onPostDelete	onPrint	onTop
onFormStatusChange	onPostEdit	onRecordMove	onUndo
onInit	onPostInsert	onResetEnv	onWriteBuffer
onInsert	onPostQuery	onResizeChild


 COneToManyBar - COneToMany with navigation on form

The class COneToManyBar inherits directly from the class COneToMany and adds the navigation controls directly on the form.

Classdesigner

Remarks

Usually you will decide to have the navigation buttons either on the form or on the main toolbar. VFX offers both possibilities. See property cMainToolbar for additional information.


 COpenDialog - The Open Dialog Class

This is the Dialog Class which will be used to create the VFXOPEN Dialog Form to present the File Open Dialog. This Form Class is based on the Class CForm and has only one exposed Method which is the LoadItem() Method which does load the Items to be displayed from the VFXFOPEN Table.

If you generate a new Application using the VFX Application Builder, the Form VFXOPEN will automatically be ready to use.

Classdesigner


 CPickDialog - The Picklist Dialog Class

This is the Picklist Dialog Class which will be used to create the VFXPICK Dialog Form which will be used to present the list of records as a Picklist. This Form Class is based on the Class CDataForm and has no special Properties, Methods or Events.

If you generate a new Application using the VFX Application Builder, the Form VFXPICK will automatically be ready to use.

Classdesigner


 CSearchDialog - The Search Dialog Class

This is the Search Dialog Class which will be used to create the VFXSRCH Dialog Form which will be used as a simple search form to define a filter for the current table or view. This Form Class is based on the Class CForm and has no special Properties, Methods or Events.

If you generate a new Application using the VFX Application Builder, the Form VFXSRCH will automatically be ready to use.

Classdesigner


 CSplashDialog - The Splash Screen Class

This is the Splash Screen class which will be used as base class to produce the splash screen if the CFoxApp property cIntroBitmap has been set to the bitmap of your choice. We provide a bitmap template, which has the name INTRO.BMP. This class has no special properties, methods or events.


 CSysErrDialog - The System Errors Dialog Class

This is the System Errors Dialog Class which will be used to create the VFXLOG dialog form which will be used as a dialog to present all logged System Errors or other events. This form class is based on the class CDataFormPage. This class has no special properties, methods or events.

Note that there are the memo fields

-VFXLOG.MESSAGE

- VFXLOG.METHOD

- VFXLOG.TABLES

where useful informations will be stored!

If you generate a new application using the VFX Application Builder, the form VFXLOG will automatically be ready to use.

Classdesigner


 CSysErrDialogBar - CSysErrDialog with navigation on form

The class CSysErrDialogBar inherits directly from the class CSysErrDialog and adds the navigation controls directly on the form.

Classdesigner

Remarks

Usually you will decide to have the navigation buttons either on the form or on the main toolbar. VFX offers both possibilities. See property cMainToolbar for additional information.


 CSystemDialog - The System Option Class

This is the System Options Dialog Class which will be used to create the VFXSYS Dialog Form which will be used as a Dialog to present the System Settings of an Application. System Settings are Installation Specific settings, versus User Specific Settings, which are User specific. This Class is based on the Class CForm. This Class has no special Properties, Methods or Events.

If you generate a new Application using the VFX Application Builder, the Form VFXSYS will automatically be ready to use.

Classdesigner

Public Valiables gs_: Like with the user specific settings described in this Document, VFX creates for every field in the VFXSYS table a public variable with the prefix gs_ and handles automatically the save & restore of these values.

Assume you have a field called TEST in the VFXSYS table. In that case you will see a public variable called gs_test which will pick up the value from the field TEST whenever the user logs on and writes the content of the public variable gs_test back to the table VFXSYS  whenever the user logs off.

This way, the only thing you have to do to support system specific settings is adding a field in the table VFXSYS.

NOTE: Since the code to open the Table (Table with one Single Record) VFXSYS.DBF, is contained in the class definition, there is no need to manually setup a Data Environment in the Form VFXSYS.


 CTableForm - The Tableform Class

CTableForm is a class which is a subclass of CDataForm. This class is used whenever you want to have a table maintenance form which is simple and has only few fields which fit easily on one page. A typical example would be a lookup table with code and description fields only. In such a case it would be an overkill to use the CDataFormPage class since paging from the list page to the edit page for such a simple form would would be inconvenient.

Classdesigner

Example

In this example you see a form which has been created based on the CTableform class. This form has also the CSpeedbar class added. This Speedbar class is NOT part of the CTableform class. It has been added during the design of this form using the VFX Form Builder.


 CToolbarDialog - The Toolbar Dialog Class

This is the Dialog Class which will be used to create the VFXTBR Dialog Form which offers a Toolbar activation Selection Dialog. This Class is based on the Class CModalForm and has no special Properties, Methods or Events.

If you generate a new Application using the VFX Application Builder, the Form VFXTBR will automatically be ready to use.

Classdesigner


 CUserDialog - The Userlist Dialog Class

This is the Userlist Data Manipulation Class which will be used to create the VFXUSER Form. This Form offers the Management of the Userlist. This Class is based on the Class CDataFormPage This Class has no special Properties, Methods or Events.

If you generate a new Application using the VFX Application Builder, the Form VFXUSER will automatically be ready to use.

Classdesigner

Public Valiables gu_: VFX creates for every field in the VFXUSER table a public variable with the prefix gu_ and handles automatically the save & restore for these values.

Assume you have a field called TEST in the VFXUSER table. In that case you will see a public variable called gu_test which will pick up the value from the field TEST from the table VFXUSER whenever the user logs on and writes the content of the public variable gu_test back to the table VFXUSER whenever the user logs off.

This way, the only thing you have to do to support user specific settings is adding a field in the table VFXUSER.


 CUserDialogBar - CUserDialog with navigation on form

The class CUserDialogBar inherits directly from the class CUserDialog and adds the navigation controls directly on the form.

Classdesigner

Remarks

Usually you will decide to have the navigation buttons either on the form or on the main toolbar. VFX offers both possibilities. See property cMainToolbar for additional information.


 CWizard - The Wizard Form Class

Wizards are everywhere. Especially users who do not work frequently with an application appreciate if they are guided through a business process to enter or modify data or whatever other task. The CWizard class is based on the CForm class and is especially desiged to create Wizard style user interfaces.

Classdesigner

Remarks

The easiest way to get up and running with your own wizard is to have a look at the Wizard in the VFX Test Application. It shows how to write code in the cmdNext.Click() and cmdBack.Click() methods to validate the user input. A good practice is to create form properties which store the data a user enters during a Wizard session. Finally, the Finish() method can be used to write the code which will execute when the user arrived to the last page and cliciked the finish button.

NOTE: The VFX Wizard class does explicitely force the user to step through every step from page to page. Basically he can not jump from page 1 to page 3 directly using a sort of a combo box or so. However, there are situations where you explicitely want to jump over a special page. This is possible and is done in the cmdnext.click() resp. cmdback.click() methods. Have a look at the Wizard style form class in the VFX Test Application. The form is called Wiz01.


 CGauge - The Gauge Control Class

Properties	Methods

The Gauge Control Class is the Control which is used in the Form Class CGaugewin.

Classdesigner


CGauge Properties

lPercentShow
nMaxValue
nValue


CGauge Methods

Release
SetMaxValue
SetText
SetValue


 CMover - The Mover Container Class

Properties	Methods	Events

The mover container class is a container class which can be used to build user friendly mover dialogs. The Visual Extend Builders use this mover class quite a lot to present the fields selection dialogs.

If you want to use a single form with the mover dialog functionality, we prepared the form class CMoverDialog to make it easier for you to use the mover functionality if you need it within a simple form.

Classdesigner


CMover Properties

lcFormClass
nColToView
nMaxCol
nMaxRow


CMover Methods

Clear
GetData
SetData


CMover Events

onSelectedChange
onSourceChange


 CCheckbox - Checkbox Class

Properties	Methods

The Checkbox Class is based on the Base Class Checkbox.


CCheckbox Properties

Extrabuffer
lAutoSetup
lProportionalResize
lUseSysColor


CCheckbox Methods

Release


 CChildFormManager - the childform manager class

This is the class which will be used when you have a parent form which has linked child form. This class will be instantiated whenever you set the form property lUseChildForm to true and handles automatically that for every existing child form of a parent, the method onSetChildData() of the parent form will be called with the approppriate parameters.

Remarks

For additional information on how to implement linked childforms using VFX please refer to the topic How to create linked child forms in this help file.


 CChildGrid - The Child Grid Class

Properties	Methods	Events

The ChildGrid class is based on the CGrid Class. The ChildGrid class is basically used in OneToMany forms. But it can also be used, whenever you need to show or edit child records in a grid format. Each child grid can represent an independant table or view.

It is important to set the following Visual FoxPro properties correctly:

ChildOrder	This Visual FoxPro property specifies the index tag for the record Source of the grid control
LinkMaster	This Visual FoxPro property specifies the parent table linked to the child table displayed in the grid control
RecordSource	This Visual FoxPro property specifies the source of data to which the grid control is bound.
RelationalExpr	This Visual FoxPro property specifies the expression based on fields in the parent table that relates to an Index in the child table

NOTE: The Visual Extend OneToMany Form Builder sets all these property automatically. You just have to make sure that you setup the data environment correctly before you call the OneToMany Form Builder.

The clias associated with the child grid is always set to work in table buffering mode. This will be set in the Init code of the CChildGrid class.


CChildGrid Properties

cAscOrderRGB	lProportionalFont
cDescOrderRGB	lProportionalResize
cFixColumnList	lUseSetKey
ExtraBuffer
lAutoSetup
lCanUpdate
lEditing


CChildGrid Methods

Release


CChildGrid Events

onDelete	onPostInsert
onInsert	onPreDelete
onKeyEnter	onPreInsert
onPostDelete


 CCombobox Class

Properties	Methods

The ComboBox Class can be used as is or as Base Class for further enhanced ComboBox Classes.


CCombobox Properties

cViewParameter
ExtraBuffer
lAutoSetup
lProportionalResize
lUseSysColor


CCombobox Methods

Release


 CCommandbutton Class

Properties	Methods

This is the VFX Commandbutton Class. You can use it as is or use as a base for your own Commandbutton Classes.


CCommandbutton Properties

ExtraBuffer
lAutoSetup
lProportionalResize


CCommandbutton Methods

Release


 CCommandgroup Class

Properties	Methods

This is the VFX commandgroup class. You can use it as is or use as a base for your own Commandgroup classes.


CCommandgroup Properties

ExtraBuffer
lAutoSetup
lProportionalResize


CCommandgroup Methods

Release


 CContainer Class

Properties	Methods

This is the VFX Container Class. You can use it as is or use as a base for your own Container Classes.


CContainer Properties

ExtraBuffer
lAutoSetup
lProportionalResize
lUseSysColor


CContainer Methods

Release


 CRecordManager Class

Abstract class for record management. This class is used as template class for the class CDataTableMgr.


 CResizeControl Class

Internal use for proportional resize of controls on a resized form. See also lProportionalFont, lProportionalResize, lDisableFormResize.


 CDataTableMgr Class

Properties	Methods

This is the VFX data table manager class which handles all record mover operations as well as other basic record manipulations. All record mover and other operations available in this class will be called from other classes whenever they need such a functionality.

Example

The netx() method will be called whenever a skip to the next record is needed.

Note

All record mover operations are optimized for optimal performance while working on large filtered database tables.


CDataTableMgr Properties

cAliasName
Extrabuffer


CDataTableMgr Methods

Delete	Next	Save
GoBottom	Previous	Undo
Insert	Release	Update
Modified	Requery


 CEditbox Class

Properties	Methods

This is the VFX Editbox Class. You can use it as is or use as a base for your own Editbox Classes.


CEditbox Properties

cViewParameter
ExtraBuffer
lAutoSetup
lProportionalResize


CEditbox Methods

Release


 CFixField Class

Properties	Methods

This Class is used to create Textboxcontrols which are automatically disabled, when it would not make sense to access the control in a Parent Child situation where a Form1 called a Form2.

Example

If you call the Orders for a specific Customer, it makes no sence to have access to the Control where the Customer will be entered. Use in such situations the Class CFixField, which automatically disables the Control, if the Form Property cFixFieldValue will be defined and the lAutoSetup Control Property is true.

If your control is a Picklist Control, use the Property lFixField to define whether the Picklist control should act as a Fixfield control or not. This will normally be defined in the Init Method of the Form.


CFixField Properties

cViewParameter
ExtraBuffer
lAutoSetup
lProportionalResize
lUseSysColor


CFixField Methods

Release


 cCalledBy Property

Property which defines, how a form has been called. Will usually be set in the Init() method according the passed parameters.

Applies To

CDataForm, CDataFormPage, COneToMany

Syntax

Form.cCalledBy[ = cExpr]

Remarks

This property will automatically be set in the Init() method of the form. Depending on who called the form, this property holds a character expression which identifies from where the form has been called. In the VFX Framework, the Form Builders generate the Init() method code of the forms when you select the checkbox ChildForm in the Builder Dialog.

Example

If the orders form gets called from the employee form (only the orders of a specific employee are visible in the child form), this property could be "EMP", which defines that the form has been called from the employee form.

You define in the onMore() event, how child forms are called from a parent form. Here an example for the Init() code of the child form:

LPARAMETERS tcArg

_screen.LockScreen = .T.

IF !EMPTY(tcArg)

IF getArgCount(tcArg) <> 0

this.cCalledBy      = UPPER(  getArg(tcArg,1)        )

this.cFixFieldValue = STRTRAN(getArg(tcArg,2),'@',';')

thisForm.Caption    =         getArg(tcArg,3)

this.cFixFieldName  = STRTRAN(getArg(tcArg,4),'@',';')

this.cFilterExpr    = UPPER(  getArg(tcArg,5)        )

this.lPutInLastFile  = .F.

IF this.cCalledBy = 'EMPLOYEE'

this.pgfPageFrame.Page1.cntEmp_ID.lFixField = .T.

ENDIF

ENDIF

ENDIF

IF !this.lWorkOnView AND !EMPTY(this.cFilterExpr)

LOCAL cFilterExpr

cFilterExpr = this.cFilterExpr

SET FILTER to &cFilterExpr

ENDIF

LOCAL lRetCode

lRetCode = CDataFormPage::Init()

_screen.LockScreen = .F.

RETURN lRetCode

For additional information please refer to the separate Visual Extend User Manual.


 cEmptyMessage Property

This property defines which text should be displayed when the current data manipulation form is empty. See also the property lHideWhenEmpty.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar,  COneToMany, COneToManyBar

Syntax

Form.cEmptyMessage[ = cExpr]

Settings

cExpr

Setting	Description
(Empty)	(Default) Default text "There are no items to show in this view" is used
(any other text)	Alternate Text is used to display when form is empty


 cFilterExpr Property

Filter expression used for restricting the current set of records which are processed within a data manipulation form.

Applies To

CPickField, CPickTextbox, CDataForm, CDataFormPage, CDataFormPageBar,  COneToMany, COneToManyBar

Syntax

Form.cFilterExpr[ = cExpr]

Remarks

In the case of the CDataForm, CDataFormPage and COneToMany, this Property will usually be set in the Init() method of the form which has been called from another form via the onMore Method. In the Picklist classes CPickField and CPickTextbox, this property equally defines the filter condition which will be used for the picklist table.

Example

The following example shows the usage of this property in the CDataForm, CDataFormPage and COneToMany class from within the Init() method of the form.

LPARAMETERS tcArg

_screen.LockScreen = .T.

IF !EMPTY(tcArg)

IF getArgCount(tcArg) <> 0

this.cCalledBy      = UPPER(  getArg(tcArg,1)        )

this.cFixFieldValue = STRTRAN(getArg(tcArg,2),'@',';')

thisForm.Caption    =         getArg(tcArg,3)

this.cFixFieldName  = STRTRAN(getArg(tcArg,4),'@',';')

this.cFilterExpr    = UPPER(  getArg(tcArg,5)        )

this.lPutInLastFile  = .F.

IF this.cCalledBy = 'EMPLOYEE'

this.pgfPageFrame.Page1.cntEmp_ID.lFixField = .T.

ENDIF

ENDIF

ENDIF

IF !this.lWorkOnView AND !EMPTY(this.cFilterExpr)

LOCAL cFilterExpr

cFilterExpr = this.cFilterExpr

SET FILTER to &cFilterExpr

ENDIF

LOCAL lRetCode

lRetCode = CDataFormPage::Init()

_screen.LockScreen = .F.

RETURN lRetCode

NOTE: Make sure that your expression is Rushmore Optimizable whenever possible for best performance.

For additional information please refer to the separate Visual Extend User Manual.


 cFixFieldName Property

Name of the field in the child table, which is the link to the parent table from the parent form. Used in a form that has been called from another form.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cFixFieldName[ = cExpr]

Remarks

This property will automatically be set in the Init() method of the form. Depending on who called the form, the cFixFieldName property holds the name of the field which acts as the parent field.

Example

If the orders form gets called from the employee form (only the orders of a specific employee are visible in the child form), the cFixFieldName property stores the name of the field in the child table, which defines the relational link to the parent table, like "EMP_ID".

You define in the onMore() event, how child forms are called from a parent form. Here an example for the Init() code of the child form:

LPARAMETERS tcArg

_screen.LockScreen = .T.

IF !EMPTY(tcArg)

IF getArgCount(tcArg) <> 0

this.cCalledBy      = UPPER(  getArg(tcArg,1)        )

this.cFixFieldValue = STRTRAN(getArg(tcArg,2),'@',';')

thisForm.Caption    =         getArg(tcArg,3)

this.cFixFieldName  = STRTRAN(getArg(tcArg,4),'@',';')

this.cFilterExpr    = UPPER(  getArg(tcArg,5)        )

this.lPutInLastFile  = .F.

IF this.cCalledBy = 'EMPLOYEE'

this.pgfPageFrame.Page1.cntEmp_ID.lFixField = .T.

ENDIF

ENDIF

ENDIF

IF !this.lWorkOnView AND !EMPTY(this.cFilterExpr)

LOCAL cFilterExpr

cFilterExpr = this.cFilterExpr

SET FILTER to &cFilterExpr

ENDIF

LOCAL lRetCode

lRetCode = CDataFormPage::Init()

_screen.LockScreen = .F.

RETURN lRetCode

NOTE : If you have to define more than one FixField, VFX assumes that you pass them within the same part of the parameter string, just separated by the @ sign.

For additional information please refer to the separate Visual Extend User Manual.


 cFixFieldValue Property

Value of the parent field, for which the child form has been called.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cFixFieldValue[ = xExpr]

Remarks

This property will automatically be set in the Init() method of the form. Depending on who called the form, the cFixFieldValue property holds the value of the field which acts as the parent field.

Example

If the orders form gets called from the employee form (only the orders of a specific employee are visible in the child form), the cFixFieldValue property equals to the value of the field from the parent table, which defines the relational link to the parent table, like "1000323". In other words: process all orders for employee with the code "1000323".

You define in the onMore() event, how child forms are called from a parent form. Here an example for the Init() code of the child form:

LPARAMETERS tcArg

_screen.LockScreen = .T.

IF !EMPTY(tcArg)

IF getArgCount(tcArg) <> 0

this.cCalledBy      = UPPER(  getArg(tcArg,1)        )

this.cFixFieldValue = STRTRAN(getArg(tcArg,2),'@',';')

thisForm.Caption    =         getArg(tcArg,3)

this.cFixFieldName  = STRTRAN(getArg(tcArg,4),'@',';')

this.cFilterExpr    = UPPER(  getArg(tcArg,5)        )

this.lPutInLastFile  = .F.

IF this.cCalledBy = 'EMPLOYEE'

this.pgfPageFrame.Page1.cntEmp_ID.lFixField = .T.

ENDIF

ENDIF

ENDIF

IF !this.lWorkOnView AND !EMPTY(this.cFilterExpr)

LOCAL cFilterExpr

cFilterExpr = this.cFilterExpr

SET FILTER to &cFilterExpr

ENDIF

LOCAL lRetCode

lRetCode = CDataFormPage::Init()

_screen.LockScreen = .F.

RETURN lRetCode

NOTE : If you have to define more than one FixField, VFX assumes that you pass them within the same part of the parameter string, just separated by the @ sign.

For additional information please refer to the separate Visual Extend User Manual.


 cFormCaption Property

The initial form caption.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cFormCaption[ = cExpr]

Remarks

Can be used whenever you need to know what the form's caption was just after the form has been loaded.


 cChildFormMgrClass Property

VFX uses the class CChildFormManager to manage linked child forms. If for any reason you need to subclass or change the childform manager class, this property allows you to define which class will be used instead of the original.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cChildFormMgr[ = cExpr]

Settings

cExpr

Setting	Description
"cChildFormManager "	(Default) Name of the class which will be used as childform manager class
(any name of a class)	Name of alternate class


 cIDXMgrClass Property

VFX uses the class CIDXManager to manage temporary index files, so called IDX files.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cIDXManager[ = cExpr]

Settings

cExpr

Setting	Description
" CIDXManager"	(Default) Name of the class which will be used as IDX manager class
(any name of a class)	Name of alternate class

NOTE: Make sure to fully understand the VFP (NOT VFX!) implications of IDX files: IDX files cannot be part of transactions. Whenever you issue a BEGIN TRANSACTION, you must make sure that all IDX files are closed, otherwise an error occurs. Also if you have in whatever form (also when private datasessions are used) a table buffering mode (5), your program will crash whenever you try to create an IDX file!


 cRecordMgrClass Property

VFX uses the class CDataTableMgr as record manager class.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cRecordMgrClass[ = cExpr]

Settings

cExpr

Setting	Description
" CDataTableMgr "	(Default) Name of the class which will be used as record manager class
(any name of a class)	Name of alternate class


 cResizeCtrlClass Property

VFX uses the class CResizeCtrl to manage the resize operations of forms. If for any reason you need to subclass or change the resize class, this property allows you to define which class will be used instead of the original.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cResizeCtrl[ = cExpr]

Settings

cExpr

Setting	Description
" CResizeCtrl "	(Default) Name of the class which will be used as resize class
(any name of a class)	Name of alternate class


 cFormName Property

The initial form name.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cFormName[ = cExpr]

Remarks

Can be used whenever you need to know what the form's initial name was just after the form has been loaded. The VFX resource file entries are based on this form name property.


 cHookFunction Property

This defines, which function is used to process a hook operation. See also explanations in the update and release notes of VFX 5.0 as well as in the nEnableHook property.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cHookFunction[ = cExpr]

Settings

cExpr

Setting	Description
.F.	(Default) Use EventHookHandler as function which handles the hooks (see vfxhook.prg)
(any procedure)	Name of alternate hook function which will process the hook request


 lUseHook Property

This property defines, whether on form level hook operations should be called or not. See also the application class property nEnableHook for further explanations regarding hooks.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lUseHook[ = lExpr]

Settings

lExpr

Setting	Description
.F.	(Default) Don't make hook calls
.T.	Make hook calls


 cMenuForm Property

This property indicates the name of the menu which will be opened whenever the form is activated.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cQueryArg[ = cExpr]

Remarks

Feature not yet released


 cQueryArg Property

Query argument string, used in Client Server forms for automizing the usage of multi parameters queries. See also lWorkOnView.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cQueryArg[ = cExpr]

Remarks

In a complex client server form, the views which are used to access the data, will usually not be simple queries but rather queries with one or several query parameters. The VFX framework automizes the usage of parameter views by providing this property which can automatically store any parameter string holding up to five individual query parameter values, separated by semicolumns. These individual query parameters will be called cQueryArg1..up to cQueryArg5 and are automatically defined in the requery() method of the client server form based on the value of the cQueryArg property which usually will be set in the init method (see following example) of the Client Server form. The function GetArg() is used to parse the string cQueryArg to get the individual parameter values.

NOTE: You must set the VFX form property lWorkOnView to true, otherwise the above described preparation of the query parameter variables will not take place!

Example

The following could be placed in the init() method of the Client Server form.

IF this.lWorkOnView

thisForm.cQueryArg = this.cFixFieldValue

ENDIF


 cReportName Property

This property defines which report will be used when the user calls the onPrint() method either with the print or preview toolbar button.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cReportName[ = cExpr]

Remarks

Enter the name of the report without the FRX filename extension. This report will be used when the user selects print or preview. This property comes in handy when there is only one report per form.


 cSearchFilterExpr Property

Additional search filter returned by the search dialog.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cSearchFilterExpr[ = cExpr]

Remarks

The search filter expression used to filter the presented data in the form acts like an additional filter. If the table has already an active filter based for example on cFilterExpr, the filter will be added to the already existing one.


 cSearchForm Property

Name of the search form to be called when the user calls the search form.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cSearchForm[ = cExpr]

Remarks

Usually, the search form which will be called from the onSearch() event is the VFXSRCH form, which is based on the form class CSearchDialog.

If you need to customize the search functionality, you might create an advanced search form class, create a form dialog which inherits from your search form class and use this form instead of the standard VFX search form.


 lUseSetKeyAsFilter Property

This property can be used, if rather than the SET FILTER TO the SET KEY TO command should be used for performance reasons. This may be an issue, if you are working on huge dbf tables in a file server environment without useing views. Doing so, you will usually set a filter using a RUSHMORE optimizable expression. Nevertheless, VFP looses sometimes rushmore optimization when you have a grid on a form. Thats why we implemented this work around. See also the tutorial

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lUseSetKeyAsFilter[ = lExpr]

Remarks

See also cSetKeyExpr, cSetKeyIndex, cSetKeyValue.

Example

In the following example, the Init() method of the child form (which in this example can be called from different parent forms namely Country and Company) is displayed:

LPARAMETERS tcArg

LOCAL cFilterExpr, lcCaption

IF !EMPTY(tcArg)

IF getArgCount(tcArg) <> 0

this.cCalledBy      = UPPER(  getArg(tcArg,1)        )

this.cFixFieldValue = STRTRAN(getArg(tcArg,2),"@",";")

this.Caption        =         getArg(tcArg,3)

this.cFixFieldName  = STRTRAN(getArg(tcArg,4),"@",";")

this.cFilterExpr    = UPPER(  getArg(tcArg,5)        )

this.lPutInLastFile  = .F.

lcCaption = this.Caption

thisForm.lUseSetKeyAsFilter = .T.

DO CASE

   CASE this.cCalledBy = "CTRY"

      this.pgfPageFrame.Page1.cntpers_ctry_id.lFixField = .T.

      this.pgfPageFrame.Page3.cntpers_comp_id.lFixField = .F.

  this.cSetKeyIndex = "CTRY"

  this.cSetKeyValue = this.cFixFieldValue

  this.cSetKeyExpr  = "upper(pers_ctry_id)"

CASE this.cCalledBy = "COMP"

      this.pgfPageFrame.Page1.cntpers_ctry_id.lFixField = .F.

      this.pgfPageFrame.Page3.cntpers_comp_id.lFixField = .T.

  this.cSetKeyIndex = "COMP_X"

  this.cSetKeyValue = this.cFixFieldValue

  this.cSetKeyExpr  = "upper(pers_comp_id)"

ENDCASE

ENDIF

ENDIF

IF this.lWorkOnView

this.cQueryArg = this.cFixfieldValue

ENDIF

lInitOk =eval(this.Class+"::init(tcArg)")

=PrepPERSGrid(This.pgfPageFrame.Page4.grdGrid)

if !empty(lcCaption)

thisForm.Caption = lcCaption

endif

RETURN lInitOk

In the above example the code from the calling parent form was exactly the same as if it would work with a SET FILTER TO in the child form, resp. with views: Here the onMore() method of the calling child form:

LPARAMETER tnIndex

SELECT (ThisForm.cWorkAlias)

LOCAL aFunct

* Argument List (ColumnNo 5)

* 1 - cCalledBy

* 2 - cFixFieldValue

* 3 - Caption

* 4 - cFixFieldName

* 5 - cFilterExpr

DIMENSION aFunct[4,5]

aFunct[1,1]	=	"Personen"

aFunct[1,2]	=	"Personen zur angewählten Firma"

aFunct[1,3]	=	"F"

aFunct[1,4]	=	"PERS"

aFunct[1,5]	=	"COMP" + ";" + ;

UPPER(COMP_ID) + ";" + ;

"Personen zur Firma " + TRIM(COMP_NAME) + ";" + ;

"PERS_COMP_ID" + ";" + ;

"UPPER(PERS_COMP_ID)=" + "'" + UPPER(COMP_ID) + "'"

aFunct[2,1]	=	"Projekte"

aFunct[2,2]	=	"Projekte zur angewählten Firma"

aFunct[2,3]	=	"F"

aFunct[2,4]	=	"PROJ"

aFunct[2,5]	=	"COMP" + ";" + ;

UPPER(COMP_ID) + ";" + ;

"Projekte zur Firma " + TRIM(COMP_NAME) + ";" + ;

"PROJ_COMP_ID" + ";" + ;

"UPPER(PROJ_COMP_ID)=" + "'" + UPPER(COMP_ID) + "'"

aFunct[3,1]	=	"Kontakte"

aFunct[3,2]	=	"Kontakte zur angewählten Firma"

aFunct[3,3]	=	"F"

aFunct[3,4]	=	"CONT"

aFunct[3,5]	=	"COMP" + ";" + ;

UPPER(COMP_ID) + ";" + ;

"Kontakte zur Firma " + TRIM(COMP_NAME) + ";" + ;

"CONT_COMP_ID" + ";" + ;

"UPPER(CONT_COMP_ID)=" + "'" + UPPER(COMP_ID) + "'"

aFunct[4,1]	=	"Schlüsselfelder"

aFunct[4,2]	=	"Schlüsselfelder zur angewählten Firma"

aFunct[4,3]	=	"F"

aFunct[4,4]	=	"KEYDATA"

aFunct[4,5]	=	"COMP" + ";" + ;

UPPER(COMP_ID) + ";" + ;

"Schlüsselfelder zur Firma " + TRIM(COMP_NAME) + ";" + ;

"OBJ" + ";" + ;

"OBJTYPE='COMP' AND UPPER(OBJ)=" + "'" + UPPER(COMP_ID) + "'"

IF EMPTY(tnIndex)

DO FORM VFXMORE WITH aFunct, this

ELSE

DO FORM VFXMORE WITH aFunct, tnIndex, this

ENDIF

goProgram.RefreshWindowMenu()


 cSetKeyExpr Property

This property can be used, if rather than the SET FILTER TO the SET KEY TO command should be used for performance reasons.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cSetKeyExpr[ = cExpr]

Remarks

See also lUseSetKeyAsFilter.

Example

See under lUseSetKeyAsFilter.


 cSetKeyIndex Property

This property can be used, if rather than the SET FILTER TO the SET KEY TO command should be used for performance reasons.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cSetKeyExpr[ = cExpr]

Remarks

See also lUseSetKeyAsFilter.

Example

See under lUseSetKeyAsFilter.


 cSetKeyValue Property

This property can be used, if rather than the SET FILTER TO the SET KEY TO command should be used for performance reasons.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cSetKeyValue[ = xExpr]

Remarks

See also lUseSetKeyAsFilter.

Example

See under lUseSetKeyAsFilter.


 cTempIndex Property

Temporary index expression for IDX indexes. See also ClearIDX() method.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cTempIndex[ = cExpr]

Remarks

Temporary index files are created using the IDX Index file technique. This is the only way to allow individual users to generate different indexes on the same table simultanously in a multi user environment.

NOTE: However, it is important to know, that as soon as you have any open IDX files Visual FoxPro cannot start with a BEGIN TRANSACTION. That's why VFX provides the method CFoxApp ClearIDX.


 cToolbarClass Property

Name of the toolbar associated with a form. VFX handles transparently all the show/ hide/ no double ... problems for you. You just define the name of the toolbar class you want to associate with your form.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cToolbarClass[ = cExpr]

Remarks

To associate a toolbar with a form could not be easier: Just set the property cToolbarClass to the name of the toolbar class you want to use for your form. VFX handles all the toolbar management automatically and for you as programmer no additional programming tasks are necessary. If a user closes the form toolbar, it can be reactivated through the menu option View/ Toolbars...


 cViewIndexExpr Property

Index expression for a view in a Client Server form. If you don't have a view ordered by, you can define, how this view should be sorted initially.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cViewIndexExpr[ = cExpr]

Remarks

This property will usually be set during design of a Client Server form. It is the index expression which will be used, when the form is displayed the first time.

NOTE: Since the actual sort order of a form is stored in the VFXRES resource file, the sort you see on your form might differ from the one you expect since the user left the current form with an alternate active sort order.


 cWorkAlias Property

Main working alias, defaults to the InitialSelectedAlias property from the data environment.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cWorkAlias[ = cExpr]

Remarks

This property is extremely useful if you have a form with multiple involved tables, like for example a OneToMany form.

Example

If you must make sure that prior a specific operation the current alias is not another than the expected one, just use this code:

SELECT(this.cWorkAlias)

before continuing your work.


 cWorkTag Property

Initial working tag.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.cWorkTag[ = cExpr]

Remarks

Internal use only.


 cViewParameter Property

This property will be used to populate the query variable with the same name as the value of this property when this control get's used on a CAskViewArg form.

Applies To

CCombobox, CEditbox , CFixField, CKeyField, CListbox, COptionGroup, CPickField, CSpinner, CTextbox

Syntax

Control.cViewParameter[ = cExpr]

Settings

cExpr

Setting	Description
Empty	(Default) No variable will be filled with the entered value when used on a CAskViewArg based form
Query VarName	Name of the query variable which will be filled when this control is used on a CAskViewArg based form

Remarks

VFX automatically sets the controlsource of the control to the value set in the cViewParameter property when this control is used on a CAskViewArg based form. The CAskViewArg form class can be used to fetch parameters for a parametrized view in an easy and convenient way. You could of course also do all of this manually but it's convenient to have VFX handle this.

Example

If the property cViewParameter has the value "QueryArgX", the variable QueryArgX will automatically be used as the new controlsource for the field when the field is used on a CAskViewArg based form. This is typically the case when you copy and paste controls from your data manipulation form to the CAskViewArg based form. Once you set the cViewParameter form it becomes easy to create your custom selection screen by copying and pasting single controls from your data manipulation form to the CAskViewArg based form.

NOTE: See also the VFX Test Application. There is a form (see File/ Open/ Page Client Server) which shows the usage of the CAskViewArg form. Additional information you find also in the tutorial.


 lUseSysColor Property

This property defines whether the form or control will automatically be synchronized with the windows system colors or not.

Applies To

CCheckbox, CCombobox, CContainer, CEditbox , CFixField, CKeyField, CLabel, CListbox, COptionGroup, CPageFrame, CPickField, CSpinner, CTextbox, CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Control.lUseSysColor[ = lExpr]

Settings

cExpr

Setting	Description
.T.	(Default) The windows system colors will define which fore and background colors are used for the selected control
.F.	The colors specified in the design phase will be used during runtime

Remarks

Be sure to set this property to .F. whenever you want to control the colors independantly from the current windows settings!


 ExtraBuffer Property

Additional user buffer, like the Visual FoxPro Tag property.

Applies To

CCheckbox, CChildGrid, CCombobox, CCommandbutton, CCommandGroup, CContainer, CEditbox , CFoxApp, CFixField, CGrid, CFoxApp, CGauge, CImage, CKeyField, CLabel, CLineClass, CListbox,CNavigator, COfficeBar, COleBoundControl, COptionGroup, CPageFrame, CPickField, CPickGrid, CPickTextBox, CPushPin, CShape, CSpinner, CTextbox, CTimer, CToolbar, CDataTableMgr

Syntax

Form.ExtraBuffer[ = xExpr]

Remarks

Info for Clipper 5 programmers: This is the same as your Cargo property.


 cAliasName Property

In the CDataTableMgr class this property defines which alias is the one on which the current record operation will be performed.

Applies To

CDataTableMgr

Syntax

Form.cAliasName[ = cExpr]

Note

The current alias will just temporary be set to cAliasName. It will be reset after each operation within CDataTableMgr methods.


 Delete Method

In the CDataTableMgr class this method is used to delete the current record. Works on the alias defined via CAliasName.

Applies To

CDataTableMgr

Syntax

Form.Delete()

Returns

lExpr

Setting	Description
True (.T.)	Delete was successfull
False (.F.)	Delete failed


 GoBottom Method

In the CDataTableMgr class this method is used to go to the bottom of the current table or view. Works on the alias defined via CAliasName.

Applies To

CDataTableMgr

Syntax

Form.GoBottom()

Note

This method code has been optimized for maximum performance also on filtered tables.


 GoTop Method

In the CDataTableMgr class this method is used to go to the top of the current table or view. Works on the alias defined via CAliasName.

Applies To

CDataTableMgr

Syntax

Form.GoTop()

Note

This method code has been optimized for maximum performance also on filtered tables.


 Insert Method

In the CDataTableMgr class this method is used to insert a record using the APPEND BLANK command. Works on the alias defined via CAliasName.

Applies To

CDataTableMgr

Syntax

Form.Insert()

Note

If you need to add a lot of records in series use INSERT INTO instead, this works faster than APPEND BLANK.


 Modified Method

In the CDataTableMgr class this method is used to detect whether the current record has been modified using the getfldstate() function. Works on the alias defined via CAliasName.

Applies To

CDataTableMgr

Syntax

Form.Modified()

Returns

lExpr

Setting	Description
True (.T.)	Record has been modified
False (.F.)	Record has not been modified


 Next Method

In the CDataTableMgr class this method is used to go to the next record in the current table or view defined via CAliasName.

Applies To

CDataTableMgr

Syntax

Form.Next()

Note

This method code has been optimized for maximum performance also on filtered tables.


 Previous Method

In the CDataTableMgr class this method is used to go to the previous record in the current table or view defined via CAliasName.

Applies To

CDataTableMgr

Syntax

Form.Previous()

Note

This method code has been optimized for maximum performance also on filtered tables.


 Save Method

In the CDataTableMgr class this method is used to save record(s). Works on all open tables using the aused() function if a true parameter will be passed.

Applies To

CDataTableMgr

Syntax

Form.Save(tlAllTables)

Arguments

tlAllTables

Setting	Description
True (.T.)	Records in all tables will be saved
False (.F.)	Only records in table defined via CAliasName will be saved

Returns

lExpr

Setting	Description
True (.T.)	Save was successfull
False (.F.)	Save failed


 Undo Method

In the CDataTableMgr class this method is used to undo changes on the current record(s). Works on all open tables using the aused() function.

Applies To

CDataTableMgr

Syntax

Form.Undo()

Returns

lExpr

Setting	Description
True (.T.)	Save was successfull
False (.F.)	Save failed


 Update Method

In the CDataTableMgr class this method is used to update changes on the current record. Works on the alias defined via CAliasName.

Applies To

CDataTableMgr

Syntax

Form.Update()

Returns

lExpr

Setting	Description
True (.T.)	Update was successfull
False (.F.)	Update failed


 lAskToSave Property

This property can be used to define, whether a confirmation should be displayed when the user makes rapid data entry using the CTRL+N keyboard shortcut sequentally. See also AskToSave() method.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lAskToSave[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	Confirmation is needed to save newly inserted record before inserting the next one.
False (.F.)	(Default) No Confirmation is needed to save newly inserted record before inserting the next one.


 lAutoEdit Property

Set this property to true if you want to enable to directly switching to edit mode whenever the user starts entering data in a form control or clicks on a checkbox, option group or combobox.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lAutoEdit[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) The form switches automatically to edit mode when user inputs data.
False (.F.)	The user must explicitely switch to edit mode before data entry is possible.


 lCanDelete Property

Defines whether the user can delete records within the current form.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lCanDelete[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) The user can delete records. The delete option is enabled.
False (.F.)	The user cannot delete records. The delete option is disabled.


 lCanEdit Property

Defines whether user can edit records within the current form.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lCanEdit[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) The user can edit records. The edit option is enabled.
False (.F.)	The user cannot edit records. The edit option is disabled.


 lCanInsert Property

Defines whether user can insert records within the current form.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lCanInsert[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) The user can insert records. The insert option is enabled.
False (.F.)	The user cannot insert records. The insert option is disabled.


 lCascade Property

Defines whether the form will open with a cascade effect based on the already existing forms.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lCascade[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) The first time a user calls this form, the form will be opened with a cascade effect.
False (.F.)	The form will be opened as defined by the programmer during design time or any other defined settings.

NOTE: Since the actual position of a form is stored in the VFXRES resource file, the position you see might differ from the one you expect since the user left the current form with an alternate position.


 lChildForm Property

Property which defines whether the current form is a child form. See also onSetChildData Event.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lChildForm[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	Form acts as a child form
False (.F.)	(Default) form does not act as a child form


 lCloseChildFormonExit Property

Defines whether child forms should be closed when the parent form gets closed. See also the onSetChildData() method.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lCloseChildFormonExit[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	Child forms will be closed when parent form closes
False (.F.)	(Default) Child forms keep alive also when parent form closes


 lCloseOnEsc Property

Defines whether the form can be closed with the ESC key.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lCloseOnEsc[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) The form can be closed using the ESC key.
False (.F.)	The form cannot be closed using the ESC key.


 lMultiInstance Property

By default all of the forms you create with VFX can be called multiple times (so called multi instanciation). This is a great feature, all you have to remember to use multiinstanciation is to set the form to private data session.

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.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lMultiInstance[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) The form can be called many times simultanously
False (.F.)	The form can only be called once


 lnHotKeyRefresh Property

This property allows you to set the keyboard hotkey which will be used to call the refresh method of the form.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lnHotKeyRefresh[ = nExpr]

Settings

nExpr

Setting	Description
-4	(Default) F5 calls the refresh method of the active
(Other)	Other hot key using number

Remarks

F5 is the default to be compatible with other windows apps as the file explorer.


 lEmpty Property

Informs whether the current table or set of records is empty.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lEmpty[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	The main table or cursor for the table is empty or the filter has been defined in a way that no matching records could be found.
False (.F.)	The main table or cursor for the table contains records.

Remarks

You can use this property to enable or disable any options.


 lEnterIsEdit Property

This property defines whether ENTER which calls the onKeyEnter() method should directly switch to edit mode or not.

Applies To

CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lEnterIsEdit[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	Pressing ENTER switches directly to edit mode.
False (.F.)	(Default) Enter does not switch directly to edit mode


 lFilterOn Property

Informs whether a filter based on the search dialog has been set. See also onSearch().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lFilterOn[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	In the search dialog a search filter has been set.
False (.F.)	(Default) No search filter has been set.

Remarks

Don't mix up this search filter information with the cFilterExpr filter used in a child form. Although when the cFilterExpr has been set, the lFilterOn property can be false. VFX handles automatically the situation where you have a filter in a child form and a search filter simultanously.


 lMore Property

Defines whether there are more functions which can be called using the More command from the Edit menu (F6), the corresponding form command button or the main toolbar. See also onMore().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lMore[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	Process the code in the onMore() method if user selects more... (F6)
False (.F.)	(Default) The more option is not available

Remarks

We introduced this property for Visual FoxPro 3.0. In Version 3.0b of Visual FoxPro this property could be droped. For now, just make sure that during design time, whenever you want that the code in the onMore() method gets processed when the user selects the more function option, the property lMore is set to true.


 lHideWhenEmpty Property

This property defines whether the message "there are no items to show in this view" should appear when the dataform is empty. To change the message to be displayed see the property cEmptyMessage. See also nHideWhenEmpty.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lHideWhenEmpty[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) When no records are available on the data form, the message
False (.F.)	The form will not be put into the Window menu.


 nHideWhenEmpty Property

Basically the form property lHideWhenEmpty defines whether the message "there are no items to show in this view" should appear when the dataform is empty. To change the message to be displayed see the property cEmptyMessage. However you can modify the overall behaviour by setting the application class property nHideWhenEmpty to have the same behaviour in all of your forms.

Applies To

CFoxApp

Syntax

goProgram.nHideWhenEmpty[ = nExpr]

Settings

nExpr

Setting	Description
0	(Default) The form property lHideWhenEmpty defines whether empty message appears when form is empty
1	The form property lHideWhenEmpty will be forced to True
2	The form property lHideWhenEmpty will be forced to False


 lPutInLastFile Property

Defines whether you want to put the form caption in the recently used file list in the File menu.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar


 lPutInWindwoMenu Property

Defines whether you want to put the form while running in the Windows menu. See also nWinMnuCount, RefreshWindowMenu().

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lPutInWindowMenu[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) The form, when running, will automatically be available in the Window menu for easier Window switching when multiple windows are open.
False (.F.)	The form will not be put into the Window menu.

Remarks

If this property is set to true, the whole window menu management is done automatically. You don't have to set any other property, like nWinMnuCount, manually.


 lSavePosition Property

Defines whether you want that all the position and other form settings are stored within the VFX Resource File. See also SavePosition().

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar, COfficebar

Syntax

Form.lSavePosition[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) The form setings are stored in the VFX resource file and restored whenever the user calls the same form again.
False (.F.)	No form settings are stored in the VFX resource file. The form appears always as defined during design time.

Remarks

To see, what form settings are stored in the VFX resource file, refer to the help topic VFX tables and refer to the VFXRES.DBF.


 lUseChildForm Property

Visual Extend allows you to create child forms which are linked to a parent form. If a parent form calls a child form, you can define on parent form level, whether the called child form(s) will be dynamically linked with the parent form or not. The parent form property lUseChildForm defines whether the parent form has linked child forms or not.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lUseChildForm[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	The parent form has child forms
False (.F.)	(Default) The parent form has no child forms

Remarks

See also the tutorial about how to create linked child forms and the property lAutoSynchChildForm resp. the events onSetChildData() and onRefreshParent().

Note: If you dont know how to call a child form from a parent form using the onMore() event, please refer to the user manual for additional information.


 lShowToolbar  Property

Visual Extend allows you to create forms with external toolbar easily. Just use the form property cToolbarclass to define which toolbar you want to open whenever the specific form is active. To force the display of the toolbar regardless of the users resource setting, you can use the lShowtoolbar property as explained here.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lShowToolbar[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	The toolbar which is associated with this form will be shown
False (.F.)	(Default) The toolbar will not be shown.

Remarks

This property is mainly used internally to save and restore the user specific settings regarding the toolbar for a specific form. However it can be usefull to know, how you can use this property to force the activation of the toolbar whenever the form is active.

Example

This example shows how this property can be used to force the toolbar to show always whenever the form loads:

Init() method of the form:

lparameters tcArg

local lInitOk

lInitOk = eval(this.Class+"::Init(tcArg)")

*****************************************

** Your initialization code ...

**force the toolbar

if !this.lshowtoolbar

this.lshowtoolbar = .t.

this.RefreshToolbar(.t.)

endif

return lInitOk


 lWorkOnView Property

Defines whether the form works on a Client Server view or not. See also cQueryArg.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar, cPickField

Syntax

Form.lWorkOnView[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	The form or pickfield works with Client Server views.
False (.F.)	(Default) The form or pickfield works with local tables.

Remarks

Set this property to true, whenever you want to create Client Server forms, regardless whether you are using local or remote views.

NOTE: See the VFX Test Application for further information and samples regarding the usage of forms and Pickfields in a C/S environment. Additional information regarding you will find in the tutorial.


 nFormStatus Property

Status of the data manipulation form.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.nFormStatus[ = nExpr]

Settings

nExpr

Setting	Description
0	The form is in normal View mode.
1	The form is in Edit mode.
2	The form is in Insert mode.

Remarks

Normally, you will not use this property. It is mainly internally used. All the synchronisation between form command buttons, menu and toolbar is handled automatically.


 nLockScreen Property

Lock Screen counter. Used to optimize screen refresh operations. See also DispBegin() and DispEnd() methods.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.nLockScreen[ = nExpr]

Settings

nExpr

Setting	Description
Any number >= 0	Number indicating the nesting level of  DispBegin() calls.

Remarks

DispBegin() and DispEnd() methods.


 uRetCode Property

This property can be used in forms which inherit from the CModalForm class to easily return a value from this form.

Applies To

CModalForm

Example

If you call the modal form like this:

DO FORM formname TO lcmyvar

you must have a line simmilar to this in the unload() method of your form to retiurn the returmn value from the form to your variuable:

RETURN lcanyretval

To make you live easier, you can just set the form property uRetCode to the desired value (anywhere in your code) and the value will be returned without the need to touch the unload method of your modal form.


 nOldRecno Property

Old record number of the main working table.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.nOldRecno[ = nExpr]

Settings

nExpr

Setting	Description
Any valid record number	Record number of the current main working table.

Remarks

Mainly internally used.


 nWarningLevel Property

Defines the level of detail for update conflict messages.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.nWarningLevel[ = nExpr]

Settings

nExpr

Setting	Description
0	One standard warning message per conflicting record..
1	More detailed warning messages for every conflict on field level.

Remarks

Under construction. Give us your feedback!


 AskToSave Method

Method which is called whenever user must confirm a save operation. See also nAskToSave resp. lAskToSave.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.AskToSave()


 ClearIDX Method

Close and erase all temporary IDX files. See also nIDXCount and ClearAllIDX().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.ClearIDX()

Remarks

If IDX Index Files are open, no BEGIN / END Transaction Code can be processed for this table. This is a Visual FoxPro restriction in handling the mechanics of Table Buffering, That's why VFX uses the Method ClearIDX.


 DispBegin Method

Enhanced LockScreen .T. replacement which can be cascaded for optimal screen repaint performance. See also nLockScreen and DispEnd().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.DispBegin()

Remarks

Since the Visual FoxPro LockScreen Property can not be cascaded, because every cascaded element who would set LockScreen to False would make the screen repaint visible again, you need a more powerful solution if you want to optimize screen locking also in cascaded method or function calls. If you issue a DispBegin(), the LockScreen is set to .T. to and the nLockScreen counter is incremented. Whenever you call a DispEnd(), the nLockScreen counter is decreased and only if it arrives back to zero, a LockScreen=.F. will be issued. That way you will have screen repaint freezing also in cascaded situations.


 DispEnd Method

Enhanced LockScreen .F. replacement which can be cascaded for optimal screen repaint performance. See also nLockScreen. See also notes under DispBegin().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.DispEnd(lForceScreenUpdate)

Arguments

tlForceScreenUpdate

Pass true, if you want to force the screen update and reset nLockScreen to 0.

Remarks

If you pass .T. to DispEnd(), the LockScreen Form property as well as the _Screen LockScreen Property will be forced to .F. and nLockScreen counter is set to zero


 ErrorHandler Method

Error handler for table rules.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.ErrorHandler(nError)

Arguments

nError

Error number.

Remarks

Will automatically be called by the onSave() method if the Tableupdate() was not successful


 FieldError Method

Called by ErrorHandler() when field trigger is violated.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.FieldError()

Remarks

Will automatically be called by the ErrorHandler() method if a FieldError occurred.


 LangSetup Method

Called by the Init() method, used for localization of the form.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar, CNavigator,

CToolbar, COfficebar, CGaugeWin

Syntax

Form.LangSetup()

Remarks

The LangSetup method is automatically called whenever the form is called through the form's Init() method. That makes it easy to locate localization code for your forms: All such code can be placed in the LangSetup method. Please refer also to the chapter Creating Multilingual Applications using VFX in the separate Visual Extend User Manual.

NOTE: Use the VFX LangSetup Builder to generate the content of this method and the VFX message editor to translate the captions and messages. Refer to the VFX user manual for additional information about this.


 LoadPosition Method

Called when the form will be opened and lSavePosition is true. See also SavePosition().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.LoadPosition()

Remarks

Will automatically be called by the Init() method of the form if lSavePosition is set to true.


 odbcError Method

Called by ErrorHandler() when odbc trigger is violated.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.odbcError()

Remarks

Will automatically be called by the ErrorHandler() method if a odbcError occurred.


 RecordChanged Method

Returns true if the current record has been changed, otherwise returns false.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.RecordChanged()

Returns

lExpr

Setting	Description
True	Record has been changed by the user.
False	Record has not been changed by the user.

Remarks

Usually internal use only.


 RecordError Method

Called by ErrorHandler() when record trigger is violated.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.RecordError()

Remarks

Will automatically be called by the ErrorHandler() method if a record trigger error occurred.


 RefreshToolbar Method

Automatically called from various form methods such as Activate() and Deactivate() to synchronize the form's toolbar, if available. See also cToolbarClass, lShowToolbar.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.RefreshToolbar()

Remarks

Internal use.


 Requery Method

Requeries the data if lWorkOnView resp. positions on top and sets the lEmpty property if working with local tables.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar, CGrid, CChildGrid, CDataTableMgr

Syntax

Form.Rquery()

Remarks

Will automatically be called to requery data. Especially useful in client server forms. Used on the grid cass, this method can be used to write custom code which can be used to simulate a requery also on grid level.


 SavePosition Method

Called when you close a form. Saves the position of the form and some of it's containers, such as the grid including advanced grid settings like columns layout and sort order. See also lSavePosition, LoadPosition(), onSavePosition().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.SavePosition()

Remarks

Automatically called from the Destroy() method to save the form settings in the VFX resource file. Use the onSavePosition() event to customize the form saving procedure.


 SetFont Method

This method is internally used to set the font of the forms in the Mac environment.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.SetFont()


 onChildRequery Event

This method gets called whenever the record in the parent form moves and you need special operations when requerying the child views. See also the onSetChildData() method.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onChildRequery()


 onEmptyForm Event

Event which gets called automatically whenever needed to make sure the message "there are no items to show in this view" gets displayed correctly. See also lHideWhenEmpty.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onEmptyForm()

Remarks

Usually you will not need to call this method explicitely. However when you are in a situation where the message "There are no items to show in this view" a call of this method might fix the problem.


 onBottom Event

Called, when the user selects Move to Bottom of the current table or view. See also onTop(), onPrev(), onNext().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onBottom()

Remarks

Automatically called whenever the user selects to move to the bottom of the current table or view either using the menu or the corresponding form command button. If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onDelete Event

Called when the user selects to delete the current record.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onDelete()

Remarks

Automatically called whenever the user selects to delete the current record either using the menu or the corresponding form command button. If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onEdit Event

Called when the user selects to edit the current record.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onEdit()

Remarks

Automatically called whenever the user selects to edit the current record either using the menu or the corresponding form command button. If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onInsert Event

Called when the user selects to insert a record.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onInsert()

Remarks

Automatically called whenever the user selects to insert a record either using the menu or the corresponding form command button. If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onInit Event

This event fires once before the form will be displayed. It is called from within the form Init() method.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onInit()


 onFormStatusChange Event

This event gets always called whenever the form status of the form changes. See also the property nFormStatus.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar,

Syntax

Form.onFormStatusChange()

Remarks

You will need this event to put code into it when you need to synchronize controls whenever the form status changes and not always by putting code in the refresh method.


 onLoadPosition Event

Called by LoadPosition() Method to read the VFX Resource File Settings.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar, CGrid, CChildGrid, CPickGrid

Syntax

Form.onLoadPosition()

Remarks

If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onParentRefresh Event

This event will be called for a linked child form whenever the parent refreshes. This  event fires only if the parent form has the property lUseChildForm set to true.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onParentRefresh()

Remarks

See also the tutorial.


 onPostInit Event

This event will be called after the init method of the form.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPostInit()

Remarks

Use this event if you want to put custom code for your form which executes before the form displays. Any return values will be ignored. The form loads anyway.


 onMore Event

Called by F6 resp the Edit/ Other... menu option to select from a list of possible choices. See also lMore.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onMore(nPassthrough)

Arguments

nPassthrough

Passing an additional Parameter to onMore() which will be forwarded to VFXMORE (see example below), the selection dialog form does not appear and the selection gets automatically performed. You will find this extremely useful, if you plan to call the same functions also from a toolbar. Just call the onMore() Method with an additional passthrough parameter and the function gets selected without any additional user dialog!

Remarks

If you select the Checkbox More Functions  in the VFX Form Builders, the code template shown in the example below will automatically be generated into the onMore() method. All you have to do is to adapt it to your specific needs. Vice versa, if you select Child Form  in the VFX form builders, you receive a code template for the Init() method. Refer to the user manual for more Information.

Example

Here a code example for an onMore() method, which offers four possible selections while "sitting" on a specific record in the current data manipulation form:

*-------------------------------------------------------

*Code Example of the OnMore()

LPARAMETER tnIndex

SELECT (thisForm.cWorkAlias)

LOCAL aFunct

* Argument List (ColumnNo 5)

* 1 - cCalledBy

* 2 - cFixFieldValue

* 3 - Caption

* 4 - cFixFieldName

* 5 - cFilterExpr

DIMENSION aFunct[4,5]

aFunct[1,1]	=	'Personen'

aFunct[1,2]	=	'Personen zur angewählten Firma'

aFunct[1,3]	=	'F'

aFunct[1,4]	=	'PERS'

aFunct[1,5]	=	'COMP' + ';' + ;

UPPER(COMP_ID) + ';' + ;

'Personen zur Firma ' + TRIM(COMP_NAME) + ';' + ;

'PERS_COMP_ID' + ';' + ;

'UPPER(PERS_COMP_ID)=' + ''' + UPPER(COMP_ID) + '''

aFunct[2,1]	=	'Projekte'

aFunct[2,2]	=	'Projekte zur angewählten Firma'

aFunct[2,3]	=	'F'

aFunct[2,4]	=	'PROJ'

aFunct[2,5]	=	'COMP' + ';' + ;

UPPER(COMP_ID) + ';' + ;

'Projekte zur Firma ' + TRIM(COMP_NAME) + ';' + ;

'PROJ_COMP_ID' + ';' + ;

'UPPER(PROJ_COMP_ID)=' + ''' + UPPER(COMP_ID) + '''

aFunct[3,1]	=	'Kontakte'

aFunct[3,2]	=	'Kontakte zur angewählten Firma'

aFunct[3,3]	=	'F'

aFunct[3,4]	=	'CONT'

aFunct[3,5]	=	'COMP' + ';' + ;

UPPER(COMP_ID) + ';' + ;

'Kontakte zur Firma ' + TRIM(COMP_NAME) + ';' + ;

'CONT_COMP_ID' + ';' + ;

'UPPER(CONT_COMP_ID)=' + ''' + UPPER(COMP_ID) + '''

aFunct[4,1]	=	'Schlüsselfelder'

aFunct[4,2]	=	'Schlüsselfelder zur angewählten Firma'

aFunct[4,3]	=	'F'

aFunct[4,4]	=	'KEYDATA'

aFunct[4,5]	=	'COMP' + ';' + ;

UPPER(COMP_ID) + ';' + ;

'Schlüsselfelder zur Firma ' + TRIM(COMP_NAME) + ';' + ;

'OBJ' + ';' + ;

'OBJTYPE='COMP' AND UPPER(OBJ)=' + ''' + UPPER(COMP_ID) + '''

IF EMPTY(tnIndex)

DO FORM VFXMORE WITH aFunct, this

ELSE

DO FORM VFXMORE WITH aFunct, tnIndex, this

ENDIF

goProgram.RefreshWindowMenu()

*-------------------------------------------------------


 onNext Event

Called when the user selects to skip to the next record. See also onTop(), onPrev(), onBotom().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onNext()

Remarks

Automatically called whenever the user selects to move to the next record of the current table or view either using the menu or the corresponding form command button. If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onPostDelete Event

Called just after a record has been deleted.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPostDelete()

Remarks

Automatically called whenever the user succcesfully deleted a record.


 onPostEdit Event

Called just after editing a record before Valid() by onSave().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPostEdit()


 onPostInsert Event

Called by onInsert() just after APPEND BLANK.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPostInsert()

Returns

lExpr

Setting	Description
True	(Default) No further action.
False	The insert will be aborted and a Tablerevert() occurs.

Example

Normally you might have code simmilar to this in this event:

*-------------------------------------------------------

CDataFormPage::onpostinsert()

thisForm.pgfPageFrame.Page2.txtComp_ID.Value = GetNewId('COMP_ID')

...

*-------------------------------------------------------

This makes sure, that the Identification Key will be replaced just after the APPEND BLANK occurred.


 onPostQuery Event

Called by Requery() after requerying the data.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPostQuery()

Remarks

Use this event to put your custom code which must run whenever a query has just been refreshed using the VFX Requery method.


 onPreDelete Event

Called by onDelete() just before deleting a record.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPreDelete()

Returns

lExpr

Setting	Description
True	(Default) Delete operation will be completed.
False	Delete operation will be aborted.

Remarks

Use this event to put your custom code which must run just before a delete operation will be performed.

NOTE: To completely restrict delete rights for a specific user see the lCanDelete property.


 onPreEdit Event

Called by onEdit() just before an edit occurs.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPreEdit()

Returns

lExpr

Setting	Description
True	(Default) Edit operation will be completed.
False	Edit operation will be aborted.

Remarks

Use this event to put your custom code which must run just before an edit operation will be performed.

NOTE: To completely restrict edit rights for a specific user see the lCanEdit property.


 onPreInsert Event

Called by onInsert() just before APPEND BLANK.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPreInsert()

Returns

lExpr

Setting	Description
True	(Default) Insert operation will be completed.
False	Insert operation will be aborted.

Remarks

Use this event to put your custom code which must run just before an Insert operation will be performed.

NOTE: To completely restrict insert rights for a specific user see the lCanInsert property.


 onPreQuery Event

Called by ReQuery() just before requerying the data.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPreQuery()

Returns

lExpr

Setting	Description
True	(Default) Requery operation will be completed.
False	Requery operation will be aborted.

Remarks

Use this event to put your custom code which must run just before requerying the data.


 onPrev Event

Called when the user selects to move to the previous record. See also onTop(), onNext(), onBotom().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPrev()

Remarks

Automatically called whenever the user selects to move to the previous record of the current table or view either using the menu or the corresponding form command button. If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onPrint Event

Called when print has been selected from either the toolbar (if present) of from the menu.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onPrint(lPreview)

Arguments

tlPreview

If called from the preview menu or toolbar icon, .T. will be passed as parameter.

Example

The following is an advanced code example for an onPrint() event:

LPARAMETERS tlPreview

LOCAL oSelectionForm, aSelArr, nSelection, lcSelRepCaption

DIMENSION aSelArr[2,3]

aSelArr[1,1] = REP_TYPE_ONE_LOC

aSelArr[1,2] = REP_TYPE_ONE_LOC

aSelArr[1,3] = "MODIFY REPORT REPORT\CONT_one.FRX"

aSelArr[2,1] = REP_TYPE_LIST_LOC

aSelArr[2,2] = REP_TYPE_LIST_LOC

aSelArr[2,3] = "MODIFY REPORT REPORT\CONT.FRX"

nSelection = 1

lcSelRepCaption = IIF(!tlPreview, CAP_REP_SEL_LOC, CAP_PRE_SEL_LOC)

DO FORM SelDlg WITH aSelArr, lcSelRepCaption, MODIFY_REP_LOC, TTT_MODIFY_REP_LOC TO nSelection

DO CASE

   CASE nSelection = 1

   	IF tlPreview

  	REPORT FORM REPORT\CONT_one.FRX PREVIEW NOCONSOLE NEXT 1

ELSE

  	REPORT FORM REPORT\CONT_one.FRX TO PRINT NOCONSOLE NEXT 1

ENDIF

CASE nSelection = 2

IF tlPreview

  	REPORT FORM REPORT\CONT.FRX PREVIEW NOCONSOLE

ELSE

  	REPORT FORM REPORT\CONT.FRX TO PRINT NOCONSOLE

ENDIF

ENDCASE


 onRecordMove Event

Event gets called whenever the current record pointer moves.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onRecordMove()

Remarks

Automatically called whenever the user moves the record in the current data form. Use this method to write code into it when you need to synchronize controls only when the record moves and not always by putting the code in the refresh method.


 onSave Event

Called whenever changes applied to the current record(s) are saved.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onSave()

Remarks

Automatically called whenever the user selects to save the current record either using the menu or the corresponding form command button. If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onSavePosition Event

Called by SavePosition() when saving the form's postion and other data into the VFX resource file.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar, CGrid, CChildGrid, CPickGrid

Syntax

Form.onSavePosition()

Remarks

Use this event to customize the form or grid saving procedure.


 onSetChildData Event

Visual Extend allows you to create child forms which are dynamically linked to a parent form. If a parent form calls a child form, you can define on parent form level, whether the called child form(s) will be dynamically linked with the parent form or not.

The parent form event onSetChildData is automatically called for all existing child forms of a parent form. All you have to do to enable linked child forms is to set the parent form property lUseChildForm to true and fill in some lines of code in the onSetChildData() event as described in the example below. The property lAutoSynchChildForm can be used to define whether the synchronization of child forms should occurr automatically or only when the user activates the child form. See also lCloseChidlformonExit().

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onSetChildData()

Example

In the following example code for onSetChildData(), the parent form can have up to two child forms. Note that you have to refer to the SCX form name with the prefix FRM, i.e. in this example the form called in the onMore() method was CUSTPRG resp. ACCOUNT, thats why they will be referenced as FRMCUSTPRG resp. FRMACCOUNT.

lparameters tcFormName, toForm

do case

case upper(tcFormName)=="FRMCUSTPRG"

toForm.Caption	= 'Customer Programs for ' + trim(catpaddr_name)

toForm.cFixFieldValue	= catpaddr.catpaddr_id

toForm.cFilterExpr	= 'UPPER(pc_id)="'+upper(catpaddr.catpaddr_id)+'"'

case upper(tcFormName)=="FRMACCOUNT"

toForm.Caption	= 'Accounts for ' + trim(catpaddr_name)

toForm.cFixFieldValue	= catpaddr.catpaddr_id

toForm.cFilterExpr	= 'UPPER(rc_id)="'+upper(catpaddr_id)+'"'

endcase

The onMore() method in the above example looks like this:

LPARAMETERS tnPassThrough

LOCAL aFunct, lcCalledBy, lcFixFieldValue, lcCaption,;

              lcFixFieldName, lcFilterExpr

DIMENSION aFunct[2,5]

************************************************************

* 1 - Function Title to display in ListBox

* 2 - Function Description

* 3 - F - Form / W -Wait Window

* 4 - FormName or Message to display if W

* 5 - Argument to pass

************************************************************

lcCalledBy      = 'CATPADDR'

lcFixFieldValue = catpaddr_id

lcCaption       = 'Customer Programs for ' + trim(catpaddr_name)

lcFixFieldName  = 'PC_ID'

lcFilterExpr    = 'UPPER(pc_id)="'+upper(catpaddr_id)+'"'

aFunct[1,1] = "Customer Programs"

aFunct[1,2] = "Customer Programs for selected CATPost Address as Producing Country"

aFunct[1,3] = "F"

aFunct[1,4] = "CUSTPRG"

aFunct[1,5] = lcCalledBy      + ";" +;

              lcFixFieldValue + ";" +;

              lcCaption       + ";" +;

              lcFixFieldName  + ";" +;

              lcFilterExpr

lcCaption       = 'Accounts for ' + trim(catpaddr_name)

lcFixFieldName  = 'RC_ID'

lcFilterExpr    = 'UPPER(rc_id)="'+upper(catpaddr_id)+'"'

aFunct[2,1] = "Accounts"

aFunct[2,2] = "Accounts for selected CATPost Address as Receiving Country"

aFunct[2,3] = "F"

aFunct[2,4] = "ACCOUNT"

aFunct[2,5] = lcCalledBy      + ";" +;

              lcFixFieldValue + ";" +;

              lcCaption       + ";" +;

              lcFixFieldName  + ";" +;

              lcFilterExpr

IF EMPTY(tnPassThrough)

DO FORM VFXMORE WITH aFunct, this

ELSE

DO FORM VFXMORE WITH aFunct, tnPassThrough, this

ENDIF

goProgram.RefreshWindowMenu()


 onSearch Event

Called when the user selects search.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onSearch()

Remarks

Automatically called whenever the user selects search either using the menu or the corresponding form command button. If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onSetEnv Event

Called by Load() (CForm class), resp. Init() (CFoxApp Class). Used to setup the working environment. See also onResetEnv event.

Applies To

CFoxApp, CForm, CForm, CModalForm, DataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Object.onSetEnv()

Remarks

Essentially two simmilar, but different, situations exists where you want to set environmental settings. One is the application start, another the form specific settings. Especially the usage of private data sessions forces you to handle the form aspect with the appropriate respect. The default code of onSetEnv() as well as the counterpart onResetEnv() does not cover all of your specific application needs. That's why you may do the following:

To customize environmental settings at application start

You will subclass the CEnvironment class including the onSetEnv() event, as described in VFXMAIN.PRG.

To customize environmental settings for a form

Put you custom code in the onSetEnv() event. Make sure to use the scope resolution operator, otherwise you would loose all of the default settings, such as the date setting which will be taken from the CFoxApp property cDateFormat for example.


 onResetEnv Event

Called by Destroy(). used to reset the original environment. See also onSetEnv event.

Applies To

CFoxApp, CForm, CModalForm, DataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Object.onResetEnv()


 onResizeChild Event

This event fires whenever the onetomany form resizes. In this method there is code to resize all the available childgrids.

Applies To

COneToMany, COneToManyBar

Syntax

Form.onResizeChild()

Remarks

Only modify this code in your forms when you really need to change the resize behaviour of your childgrids.


 onTop Event

Called when the user selects go top. See also onPrev(), onNext(), onBotom().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onTop()

Remarks

Automatically called whenever the user selects to move to the top of the current table or view either using the menu or the corresponding form command button. If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onUndo Event

Called whenever changes applied to the current record(s) are rejected.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onUndo()

Remarks

Automatically called whenever the user selects to undo chenges to the current record either using the menu or the corresponding form command button. If you put custom code into this event, make sure to always call the parent code using the scope resolution operator.


 onWriteBuffer Event

Called by the onSave() event to make sure that the currently entered data, which have not yet been flushed to the data source will be saved anyway.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onWriteBuffer()

Remarks

It is a common xBase behaviour, that changes affected to a field control are lost, if the cursor has not been moved out of the current control. To overcome this, from a user's perspective illogical behaviour, the onWriteBuffer() event gets automatically called whenever the edit has been successfull.


 SetObjectFocus Method

Called by onEdit() and onInsert() to set the focus to the first object.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.SetObjectFocus()

Remarks

Make sure that the object order of your controls matches the physical arrangement of your controls, otherwise you may never position on the first "logical" control of your form.


 SetQueryArg Method

This method sets the property cQueryArg to the cFixFieldValue when lWorkonView is set to true.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.SetQueryArg()

Remarks

This comes in handy when creating a child form which has one parametrized view. Since the method SetQueryArg gets called automatically whenever a requery of the child is needed, no additional coding is required to make a parent child form scenario working even in a C/S environment working with views.

NOTE: It is highly recommended to check out our VFX test application (not the demo app). There you will find some C/S sample forms.


 TriggerError Method

Called by ErrorHandler(), when table trigger has been violated.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.TriggerError()

Remarks

Will automatically be called by the ErrorHandler() method if a trigger error occurred.


 UniqueError Method

Called by Errorhandler(), when unique key has been violated.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.UniqueError()

Remarks

Will automatically be called by the ErrorHandler() method if a unique error occurred.


 UpdateError Method

Called by ErrorHandler() when update trigger has been violated.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.UpdateError()

Remarks

Will automatically be called by the ErrorHandler() method if an update triggr error occurred.


 Valid Method

Form valid event.Called by onSave().

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.Valid()

Returns

lExpr

Setting	Description
True	Form validation was ok. Applied changes to the current record can be saved.
False	One or more form validation rule has been violated. Changes applied to the current record will not be committed.


 WaitMode Method

Call WaitMode(.T.), if you want the mouse cursor in wait mode.

Applies To

CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.WaitMode(lWait)

Arguments

lWait

Setting	Description
True	Sets mouse cursor in wait mode.
False	Sets mouse cursor in normal mode.

Remarks

Use this method to enhance your user interface and syncronize the mouse cursor with the current task.


 cAscOrderRGB Property

Specifies the color which will be used to show the current ascending sort in the columns header of the grid.

Applies To

CFoxApp, CGrid

Syntax

goProgram.cAscOrderRGB [ = cExpr]

Settings

cExpr

Setting	Description
RGB(255,255,0)	(Default) yellow
any other RGB setting	your color

Remarks

This propety will be used to display the column with the actual sort in another color for better user feedback. On grid level, this property is only used, if this property is empty on CFoxApp level. In other words the CFoxApp setting has, if set, preference. Usually you will set this property on the CFoxApp level rather than on the grid level.


 CDataDir Property

Specifies the data directory of your main database relative to your application executable file.

Applies To

CFoxApp

Syntax

goProgram.cDataDir [ = cExpr]

Settings

cExpr

Setting	Description
"DATA"	(Default) Defines the relative path to locate the data directory of your application.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

************************************************************

** Database definitions

cDataDir             = DATAPATH_LOC

cMainDatabase        = DATABASE_LOC

....

....

ENDDEFINE

In the above example, the VFX constant DATAPATH_LOC is used to define the value of the cDataDir property. Set the DATAPATH_LOC property in the userdef.h include file.


 cDateFormat Property

Specifies the Date Format.

Applies To

CFoxApp

Syntax

goProgram.cDateFormat [ = cExpr]

Settings

cExpr

Setting	Description
"BRITISH"	(Default) The setting of this property will be used for the SET DATE TO command.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG. This setting will also be used as form default within the onSetEnv() event.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

....

....

ENDDEFINE


 cDescOrderRGB Property

Specifies the color which will be used to show the current descending sort in the column header of the grid.

Applies To

CFoxApp, CGrid

Syntax

goProgram.cDescOrderRGB [ = cExpr]

Settings

cExpr

Setting	Description
RGB(255, 0, 0)	(Default) red
any other RGB setting	your color

Remarks

See remarks under CAscOrderRGB.


 cEdt_Date Property

VFX allows you to easily implement a simple auditing feature. If you want to log when which user created a record and which user last changed a record, you will work with the following properties: cIns_Usr, cIns_Date, cEdt_Usr, cEdt_Date.

Applies To

CFoxApp

Syntax

goProgram.cEdt_Date [ = cExpr]

Settings

cExpr

Setting	Description
"edt_date"	(Default) Identifies the field name in your table(s) which will be used to store the date when a record has ben modified.
any other fieldname	If you have a different fieldname than "edt_date" for the field holding the last modification date.

Remarks

VFX sets the content of this field automatically to the current date (if the field is of type date), current datetime (if the field is of type datetime) or to a string holding the current date and the current time (if the field is of type character) when the record will be saved. You find the code in the class CDataTablemgr in the method Update() which will be called from the onSave() event.


 cEdt_Usr Property

VFX allows you to easily implement a simple auditing feature. If you want to log when which user created a record and which user last changed a record, you will work with the following properties: cIns_Usr, cIns_Date, cEdt_Usr, cEdt_Date.

Applies To

CFoxApp

Syntax

goProgram.cEdt_Usr [ = cExpr]

Settings

cExpr

Setting	Description
"edt_usr"	(Default) Identifies the field name in your table(s) which will be used to store the user name of the user who last modified a record.
any other fieldname	If you have a different fieldname than "edt_usr" for the field holding the last modification user.

Remarks

VFX sets the content of this field automatically to the current user (variable gu_user) when the record will be saved. You find the code in the class CDataTablemgr in the method Update() which will be called from the onSave() event.


 cIns_Date Property

VFX allows you to easily implement a simple auditing feature. If you want to log when which user created a record and which user last changed a record, you will work with the following properties: cIns_Usr, cIns_Date, cEdt_Usr, cEdt_Date.

Applies To

CFoxApp

Syntax

goProgram.cIns_Date [ = cExpr]

Settings

cExpr

Setting	Description
"ins_date"	(Default) Identifies the field name in your table(s) which will be used to store the date when a record has ben created.
any other fieldname	If you have a different fieldname than "ins_date" for the field holding the creation date.

Remarks

VFX sets the content of this field automatically to the current date (if the field is of type date), current datetime (if the field is of type datetime) or to a string holding the current date and the current time (if the field is of type character) when the record will be created. You find the code in the class CDataTablemgr in the method Update() which will be called from the onSave() event.


 cIns_Usr Property

VFX allows you to easily implement a simple auditing feature. If you want to log when which user created a record and which user last changed a record, you will work with the following properties: cIns_Usr, cIns_Date, cEdt_Usr, cEdt_Date.

Applies To

CFoxApp

Syntax

goProgram.cIns_Usr [ = cExpr]

Settings

cExpr

Setting	Description
"ins_usr"	(Default) Identifies the field name in your table(s) which will be used to store the user name of the user who created a record.
any other fieldname	If you have a different fieldname than "ins_usr" for the field holding the creation user.

Remarks

VFX sets the content of this field automatically to the current user (variable gu_user) when the record will be saved after inserting a new record (nFormStatus = 2). You find the code in the class CDataTablemgr in the method Update() which will be called from the onSave() event.


 cExcludeFiles Property

Specifies, which files will be excluded from the standard database tools dialog for packing, reindexing and repairing. Usually these will be some internal system tables.

Applies To

CFoxApp

Syntax

goProgram.cExcludeFiles [ = cExpr]

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

...

cExcludeFiles        = "DBCXREG.DBF;CDBKMETA.DBF;SDTMETA.DBF;SDTUSER.DBF"

...


 cHelpFile Property

Specifies, which main helpfile will be active.

Applies To

CFoxApp

Syntax

goProgram.cHelpFile [ = cExpr]


 cIntroBitMap Property

Specifies the bitmap which is used in the Splash Screen. See also OpenIntroForm(), lShowIntroForm, cIntroForm, ReleaseIntoForm().

Applies To

CFoxApp

Syntax

goProgram.cIntroBitmap [ = cExpr]

Settings

cExpr

Setting	Description
"BITMAP\INTRO.BMP"	(Default) The splash screen defined with the CFoxApp property cIntroForm will be displayed using this Bitmap when the application starts.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

....

....

ENDDEFINE

Tutorial

See also the tutorial topic How can I change the splash screen.


 cIntroForm Property

Specifies the Splash Dialog Class which will be used for the splash screen when the application starts. See also OpenIntroForm(), lShowIntroForm, cIntroBitMap, ReleaseIntoForm().

Applies To

CFoxApp

Syntax

goProgram.cIntroForm [ = cExpr]

Settings

cExpr

Setting	Description
"CSplashDialog"	(Default) The splash screen defined here will be displayed using the bitmap defined under cIntroBitmap when the application starts.
If empty	No splash screen will be displayed.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

Example

define class CApplication as CFoxApp

** cHelpFile          = [Help File]

** cMainDatabase      = [Main Database]

** cMainMenu          = [Main Menu - Blank if none]

** cDateFormat        = [Date Format]

** cMainForm          = [SCX form to display when the application start]

** cMainTitle         = [Main Title]

** cMainIcon	      = [Your Application ICON]

cIntroBitMap       = bitmap\my.bmp  &&[Image used for the splash screen]

** cIntroForm         = [Class name used for the splash screen - Blank if none]

** cLoginForm         = [SCX for login dialog - Blank if none]

** lShowIntroForm     = .T. if you want display the splash screen

enddefine


 cLangID Property

Defines the language for the application. See also the include file.VFXDEF.H.

Applies To

CFoxApp

Syntax

goProgram.cLangID [ = cExpr]

Settings

cExpr

Defines the current language the application is running. Default language code is "ENG" for english. Available out of the box are:

Setting	Description
ENG	English
FRE	French
ITA	Italian
ESP	Spanish
GER	German
USR	User


 cLoginForm Property

Specifies the User Login Form which will be used as user login form.

Applies To

CFoxApp

Syntax

goProgram.cLoginForm [ = cExpr]

Settings

cExpr

Setting	Description
"VFXLOGIN"	(Default)
if empty	No login screen appears. Note however that you will not have the user's public variables available if no login screen appears. These will only be created if you use a login form which is based on the class cUserLogin.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

cLoginForm    = "MYLOGIN"

....

....

ENDDEFINE


 cMainDatabase Property

Specifies the main database which will be opened in the CFoxApp method OpenDatabase. VFX assumes that you are working at least with one open database. See also the cFoxApp method OpenDatabase.

Working with multiple Databases

Refer to the VFX sample application, available for registered users from our homepage, to see how to work with VFX using multiple databases.

Applies To

CFoxApp

Syntax

goProgram.cMainDatabase [ = cExpr]

Settings

cExpr

Setting	Description
"DATA\DATABASE"	(Default)
DATA\MYDATABASE	Any database including relative path without the ending dbc.
if empty	If you don't want to put your tables into any database or if you want to open your database programmatically whenever you want

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

cLoginForm    = "APPLOGIN"

cMainDatabase = "DATA\APPDATABASE"

....

....

ENDDEFINE

Working with dynamic database locations

If you want to provide the possibility that users of your applications can have their data directory wherever they want, or even switchable at runtime, make sure to add the relative or absolute directory of the actual database location to the cMainDatabase property. VFX will automatically add the directory prefix to the path statement HINT: This is the easiest way to create applications with multi client databases, where you have different data for every user, client or whatever!

See also How to dynamically move the data location in the tutorial section of this help file.

Working with a database with another name than database.dbc

You might want to name you database other than database.dbc. If you are working with xCase for example, this might be the case, because xCase does not allow you to have multiple database projects with the same name, like database.dbc. Since some VFX forms have already been prepared with a data environment where the database name was database.dbc, make sure to open all VFX forms in the form designer, locate your database and select save. This way your VFX forms will locate the right database. For instructions on how to remove the VFX tables from the database.dbc and how to add them to your own database, you might read the step by step instructions under the xCase topic of this help file.

NOTE: Remember to include at least the relative path to your database, like data\mydatabase, because VFX uses the prefix, in this example data\ and adds it automatically to the current path statement. This helps to locate the free VFX and other free tables.


 cMainForm Property

Specifies the startup form which will start just after the Application starts. Enter the Name of the Form. No SCX extension is needed.

Applies To

CFoxApp

Syntax

goProgram.cMainForm [ = cExpr]

Settings

cExpr

Setting	Description
"ANYFORM"	Enter the name of any existing form, could also be the VFXOPEN form.
if empty	(Default) No form will be called after the application starts.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

cLoginForm    = "APPLOGIN"

cMainDatabase = "DATA\APPDATABASE"

cEnvClass     = 'MYEnvironment'	&& see Class CMyEnvironment later

....

....

ENDDEFINE


 cMainIcon Property

Specifies the application's main ICON which will be used when the main application window will be minimized and in the taskswitch window as well.

Applies To

CFoxApp

Syntax

goProgram.cMainIcon [ = cExpr]

Settings

cExpr

Setting	Description
"BITMAP\MAIN.BMP"	(Default) The _screen.icon property will be set to this value
If empty	No main icon will be set.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

cMainIcon     = "BITMAP\APPICON"

cEnvClass     = 'MYEnvironment'	&& see Class CMyEnvironment later

....

....

ENDDEFINE

NOTE: If you should use your own specific icon, remember to make sure, that you include it into your project, otherwise your application may not find the icon when installed on your customer's site.


 cMainMenu Property

Specifies the Main Menu (.MPR) which will be started when the Application starts.

If you want to add a menu extension to the existing menu after it has been loaded, just subclass the method ShowMenu(), like shown in the class description CFoxApp (VFXMAIN.PRG) for the cFoxApp and the CEnvironment class.

Applies To

CFoxApp

Syntax

goProgram.cMainMenu [ = cExpr]

Settings

cExpr

Setting	Description
"VFXMENU.MPR"	(Default) This is the menu, which will be called with the DO MENU command.
If empty	No main menu will be called. Exeption: You pass the name of the main menu to the init() method of your application class when instantiating it, like in this example. goProgram = CREATEOBJECT("CApplication", MAINTITLE_LOC, <MyMenuPrg>) Note however, that having no menu at all will force you to disable all form properties for menu interaction, like lPutInLastFile and lPutInWindowMenu.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

The Init() method of the CFoxApp class has two parameters, the first defining the caption for the main FoxPro screen for your application, the second defining the property cMainMenu. This allows you to pass the name of the main menu for your application as a parameter directly when instantiating the application class. However the setting of this property has preference over any parameter passed to the Init() method of your application class.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

cMainIcon     = "BITMAP\APPICON"

cEnvClass     = 'MYEnvironment'	&& see Class CMyEnvironment later

....

....

ENDDEFINE


 cMainTitle Property

Caption of the main Visual FoxPro window. You can specify this also via a VFX Include File.

The Init() method of the CFoxApp class has two parameters, the first defining the caption for the main screen for your application, the second defining the property cMainMenu. This allows you to pass the name of the main screen for your application as a parameter directly when instantiating the application class. However the setting of this property has preference over any parameter passed to the Init() method of your application class.

Applies To

CFoxApp

Syntax

goProgram.cMainTitle [ = cExpr]

Settings

cExpr

Setting	Description
"Your App Title"	The _screen.caption property will be set to this value
If empty	No main title will be set. Exeption: You pass the name of the main title to the init() method of your application class when instantiating it, like in this example: goProgram = CREATEOBJECT("CApplication", MAINTITLE_LOC)

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

cMainIcon     = "BITMAP\APPICON"

cEnvClass     = 'MYEnvironment'	&& see Class CMyEnvironment later

....

....

ENDDEFINE


 cMainToolBar Property

Name of the main application specific toolbar class. VFX provides already two ready to use application specific toolbar classes. CAppNavBar and CAppToolbar. You can easily use them by just setting the property cMainToolbar to one of these values.

Applies To

CFoxApp

Syntax

goProgram.cMainToolbar [ = cExpr]

Settings

cExpr

Setting	Description
"CAppNavBar"	Use this if you need navigation controls on the main toolbar
CAppToolbar	Use this if you have navigation controls already on each form

Remarks

If you have no navigation buttons on the form, you may want them to appear on the toolbar. Thats why we prepared a toolbar class which includes the navigation controls. For easier usage, we already subclassed this toolbar and put it in the project specific class library APPL.VCX. The name of this toolbar is CAppNavBar. All you have to do to use it is to set the application class property CMainToolbar to CAppNavBar. You can do this directly in VFXMAIN.PRG.

If you have navigation buttons on the form, you may want to use the prepared toolbar CAppToolbar.instead.


 FileMnuName Property

Specifies the name for the File menu pad. See also WinMnuName.

Applies To

CFoxApp

Syntax

goProgram.cFileMnuName [ = cExpr]

Settings

cExpr

Setting	Description
"File"	(Default) This is the default name for the file menu pad when the application is in english.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG in the setLangID Method of the CFoxApp application class.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

cMainIcon     = "BITMAP\APPICON"

cEnvClass     = 'MYEnvironment'	&& see Class CMyEnvironment later

PROCEDURE SetLanguage

LPARAMETERS tcLanguage

CFoxApp::SetLanguage(tcLanguage)

DO CASE

CASE tcLanguage = "E"

this.FileMnuName = "File"

this.WinMnuName  = "Window"

CASE tcLanguage = "F"

this.FileMnuName = "Fichier"

this.WinMnuName  = "Fenêtre"

CASE tcLanguage = "G"

this.FileMnuName = "Datei"

this.WinMnuName  = "Fenster"

CASE tcLanguage = "I"

this.FileMnuName = "File"

this.WinMnuName  = "Finestra"

CASE tcLanguage = "S"

this.FileMnuName = "File"

this.WinMnuName  = "Window"

ENDCASE

ENDPROC

ENDDEFINE

NOTE: Important for multilingual applications.


 FileMnuOffset Property

Specifies how many items are defined in the file menu popup before the first recently used item can be displayed. See also WinMnuOffset. If you create multilingual applications see also the property FileMnuName.

Applies To

CFoxApp

Syntax

goProgram.cFileMnuOffset [ = nExpr]

Settings

nExpr

Setting	Description
7	(Default) Usually 7 menu items are defined before the first element of the recently used file list can be displayed as element number 8 in the file menu popup.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

NOTE: Only important if you make changes to the File menu pad which will change the position of the first recently used menu option (recently used file list: the last 4 user selections are always availabe in the file menu).

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

define class CApplication as CFoxApp

***********************************************************

**  User Settings

filemnuoffset = 8

** cHelpFile          = [Help File]

** cMainDatabase      = [Main Database]

** cMainMenu          = [Main Menu - Blank if none]

** cDateFormat        = [Date Format]

...

...

...

enddefine


 lCanClose Property

Defines whether the application can be closed. Internally used to check in the Destroy() method, whether the onQuit() event can be called.

Applies To

CFoxApp

Syntax

goProgram.lCanClose[ = lExpr]

Settings

lExpr

Setting	Description
False (.F.)	(Default)
True (.T.)	The onQuit() method sets this property to true


 lCentury Property

Defines whether you want to see the century in the date fields. The setting of this property will be used to SET CENTURY ON/ OFF.

Applies To

CFoxApp

Syntax

goProgram.lCentury[ = lExpr]

Settings

lExpr

Setting	Description
False (.F.)	(Default) SET CENTURY will be set to false
True (.T.)	SET CENTURY will be set to true


 lClearIDXmsg Property

Defines whether before deleting all IDX files, the user receives a messagebox or not. See also nIDXCount, ClearAllIDX.

Applies To

CFoxApp

Syntax

goProgram.lClearIDXmsg[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) A messagebox indicating that all temporary index files will be deleted appears whenever all IDX temporary index files will have to be deleted.
False (.F.)	If the temporary index files will be deleted the default index order will be established without any notification.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

define class CApplication as CFoxApp

** cHelpFile          = [Help File]

** cMainDatabase      = [Main Database]

** cMainMenu          = [Main Menu - Blank if none]

** cDateFormat        = [Date Format]

** cMainForm          = [SCX form to display when the application start]

** cMainTitle         = [Main Title]

** cMainIcon	      = [Your Application ICON]

** cIntroBitMap       = [Image used for the splash screen]

** cIntroForm         = [Class name used for the splash screen - Blank if none]

** cLoginForm         = [SCX for login dialog - Blank if none]

** lShowIntroForm     = .T. if you want display the splash screen

** lCentury           = .T. If you want use SET CENTURY ON

** nShowGridOrderType = 2	&& Use Colors

** cAscOrderRGB       = RGB(255,255,0)

** cDescOrderRGB      = RGB(255,0,0)

** nAutoEditMode      = 1	&& 0 - None, 1 - .T., 2 - .F.

lClearIDXMsg       = .F.     && Don't show the 'Deleting Tmp. Index'

** CAppToolBar	- Tooolbar without Navigation Buttons

** CAppNavBar	- Tooolbar with    Navigation Buttons

cMainToolBar         = "CAppNavBar"

cExcludeFiles        = "DBCXREG.DBF;CDBKMETA.DBF;SDTMETA.DBF;SDTUSER.DBF"	....

....

....

ENDDEFINE

NOTE: Read also the very important notes in the Read this before you start topic regarding Working with temporary indexes and TRANSACTIONS and Table Buffering!


 lDebugMode Property

Specifies if DebugMode it's active or not. You can specify the _DebugMode constant also via a VFX Include File. See also the application class method DebugMode().

Applies To

CFoxApp

Syntax

goProgram.lDebugMode[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	The DebugMode is active. (Include File Setting of _DebugMode is True)
False (.F.)	(Default) The DebugMode is not active. (Include File Setting of DebugMode is False)

NOTE: If your changes in the Include Files have no effect, refer to the Troubleshooting Guide for further assistance.


 lOpenDialog Property

This property will be set to true, whenever the file open dialog is active.

Applies To

CFoxApp

Syntax

goProgram.lOpenDialog[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	Open Dialog is currently active
False (.F.)	(Default) Open Dialog is currently not active

Remarks

Internal use mainly


 lRelogonQuit Property

This property allows you to define the bahaviour when the user of your application selects relogon from the tools menu or the main toolbar to change the currently logged on user while the application is running and then selects the cancel button in the login dialog. See also the Relogon() method.There are two possible behaviours when the user selects cancel in the login dialog during a relogon procedure:

1. Quit the application

2. Keep the previous user and don't quit the application

Applies To

CFoxApp

Syntax

goProgram.lRelogonQuit[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) Quits the application when user selects the cancel button during a relogon procedure.
False (.F.)	Don't quit the application, keep the previous user as currently loggend on user.


 lDisableFormResize Property

This property allows you to disable the form resize feature on application level. See also the form propery lAutoResizeControl. Setting the application class property lDisableFormResize to true, will do the following:

1. set border style to 2 (double wide border, not resizable)

2. no resize logic will be processed during form load (lAutoResizeControl will be ignored)

Applies To

CFoxApp

Syntax

goProgram.lDisableFormResize[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	Disables the resize feature of forms and their controls
False (.F.)	(Default) Does not disable the proportional resize functionality. Use lAutoResizeControl instead.

NOTE: This option can be usefull, if you dontt want that your users can resize forms at all or if you have to run your application on low profile hardware.


 lShowIntroForm Property

Specifies if a splash screen should be uses as an introduction to the application. See also OpenIntroForm(), cIntroBitMap, cIntroForm, ReleaseIntoForm().

Applies To

CFoxApp

Syntax

goProgram.lShowIntroForm[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) The splash screen defined with the CFoxApp property cIntroForm will be displayed using the bitmap defined under cIntroBitmap when the application starts.
False (.F.)	No splash screen appears.


 lUseDesktopColor Property

This property allows you to define whether the main window of your application should look like the definition in the windows system colors.

Applies To

CFoxApp

Syntax

goProgram.lUseDesktopColor[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	Use the color of the windows desktop for the main window of your application
False (.F.)	(Default) Don't use the color of the windows desktop


 lUseEnterAsTab Property

If you want to give the user the possibility to press enter on a checkbox to tab to the next field you can use this property to set the behaviour.

Applies To

CFoxApp

Syntax

goProgram.lUseEnterAsTab[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	When focus is on a VFX checkbox based control and the user presses ENTER, a keyboard TAB is issued and the next control receives focus.
False (.F.)	(Default) No special behaviour when pressing ENTER on a VFX based checkbox


 nShowGridOrderType Property

Specifies, how the current sort in a grid will be visualized.

Applies To

CFoxApp

Syntax

goProgram.cWhowGridOrderType [ = nExpr]

Settings

cExpr

Setting	Description
0	No visualization of the current sort
1	(Default) Underline the caption
2	Use the colors specified in the properties cAscOrderRGB resp. cDescOrderRGB.

Remarks

This Property will usually be set in the class definition of your own application


 nEnterisEditinGrid Property

This property defines the overall behaviour when a user presses ENTER when on a grid on the list page of a CDataFormPage or COneToMany based form. Basically the behaviour of the ENTER key is defined in the CGrid property lEnterisEditMode. However you can define the overall behaviour for all forms using the application class property nEnterisEditinGrid.

Applies To

CFoxApp

Syntax

goProgram.nEnterisEditinGrid[ = nExpr]

Settings

nExpr

Setting	Description
0	(Default) take setting as defined in the Grid using the lEnterisEditMode property
1	Overwrite the grid setting lEnterisEditMode to True
2	Overwrite the grid setting lEnterisEditMode to False

Remarks

Whenever the user presses ENTER the onKeyEnter() method gets called.


 nIDXCount Property

Counter specifying the number of totally available IDX temporary index files. Used to optimize the automatic IDX clearing to ensure that all BEGIN TRANSCTION code blocks, like RI code and other table trigger code can be processed without errors. Internally used. See also lClearIDXmsg and ClearAllIDX.

Applies To

CFoxApp

Syntax

goProgram.nIDXCount[ = nExpr]

Remarks

Since IDX temporary index files cannot participate in Visual FoxPro's transaction processing, it is extremely important, that the VFX framework keeps track of all generated IDX files. Usually the IDX temporary indexes are created either during an incremental search in a dataform or in the picklist.

NOTE: Read also the very important notes in the Read this before you start topic regarding Working with temporary indexes and TRANSACTIONS and Table Buffering!


 nWinMnuCount Property

Counter specifying the number of totally available windows in the Windows menu. See also lPutInWindowMenu.

Applies To

CFoxApp

Syntax

goProgram.nWinMnuCount[ = nExpr]

Remarks

This counter will be set automatically in the Init() method of the form if the form property lPutInWindowMenu is set to True.


 oLastFormCreated Property

Sometimes you want to know which form the user has last started. With the property oLastFormCreated you have an object reference to the form the user just started in order to be able to work directly with this form.

Applies To

CFoxApp

Syntax

goProgram.oLastFormCreated [ = oForm]

Settings

oForm

Setting	Description
(Object)	Object reference to the form the user just started.

Remarks

This Object reference will automatically be set in the RunForm() method. If you don't start a form using the VFX Runform() method, this object reference will not update.


 WinMnuName Property

Specifies the name of the window menu pad. See also FileMnuName.

Applies To

CFoxApp

Syntax

goProgram.cWinMnuName [ = cExpr]

Settings

cExpr

Setting	Description
"Window"	(Default) This is the default name for the Window menu pad when the application is in english.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG in the setLangID Method of the CFoxApp application class.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

Example for CFoxApp...

DEFINE CLASS CApplication AS CFoxApp

* Set all FoxApp Properties here:.....

cMainMenu     = 'MYMENNU.MPR'

cIntroBitMap  = 'BITMAP\MYLOGO.BMP'

cMainToolBar  = 'CMyMainToolBarClass'

cMainForm     = 'VFXOPEN'

cDateFormat   = "GERMAN"

cMainIcon     = "BITMAP\APPICON"

cEnvClass     = 'MYEnvironment'	&& see Class CMyEnvironment later

PROCEDURE SetLanguage

LPARAMETERS tcLanguage

CFoxApp::SetLanguage(tcLanguage)

DO CASE

CASE tcLanguage = "E"

this.FileMnuName = "File"

this.WinMnuName  = "Window"

CASE tcLanguage = "F"

this.FileMnuName = "Fichier"

this.WinMnuName  = "Fenêtre"

CASE tcLanguage = "G"

this.FileMnuName = "Datei"

this.WinMnuName  = "Fenster"

CASE tcLanguage = "I"

this.FileMnuName = "File"

this.WinMnuName  = "Finestra"

CASE tcLanguage = "S"

this.FileMnuName = "File"

this.WinMnuName  = "Window"

ENDCASE

ENDPROC

ENDDEFINE

NOTE: Important for multilingual applications.


 WinMnuOffset Property

Specifies how many menu items are defined in the Window Menu popup before the actually the first open window will be displayed under the Windows Menu pad. See also FileMnuOffset. If you create multilingual applications see also the property WinMnuName.

Applies To

CFoxApp

Syntax

goProgram.WinMnuOffset [ = nExpr]

Settings

nExpr

Setting	Description
1	(Default) Usually 1 menu item has been  defined before the information regarding currently open windows can be displayed.

Remarks

This Property will usually be set in the class definition of your own application class in VFXMAIN.PRG.

NOTE: Only important if you make changes to the Windows Menu pad.

Example

In this example, the code found in the VFXMAIN.PRG used to subclass the application class is shown:

define class CApplication as CFoxApp

***********************************************************

**  User Settings

WinMnuOffset  = 1

filemnuoffset = 8

** cHelpFile          = [Help File]

** cMainDatabase      = [Main Database]

** cMainMenu          = [Main Menu - Blank if none]

** cDateFormat        = [Date Format]

...

...

...

enddefine


 AddToLastfile Method

Adds an option to the recently used file list in the File menu.

Applies To

CFoxApp

Syntax

Object.AddToLastFile(cFormName, cCaption)

Arguments

cFormName

Name of the form to put in recently used file list

cCaption

Caption of the form to put in recently used file list

Remarks

This method will automatically be called by the CFoxApp method RunForm() if the form property lPutInLastFile is set to true.


 AddToolbar Method

Adds a new toolbar to the application.

Applies To

CFoxApp

Syntax

Object.AddToolbar(cClassName)

Arguments

cClassName

Name of the toolbar class to be created.

Remarks

This method will automatically be called by the CFoxApp event onSetToolbar.


 ClearAllIDX Method

Clears all IDX temporary indexes within the current running application. See also lClearIDXmsg and nIDXCount.

Applies To

CFoxApp

Syntax

goProgram.ClearAllIDX()

Remarks

This method will automatically be called, whenever the user calls the Edit, Insert or Delete function. This to make sure, that no errors will occurr even if any trigger code in the database will be fired which may include any BEGIN TRANSACTION statements which would not work whenever any IDX files are open.

NOTE: Read also the very important notes in the Read this before you start topic regarding Working with temporary indexes and TRANSACTIONS and Table Buffering!


 Debugmode Method

Sets the debug mode and activates the debug menu. See also lDebugMode property.

Applies To

CFoxApp

Syntax

goProgram.DebugMode(tlMode)

Arguments

tlMode

If you pass true, the debug mode will be activated and the VFX debug menu will be installed. If you pass false, the original Visual FoxPro menu will be set back.

Example

Usually you will define whether your application should run in debugging mode or not directly in the VFXMAIN.PRG. Here the code which defines, whether the debugmode() method will be called with a parameter of True or not.

#ifdef _DEBUG_MODE

goProgram.DebugMode(.t.)

#endif

You could define the _DEBUG_MODE constand in the VFX include file or just remark the ifdef statement, thats the easier way than changing the include file:

*#ifdef _DEBUG_MODE

goProgram.DebugMode(.t.)

*#endif

To switch back, just change back to

#ifdef _DEBUG_MODE

goProgram.DebugMode(.t.)

#endif


 DrawBackground Method

Called from the CFoxApp method Start(), this method can be used to place the code to generate a background for your application.

Applies To

CFoxApp

Syntax

goProgram.DrawBackground()

Remarks

Since this method is part of the application class, which will be subclassed in the VFXMAIN program file, you can define the content of the method DrawBackground directly in VFXMAIN.PRG.

Example

define class CApplication as CFoxApp

cMainToolBar         = "CAppNavBar"

cExcludeFiles        = "DBCXREG.DBF;CDBKMETA.DBF;SDTMETA.DBF;SDTUSER.DBF"

lClearIDXMsg         = .F.

procedure SetLangID

...

...

endproc

procedure DrawBackground

_screen.addobject("oLogoImage","image")

_screen.oLogoImage.picture = "bitmap\desktop.bmp"

_screen.oLogoImage.top  = (_screen.height - _screen.oLogoImage.height)/2

_screen.oLogoImage.left = (_screen.width  - _screen.oLogoImage.width)/2

_screen.oLogoImage.visible = .t.

endproc

function OpenDatabase()

...

...

endfunc

procedure OnQuit()

...

...

endproc

enddefine

Tutorial

See also the tutorial topic How can I change the background bitmap.


 GetLangID Method

Gets the value of the property cLangID.

Applies To

CFoxApp

Syntax

goProgram.GetLangID()


 OpenDatabase Method

Opens the database specified by the CFoxApp property cMainDatabase.

Applies To

CFoxApp

Syntax

goProgram.OpenDatabase()

Remarks

VFX does automatically open for every form which may have a private data session the database. If you are not sure whether your database is really open, use code simmilar to this:

IF EMPTY(DBC())

SET DATABASE TO (goProgram.cMainDatabase)

ENDIF


 OpenIntroForm Method

Shows the splash screen as an introduction to your application. See also lShowIntroForm, cIntroBitMap, cIntroForm, ReleaseIntoForm().

Applies To

CFoxApp

Syntax

goProgram.OpenIntroForm()

Remarks

This method is called from within the Init() method of the application class CFoxApp when the application starts.


 RefreshWindowMenu Method

Refreshes the Window menu popup showing all currently open windows allowing the user to switch from one window to another.

Applies To

CFoxApp

Syntax

goProgram.RefreshWindowMenu()

Remarks

This method is called from the Init() and the Destroy() methods of the CForm class. This makes sure that all VFX based forms will automatically register correctly in the Window menu popup as "currently open window".


 Release Method

Releases the object.

Applies To

CCheckbox, CChildGrid, CCombobox, CCommandbutton, CCommandGroup, CContainer, ceditbox , CFixField, CGrid, CFoxApp, CGauge, CImage, CKeyField, CLabel, CLineClass, CListbox,CNavigator, COfficeBar, COleBoundControl, COptionGroup, CPageFrame, CPickField, CPickGrid, CPickTextBox, CPushPin, CShape, CSpinner, CTextbox, CTimer, CToolbar, CDataTableMgr

Syntax

Object.Release()

Remarks

All VFX based controls have the release method making it easier to write generic code which releases any (contained) controls. The Release method is useful when an object is created and there is no variable by which to reference the object. The release method mimics the RELEASE command issued directly from within the object.


 ReleaseIntroForm Method

Releases the splash screen which may be used as intro form. See also lShowIntroForm, OpenIntroForm, cIntroBitMap, cIntroForm, ReleaseIntoForm().

Applies To

CFoxApp

Syntax

goProgram.ReleaseIntroForm()

Remarks

Called from the onUserLogin() event to make sure the splash screen has correctly been released before program execution continues with the userlogin dialog.


 Relogon Method

This is the method which is called when the user wants to relogon as a different user without quitting the application. He can do this by selecting Tools/ Login... in the menu or by pressing the Login button on te main toolbar. See also the lRelogonQuit property.

Applies To

CFoxApp

Syntax

goProgram.Relogon(cClassName)


 RemoveToolbar Method

Removes the specified or all toolbars.

Applies To

CFoxApp

Syntax

goProgram.RemoveToolbar(cClassName)

Arguments

cClassName

Pass the name of the toolbar class which should be removed. To remove all toolbars, pass the parameter string "[ALL]".

Remarks

This method is automatically called from the onQuit() method of the application class CFoxApp.


 RunForm Method

Runs a form and sets the recently used file list in the File menu.

Applies To

CFoxApp

Syntax

goProgram.RunForm(cFormName[, cArgument])

Arguments

cFormName

Pass the name of the form to run.

cArgument

Pass any optional parameter which will be passed to the form. See the GetArg() function, if you need to pass multiple parameters in one parameter string.

HINTS: If you want to run a form from the standard VFX File/ Open Dialog without using the VFX RunForm() method, you can use the following technique to do so: Place a * in front of the form name which you define in the VFX Table VFXFOPEN. This tells VFX to issue a DO FORM command rather than using the RunForm() method to run the form. This way you can easily integrate non VFX based forms within the VFX framework using the same File Open dialog.

If you want to issue a DO FORM ... LINKED, just prefix #.


 SetLangID Method

Sets the current language of the application.

Applies To

CFoxApp

Syntax

goProgram.setLangID([cExpr])

Arguments

cExpr

Pass the language code for the language the application currently runs. If you pass no parameter, the default language which is "ENG" for english will be used.

Remarks

This method does only set the cLangID property of the application class CFoxApp. Usually you will call the setLangID method from the VFXMAIN.PRG: which will take the setting ID_LANGUAGE from the include file VFXDEF.H.

NOTE: Only important for multilingual applications.


 ShowMenu Method

Runs the menu specified in cMainMenu.

Applies To

CFoxApp

Syntax

goProgram.ShowMenu()


 ShowToolbar Method

Shows or hides the main toolbar.

Applies To

CFoxApp

Syntax

goProgram.ShowToolbar(lShow)

Arguments

lShow

Pass .T. if the toolbar should be shown, otherwise .F.


 Start Method

Starts the application and issues the READ EVENTS command. The onQuit() method clears the Read Event.

Applies To

CFoxApp

Syntax

goProgram.Start()

Remarks

If the CFoxApp property lDebugMode is set to true,

SET ESCAPE ON, ON SHUTDOWN and ON ERROR are issued, otherwise

SET ESCAPE OFF, ON SHUTDOWN DO OnShutDown and ON ERROR DO OnError WITH ERROR(), PROGRAM(), LINENO(), MESSAGE() are issued.

Then , the methods this.ViewLastFileMenu(), this.OnSetToolBar(), this.ShowToolBar(.T.), this.DrawBackground(), this._screen.icon = this.cMainIcon, _screen.MousePointer = MOUSE_DEFAULT, this.StartMainForm() and finally the READ EVENTS command is issued.


 StartMainForm Method

Starts the main form defined in cMainForm which automatically starts at startup of your application.

Applies To

CFoxApp

Syntax

goProgram.StartMainForm()

Remarks

Issues a this.RunForm(this.cMainForm) command. The form defined by cMainForm can be any form having any attributes. This makes it easy to define attractive dashboard like main screens...


 VFPToolbar Method

Shows or hides the Visual FoxPro toolbars.

Applies To

CFoxApp

Syntax

goProgram.VFPToolbar(lSwitch)

Arguments

lSwitch

If you pass the ID_ON constant (see include files), the VFP toolbars will be set on, if you pass the ID_OFF constant, the VFP toolbars will be set off.


 ViewLastFileMenu Method

Shows the (maximal four) recently used forms in the File menu. If you make changes to the File menu popup like adding new menu items or removing some items, make sure to adapt the FileMnuOffset property accordingly.

Applies To

CFoxApp

Syntax

goProgram.ViewLastFileMenu()


 onPostLogin Event

Called by onUserLogin() if the user successfully logged in.

Applies To

CFoxApp

Syntax

goProgram.onPostLogin()

Remarks

Issues the following commands to open the VFXSYS table:

USE VFXSYS IN 0 ALIAS SYSTEM

SELECT SYSTEM

GO TOP

...

...

NOTE: The VFXSYS table must have one record, otherwise the public variables coming from the VFXSYS fields can not be saved. If you distribute your application with no tables (generated at the client site), or with empty tables, VFX will generate one record for the VFXSYS table for you during startup of your application.

Then, the public variables with the prefix gs_ are created based on the fields in the VFXSYS table, the VFXSYS table closed and the original workarea reset.


 onPreLogin Event

Called by onUserLogin() just before the user logs on.

Applies To

CFoxApp

Syntax

goProgram.onPreLogin()

Returns

lExpr

Setting	Description
True	logon will be processed
False	logon fails

Remarks

If the event onPreLogin returnes false, the login will fail. This is an excellent place to make additional validations regarding user login security.


 onQuit Event

Called by the File/ Exit command. See also Start() method.

Applies To

CFoxApp

Syntax

goProgram.onQuit()

Remarks

Releases all forms for which the QueryUnload() method returns true, calls the RemoveToolbar() method, resets the main form caption, sets the CFoxApp property lCanClose to true, calls VFPToolbar(ID_ON), resets the mouse pointer to MOUSE_DEFAULT and issues the CLEAR EVENTS command.


 onSetToolbar Event

Calls the AddToolbar() method if the cMainToolbar property is not empty.

Applies To

CFoxApp

Syntax

goProgram.onSetToolbar()

Remarks

Issues the following code:

IF !EMPTY(this.cMainToolBar)

this.AddToolBar(this.cMainToolBar)

ENDIF


 onUserLogin Event

Called by the main program VFXMAIN.PRG, calls the user login form defined by cLoginForm.

Applies To

CFoxApp

Syntax

goProgram.onUserLogin()

Remarks

Releases the splash screen by calling the ReleaseIntroForm() method, calls the onPreLogin() event, calls the login form defined by cLoginForm and calls the onPostLogin() event.


 onUserLogout Event

Called by the main program VFXMAIN.PRG.

Applies To

CFoxApp

Syntax

goProgram.onUserLogout()

Remarks

Issues the following commands to open the VFXUSR table:

USE VFXUSR IN 0 ALIAS USER ORDER TAG USER

SELECT USER...

...

Seeks the user with SEEK(UPPER(m.GU_User)), saves the public user specific variables including the recently used file list entries, closes the VFXUSR table and and selects the original alias.


 cHelpFileName Property

Name of the current online help file.

Applies To

CFoxApp

Syntax

goProgram.CHelpFileName

Remarks

The help file automatization is still under construction.


 cOldBell Property

Old value of SET BELL ...

Applies To

CEnvironment

Syntax

OEnvironment.COldBell


 cOldClassLib Property

Old value of SET CLASSLIB ...

Applies To

CEnvironment

Syntax

OEnvironment.COldClassLib


 cOldConfirm Property

Old value of SET CONFIRM ...

Applies To

CEnvironment

Syntax

OEnvironment.COldConfirm


 cOldDate Property

Old value of SET DATE ...

Applies To

CEnvironment

Syntax

OEnvironment.COldDate


 cOldDeleted Property

Old value of SET DELETED ...

Applies To

CEnvironment

Syntax

OEnvironment.COldDeleted


 cOldDir Property

Old setting which will be saved and restored.

Applies To

CEnvironment

Syntax

OEnvironment.COldDir


 cOldEscape Property

Old setting which will be saved and restored.

Applies To

CEnvironment

Syntax

OEnvironment.COldEscape


 cOldExact Property

Old value of SET EXACT ...

Applies To

CEnvironment

Syntax

OEnvironment.COldExact


 cOldExclusive Property

Old value of SET EXCLUSIVE ...

Applies To

CEnvironment

Syntax

OEnvironment.COldExclusive


 cOldHelp Property

Old value of SET HELP ...

Applies To

CEnvironment

Syntax

OEnvironment.COldHelp


 cOldIntensity Property

Old value of SET INTENSITY ...

Applies To

CEnvironment

Syntax

OEnvironment.COldIntensity


 cOldMultilocks Property

Old value of SET¨MULTILOCKS ...

Applies To

CEnvironment

Syntax

OEnvironment.COldMultilocks


 cOldNear Property

Old value of SET NEAR ...

Applies To

CEnvironment

Syntax

OEnvironment.COldNear


 cOldNotify Property

Old value of SET NOTIFY ...

Applies To

CEnvironment

Syntax

OEnvironment.COldNotify


 cOldOnShutDown Property

Old value of ON SHUTDOWN ...

Applies To

CEnvironment

Syntax

OEnvironment.COldOnShutDown


 cOldPath Property

Old value of SET PATH ...

Applies To

CEnvironment

Syntax

OEnvironment.COldPath


 cOldProc Property

Old value of SET PROCEDURE ...

Applies To

CEnvironment

Syntax

OEnvironment.COldProc


 cOldResource Property

Old value of SET RESOURCE ...

Applies To

CEnvironment

Syntax

OEnvironment.COldResource


 cOldSafety Property

Old value of SET SAFETY ...

Applies To

CEnvironment

Syntax

OEnvironment.COldSafety


 cOldStatus Property

Old value of SET STATUS ...

Applies To

CEnvironment

Syntax

OEnvironment.COldStatus


 cOldTalk Property

Old value of SET TALK ...

Applies To

CEnvironment

Syntax

OEnvironment.COldTalk


 nOldMemo Property

Old value of  SET MEMOWIDTH ...

Applies To

CEnvironment

Syntax

OEnvironment.COldMemo


 Reset Method

Resets the Environment to the initial state, automatically called by Destroy().

Applies To

CEnvironment

Syntax

OEnvironment.Reset()


 Set Method

Sets the Environment to the desired state.

Applies To

CEnvironment

Syntax

OEnvironment.Set()


 QueryUnload Method

The Query Unload Method mimics the same functionality as the built in Visual FoxPro Query Unload method where this method does not exist.

Applies To

COfficebar, CToolbar,

Syntax

OToolbar.QueryUnload()

Returns

lExpr

Setting	Description
True	(Default) Unload can occur.
False	Unload request failed, unload should not occur.


 lMultiPage Property

Property which defines whether there are more than one pages on the PageFrame. Usually this is the case. If you want to have a Form with one no pages, use the class CDataForm instead.

Applies To

CDataFormPage, COneToMany,


 nOldPage Property

If you doubleclick in the VFX grid on a record, or if you select Edit (CTRL+E), you will automatically come back to the page where you started the operation. The property nOldPage saves the current page before switching to another page.

Applies To

CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar


 nPageEdit Property

Defines, on which pageframe page you have the first Edit Page. Usually this is the page number one. See also nPageList property.

Applies To

CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar


 nPageList Property

Defines, on which page you have the grid page. See also nPageEdit property.

Applies To

CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

NOTE: If you manually increase the number of pages using the PageCount property from the PageFrame, remember to increase this property to the propper number!


 onNextPage Event

This is the event which occurs whenever the user switches to a next page in the PageFrame. See also onPrevPage event.

Applies To

CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar


 onPrevPage Event

This is the event which occurs whenever the user switches to a previous page in the PageFrame. See also onNextPage event.

Applies To

CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar


 oChildGrid Property

Object handle to the current active child grid control.

Applies To

COneToMany, COneToManyBar

Remarks

This property is usually internally used.


 DeleteChildData Method

Use this method to write custom code which must execute to delete under special situations additional data related to the child record(s).

Applies To

COneToMany, COneToManyBar


 onSaveChildData Event

Will be called by the OnSave() method. Use this method to write custom code which must execute to save in special situations additional data related to the child record(s).

Applies To

COneToMany, COneToManyBar


 onDeleteChildData Event

Will be called whenever a child record will be deleted using the CTRL+DEL command button.

Applies To

COneToMany, COneToManyBar


 onInsertChildData Event

Will be called whenever a child record will be inserted using the CTRL+INS command button.

Applies To

COneToMany, COneToManyBar


 DoIt Method

Do the selected Task in the Database Tools Form for the selected Tables.

Applies To

CDatabaseTools


 SetMaxValue Method

Sets the Maximum Value, corresponding to 100%.

Applies To

CGauge


 SetMessage Method

Parameters

LPARAMETERS tcValue

Sets the Text of the Message Label on Top of the Gauge Display. Pass the Text as Parameter.

Applies To

CGauge


 SetText Method

Parameters

LPARAMETERS tcTitle

Sets the Text you pass as parameter for the Gauge.

Applies To

CGauge


 SetValue Method

Use this Method to Set the current Value, which will be used to display the current percentage of completion based on the 100% total, which will be defned while creating the GaugeObject in the following way:

loGauge = CREATEOBJECT('CGaugeWin', lnMaxItems)

Applies To

CGauge


 OnError Function

This is the Error Function which will be called when an error occurs. Refer also to the various

Errors are logged in the VFXLOG Table and can be viewed using a Form which is based on the Class CSysErrDialog which will be used to create the Form VFXLOG.

*-------------------------------------------------------

* Function....: OnError

* Called by...:

*

* Abstract....: ON ERROR Function Handler

*

* Returns.....:

*

* Parameters..: nError, cMethod, nLine, cMessage

*

* Notes.......:

*-------------------------------------------------------

FUNCTION OnError(nError, cMethod, nLine, cMessage)

...

...

...

...

*-------------------------------------------------------


 OnShutDown Function

This is the function which will be triggered whenever the user shuts down the main window of your application.

In the Method Set() of the class CEnvironment, the ON SHUTDOWN Clause will be executed...

#IFDEF _DEBUG_MODE

SET ESCAPE ON

ON SHUTDOWN

#ELSE

SET ESCAPE OFF

ON SHUTDOWN DO OnShutDown

#ENDIF

...and In the Method ReSet() of the Class CEnvironment, the original Value of the ON SHUTDOWN Clause will be resetted....

luTemp = this.cOldOnShutdown

ON SHUTDOWN &luTemp

*-------------------------------------------------------

* Function....: OnShutDown

* Called by...:

*

* Abstract....: ON SHUTDOWN Function Handler

*

* Returns.....:

*

* Parameters..:

*

* Notes.......:

*-------------------------------------------------------

FUNCTION OnShutDown()

...

...

*-------------------------------------------------------


 OnSkipMenu Function

This is the function which is used in the menu to define which when menu option must be disabled or enabled, FoxPro jargon: Skipping a menu option means disabling it and vice versa.

Here the example of the Edit/ Delete Menu Option:

OnSkipMenu('EDIT_DELETE')

Note: Make sure that the parameter you pass matches with the name you use in your menu.


 GetNewID Function

This Function can be used to create a new unique id which can be used as identification key. Normally you will use this Function in the onPostInsert() Event like in the following example:

*-------------------------------------------------------

CDataFormPage::onpostinsert()

replace table.field with GetNewId('COMP_ID')

...

*-------------------------------------------------------


 XLock Function

This Function can be used to log any event in the VFXLOG Table. See the Class CSysErrDialog.

*-------------------------------------------------------

* Function....: XLock

* Called by...:

*

* Abstract....: Logical File/Record Locking

*

* Returns.....: .T. If record/table is locked

*

* Parameters..: tcAlias, tnRecord

*

* Notes.......: USE DATA\VFXLOCK ORDER TAG KEY

*               IF tnRecord is empty lock table

*-------------------------------------------------------

FUNCTION XLock(tcAlias, tnRecord)

...

...

*-------------------------------------------------------


 XUnlock Function

This Function can be used to unlog any event in the VFXLOG Table. For additional informations refer to the Class CSysErrDialog for additional informations

*-------------------------------------------------------

* Function....: XUnLock

* Called by...:

*

* Abstract....: Logical File/Record Unlocking

*

* Returns.....: .T. If record/table is unlocked

*

* Parameters..: tcAlias, tnRecord, tlAllLock

*

* Notes.......: USE DATA\VFXLOCK ORDER TAG KEY

*-------------------------------------------------------

FUNCTION XUnLock(tcAlias, tnRecord, tlAllLock)

...

...

*-------------------------------------------------------


 XCrypt Function

Very simple encryption. Used to encrypt user passwords in the VFXUSER Table. For additional informations refer to the class CUserDialog.


 AddpageDelay Function

This function is used to add a container which contains all the controls for a page during runtime to a page. This is used to speedup form load time since loading all pages of a heavy CDataFormPage or COneToMany form can be rather time consuming.

See also the VFX Test Application, there we show how to create delayed instantiated forms (see form with the name delayed).

Usage

On the pages one to n-1, you will put the following code in the Activate() event of the page:

=AddPageDelay(thisform, this, 'x', 'delayed_p1')

whereas x is a name for the container which will be added to te page and delayed_p1 is the name of the container class holding all the controls which will be used on the page.

On the grid page, you add the following page in the Activate() event:

=AddPageDelay(thisform, this, 'grdgrid', 'delayed_p5')

NOTE: Make sure to name the grid grdgrid, since VFX depends on that.


 ErrorMsg Function

This Function is used to display error messages.

*-------------------------------------------------------

* Function....: ErrorMsg

* Called by...:

*

* Abstract....: Display a Error MessageBox

*

* Returns.....: lnAnswer

*

* Parameters..: tcMessageText, tnDialogType, tcMessageTitle

*

* Notes.......: USE a XOR bitwise

*-------------------------------------------------------

FUNCTION ErrorMsg(tcMessageText, tnDialogType, tcMessageTitle)

   LOCAL lnAnswer

   IF EMPTY(tcMessageText)

      tcMessageText = 'Syntax Error: ErrorMsg(tcMessageText, tnDialogType, tcMessageTitle)'

   ENDIF

   IF EMPTY(tnDialogType)

      tnDialogType = MB_OK+MB_ICONSTOP

   ENDIF

   IF EMPTY(tcMessageTitle)

      tcMessageTitle = ATTENTION_LOC

   ENDIF

   lnAnswer = MESSAGEBOX(tcMessageText, tnDialogType, tcMessageTitle)

   RETURN lnAnswer

ENDFUNC

*-------------------------------------------------------


 SetFirstFocus Function

This function is used to set the focus on the very first control.

It is automatically called by OnInsert() and OnEdit()

*-------------------------------------------------------

* Function....: SetFirstFocus

* Called by...: CDataForm::OnInsert(), CDataForm::OnEdit()

*

* Abstract....: Set focus to control with lesser TabIndex

*

* Returns.....:

*

* Parameters..: oContainer

*

* Notes.......:

*-------------------------------------------------------

FUNCTION SetFirstFocus(oContainer)

...

...

*-------------------------------------------------------

Note: It is important, that your object order is correct. Otherwise you will never get the expected results!


 GetArgCount Function

In situations, where you want to pass multiple parameters via a single parameter string, you need a function, which parses this string and identifyies each single logical parameter.

Refer to the code example in the topic GetArg Function.


 GetArg Function

In situations, where you want to pass multiple parameters via a single parameter string, you need a function, which parses this string and identifyies each single logical parameter.

Here a code exaple for this coming from the Init() method of a form:

*-------------------------------------------------------

LPARAMETERS tcArg

LOCAL cFilterExpr

IF !EMPTY(tcArg)

IF getArgCount(tcArg) <> 0

this.cCalledBy      = UPPER(  getArg(tcArg,1)        )

this.cFixFieldValue = STRTRAN(getArg(tcArg,2),'@',';')

thisForm.Caption    =         getArg(tcArg,3)

this.cFixFieldName  = STRTRAN(getArg(tcArg,4),'@',';')

this.cFilterExpr    = UPPER(  getArg(tcArg,5)        )

this.lPutInLastFile  = .F.

DO CASE

   CASE this.cCalledBy = 'CTRY'

      this.pgfPageFrame.Page1.cntpers_ctry_id.lFixField = .T.

      this.pgfPageFrame.Page3.cntpers_comp_id.lFixField = .F.

CASE this.cCalledBy = 'COMP'

      this.pgfPageFrame.Page1.cntpers_ctry_id.lFixField = .F.

      this.pgfPageFrame.Page3.cntpers_comp_id.lFixField = .T.

ENDCASE

ENDIF

ENDIF

IF !this.lWorkOnView AND !EMPTY(this.cFilterExpr)

cFilterExpr = this.cFilterExpr

SET FILTER to &cFilterExpr

this.pgfPageFrame.Page4.grdGrid.Refresh()

ENDIF

*--we need that for temp new rec in comp!!

this.extrabuffer = SYS(2015)

*--

***************************************************

IF this.lWorkOnView

thisForm.cQueryArg = this.cFixFieldValue

ENDIF

CDataFormPage::Init()

*-------------------------------------------------------

NOTE: If you select Child Form  in the VFX form builders, you receive a code template for the Init() method. Refer to the user manual, Topic Create a Form that gets called by a Master Form

 for more Information.


 IncBase10 Function

This Function is used within GetNewId(). It generates an incremented character Identification key.

'0000000013'

'0000000014'

'0000000015'

*-------------------------------------------------------

* Function....: IncBase10

* Called by...: GetNewId

*

* Abstract....: Generate a incremented char value

*

* Returns.....: cNewValue

*

* Parameters..: tcValue, tnMaxLen

*

* Notes.......: Format string: '0000000000'

*-------------------------------------------------------

FUNCTION IncBase10(tcValue, tnMaxLen)

   LOCAL lcNewValue, lnStringLength

   lnStringLength = LEN(tcValue)

   IF PARAMETERS() = 2

      lnStringLength = tnMaxLen

   ENDIF

   IF EMPTY(tcValue)

      tcValue = '0'

   ENDIF

   lcNewValue = PADL(RIGHT(ALLT(STR(VAL(tcValue) + 1)), lnStringLength), lnStringLength)

   lcNewValue = STRTRAN(lcNewValue,' ', '0')

   RETURN lcNewValue

ENDFUNC

*-------------------------------------------------------


 Spy Function

If you are lost and don't know any more from where a particular Method or Event will be called, just put the line

=SPY()

in the code of the Method you want to inspect. This Utility is also extremely useful if you want to make code tuning, where you must reduce the number of times certain routines will be called.

If you are additionally interested in the value of a specific variable, pass the Name of the variable as a parameter. Spy then shows you also the content of this variable.

*-------------------------------------------------------

* Function....: Spy

* Called by...:

*

* Abstract....: Display last 4  programs stack calls

*

* Returns.....:

*

* Parameters..:

*

* Notes.......:

*-------------------------------------------------------

FUNCTION Spy

   LPARAMETERS tcVariable

   LOCAL j,  k,  cText, xValue

   cText = 'Called by: ' + CHR(13)

   j = 1

   DO WHILE !EMPTY(PROGRAM(j))

      j = j + 1

   ENDDO

   k = j - 1

   IF k > 4

      j = k - 4

   ENDIF

   DO WHILE j < k

      cText = cText + PROGRAM(j)+CHR(13)

      j = j + 1

   ENDDO

   IF !EMPTY(tcVariable)

      cText  =  cText + tcVariable + ' = '

      xValue = &tcVariable

      IF TYPE('xValue') = 'C'

         cText = cText + xValue

      ENDIF

      IF TYPE('xValue')  $  'NFI'

         cText = cText + ALLTRIM(STR(xValue))

      ENDIF

      IF TYPE('xValue')  $  'D'

         cText = cText + DTOC(xValue)

      ENDIF

      IF TYPE('xValue')  $  'D'

         cText = cText + DTOC(xValue)

      ENDIF

      IF TYPE('xValue')  $  'L'

         cText = cText + IIF(xValue , '.T.', '.F.')

      ENDIF

   ENDIF

   WAIT WINDOW cText

   RETURN .T.

ENDFUNC

*-------------------------------------------------------


 VFX_CheckUpdate Function

VFX offers an easy, non ALTER TABLE but APPEND FROM based way to update the data structures at your client sites. The disadvantage is that it takes sometimes longer than an ALTER TABLE based approach, the advantage is that it always works, also with views and local tables.

Usage

To update the data structures at the client site prepare an empty copy of the new data structure, preferrably zap all tables to save space, however VFX automatically zaps them during further processing.

Make sure no user is currently working with the application you want to update. Copy the empty data structures in the DATA\UPDATE directory at your client site (together with the new EXE and other components which may have changed). When the first user starts the application a control file named UPD$CTRL.KEY is created in the application directory to prevent other users from starting the application during the update process is running.

NOTE: Recommend that the user always makes a copy of his current application files before he updates to a new version. If for any reason you crashed during an update, make sure to delete the control file named UPD$CTRL.KEY, solve the problem you had and try again.

The file update.log logs the update process.

Incremental updates

The VFX update process is optimized and checks whether a table needs to be updated or not. This makes it easy for you: Always send all empty data structures to the client as described above and the update process takes care of an optimized way to update your client installation.


 VFX_NeedUpdate Function

This is a utility function used by the VFX_CheckUpdate function.


 WriteDBCLink Function

This is a utility function used by the VFX_CheckUpdate function.


 VFX_UpdateError Function

This is a utility function used by the VFX_CheckUpdate function.


Visual FoxPro Internal

This is a built in Visual FoxPro Element. Please refer to the Visual FoxPro Help.


 lPercentShow Property

Defines, whether a % Value of completion will be displayed.

Applies To

CGauge


 nMaxValue Property

Property holding the Maximum Value which corresponds to 100%.

Applies To

CGauge


 nValue Property

Property holding the current value to be displayed the progress for.

Applies To

CGauge


 lcFormClass Property

Internally used Property which defines, whether TYPE('thisForm.nLockScreen') = 'N'.

Applies To

CMover

To optimize Screen Refresh Operations, this Property will be used as follows:

IF this.lCFormClass

    thisForm.DispBegin()

ELSE

    thisForm.LockScreen = .T.

ENDIF


 nColToView Property

Defines, which Colums in a multi column array will be used to ve displayed. If not defined, by default, the first column will be displayed.

Applies To

CMover


 nMaxCol Property

Defines the maximum number of Columns in the Array.

Applies To

CMover


 nMaxRow Property

Defines the maximum number of Rows in the Array.

Applies To

CMover


 GetData Method

Parameters

LPARAMETERS taSelected

Pass the Array by reference into which you want to put the selected items.

Applies To

CMover


 SetData Method

Parameters

LPARAMETERS taSource, taSelected

Pass the Source Array plus, if you need to, the Array which descibes which Elements need to be preselected. This will be usefull, when you have reentrant Mover Dialogs.

Applies To

CMover


 onSelectedChange Event

Occurs, when the List of selected Elements changes.

Applies To

CMover


 onSourceChange Event

Will be called from the InteractiveChange() Method from the Source List.

Applies To

CMover


 lAutoSetup Property

The lAutoSetup Property defines, whether the control should automatically be disabled while not in edit or insert mode and vice versa. See also the form property nFormStatus.

Applies To

CCheckbox, CChildGrid, CCombobox, CCommandButton, CCommandGroup, CContainer, CEditbox , CFixField, CGrid, CKeyField, CListbox, CPickField, CPickGrid, CPickTextBox, CPushPin, CSpinner, CTextbox,

Remarks

On grid level, this property allows you to create data entry grids when setting lAutoSetup to false.

NOTE: Set this property always to False when you want a control to be always accessible, i.e. independant from the form status. Usually this is also the case when you use the control on a screen like the system parameters screen, which does not know the form status edit or insert of course.


 lAutoResizeControl Property

Defines, whether the controls on the form will resize according the resize of the form. Applies to all VFX forms. See also the application class property lDisableFormResize

Applies To

CForm, CModalForm, DataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar


 lAutoSynchChildform Property

This property defines, whether you want the linked child forms synchronize automatically whenever the parent record changes or only when the user activates the child form.

Applies To

CForm, CModalForm, DataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.lAutoSynchChildform[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	Linked child forms will refresh immediately when parent record changes
False (.F.)	(Default) Linked child forms will refresh only when user activates them

Remarks

See also property lUseChildform and method onSetChildData() for further information.


 lProportionalResize Property

Defines, whether the controls should resize keeping the original proportions to each other. Applies to all VFX controls you can use on a form.

Works only if the form property lAutoResizeControl is set to true.

Applies To

CCheckbox, CChildGrid, CCombobox, CCommanbutton, CEditbox , CFixField, CGrid, CKeyField, CLine, CListbox, COleBoundControl, CPickField, CPickGrid, CPickTextBox, CPushPin, CShape,  CSpinner, CTextbox

Syntax

Form.lProportionalResize[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default) controls will resize keeping the original proportions to each other
False (.F.)	controls will not resize if form is resized


 lUseSetKey Property

This property indicates whether the current grid uses the SET KEY TO command rather than the SET FILTER TO command for performance reasons.

Applies To

CGrid, CChildGrid

Syntax

Form.lUseSetKey[ = lExpr]

Settings

lExpr

Setting	Description
True (.T.)	(Default in CGrid)
False (.F.)	(Default in CChildGrid)

Remarks

Usually you will just set the form property lUseSetKeyAsFilter.


 nIncSearchTimeout Property

This property defines for how many seconds the actually entered search string will be active. By default the current search string for incremental search (displayed also in the statusbar) will be initialized after 2 seconds.

Applies To

CGrid

Syntax

Form.nIncSearchTimeout[ = nExpr]

Settings

nExpr

Setting	Description
2	(Default) After 2 seconds the incremental search string will be initialiized
0	No time related initialization occurrs
Any pos number	Number of seconds before the incremental search string will be initialiized

Remarks

Note that the displayed search string in the status bar does only change when a user input occurs.


 nMaxRec Property

If the user invokes an incremental search or a sort by doubleclicking on the column header and there is no CDX index tag available, VFX creates a temporary IDX index. Usually this temporary creation is fast if there are not too many records, thats why no user dialog appears before the index is created.

If you have a table or view with a lot of records, you may want to let the user the choice whether he really wants to create the index or not. The property nMaxRec defines the maximum records before a confirmation dialog appears. If there are more than nMaxRec records available, a messagebox appears saying This operation may take longer. Do you want to continue?.

Applies To

CGrid

Syntax

Form.nMaxRec[ = nExpr]

Settings

nExpr

Setting	Description
1000	(Default) Up to 1000 records will be indexed without user interaction
-1	Always ask before any IDX will be created


 lUseWinUsername Property

Defines, whether the windows logon name will be used when the VFX login dialog appears.

Applies To

CFoxApp

Syntax

goProgram.lUseWinUsername[ = lExpr]

Settings

lExpr

Setting	Description
.T.	(Default) Use the Windows logon name as default in the logon dialog when the application starts
.F.	Do not take the Windows logon name in the logon dialog. User must always enter his username manually

Remarks

Note that there is a special behaviour when no application level security has been installed when there is no password in the VFXUSR table for the administrator account.


 nAddUserToCaption Property

Defines, whether you want to display the currently logged on user in the main caption of your application window.

Applies To

CFoxApp

Syntax

goProgram.nAddUserToCaption[ = nExpr]

Settings

nExpr

Setting	Description
0	(Default) Do not alter the caption of the application main window
1	Add the content of the field user_name (c, 32) as entered in the user table to the caption of the application main window
2	Add the content of the field user (c, 10) as entered in the user table to the caption of the application main window


 nAskToSave Property

If you dont like it, that the users of your application will always be asked before a record modification will be saved you can use this property to define this behaviour. Basically the form property lAskToSave defines, whether a user will be asked prior a record will be saved or not. The application class property nAskToSave is used to override the form settings of lAskToSave if needed. This allows you to easily switch for all forms within an application at once from one behaviour to another or let your users decide how they want to work by setting this application class property in the onPostlogin() method after the user logged in based on a user specific setting.

Applies To

CFoxApp

Syntax

goProgram.nAskToSave[ = nExpr]

Settings

lExpr

Setting	Description
0	(Default) Take form settings as defined in the form property lAskToSave
1	For all forms lAskToSave will be forced to true
2	For all forms lAskToSave will be forced to false


 nEnableHook Property

Hooks are places in the VFX source code where a function will be called to allow further customization without the need to subclass. See the following Remarks for more details regarding hooks in general. The property nEnableHook defines the behaviour regarding VFX hook operations. Basically the form property lUseHook defines, whether the VFX hooks are called or not. The application class property nEnableHook is used to override the form settings of lUseHook if needed. This allows you to easily switch for all forms within an application at once from one behaviour to another.

Applies To

CFoxApp

Syntax

goProgram.nEnableHook[ = nExpr]

Settings

nExpr

Setting	Description
0	(Default) Take form settings as defined in the form property lUseHook
1	For all forms lUseHook will be forced to true
2	For all forms lUseHook will be forced to false

Remarks

For a list of all available hooks refer to the update and release notes of VFX 5.0 or search in the whole VFX source code the name "hook".

Hooks and the associated code can easily be defined and affect exactly the objects the developer decides. This eliminates the need to subclass the VFX classes and allows the modification of already created applications without code redundancy.

The concept behind the VFX hooks is very simple. From within specific VFX methods, the onEventHook method gets called. Here is an example of such a call from within a refresh method:

PROCEDURE Refresh

if pemstatus(thisForm,"lUseHook",5) and thisForm.lUseHook and
 	!thisForm.OnEventHook("Refresh",this,thisForm)

return .t.

endif

ENDPROC

Then, the onEventHook method looks which function has te be called. This can be specified on form level using the cHookFunction property.

PROCEDURE oneventhook

lparameters tcEvent, toObject, toForm

local lRetCode

lRetCode = .T.

if empty(this.cHookFunction)

lRetCode = EventHookHandler(tcEvent,toObject,toForm)

else

lRetCode = eval(this.cHookFunction+"(tcEvent,toObject,toForm)")

endif

return lRetCode

ENDPROC

The function EventhookHandler looks like this. Here you put your event hook code to customize whatever behaviour of your application without the need to create a subclass.

******************************************************************************

* Project...........: Visual Extend 5.0

*                     Copyright (c) Devigus Engineering AG.

*                     All Rights Reserved.

*

* Program...........: VFXHOOK.PRG

* Author ...........: DEAG

* Created...........: April 1997

* Version...........: 05.00.000

*

* Description.......:

* Calling Samples...:

* Parameter List....:

* Major change list.:

*

#INCLUDE "INCLUDE\VFX.H"

function EventHookHandler(tcEvent, toObject, toForm)

local lContinue

lContinue = .T.

do case

** your hook handler code goes here

**

endcase

return lContinue

endfunc

Here are the properties which are used to customize the hook behaviour:

The CFoxapp property nEnableHook is responsible whether hooks will be activated or not. Use this property, if you want to use hooks in all of your forms.


 onEventHook Event

This is the event hook on form level which will be called to process hook operations. If the property cHookFunction has not been set, the default function called EventHookHandler gets called, otherwise the function defined through the cHookFunction property gets called. See also nEnableHook resp. lUseHook.

Applies To

CForm, CModalForm, CDataForm, CDataFormPage, CDataFormPageBar, COneToMany, COneToManyBar

Syntax

Form.onInit()


 nAutoEditMode Property

If you dont like it, that the users of your application will always have to explicitely enter into edit mode before they can make changes to existing data (CTRL+E), you will use this property. Basically the form property lAutoEdit defines, whether you can switch to edit mode just by editing any control on the form or not. The application class property nAutoEditMode is used to override the form settings of lAutoEdit if needed. This allows you to easily switch for all forms within an application at once from one behaviour to another or let your users decide how they want to work by setting this application class property in the onPostlogin() method after the user logged in based on a user specific setting.

Applies To

CFoxApp

Syntax

goProgram.nAutoEditMode[ = nExpr]

Settings

lExpr

Setting	Description
0	Take form settings for lAutoEdit
1	(Default) For all forms lAutoEdit will be forced to true
2	For all forms lAutoEdit will be forced to false


 nCentury Property

Together with the property nCentury, the property nRollover will be used in the onSetenv() method of the CForm class to make the following statement when a form loads:

set century to (lnCentury) rollover (lnRollover)

lnCentury will be defined by the nCentury property and lnRollover will be defined by the nRollover property. See also the property lCentury.

Applies To

CFoxApp

Syntax

goProgram.nCentury[ = nExpr]

Settings

lExpr

Setting	Description
nExpr	A number from 1 to 99 that specifies the current century. When a date has a two digit year, nCentury determines in which century the year occurs.

Example

SET CENTURY TO 19 ROLLOVER 60

? {02/16/96}	&& Displays 02/16/1996

? {02/16/56}	&& Displays 02/16/2056

NOTE: For additional information please refer to the Visual FoxPro help system regarding set century to.


 nRollover Property

Together with the property nCentury, the property nRollover will be used in the onSetenv() method of the CForm class to make the following statement when a form loads:

set century to (lnCentury) rollover (lnRollover)

lnCentury will be defined by the nCentury property and lnRollover will be defined by the nRollover property. See also the property lCentury.

Applies To

CFoxApp

Syntax

goProgram.nRollover[ = nExpr]

Settings

lExpr

Setting	Description
nExpr	A number from 0 to 99 that specifies the year above which is the current century and below which is the next century.

Example

SET CENTURY TO 19 ROLLOVER 60

? {02/16/96}	&& Displays 02/16/1996

? {02/16/56}	&& Displays 02/16/2056

NOTE: For additional information please refer to the Visual FoxPro help system regarding set century to.


 lProportionalFont Property

Defines, how the Grid will be treated in the Resize Event. If you select lProportionalFont=.T., the Grid resizes keeping the original proportions. This means that you don't see more lines if the grid increases in size, the Font just gets proportinally bigger.

If you want to see more lines whenever the Grid increases in size, set this Property to .F. This defines, that the original Font will be kept and therefore you see more lines in the grid.

Works only if the Form Property lAutoResizeControl is set to .T.

Applies To

CGrid, CChildGrid, CPickGrid


 onKeyEnter Event

Called whenever the user presses the ENTER key.

Applies To

CGrid, CChildGrid, CPickGrid

Remarks

Use this event if you want to trigger specific functions whenever the user presses enter while in the grid.


 onKeyPress Event

Called by the Keypress Event of the Text contained in the Column of the Grid.

In the CChildGrid there is no Code associated to this Event.

Applies To

CGrid, CPickGrid


 onSetOrder Event

Called by the Doubleclick Event of the Header.

In the CChildGrid there is no Code associated to this Event.

Applies To

CGrid, CChildGrid, CPickGrid


 cFixColumnList Property

String of semicolumn delimited column numbers which will always be in ReadOnly Mode. This is easier than setting the ReadOnly Property in the Grid manually.

Example: cFixColumnList = F'1;3;5'

This setting will automatically be set by the VFX Form Builder.

Applies To

CChildGrid


 lCanUpdate Property

Defines, whether the CTRL+INS (o ) and CTRL+CANC (onDelete) can be used.

If you want only to allow only the Editing of already existing Records, see the lEditing Property.

Applies To

CChildGrid

NOTE: Do not confuse this with the Form Property lCanEdit. It has nothing to do with it. The lCanUpdate just defines, whether it should be possible to insert new records and delete existing ones.


 lEditing Property

If you set this Property to .T. and leave the lCanUpdate Property to .F., you can only Edit the existing Records in the Chid Grid.

If lEditing is set to .F., the grid will be in read only mode.

Applies To

CChildGrid


 Hide Method

Use this Method, if you want to hide the Control. Sets the Visible Property to false.

Applies To

CImage


 Show Method

Use this Method to show the Control. Sets the Visible Property to true.

Applies To

CImage


 Refresh Method

Refreshes the Control.

Applies To

CLabel, CImage, CLine, COleBoundControl, CShape


 lUseGrid Property

This property defines whether the pagaframe contains a grid or not. Used for optimization of refresh.

Applies To

CPageFrame


 cDataForm Pickfield Property

Name of the form which gets called when user selects Maintenance while in the picklist dialog.

Applies To

CPickField, CPickTextbox


 cFieldList Property

List of Fields which are displayed in the Picklist Dialog, separated by semicolumn.

This is sometimes a more convenient way to pick from a local file than defining a cursor which contains the desired fields for the picklist. See also cFieldTitle property.

Applies To

CPickField, CPickTextbox


 cFieldTitle Property

This property is used to define the captions, separated with semi colons, which are used as titles for the fields used in the pick dialog. See also cFieldList property.

Applies To

CPickField, CPickTextbox


 cIndexExpr Property

Index Expression for the picklist table.

Applies To

CPickField, CPickTextbox


 cPickCaption Property

Caption for the picklist form. Usually something like:

Applies To

CPickField, CPickTextbox

Example

Please select a customer...


 cPickCursor Property

Internal use.

Applies To

CPickField, CPickTextbox


 cPickForm Property

Name of the form which gets called as the picklist dialog. Usually this is the VFXPICK Form.

Applies To

CPickField, CPickTextbox

Example

this.cPickForm='VFXPICK'


 cReturnExpr Property

Return expression for the picklist code textbox. This is the field you want to pick from the picklist table.

Applies To

CPickField, CPickTextbox

Formdesigner:

Example

this.cReturnExpr='CUST_ID'

NOTE: You don't need to prefix the table alias from the picklist table. Just write the name of the field you want to get the value back.


 cReturnExprDesc Property

Return Expression for the picklist field.

Applies To

CPickField, CPickTextbox

Formdesigner:

Example

this.cReturnExprDesc='CUST_ID'

NOTE: You don't need to prefix the table alias from the picklist table. Just write the name of the field you want to get the value back.


 cReturnMoreExpr Property

Sometimes, it's not enough to get only a code together with a description from a picklist table. In such a case, you will use the property cReturnMoreExpr where you can write any valid expression which will be evaluated on the picklist table.The result of your expression will be stored in the property cReturnMoreExprVal.

Applies To

CPickField, CPickTextbox

Example

this.cReturnMoreExpr='CREDIT_LIMIT'

This would pick up the value of the Field CREDIT_LIMIT from the picklist table and stores the result in the cReturnMoreExprVal, which could become the value of llet's say the number 10000.

See also the onPick event.


 cReturnMoreExprVal Property

Sometimes, it's not enough to get only a code together with a description from a picklist table. In such a case, you will use the property cReturnMoreExpr where you can write any valid expression which will be evaluated on the picklist table.The result of your expresseion will be stored in the property cReturnMoreExprVal.

Applies To

CPickField, CPickTextbox

Example

this.cReturnMoreExpr='CREDIT_LIMIT'

This would pick up the value of the Field CREDIT_LIMIT from the picklist table and stores the result in the cReturnMoreExprVal, which could become the value of llet's say the number 10000.


 cSeekValue Property

If the picklist table has a concatenated key to identify the records, you may use this property to set in the LostFocus() Method of the txtField pickfield control the appropriate value.

Applies To

CPickField, CPickTextbox

Example

this.TxtField.LostFocus()

...

this.cSeekValue = <ExprX> + this.Value

In the above example, the concatenation of an Expression <ExprX> with the value of the pickfield textbox holding the code defines the seekvalue with which the validation in the picklist table can be performed.


 cSQLValid Property

This property should no more be used. Now a better validation method is available through the nValidMode property if set to 1.It is highly recommended that you update your existing pickfield objects which operate with views to the new standard with nValidMode = 1!

History:

First the VFX CPickField class was not at all optimized for C/S environments. Then we added the cSQLValid property to give the developer a method to validate the user input in the pickfield using an SQL statement which was used against the picklist view. This had the disadvantage, that for a simple validation the whole pick view had to be retrieved, which was not optimized enough.

Now:

See the nValidMode property as well as the cViewValid properties for explanations how to use the CPickField efficiently in a C/S environment.


 nValidMode Property

This property defines how the user input in a pickfield is validated when working against a view, what will be defined using the lWorkonView property. Since in a view there is no index by design, a seek cannot be issued. Also if you would index the view and issue a seek, you would still have a poor design for C/S environments because you would retrieve records which are not needed.

The best scenario is, that the user input gets validated by just retrieving one single record using a parametrized, non updatable view. To do this you must set the property nValidMode to 1.

Applies To

CPickField

Syntax

PickField.nValidMode[ = nExpr]

Settings

nExpr

Setting	Description
0	(Default) Old compatibility modus for C/S environments, not recommended anymore
1	Advanced optimized mode using two separate views for validating and picking

Remarks

If you set this property to 1, you will have to define two views. One for the validation of user input (property cViewValid) and another for the picklist showing all available records (property cTableName)

NOTE: See the VFX Test Application for further information and samples regarding the usage of VFX Pickfields in a C/S environment. Additional information you will find in the tutorial.


 readonly Property

Setting this property to true, the CPickField object will be read ony. This is easier than setting the readonly property on the txtField and the cmdpick object.

Applies To

CPickField

Syntax

PickField.readonly[ = lExpr]


 cViewValid Property

When operating in a C/S modus defined with lWorkOnView = .T. and the nValidMode property = 1, this property holds the name of the view which will be used to validate the user's input.

Applies To

CPickField

Syntax

PickField.cViewValid[ = cExpr]

Remarks

This view can be read only and must have exactly one parameter which will automatically be read and used during runtime to make the validation using the input the used made in the CPickfield.txtField textbox.

NOTE: See the VFX Test Application for further information and samples regarding the usage of VFX Pickfields in a C/S environment.


 cTableName Property

Name of the picklist table.

Applies To

CPickField, CPickTextbox

Example

this.cTableName = 'CUSTOMER'

Remarks

When lWorkonView is true, this is the name of the view. See also nValidMode for additional infos regarding C/S environments.


 cTagName Property

Name of the index tag used for the picklist table.

Applies To

CPickField, CPickTextbox

Example

this.cTagName = 'CUST_ID'


 cTagNameJump Property

In cases where the index used for the pickfield does not exist (working with a view) the property cTagName will be empty. To be able however to define a tagname which will be used to position the record in the called maintenance form, the property cTagNameJump will be used.

Applies To

CPickField, CPickTextbox

Example

this.cTagNameJump = 'ID'

Remarks

If the property cTagNameJump has been defined the property cTagName will be ignored when jumping to the record in the maintenance form.


 l3DDesc Property

Defines whether the txtDesc controls should show the description in a 3 dimensional look.

Applies To

CPickField

Syntax

PickField.l3DDesc[ = lExpr]

Settings

lExpr

Setting	Description
.T. (True)	(Default) Use 3D style
.F. (False)	Don't use 3D style


 lAutoPick Property

Defines whether the pickfield dialog will automatically be called when a wrong input has been made.

Applies To

CPickField

Syntax

PickField.lAutoPick[ = lExpr]

Settings

lExpr

Setting	Description
.T. (True)	Automatically call the pick dialog when wrong code has been entered
.F. (False)	(Default) Don't automatically call the pick dialog when wrong code has been entered


 lAutoResize Pickfield Property

Defines whether the cmdPick command button will automatically be adapted in the size according the size of the txtField control.

Applies To

CPickField

Don't mix this property up with the lAutoResizeControl property which has been introduced for the proportinal resize functionality.


 lDoValid Property

Defines whether the validation of of the txtField value must be performed. Normall you should not use this. It's more for internal use than for external.

Applies To

CPickField, CPickTextbox


 lFixField Property

Mimics the behaviour of a CFixField control. Set this property to true if your pickfield control should act as if it would be a FixField control.

This property usually will be set in the Init() method of the form.

Applies To

CPickField

Example

LPARAMETERS tcArg

IF !EMPTY(tcArg)

IF getArgCount(tcArg) <> 0

this.cCalledBy      = UPPER(  getArg(tcArg,1)        )

this.cFixFieldValue = STRTRAN(getArg(tcArg,2),'@',';')

thisForm.Caption    =         getArg(tcArg,3)

this.cFixFieldName  = STRTRAN(getArg(tcArg,4),'@',';')

this.cFilterExpr    = UPPER(  getArg(tcArg,5)        )

this.lPutInLastFile  = .F.

IF this.cCalledBy = 'EMPLOYEE'

this.pgfPageFrame.Page1.cntEmp_ID.lFixField = .T.

ENDIF

ENDIF

ENDIF

IF !this.lWorkOnView AND !EMPTY(this.cFilterExpr)

LOCAL cFilterExpr

cFilterExpr = this.cFilterExpr

SET FILTER to &cFilterExpr

ENDIF

LOCAL lRetCode

lRetCode = CDataFormPage::Init()

_screen.LockScreen = .F.

RETURN lRetCode


 lHideCode Property

This property can be set to true, if the textbox of the pickfield should be hidden.

Applies To

CPickField

Syntax

PickField.lHideCode[ = lExpr]

Settings

lExpr

Setting	Description
.T. (True)	Textfield will be hidden
.F. (False)	(Default) Textfield is visible

NOTE: To hide the description field, you must size it to width 0.


 lUseTab Property

This property can be set to true, if you want to tab directly to the next field whenever a value has been picked from the picklist.

Applies To

CPickField

Syntax

PickField.lUseTab[ = lExpr]

Settings

lExpr

Setting	Description
.T. (True)	Tabs to the next field in taborder after pick
.F. (False)	(Default) stays on the same field


 onPick Event

This event fires automaticall whenever a value has been picked from the picklist.You can use this event for easy fetching of any additional information from the pick table which will be selected and positioned correctly (according the entered pick value) when this event fires.

Applies To

CPickField

Remarks

This event fires also if the picklist is not explicitely called and a correct user input occurred.


 onRefresh Event

This event fires automaticall whenever the pickfield will refresh and the lUserRefresh property is set to true. Use this for custom refresh code which should be displayed in the description of the pickfield.

Applies To

CPickField

Example

This code is placed in the onRefresh event of a pickfield which displays descriptive information on two lines (increased size of description textbox)

if !empty(this.txtfield.value)

if thisForm.nFormStatus # 2

this.txtdesc.value = trim(custprg.program_name) + chr(13) +;

                     	trim(catpaddr.catpaddr_name)

endif

endif

with thisForm.pgfPageFrame

if thisForm.nFormStatus = 2 and empty(location.customer_id)

.Page1.cntCustomer_Id.SetCodeValue(custprg.customer_id, .T.)

endif

endwith


 lKeyField Property

Mimics the behaviour of a CKeyField control. Set this property to true if your pickfield control should act as if it would be a KeyField control.

That a pickfield is in the same time also a KeyField is rather rare, but can occurr.

Applies To

CPickField


 lNullValid Property

Defineswhether the txtField can be empty at runtime.

Applies To

CPickField, CPickTextbox


 lUserRefresh Property

If you need a custom refresh for the txtDesc control, set this property ti true and write your own refresh code in the onRefresh() event of the pickfield container control.

Applies To

CPickField

See also onRefresh.


 Clear Pickfield Method

Calls the Clear() Methods of the two Listboxes lslSource and lstSelected and Initializes the whole Mover Environment to blank.

Applies To

CMover


 GetCodeValue Method

Gets the value property of the txtField control.

Applies To

CPickField, CPickTextbox


 Clear Method

This method clears the code and description field of the pickfield.

Applies To

CPickField


 GetDescValue Method

Gets the value property of the txtDesc control.

Applies To

CPickField


 GetMoreValue Method

Gets the value of the cReturnMoreExprVal property.

Applies To

CPickField


 SetCodeValue Method

Sets the property of the txtField and automatically synchronizes the txtDesc control by fetching the right description and refreshes correctly.

Applies To

CPickField, CPickTextbox

Example

CDataFormPage::onpostinsert()

thisForm.pgfPageFrame.Page2.txtComp_ID.Value = GetNewId('COMP_ID')

IF !EMPTY(m.gs_CTRY_ID) AND EMPTY(COMP_CTRY_ID)  && this empty is important if fixfield!!

  thisForm.pgfPageFrame.Page1.cntcomp_ctry_id.SetCodeValue(m.gs_CTRY_ID, .T.)

ENDIF


 SetDescValue Method

Sets the property of the txtDesc and refreshes correctly.

Applies To

CPickField


 DoPickForm Method

Calls the Picklist Form. The user can call the picklist either

-by pressing the F9 key, or

-by Doubleclicking

Applies To

CPickTextbox


banana layer

Banana layers are software components which are put on top of Visual FoxPro and offer some entry level assistance. Since these components hide you from the Visual FoxPro development environment, and, in some cases are in competition with already existing components such as project manager, class designer and others, they are unproductive after a while and very dangerous. That's why VFX does not offer such a banana layer. You can call the VFX builders just when you need them, but otherwise you work within VFP.


 Tutorial

See the various tutorial topics to find out how to do specific things with VFX. Note: We have also a Frequently Asked Questions Section on our web, visit us!

Initial Application Setup

How can I change the splash screen

How can I change the background bitmap

How can I change the caption of the main window

How can I change the captions in the about dialog

Menu customization

How can I add menu bars to the file menu

How can I add menu bars to the window menu

How can I add menu pads to the main menu

Foreign key validation using the VFX Pickfield

How can I use the pickfield class with numeric fields

How can I use my own refresh logic using the pickfield class

How can I pick additional information from the pick table after picking

How can I tab to the next field after the user picked a value

Advanced form techniques

How can I create linked child forms

How can I use the VFX event onPostInsert() to fill in a generated ID

How can I add additional pages in a dataformpage form

How can I add additional pages in the child area of a onetomany form

How can I synchronize the form with a form specific toolbar

How can I use the mover dialog and pass preselected items

How can I use the gauge window to graphically show the progress of an operation

How can I restrict the multi instantiation feature of a form

How can I get rid of the navigation bar on the form and have them in the main toolbar

How can I have the navigation bar on the form and get rid of them in the main toolbar

Dynamic Data Location

How can I dynamically move the data location at the customer site

Speed Optimization with filtered data

How can I use the optimization property lUseSetKeyAsFilter

Views and Client/Server

How can I create Client/Server Forms using parametrized local/ remote views

How can I use views in called child forms

How can I use views in onetoMany forms


 VFX Test Application

The VFX Test Application is a great source of information.

NOTE: The VFX Test Application contains full source code and therefore can not be freely distributed. Only registered VFX customers can download the VFX Test Application from our VFX download site at http://www.devigus.com.

Components of the Test Application (Structured according the File/ Open Dialog in the application):

Page	Form	Description	Formname
Simple	Parent	Parent form which acts as parent form in a linked child form scenario (see also the Tutorial) plus a sample use of the mover dialog form and the gauge dialog form  class.	parent
	Child	The child form can also be called directly, not only via the parent form. This form shows usefull things regarding the cPickField class, especially the lFixField property defined in the Init() method of the form.	child
	Item	The item table shows the usage of the CTableForm class.	item
	OneToMany	This form, based on the COneToMany form class shows also the usage of the CPicktextbox class in the CChildGrid grid class. In this example the one side is the parent table and the many side is the child table.	oneto
	OneToMany2	This is the same form as the previous one with the difference that the one side is the item table and the many side is the child table.	oneto2
	Parent2	This form shows how to display all child records of a parent record using a view on a separate page including how to refresh it (see the Refresh method on page2 of the pageframe).	parent2
Delayed	Delayed	This form shows how to use the addpagedelay function of VFX to reduce form load time.	delayed
Wizard	Wizard	This is a sample of a form based on the CWizard class.	wiz01
LViews	xvParent C/S	This is a C/S form which uses the CAskViewArg class to get the selection criteria from the user before the data will be retrieved using a parametrized view.  Used Views: xvparent (main view)	xvparent
	xvParent2 C/S	This sample uses a range from ... to rather than just one value to select the data. Used Views: xvparent2 (main view)	xvparent2
	xvChild C/S	This form is called via the xvParent resp. the xvParent2 C/S forms above. Used Views: xvchild (main view) xvpickparent (picklist view for parent pick) xvpickparentv (validation view for parent) xvpickitem (picklist view for item pick) xvpickitemv (validation view for item) NOTE: Make sure to check out the CPickField objects for parent and item and fully understand the usage of the two views, one for picking (all records are retrieved) and one for validation (only a single record is retrieved).	xvchild
	OneToMany C/S	Same techniques as above, this time with a COneToMany based form. Used Views: xvparent2 (main view) xvchild3 (child view) xvpickitem (item pick)	onetocs
RViews	Authors	This is the sample working with the SQL Server 6.5 demo database named PUBS. Used Views: rvauthors (main remote view) NOTE: Make sure to have a DSN entry in your ODBC setup called VFXPUBS pointing to the pubs database on your SQL 6.5 Server, english version only, since the german version has been translated :(	rvauthors
	Titles	This form is called via the rvauthors form described  above. Used Views: rvtitleauthor (main remote view) rvpicktitles (picklist remote view for title pick) xvpicktitlesv (validation remote view for title) NOTE: Make sure to check out the CPickField objects for parent and item and fully understand the usage of the two views, one for picking (all records retrieved) and one for validation (single record retrieved).	rvtitlea


 How can I change the splash screen

The spleash screen is essentially created based on the bitmap defined in the application class property cIntroBitmap.

The easiest way to change the appearance of your splash screen is to modify the default bitmap called \bitmap\intro.bmp to your needs. Since you have a copy within your application directory, this is the straight foreward approach. Of course you could also set the property cIntroBitmap to point on any other bitmap you may already have. This would be done in the VFXMAIN.PRG like in the example shown unter the property cIntroBitmap.


 How can I change the background bitmap

The application class method DrawBackground() takes care of the creation of the background screen of your application.

The easiest way to change to another bitmap is to modify the bitmap bitmap\desktop.bmp. Since you have a copy within your application directory, this is the straight foreward approach.


 How can I change the caption of the main window

The constant MAINTITLE_LOC, found in the include file USERTXT.H is used to set the main caption of your application window. The statement in VFXMAIN PRG is the following:

Example

_screen.caption     = MAINTITLE_LOC


 How can I change the captions in the about dialog

In the include file USERTXT.H, you find the following constants, which define the appearance of your about dialog:

#define CAP_LBLYOURAPPLICATIONNAME          "Visual Extend Library"

#define CAP_LBLVERSION                      "3.50.110"

#define CAP_LBLCOPYRIGHTINFORMATION         "Copyright 1996 Devigus Engineering"

#define CAP_LBLTRADEMARKINFORMATION         "All rights reserved"

#define CAP_LBLTHISPRODUCTISLICENSEDTO      "This product is licensed to:"

change the above constants in the include file to something simmiar to this:

Example

#define CAP_LBLYOURAPPLICATIONNAME          "My Order Entry System"

#define CAP_LBLVERSION                      "2.00.000"

#define CAP_LBLCOPYRIGHTINFORMATION         "Copyright 1996 Your Company"

#define CAP_LBLTRADEMARKINFORMATION         "All rights reserved"

#define CAP_LBLTHISPRODUCTISLICENSEDTO      "This product is licensed to:"

NOTE: Before your changes will take effect, it is important that you open the form class CAboutDialog from within the class tab of your project manager, make a dummy change to the class and save it. This way Visual FoxPro will correctly recompile your about form and you will be able to see your personalized captions. This is due to the fact that we placed the langsetup code in the class library rather than on the form. The langsetup code gets executed whwnever a form starts. For additional information about this, please refer to the VFX user manual, chapter Creating Multilingual Applications.

Alternatively you can also use the recompile all option from within the VFX application manager form. This makes a real rebuild of your project, much better than the rebuild all option in the project manager.

NOTE FOR SHAREWARE USERS: In the shareware of VFX this feature is not available, because the source code of the class library is not available in the shareware.


 How can I add menu bars to the file menu

To add a menu bar to the File menu, open the menu file vfxmnu with the Visual FoxPro menu designer and make the changes you want to make. In the Visual FoxPro project manager, you find the menu under the page Other.

NOTE: Dont forget to generate your menu program file (vfxmnu.mpr) after you made changes in the menu designer!

In order to allow VFX to correctly put the recently used forms in the File menu, it has to know, where to start with the first entry. Therefore, you set the CFoxApp property FileMnuOffset, which is 7 by default to the correct value.


 How can I add menu bars to the window menu

To add a menu bar to the Window menu, open the menu file vfxmnu with the Visual FoxPro menu designer and make the changes you want to make. In the Visual FoxPro project manager, you find the menu under the page Other.

NOTE: Dont forget to generate your menu program file (vfxmnu.mpr) after you made changes in the menu designer!

In order to allow VFX to correctly put the currently open forms in the Window menu, it has to know, where to start with the first entry. Therefore, you set the CFoxApp property WinMnuOffset to the correct value.


 How can I add menu pads to the main menu

To add a new menu pad to the main menu, open the menu file vfxmnu with the Visual FoxPro menu designer and make the changes you want to make. In the Visual FoxPro project manager, you find the menu under the page Other.

NOTE: Dont forget to generate your menu program file (vfxmnu.mpr) after you made changes in the menu designer!

No further action is required if you add new menu pads. However make sure to respect the following fix points in the VFX menu: FileMnuName, FileMnuOffset, WinMnuName, WinMnuOffset.


 How can I create linked child forms

Linked child forms are one of the most exciting features of Visual Extend. Linked child forms are usefull, if you have a parent form for which you want to see related information in a separate form. Usually the records in the related child form are ralated via a onetomany relation from the parent table to the child table.

In this tutorial we create a parent form named parent, which will manage the table named parent.dbf. The child form we create will have the name child and manages the table with the name child.dbf.

Parent table (parent.dbf)

Field	Description	Index
parent_id	parent identification	primary
descr	description
date	date
status	status
...	...
...	...
...	...

Child table (child.dbf)

Field	Description	Index
child_id	child identification	primary
parent_id	link to parent table	regular
value	value
flag	flag
...	...
...	...
...	...

Step 1: Create the parent form

Use the VFX form builder to create a new data manipulation form based on the class CDataFormPage resp. CDataFormPageBar as described in detail in the VFX user manual. VFX makes it very easy to create linked child forms, the most of the work can be done in the parent form as described here.

NOTE: Make sure to set the following options in the VFX form builder when generating the parent form in order to have your parent form already setup convenient:

-select the option Has More Functions in the form builder builder

-select the option Has Linked Child Forms in the form builder builder

Please refer also to the VFX video clip where you see the VFX builder in action. If you watch the video clip, you see also which properties and which methods will have to be used on the parent form. Here a summary of all involved methods and properties:

Event onMore

Used to setup how the child form will be called and which parameters to pass. Automatically prefilled with template code if builder option Has More Functions has been selected. You can also refer to the VFX user manual, where the creation of a form which calls another form is described in greater detail.

Event onSetChildData

The event where you put your code for the child refresh. Automatically filled with template code if the builder option Has Linked Child Forms has been selected. This event will automatically be called once for every active child form with the appropriate parameters, namely tcFormName (Name of the currently processed child form, prefixed with FRM...) and toForm (Object reference of the currently processed child form). Yes, its true: The internal VFX child form manager class handles this absolutely transparently for you!

Property lUseChildForm

Builder sets this property to true if option Has Linked Child Forms selected. If you forgot to set the checkbox in the builder, you can, of course, set this property anytyme also later in the property sheet.

Property lAutoSynchChildForm

to define whether you want immediate refresh of the child forms when the record in the parent form changes or not. NOTE: Default is false! Be careful, if you have a lot of child forms, or even cascaded parent child forms (i.e. childs beeing parent again), you need to test for appropriate hardware power to make you system perform acceptable. This option can easily also be set in the init method of the form, allowing you to customize this feature at runtime for example through the VFXSYS dialog.

Watch the following video clip (avi with no sound) to see, how all of the above will be done:

Create linked parent child forms: the parent form

Step 2:  Create the child form

Use the VFX form builder to create a new data manipulation form based on the class CDataFormPage resp. CDataFormPageBar as described in detail in the VFX user manual. All you have to configure on the child form is the init method, where the form builder already puts the needed template code if you

-select the builder option Is Child Form to true

Watch the following video clip (avi with no sound) to see, how all of the above will be done:

Create linked parent child forms: the child form


 How can I dynamically move the data location at the customer site

A question which always pops up is the following: What if I want to create an application which must work with data located on different drives on a network or just in other directories and how can I let the user decide where data is located.

First and foremost lets clarify one thing. Although a lot of VFP developers think that using the form data environment makes it impossible to switch the data location at runtime, this statement is not true! We and a lot of our VFX customers have already created apps with dynamical data locations, here is all you have to know to create dynamical data locations:

Step 1:

Make sure that the user gets the choice to locate the DBC when your app cannot locate it automatically and set the CFoxApp property cMainDatabase to the fullpath statement of this database.

Step 2:

Add the path of the DBC location to your current VFP path.

Thats all, try it out and enjoy.

NOTE for DBC tables: Note that you cannot directly move the relative location from DBF to DBC and vice versa. Always

NOTE for free tables: If you are using free tables, VFP issues just an implicit USE table again when working with the data environment, therefore the path to the free tables, if not at the same place like the DBC must explicitely be set.


 How can I use the optimization property lUseSetKeyAsFilter

Although is has a lot of advantages to directly access fox data located in a file server environment there are some disadvantages if you are setting a filter in a large table which sould select only few records.

You might think that rushmore takes care about this. Well, we first thougt this was the case too, but note that depending on the situation and the currently selected index tag, the rushmore optimization failes. If you are not yet familiar with rusmore optimization it is highly recommended

that you read the topics in your VFP manual or help file.

Here a hint: The best way to make sure that your rushmore optimization really works is to copy the index expression from the table designer and paste the code into the to be rushmore optimized command, this works always. Just remember to update your code if you change someting in the index expression, otherwise rusmore will just fail.

Fact: If you have a rushmore optimizable SET FILTER TO <rushmore optimizable command> and the rusmore optimization works it still can fail if you have a form using a standard VFP or VFX grid. Yes, this is true. I talked to Calvin about this, mailed on Compuserve but did not get any solution to this problem.

Rushmore optimization should also work, if you are working with the filtered data in a grid. We dont understand why the SET FILTER TO <rushmore optimizable command> with a subsequent BROWSE or SCAN command is always fast, i.e. rushmore optimized, whereas the grid just begins to sleep. And here we are not talking about seconds, but minutes...

If you dont want to work with a view instead, we offer the following work around to this performance problem:

Use the VFX form property luseSetKeyAsFilter


 How can I create Client/Server Forms using parametrized local/ remote views

In this example we create a C/S form based on a view named xvparent with two parameters named tnParentidFrom and tnParentidTo. The documented example can also be downloaded from our web!

Step 1:

Create a CDataFormPage based form and use the view in the data environment. Make sure that you set the following properties in the Dataenvironment:

Dataenvironment.Cursor1.NoDataOnLoad = .T.

This defines that the view does not get requeried when the form loads. This is very important since in a C/S form you always have to prompt the user for at least one parameter before you can requery the view.

Set the property

Dataenvironment.InitialSelectedAlias = xvparent.

IMPORTANT: On the form level make sure that you set the property Form.lWorkonView=.T.

Step 2:

As an optional preparation step you can set the property cViewParameter of the textbox(es) you may use later as a base for the creation of a query selection dialog. If you don't set these properties, you can manually set these on the query selection dialog to the name of the parameter variables used in the view.

Step 3:

Now we create a new form based on the class CAskViewArg. Use the drag and drop feature to create this form and make sure to remove the form1 and the formset before you continue! You find this class in the class library named VFXTOOLS.VCX.

This dialog will be used to ask the user which data he wants to see. In our example we will ask the user to enter a range from - to for the parentid of the parent table the query is based on.

To create this form the easiest way is to copy the controls from the main data manipulation form we created in Step 1 and 2 and paste the label plus the textbox on the CAskViewArg based form you just created.

Make sure that the properties cViewParameters are set correctly to the name of the query variables you used in your view. NOTE: Do not manually put these as ControlSources since VFX does this automatically for you.

Step 4:

Now you have top prompt the user for the parameters when he starts the form. To do this you can put the following line of code in the init() method of the form:

** Insert your extra initialization code here

do form askparent2 with this

Step 5:

Since you don't want that your users do have to close and reopen the form every time they want to see other data, provide a commandbutton on the toolbar of the form with the following code in its click() event:

do form askparent2 with thisform

Make sure to pass here thisform and not this, since this would mean the commandbutton!


 How can I use the VFX event onPostInsert() to fill in a generated ID

Write the following lines of code in the onPostInsert() method:

Example

REPLACE parent_id with getnewid()

You find the getnewid() function in VFXFUNC.PRG. Of course you can add your own next id alghorithm as a stored procedure in your DBC and call it directly from the insert trigger. Sometimes, however, you might not want to do so, thats why we prepared this possibility.

You should mail to microsoft whish line that they add a nummerator like in jet 3.5...


 How can I add additional pages in a dataformpage form

Sometimes, you have to rearrange the form pages or simply add a new page within a pageframe after the original creation with the VFX form builders. In such a case the following steps are appropriate:

Starting Point:

Assume we have a simple dataformpage form with one edit page and another page containing the search grid like shown in the following screen:

To change this form to a form with two edit pages and the grid on page 3, do the following:

Step 1:

Set the Visual FoxPro property nPageCount of the pageframe pgfPageFrame from 2 to 3. You find this property in the property sheet under Layout.

Step 2:

Adjust the captions: We will make the page 3 the new grid page: Select the page 3 and set the caption to something simmilar to List. (Since the default font size of newly added pages in a pageframe during design time is 9, you might want to change it to 8. If you dont do it here, it will be adjusted during runtime anyhow). Change the caption of page number 2, previously the List page to something like Page2.

Step 3:

Set the VFX property nPageList: Since VFX has to know, where the search grid is, you have to adjust the VFX form property nPageList from 2 to 3. You find this property under Others in the property sheet while the form is the currently selected object.

Step 4:

Cut and paste the grid from page 2 to page 3. Finally add the wanted controls on the newly inserted page 2 of your pageframe.

Result:


 How can I add additional pages in the child area of a onetomany form

In the onetomany form you have a child area where the data from one or more child tables can be edited in one or more child grid(s). Quite often, you feel the need to either expand the child pageframe to multiple pages to allowe a full edit or simply add new child grids later in the design process. Both cases have in common, that you expand the child pageframe. In this tutorial, we do add an additional page to allow the edit of the selected child record.

Starting Point:

Assume we have a simple onetomany form  with one child table :

Step 1:

Select the object pgfChildGrid and set the following properties:

oForm.pgfChildGrid.Tabs = .T.

oForm.pgfChildGrid.PageCount  = 2

Step 2:

Select the object oForm.pgfChildGrid.Page1 and set the following property:

oForm.pgfChildGrid.Page1.Caption = Items

Step 3:

Select the object oForm.pgfChildGrid.Page2 and set the following property:

oForm.pgfChildGrid.Page2.Caption = Details

oForm.pgfChildGrid.Page2.FontSize = 8

The Fontsize property is optional. Remeber, that new elements in a container object do not inherit from any class attributes like FontSize. Since in the pageframe class, only one pageframe is defined, the first inherits, the other ones not. There are solutions to this problem however: VFX sets automatically all pageframe pages to the same font and fontsize during runtime. NOTE: You cannot cut the childgrid from page1 and put it on page2 directly, since the childgrid is part of the pageframe class (encapsulation).

Step 4:

Create 3 textbox controls and labels for the editing of the child data on page2. Therefore drag from the vfxobj class library the class CTextbox resp. CLabel and drop it on the form. TIP: Depending on your VFP settings, the drag and drop operation could be optimized. See the field mapping topic in the VFP help file!

Step 5:

In order to have a correct refresh of the controls whenever the user switches to the page2 of the childgrid, add the following line in the activate event of the page2. Since there are no record mover fuctionality in our example on the pageframe page2, there is no further action required.

Code to put in the method oForm.pgfChildGrid.Page2.Activate()

this.refresh()

Result:


 How can I synchronize the form with a form specific toolbar

If you want to define a toolbar which will be activated automatically whenever a specific form is active, you can accomplish this with the VFX form property cToolbarClass.

Step 1:

Create a toolbar class in the class library file appl. Therefore select the class library file appl in the project manager and select new. In the following dialog enter this:

As Class Name enter any name you want to give your new toolbar class, i.e. CTest. In the Based On box select the lib\vfxobj.vcx class library file and within this class library file the class CToolbar. NOTE: If you select the class, you must first select the class library file and then the class within this class library file.

Step 2:

Select the form you want to associate the created toolbar class with and set the form property cToolbarClass to the appropriate value. i.e. CTest.

Step 3:

Start your application, load the form and select the menu option Tools/ Toolbar... The following toolbar dialog appears.

Double click on the toolbar you want to activate and you are up and running with your toolbar. NOTE: The toolbar setting (active, inactive and position) is stored in the user resource file and automatically restored whenever the user calls the form.

If you want to activate the toolbar always when the form loads, you can use the form property lShowToolbar in the init code as shown in this sample Init() code:

Example:

lparameters tcArg

local lInitOk

lInitOk = eval(this.Class+"::Init(tcArg)")

*****************************************

** Your initialization code ...

**force the toolbar

if !this.lshowtoolbar

this.lshowtoolbar = .t.

this.RefreshToolbar(.t.)

endif

return lInitOk

NOTE: You can also put the above code in the onInit() event of your form.

Example:

**force the toolbar

if !this.lshowtoolbar

this.lshowtoolbar = .t.

this.RefreshToolbar(.t.)

endif


 How can I use the mover dialog and pass preselected items

The VFX mover dialog is a container class named CMover. In situations, where you just need a moover dialog form, you can directly use the form class CMoverDialog.

Assume, we want to create a user interface, where the user has the possibility to choose items which will be stored in an additional table, like in a many to many situation as described in the following sample.

Example

LOCAL lcAlias, laSource, laSelected

dimension lasource[1,1]

dimension laselected[1,1]

lcAlias = SELECT()

*--preselected items

SELECT locins.location_id, location.location_name FROM locins, location  ;

WHERE UPPER(locins.location_id) == UPPER(location.location_id) AND ;

  UPPER(locins.policy_id)== UPPER(policy.policy_id) ;

INTO ARRAY laSelected

*--all items

SELECT location_id, location_name FROM location  ;

WHERE UPPER(location.account_id)==UPPER(policy.account_id) ;

INTO ARRAY laSource

IF _TALLY > 0

loMover = CREATEOBJECT("CMoverDialog")

loMover.Caption = "Select the Insured Locations"

loMover.cntMover.nColToView = 2

loMover.cntMover.lstSource.MultiSelect = .T.

IF !EMPTY(laSelected)

loMover.cntMover.SetData(@laSource, @laSelected)

ELSE

loMover.cntMover.SetData(@laSource)

ENDIF

loMover.Show()

if !(type(_gaMoverList)=="C" and _gaMoverList == "[CANCEL]")

    local lnLocInsMode

    	lnLocInsMode = cursorgetprop('Buffering',"locins")

=cursorsetprop('buffering', 5 ,"locins" )

*--delete all existing records

SELECT LOCINS

DELETE ALL FOR UPPER(locins.policy_id)==UPPER(policy.policy_id)

*--

SET DELETED OFF

*--generate

IF !EMPTY(_gaMoverList)

FOR i = 1 TO ALEN(_gaMoverlist,1)

 	lcLocation_id = _gaMoverlist[i,1]

 	if !empty(lcLocation_id)

IF SEEK(UPPER(lcLocation_id) + UPPER(policy.policy_id), "LOCINS", "ID")

RECALL

ELSE

INSERT INTO "LOCINS" (location_id, policy_id) VALUES ;

      	 (lcLocation_id, policy.policy_id)

ENDIF

endif

NEXT

ENDIF

*--

    SET DELETED ON

    *--

    =TableUpdate(.T., .T., "LOCINS")

=cursorsetprop('buffering', lnLocInsMode ,"locins" )

    SELECT (lcAlias)

    *--

endif

ELSE

  =messagebox(	"No locations found for this account." + CHR(13) + ;

"Please enter first at least one location"  + CHR(13) + ;

"for the selected account and try again!", 0+64, _screen.caption)

ENDIF

release _gaMoverList, lasource, laselected


 How can I use the gauge window to graphically show the progress of an operation

Quite often it would be nice to show the progress of an operation graphically to the user. There have been a lot of suggestions regarding the progress bar, thermometer or gauge window topic. Recently I read an article in the FoxPro Advisor mag from January 1997: Use DrawMode for Visual Tricks from Michael Bongiovi. Although the VFX gauge class resp. the VFX gauge form class does not intend to bring you the ultimate in progress bar technique, it is an attractive solution for a wide range of application needs. And it is very easy to use!

In the following tutorial, we create a simple gauge window which will pop up during a scan through the master table:

Step 1:

Open the master form, or, if you did not work through the tutorial yet, any other form with the form designer.

Step 2:

Select the page1 or another object where you want to place the command button. Use drag and drop from the vfxobj class library and drop a CCommandbutton on your form.

Step 3:

Put the following code in the click event of your command button:

LOCAL lnactrecno, lnMaxItems, lnItem

lnactrecno = iif(eof() or bof(), 0, recno())

lnItem = 0

IF lnactrecno > 0

lnMaxItems = RECCOUNT()  && NOTE: reccount takes also the deleted records

loGauge = createobject('CGaugeWin', lnMaxItems)

loGauge.show()

SET dele off	&& see note above

SCAN

lnItem = lnItem + 1

loGauge.SetText("Gauge Demo: " + ALLTRIM(STR(lnItem)))

loGauge.SetValue(lnItem)

INKEY(.5, "H")

ENDSCAN

SET dele on

loGauge.release()

GO lnactrecno

ENDIF

Result:

If you run the form and click on the command button, the gauge window appears while the program scans through all of the records of the currently selected table.


 How can I restrict the multi instantiation feature of a form

VFX forms can by default be opened more than once. VFX handles all of the behind the scenes issues such as correct form caption with :2, :3, ..., correct recently used file list entries and more. However it can be confusing or just unwanted, if specific forms can be opened  more than once by the same user. In such a situation, set the form property lMultiinstance to false.


 How can I get rid of the navigation bar on the form and have them in the main toolbar

VFX offers form classes which have a navigation and other editing command buttons directly on the form and others who dont.

To get rid of the navigation bar on all of your forms:

Make sure to use the appropriate form class. i.e. use CDataFormPage rather than CDataFormPageBar resp. COneToMany rather than COneToManyBar.

If you already created your forms with the navigation buttons on the form, use the VFX class switcher to switch all the forms at once from the version with navigation bar on the form to the one without. For this, call the class switcher from the VFX menu. The class switcher presents the following dialog.

NOTE: Make sure that you did not select any form or other object in design mode, just open the project with the project manager and call the class switcher from the VFX menu.

To have the navigation and other buttons on the main toolbar:

Set the CFoxApp property cMainToolbar to the toolbar with the navigation and other buttons. We already prepared one for you, named CAppNavBar.


 How can I have the navigation bar on the form and get rid of them in the main toolbar

VFX offers form classes which have a navigation and other editing command buttons directly on the form and others who dont.

To have the navigation bar on all of your forms:

Make sure to use the appropriate form class. i.e. use CDataFormPageBar rather than  CDataFormPage resp COneToManyBar rather than COneToMany.

If you already created your forms without the navigation buttons on the form, use the VFX class switcher to switch all the forms at once from the version without navigation bar on the form to the one with navigation bar. For this, call the class switcher from the VFX menu. The class switcher presents the following dialog.

NOTE: Make sure that you did not select any form or other object in design mode, just open the project with the project manager and call the class switcher from the VFX menu.

To get rid of the navigation and other buttons on the main toolbar:

Set the CFoxApp property cMainToolbar to the toolbar without the navigation and other buttons. We already prepared one for you, named CAppToolbar.


 How can I use the pickfield class with numeric fields

Set the CPickField property cReturnExp to something of type char:

Example

oPickField.cReturnExpr= STR(numfield)

The rest works just like with character fields.


 How can I use my own refresh logic using the pickfield class

The VFX pickfield class offers a lot of customization which goes far beyond the simple code and description you will show the user in standard cases. Sure you already had the need to show very particular information from the foreign table the pickfield control actually relates to. Its also quite common, that one single line does not offer the possibility to really bring all wanted information to the user. Also, if you first have to grab the information you really want to show, for example based on some values of the form or of the selected item.

In such situations, you will customize the refresh code of the pickfield class in order to allow you to display exactly the information from the foreign table you really want to show. In the onrefresh() event of the pickfield, you can write any code you want to and set the txtdesc.value property of the pickfield class to the desired value.

In this tutorial we create a simple two table case, where we have a master table with a foreign key and another table called product.dbf. Here are the structures for our tutorial:

Master table (master.dbf)

Field	Description	Type, Len, Dec	Index
master_id	master identification	i,4	primary
descr	description	c,40
date	date	d,8
status	status	l,1
product_id	foreign key to the product table	i,4	regular
...	...
...	...

Foreign table (product.dbf)

Field	Description	Type, Len, Dec	Index
product_id	product identification	i,4	primary
descr	product description	c,40
date	product date	d,8
comment	product comment	c,20
...	...
...	...

Step 1:

Create a new form named master, best using the VFX Form Builder based on the VFX class cDataFormPage (or cDataFormPagebar if you want to have navigation buttons on the form). If you are not familliar with the VFX Form Builder, please refer to the corresponding topic in the VFX User Guide.

Note: Make sure to setup the dataenvironment correctly! It is important, that you drag the relation from the foreign key field product_id from the master table to the matching index in the product table called id. If VFP defaults another usually a onetomany relation due to the predefinition of a persistent relation in your dbc (Database Container), delete it and recreate the relation to be sure it points the right way from the right field to the matching (here its easy because there is only one) index.

Step 2:

In the VFX Form Builder, select all fields from the master table and for the field product_id, select the control class cPickfield. Of course you can also add the pickfield control manually anytime later after you already created your form. In such a case you drag the VFX class cPickField from the vfxobj class library to the desired page. Drag and Drop: Make sure that the page is selected and not the pageframe or even the form. Dont worry if you drop controls on an object you actually didnt want them to drop, this happens to almost everyone once in a while. In such a case just cut and paste the controls so that they are there where they belong to.

Step 3: (Optional for this tutorial)

Call the grid builder and use the product description or any other information from the product table in the grid. Of course you could also create calculated fields here, but this is not what the current tutorial is about.

Step 4:

Call the VFX Pickfield Builder. Select the control cntProduct_id and call the VFX Builder with the rightmouse. Hint: Whats the most efficient way to select this control? Answer: Click on the form, the object pgfpageframe is selected, use rightclick and select edit, this edits the controls of this container i.e. the next deeper object pgfpageframe.page1 is selected, rightclick and select edit again and your cntProduct_id will be selected. We think this is the fastest and therefore most productive way to navigate down the container hirarchy to edit specific controls!

Step 5:

Make the txtdesc control bigger or arrange ist that way that is looks somehow like this:

Step 6:

Fill in the following items in the VFX Pickfield Builder:

Pick Dialog Caption	Please select a product...
Maintenance Form Name	PRODUCT
Pick Table	PRODUCT
Pick Table Order	ID
Field Control Source	master.product_id
Description Control Source	product.description
Pick Return Code Field	product_id
Pick Return Description Field	DESCR
User Refresh Code	select this checkbox to true
User Refresh Code Method	this.txtdesc.value = trim(product.descr) + chr(13) + dtos(product.date) + chr(13) + product.comment NOTE: Here you could write any other Visual FoxPro code  you like. Just make sure, to set the this.txtdesc.value property to the desired result at the end.

Remarks: The description in the Pick Return Code Field, the property cReturnExprDesc will be used when the user picks a valid, the onrefresh code will be called whenever the pickfield control will be refreshed.


 How can I pick additional information from the pick table after picking

The VFX pickfield class provides an easy way to fetch additional information from the picklist table or view. Just write the code you need into the onpick() event of your picklist control.

Example:

Assuming that the picklist table or view contains an additional field named data. If you want to fetch the content of this field automatically whenever the user picks or enters a correct value, the onpick event fires. This makes is very easy for you to referende to any fields from the pick table or view.Just write code simmilar to this example in the onpick() event of your pickfield control.

oPickfield.onpick()

this.parent.lbltest.caption = date

NOTE: Dont use any alias to reference the field date in the above example or in your code, since the picklist control generates a random alias during runtime.

The VFX pickfield class provides also other properties which can be used in the same context. These are cReturnMoreExpr respectively cReturnMoreExprVal, which can be used if you need to access additional data. The VFX pickfield class stores the result of the evaluated expression in the cReturnMoreExprVal property.

When to use which method?

The onpick event method has the advantage that you can write into this event directly any action code whereas with the cReturnMoreExprVal you just have a property containing the desired value, you then usually have to decide where you put your action code. Its up to you.


 How can I tab to the next field after the user picked a value

Sometimes its usefull that the user gets automatically positioned on the field next to the pickfield he just selected a value for. This speeds up form data entry.

To activate this feature, just set the VFX pickfield property lusetab to true.


 VFX and other products

VFX has been designed to be as open as possible. We invested a lot of time to make you more productive using VFX together with other productivity tools.

DBCX

Stonefield Database Toolkit

xCase


 DBCX

VFX is compatible with the DBCX standard. All there is to do to integrate VFX with any other DBCX compliant products is to set the include constant _DBCX in the include file vfx.h to true:

Example

#DEFINE _DBCX	.T.

See also Stonefield Database Toolkit.

DBCX is the name of the data dictionary extension scheme for the Visual FoxPro Codebook. DBCX was a collaborative effort between the following companies:

·	Flash Creative Management

·	Neon Software

·	MicroMega Systems

·	Stonefield Systems Group Inc.

Many other companies will be using DBCX to add extensions to the VFP data dictionary for their own tools. The advantage of using DBCX is that these products can all work together without having to maintain separate data dictionary extensions.

DBCX consists, at a minimum, of the following files:

·	DBCXMGR.VCX: a visual class library containing the DBCX classes.

·	DBCXREG.DBF: the DBCX manager registry table.

Please read the DBCX documentation file DBCXREF.DOC, which is included in DBCX.ZIP on the SDT diskette, for more information on DBCX.


 Stonefield Database Toolkit

Visual Extend has already been prepared for the usage of the Stonefield Database Toolkit. If you own SDT and want to integrate it with your VFX project, please refer to the update and release notes of VFX 3.5. There you find all needed Information for the SDT Integration. For questions regarding SDT, please contact Doug Hennig from Stonefield Systems Group directly.

Company:

Stonefield Systems Group

Internet:

http://www.stonefield.com


 xCase

xCase is a database design and maintenance tool for database designers and programmers. xCase automates your work and is at your side throughout all the stages of the database development cycle: conceptual analysis, design, presentation and documentation, code generation, physical file generation, and ongoing database maintenance.

We think, that xCase is a great product for database design and maintenance. If you plan to use it, here you find useful information regarding the integration of VFX and xCase.

The default name of the VFX main database is database, i.e. the database container file is database.dbc. Since you cannot have more than one database in xCase which have the same name, you have to exchange the VFX default database with the one you will design using xCase. Here a step by step guide:

Step 1:

Create a new VFX project with the VFX Application Wizard and make sure to give your DBC already the name of the model you want to give or already gave to your xCase Model.

Step 2a: You already created your xCase model

If you already created an xCase Model, make sure that your VFX database contains no database bound tables. All the VFX tables are initially free tables to make such operations easy. If this is the case, you can select Update DBC from xCase Model from the xCase Menu.

Step 2b: You did not yet create your xCase model

Proceed with step 3

Step 3:

In Visual FoxPro add the VFX tables you want to have in your xCase model, (usually the VFXUSR and the VFXSYS table) to the DBC and select Update xCase model from DBC from the xCase menu. In xCase make sure to select the newly added tables so they are visible in your diagram. You can do this by selecting the menu Diagram/ Diagram entities.

Step 4:

Once you have setup your xCase data model with all the needed VFX tables included, you can work using xCase as described in the xCase manual. Have fun and be productive!

Important Note:

If you generate the DBC from your model, xCase uses the long description of your entities and places it in the DBC. This means that you will have to reference your tables using these long descriptions. To avoid problems, make sure to replace all spaces with _, like shown in the following screen:

Please contact the makers of xCase directly for any assistance you need to setup your xCase model:

Company:

Resolution

Internet:

http://www.xcase.co.il


 Read this before you start

There are a few things you must to know before you will be able to succesfully adapt a VFX application or even a single form to your needs. Here you find the summary which helps you to recognize features as such before they become a problem during your development cycle.

The nFormstatus property

This property defines in which state the form currently is. If the user selects Edit from the Edit menu (CTRL+E) the form switches to edit mode. You will note this also in the form caption. Since VFX 5.0 you can decide how it's possible for the user to switch to the edit mode. If you set the form property lAutoEdit to .T. or force the auto edit feature through the application class property nAutoEdit to 1, the user can enter into edit mode by simply writing into any textbox of your form or making a change with a combobox or accessing the picklist withing a pickfield control or touching any other control you may have on your form.

The lAutoSetup property

This property defines whether a control will be synchronized automatically with the form status or not. Note that you have to set this property to .F. whenever you use a control where you want to control the enable status or where the control has to be always accessible.

The lUseSyscolor Property

This new property defines whether the control will automatically be synchronozed with the windows system colors or not. Be sure to set this property to .F. whenever you want to control the colors independantly from the current windows user settings!

OOP: Inheritance for simple non container constructions like the Textbox

VFX makes extensive use of the inheritance feature offered within the OOP design of VFP. This feature gives the ability to inherit code from one parent class to the subsequent subclasses. Be sure to call the parent class code for following core events of your controls whenever you touch them:

GotFocus Event, Init Event, Interactive Change Event, LostFocus Event, Refresh Event

If you put code in one of these VFP events make sure to call the parent class code with either dodefault() (use in VFP 5.0 only and only if not in a container class hirarchy!) or i.e. cTextbox::GotFocus for the textbox, CSpinner::GotFocus for the SPinner, ...

If you brake the inheritance by overwriting these methods in your controls, the VFX framework will no more work as expected!

OOP (Advanced): Inheritance for container constructions like the PickField

Make sure to understand that calling the parent class code with dodefault() calls always the parent class code of the control which is usually not what you want if you are in a container! Let's look at a simple example here within the pickfield class. Note however that this discussion applies also to your own class library constructions and is VFP independent and therefore applies to all languages where inheritance is offered (probably that's the reason why VB does not have this sort of inheritance even not in Version 5.0...):

The pickfield class is a container class which consists of the following components directly placed in a main container:

txtField, the textbox where you can enter the code

cmdPick, the commandbutton to click on to get the picklist appear and the

txtDesc, the description textbox

Assume you want to modify the RightClick Event which is in the txtDesc Textbox but you dont want to loose the functionality which VFX provides when you RightClick on the description of the txtDesc Textbox. If you would place the following code in the RightClick Event of the txtDesc Textbox, the VFX inheritance would fail:

** custom code goes here

**

dodefault()

This would fail since the above dodefault() statement would call the RightClick Event of the cTextbox Class which is definitively not what we want here! The right code would be:

** custom code goes here

**

CPickField::txtDesc.RightClick()

This very simple example shows one important aspect of the Inheritance feature in OOP when dealing with a container ship hierarchy. Be carefull when calling the parent class code in a container class construction!

If you did not fully understand this discussion you can still work with VFX. Just make sure not to touch methods and events which are members of container classes as the PickField.

Good practice is to have a look at the VFX code before you put any code into Methods or Events to fully understand what VFX would do if you would not put any code in the corresponding Method or Event.

Working with temporary indexes and TRANSACTIONS and Table Buffering

A. Make sure to fully understand the VFP (NOT VFX!) implications of IDX files: IDX files cannot be part of transactions. Whenever you issue a BEGIN TRANSACTION, you must make sure that all IDX files are closed first, otherwise a runtime error occurs. Thats's why we call the ClearAllIDX() method anytime we issue an edit or insert operation because database triggers like to start with the statement BEGIN TRANSACTION!!!

B. Also if you have in whatever form (also when private datasessions are used!) a table buffering mode (5) of a specific table, your program will crash whenever you try to create an IDX file on this table even in another form! When you are unable to make sure that your table is never used in table buffering mode, make sure that you have enough CDX tags in order to prevent VFX from creating temporary index files, or select no incremental search in the Grid Builder for the columns where no CDX exists!

NOTE: This Technical Reference is not completed yet

Some properties and methods are just mentioned and not yet explained in the final way. Please verify these by looking into the VFX source code before using them. Especially before calling support regardless whether it is free or not, it is mandatory that you look in the source code! Additional sources are also the update an release notes as well as the changes.rtf document on our download site at http://www.devigus.com. Thank you for your cooperation.