Copyright: Connections Programmer's Help, v.5.xx
Citation: Copyright ® 1994 Borland International.


Connections Developer Help
 Connections Programmer's Help

See Also

This help system is for ObjectPAL programmers who would like to expand Connections and learn more about developing applications in Paradox for Windows. Click a topic for more information.

	Common Variables	Overview of variables used throughout Connections
	Tables	Overview of the tables used by Connections
	Code	Source code for Connections, organized by object (to view this information within Connections, right-click an object, then choose Code Help)
	Reports	Overview of the reports used by Connections


See Also

Connections user Help

ObjectPAL Reference


 Common Variables

See Also

When an application uses a variable for a similar purpose throughout its forms, it is helpful to give it one consistent name. Variables common to all a form's methods are defined in the form's Var section. Click a topic for more information on common variables used throughout Connections.

formName

kPhysical

menuLib

msgHelpLib

uio

uioName


See Also

Variables (ObjectPAL Reference)


 formName

Variable of type Form. Identifies the form being used. Connections uses formName to get the title of the active form. It also uses it to retrieve the form's name for context-sensitive Help.


 kPhysical

Variable of type String. Set in keyPhysical methods--using eventInfo.VChar()--to the key pressed by the user. Connections uses kPhysical to provide shortcut keys to the user.


 menuLib

Variable of type Library. Set in open forms to the MENUS.LSL library, which provides methods for retrieving the active page name, processing menu commands, and checking whether the application started properly.


 msgHelpLib

Variable of type Library. Set in open forms to the MSGHELP.LSL library, which provides methods for displaying programmer Help, popup menus, and control hints (brief descriptions that display on the status line).


 uio

Variable of type uiObject. Set in mouseEnter and mouseRightUp methods--using eventInfo.GetTarget(uio)--to the target of a mouse operation like pointing or right-clicking. It is used to get the name (stored in uioName) and class of objects.


 uioName

Variable of type String. Set to the name of an object (indicated by uio) affected by a mouse operation. It is used to display programmer Help.


Connections Tables
 Tables

See Also

Connections uses tables to store contact and company data, display popup menus, and display context-sensitive Help. Click a topic for more information on a table.

action.db	contlist.db

activity.db	contypes.db

acttypes.db	grades.db

company.db	msghelp.db

confinan.db	system.db


See Also

Tables (Paradox Help)


 action.db

Contains follow-up items for all contacts. Action is sorted by Date, Contact, and ActionItem.

Field	Description

Date	Date the follow-up item is due

Contact	Name of the contact associated with the item

ActionItem	Follow-up item code (must be a value in ACTTYPES.DB)

Comments	Notes on the follow-up item

Fulfilled	Whether the follow-up item was performed or not


 activity.db

Contains an activity log (phone calls, research, literature mailings) for all contacts. Activity is sorted by Contact and SequenceNumber.

Field	Description

Contact	Name of the contact associated with the item

SequenceNumber	A unique number used to sort each contact's activities

Date	Date the activity was performed

Time	Time the activity started

Duration	Length of the activity

Action	Activity code (must be a value in ACTTYPES.DB)

Comments	Notes on the activity


 acttypes.db

Contains a list of activity types and follow-up items used by Connections (phone calls, birthdays, sending product literature, and so on). Acttypes is sorted by ActionCode.

Field	Description

ActionCode	Activity/Action item code (required field)

Definition	Description of the activity associated with the code


 company.db

A list of the companies stored in Connections. Company is sorted by Name and maintains a multi-valued relationship with CONTLIST.DB (the detail table).

Field	Description

Name	Company name

ShortName	Abbreviated company name

Address	First line of company address

Address2	Second line of company address

City	City of the company

State	State or province of the company

PostalCode	Postal code of the company

MainPhone	Main phone number of the company

Comments	Notes on the company


 confinan.db

Contains revenues and expenses for all contacts. Confinan is sorted by Contact and Sequence. It also uses a secondary index (TransactionType) to sort records by Contact, Type, and Sequence.

Field	Description

Contact	Name of the contact associated with the item (required field)

Sequence	A unique number used to sort each contact's financial records (required field)

Type	Whether the amount was revenue or an expense (required field)

Date	Date the record was added (required field)

Amount	Amount of the revenue or expense (required field)

Description	Notes on the record


 contlist.db

Contains all the contacts stored in Connections. Contlist maintains a multi-valued relationship with COMPANY.DB (the master table). Contlist is sorted by Company, LastName, and FirstName. It also contains the following secondary indexes: ContactLevel, ContactNumber, Grade, LastName, UserDefined1, and UserDefined2.

Field	Description

Company	Name of the company associated with the contact (required field that must use a value in COMPANY.DB)

LastName	Last name (required field)

FirstName	First name (required field)

Salutation	Title of the contact (Mr., Dr., Miss)

Address	First line of the contact's address

Address2	Second line of the contact's address

City	City of the contact's address

State	State or province of the contact's address

PostalCode	Postal code of the contact's address

Country	Country of the contact's address

Title	Title of the contact (Manager, Customer Service, and so on)

Level	Contact's level in the organization

LocalPhone	Local phone number

LocalFax	Fax number

CarPhone	Cellular phone number

Beeper	Pager number

HomePhone	Home phone number

Spouse	Spouses name

Children	Name of contact's children

Birthday	Birthdate

HoursWorked	Working hours

DateEntered	Date contact was added

Source	How the contact was met

ContactType	Contact type (must use a value in CONTYPES.DB)

Grade	Contact's interest level (must use a value in GRADE.DB)

UserDefined1	User-defined field one (Dept./Division by default)

UserDefined2	User-defined field two (Industry by default)

ContactNumber	Unique number identifying the contact

Comments	Notes on the contact


 contypes.db

Contains contact types. Contypes is a lookup table sorted by Contact.

Field	Description

Contact	Contact type code (required field)

Definition	Definition of the code (required field)


 grades.db

Contains prospect grades. Grades is a lookup table sorted by ProspectGrade.

Field	Description

ProspectGrade	Prospect grade code (required field)

Definition	Definition of the code (required field)


 msghelp.db

Contains object name keywords that Connections uses to display programmer Help.

Field	Description

Form Name	Name of the object's form

Page Name	Name of the page containing the object

Object ID	Name of the object

Context ID	Help context ID of the object


 system.db

Contains default settings for the application (COM port to use, user-defined field titles, and so on). System is sorted by CurrentContact and CurrentDate, but never contains more than one record.

Field	Description

CurrentContact	Contact number of the current contact

CurrentDate	The current system date

NextActivitySequenceNo	A unique number used when creating activity and financial records

UserDefined1Title	Name of the first user-defined field

UserDefined2Title	Name of the second user-defined field

BirthdayAdvanceDays	Number of days to remind a user in advance of a contact's birthday

ComPort	COM port used to dial phone numbers

DialPrefix	Numbers to dial before dialing a phone number

OKToOpen	Used to check whether the application is in the current working directory


 Code

See Also

ObjectPAL is an event-driven, object-oriented programming language, different from a traditional procedural language where you create a file of commands that execute one after another. The following sections list areas where Paradox stores code modules (called methods).

Forms

The user interface displayed in Connections, including dialog boxes, consists of a series of forms. Using ObjectPAL, you place design objects (for example, buttons and fields) in a form and attach methods that execute when something happens to the object. Click a topic for information on a form and its code. (You can also display this information from within the application by right-clicking an object and choosing Code Help.)

ActivityForm (ACTIVITY.FSL)

ActivityTypeForm (ACTTYPES.FSL)

CompanyForm (COMPANY.FSL)

CompanyListForm (COMPLIST.FSL)

ContactForm (CONTACTS.FSL)

ContactTypesForm (CONTYPES.FSL)

DefaultForm (SYSTEM.FSL)

FinancialForm (CONFINAN.FSL)

GradesForm (GRADES.FSL)

NewActivityForm (NEWACTIV.FSL)

ReminderForm (REMINDER.FSL)

SearchForm (SEARCH.FSL)

Libraries

A library is a collection of custom methods. Libraries are useful for storing and maintaining frequently used routines, and for sharing custom methods and variables among several forms. Connections uses library methods to display Help and menus. Click a topic for information on a library and its code.

MENUS.LSL

MSGHELP.LSL

Scripts

A script consists of code in its own file, not attached to a form. It's an object, and displays on the Desktop as an icon. Use a script when you want to execute code without opening and displaying a form window. Connections uses START.SSL to start the application.


See Also

Common Variables

ObjectPAL (Paradox Help)


 Reports

See Also

Connections uses reports to print out summaries of the information stored in its tables. Click a topic for information on a Connections report.

REVENUE.RSL

CONTACTS.RSL


See Also

Reports (Paradox Help)


 revenue.rsl

Displays a bar graph showing the projected revenue by date for the current contact. Use this report to estimate commissions from forthcoming business.


 contacts.rsl

Displays a list of all contacts stored in Connections. The list is sorted by company and last name.


 ActivityForm (ACTIVITY.FSL)

See Also	Objects	Methods

ActivityForm displays in the application as the Contact Activity dialog box. Each contact has multiple activities associated with it that correspond to communications with the contact and follow-up items (meetings, mailings, and so on).

Uses

Defines the argument structure of library methods stored in MENUS.LSL and MSGHELP.LSL. Connections uses these routines to display menus and help.

Uses objectPal

; Method in MENUS.LSL

checkOpen(formTitle string) string

; Methods in MSGHELP.LSL

objMsg(ObjectID String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the ActivityForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

menuLib, msgHelpLib	library

formName	form

uio	uiObject

uioName, kPhysical	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNNEW_HK = "N"

TXTBTNLOCATE_HK = "L"

TXTBTNCLOSE_HK = "C"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_ACTIVITY = 1025

endConst

open

Called when the dialog box is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries and checks whether the dialog box can be opened.

method open(var eventInfo Event)

var

formTitle	String

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL library

if not menuLib.open("Menus") then

; If MENUS.LSL can't be opened, display an error

; message and close the form

msgStop("Failure","Your working directory is "+workingDir()+

".  "+"Please change your working directory to where

 Connections is located.")

disabledefault

close()

else

; Open the MSGHELP.LSL library

msgHelpLib.open("msgHelp")

; Associate formName, a Form variable, with

; ACTIVITY.FSL

formName.attach()

; Set formTitle to the form's title

formTitle = formName.gettitle()

; Check if the application was started properly

menuLib.checkOpen(formTitle)

endif

endif

endmethod

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user tries to display a filter menu by right-clicking a field, this method prevents it.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicked a field, prevent

; the Filter menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button or a field, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

; Set uioName, a String variable, to the name of the object

; being pointed to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field" then

; If object being pointed to is a button or a field,

; display a description on the status line

msgHelplib.objMsg(formName.name+","+msgHelplib.pageNameof(uio)+","+uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located within a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; uio is a UIObject variable that was set by the

; mouseEnter method

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

while uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Contact Activity dialog box. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the name

; of the key pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process the key

if kPhysical = "VK_F1" then

; If the user pressed F1, prevent Paradox from

; displaying Help

disableDefault

; Display Help by calling the pushButton method

; of HelpButton

HelpButton.PushButton()

endif

; Shortcut keys

if eventinfo.IsAltKeyDown() then

switch

; Shortcut for the New button

case kPhysical = TXTBTNNEW_HK :

NewButton.PushButton()

; Shortcut for the Locate button

case kPhysical = TXTBTNLOCATE_HK :

LocateButton.PushButton()

; Shortcut for the Close button

case kPhysical = TXTBTNCLOSE_HK :

CloseButton.PushButton()

endswitch

endif

else

; This code executes only for the form.

endif

endmethod


Methods

Uses

Var

Const

action

keyPhysical

mouseEnter

mouseExit

mouseRightUp

open


Objects

thePage


See Also

NewActivityForm (NEWACTIV.FSL)

ActivityTypeForm (ACTTYPES.FSL)

Contact Activity dialog box (User Help)


thePage (ActivityForm)
 thePage

Objects	Methods

thePage contains all controls used by ActivityForm.

setFocus

Called when the page becomes active (also called gaining focus). It retrieves the contact number of the contact displayed in the Contact Profile form (stored in the SYSTEM.DB record currentContact), then sorts CONTLIST.DB using an index and uses it to locate the activity records for the contact. It also associates the UIObject variable ui with company, a field on the form, places the dialog box in Edit mode, and makes sure the table frame is visible.

method setFocus(var eventInfo Event)

var

sysTC,tc tcursor

ui uiObject

endVar

; Open SYSTEM.DB, which contains the contact number of

; the contact currently displayed in the Contact Profile

; form

sysTC.open("system")

if sysTC.isEmpty() then

; If SYSTEM.DB is empty, defaults are missing;

; display an error message and close the form

msgStop("Problem","The system table is empty. Please reinstall Connections.")

close()

return

endif

; Open CONTLIST.DB, which contains the contacts

tc.open("ContList")

; Sort CONTLIST.DB by contact number using an index

tc.switchIndex("contactNumber")

; Find the contact associated with the contact number in

; SYSTEM.DB

tc.qLocate(sysTC.currentContact)

; Close SYSTEM.DB

sysTC.close()

; Associate ui, a UIObject variable, with Company,

; which lists the company name

ui.attach(Company)

; Refresh Company so it reflects the company

; associated with the contact tc is referencing

ui.resync(tc)

; Place the form in Edit mode

action(dataBeginEdit)

; Display the table frame of activity records

dataFrame.visible=yes

endmethod

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user tries to insert a record, the pushButton method of NewButton is called instead.

method action(var eventInfo ActionEvent)

switch

case eventInfo.id()=dataInsertRecord:

; If the user tries to insert a record,

; disable the default behavior and call

; the pushButton method of NewButton

; instead

disableDefault

pushbutton(NewButton)

endSwitch

endmethod


Objects

CloseButton

Action

ContactName

HelpButton

LocateButton

NewButton


Methods

setFocus

action


HelpButton (ActivityForm)
 HelpButton

Objects

Displays Connections user Help for the Contact Activity dialog box.

pushButton

Called when a user clicks the Help button on the Contact Profile form or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the form

helpShowContext(helpFile,#IDH_FORMS_ACTIVITY)

endmethod


CloseButton (ActivityForm)
 CloseButton

Objects

CloseButton lets the user close the Contact Activity dialog box.

pushButton

Called when the user clicks the Close button in the Contact Activity dialog box. It returns an empty string to the form that called it, which then closes the form.

method pushButton(var eventInfo Event)

; Close the form

formReturn("")

endmethod


NewButton (ActivityForm)
 NewButton

Objects

NewButton displays the New Activity dialog box, letting the the user log new activity (calls, research, and so on).

pushButton

Called when the user clicks the New button on the Contact Activity dialog box. It displays the New Activity dialog box and suspends execution of the method (using wait) until the user closes the New Activity dialog box.

method pushButton(var eventInfo Event)

var

formToOpen form

endVar

; Open NEWACTIV.FSL (the New Activity dialog box)

formToOpen.open("newactiv")

; Wait for the user to manipulate the dialog box

; and close it

returns=string(formToOpen.wait())

endmethod


Action (ActivityForm)
 Action

Objects

Action displays activity records for the current contact.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a message explaining the sort order of the activity records.

method status(var eventInfo StatusEvent)

message("Activity records are listed in descending order (most recent first)")

endmethod


ContactName (ActivityForm)
 ContactName

Objects

ContactName is a calculated field that combines the contents of the FirstName and LastName fields (in CONTLIST.DB) to display the contact's full name.

[CONTLIST.FIRSTNAME]+" "+[CONTLIST.LASTNAME]


LocateButton (ActivityForm)
 LocateButton

Objects	Methods

LocateButton lets the user search for a contact by Name, Company, or the value of one of the user-defined fields.

Uses

Defines the argument structure of a method stored in ContactForm. ActivityForm uses this routine to change the current contact.

Uses objectPal

; Method in CONTLIST.FSL

switchNameFromActivityForm()

endUses

pushButton

Called when the user clicks Locate from the Contact Activity dialog box.

If the Reminder dialog box is open, it associates active, a uiObject variable, with LocateButton, then performs a search using Record|Locate|Value.

If the Reminder dialog box is not open, it displays a popup menu asking if it should search for a specific activity record or a different contact:

For a contact search, it associates the Form variable formOther with the Contact Profile form, then calls switchNameFromActivityForm (in ContactForm).

For an activity record search, it uses Record|Locate|Value.

method pushButton(var eventInfo Event)

var

lPop popUpMenu

formOther form

active uiObject

endVar

; Check if REMINDER.FSL is open by trying to

; associate formOther, a Form variable, with

; it

if formOther.attach("Reminder") then

; If REMINDER.FSL is open, associate

; active, a UIObject variable, with

; LocateButton

active.attach(self)

; Use Paradox's Record|Locate|Value command

; to search

active.menuAction(MenuRecordLocateValue)

else

; If REMINDER.FSL isn't open, create

; a popup menu asking the user what

; type of search to perform. The user's

; choice is stored in returns, a String

; variable

Lpop.addStaticText("Locate What?")

Lpop.addSeparator()

Lpop.addText("Activity Record For This Contact")

Lpop.addText("Different Contact By Last Name")

returns=Lpop.show()

; Process the popup menu choice

switch

case returns="Different Contact By Last Name":

; If the user is searching for a contact,

; search for it using switchNameFromActivityForm

; in CONTACTS.FSL

formOther.attach("Contact Profile")

formReturn("NameChange")

case returns="Activity Record For This Contact":

; If the user is searching for an activity record,

; associate active with the button

active.attach(self)

; Search using Paradox's Record|Locate|Value

; command

active.action(dataSearch)

endSwitch

endif

endmethod


Methods

pushButton

Uses


 ActivityTypeForm (ACTTYPES.FSL)

See Also	Objects	Methods

ActivityTypeForm displays in the application as the Activity/Action Item dialog box, which is used to edit the action types displayed in the Reminder dialog box, Contact Activity form, and New Activity dialog box.

Uses

Defines the argument structure of library methods stored in MENUS.LSL and MSGHELP.LSL. Connections uses these routines to display menus and help.

Uses objectPal

; Method in MENUS.LSL

checkOpen(formTitle string) string

; Methods in MSGHELP.LSL

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

objMsg(ObjectID String)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the ActivityTypeForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

menuLib, msgHelpLib	library

formName	form

uio	uiObject

uioName, kPhysical	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNCLOSE_HK = "C"

TXTBTNNEW_HK = "N"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_ACTIVITY = 1010

endConst

open

Called when the dialog box is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries and checks whether the dialog box can be opened.

method open(var eventInfo Event)

var

formTitle	string

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL library

if not menuLib.open("Menus") then

; If MENUS.LSL can't be opened, display an error

; message and close the form

msgStop("Failure","Your working directory is "+workingDir()+

".  "+"Please change your working directory to where

 Connections is located.")

disabledefault

close()

else

; Open the MSGHELP.LSL library

msgHelpLib.open("MsgHelp")

; Associate formName, a Form variable, with

; ACTIVITY.FSL and set formTitle to the form's

; title

formname.attach()

formTitle = formName.getTitle()

; Check if the application was started properly

menuLib.checkOpen(formTitle)

endif

endif

endmethod

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user tries to display a filter menu by right-clicking a field, this method prevents it.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; When the user right-clicks an object, prevent

; the Filter menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button or a field, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

; Set uioName, a String variable, to the name of the object

; being pointed to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field" then

; If object being pointed to is a button or a field,

; display a description on the status line

msgHelplib.objMsg(formName.name+","+msgHelplib.pageNameof(uio)+

","+uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located within a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object

; the user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

while

uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Activity/Action Item dialog box. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the name

; of the key pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process the key

if kPhysical = "VK_F1" then

; If the user pressed F1, prevent

; Paradox Help from displaying

disableDefault

; Display Help by calling the

; pushButton method of HelpButton

HelpButton.pushButton()

endif

; Shortcut keys

if eventinfo.IsAltKeyDown() then

switch

; Shortcut for the Close button

case kPhysical = TXTBTNCLOSE_HK :

CloseButton.pushButton()

; Shortcut for the New button

case kPhysical = TXTBTNNEW_HK :

NewButton.pushButton()

endswitch

endif

else

; This code executes only for the form.

endif

endmethod


Methods

Uses

Var

Const

open

action

mouseEnter

mouseExit

mouseRightUp

keyPhysical


Objects

thePage


See Also

NewActivityForm (NEWACTIV.FSL)

ActivityForm (ACTIVITY.FSL)

Activity/Action Item Dialog Box (User Help)


thePage (ActivityTypeForm)
 thePage

Objects

thePage contains all the controls that are displayed by ActivityTypeForm.

setFocus

Called when the dialog box becomes active (also called gaining focus). It places the form in Edit mode.

method setFocus(var eventInfo Event)

; Place the form in Edit mode

action(dataBeginEdit)

endmethod


Objects

HelpButton

NewButton

CloseButton


HelpButton (ActivityTypeForm)
 HelpButton

Objects

Displays Connections user Help for the Activity/Action Item dialog box.

pushButton

Called when a user clicks the Help button on the Activity/Action Item dialog box or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the dialog box

helpShowContext(helpFile,#IDH_FORMS_ACTIVITY)

endmethod


NewButton (ActivityTypeForm)
 NewButton

Objects

NewButton lets the user add a new activity or action item to the list.

pushButton

Called when the user clicks the New button. It places ACTTYPES (the table frame displayed on the form) in Edit mode and adds a record to it.

method pushButton(var eventInfo Event)

; Place the table frame in Edit mode and

; insert a record

ACTTYPES.action(DataBeginEdit)

ACTTYPES.action(DataInsertRecord)

endmethod


CloseButton (ActivityTypeForm)
 CloseButton

Objects

CloseButton lets the user close the Activity/Action Item dialog box.

pushButton

Called when the user clicks the Close button. It closes the form.

method pushButton(var eventInfo Event)

; Close the form

close()

endmethod


 CompanyForm (COMPANY.FSL)

See Also	Objects	Methods

CompanyForm displays in the application as the Company Information form. Companies can have multiple contacts. The Company Information form is used to look up, view, enter and edit details on a company.

Uses

Defines the argument structure of library methods stored in MENUS.LSL and MSGHELP.LSL. Connections uses these routines to display menus and help.

Uses objectPal

; Methods in MENUS.LSL

displayMenus(callingForm smallInt)

menuActivity(choice string)

search(searchArguments string)

checkOpen(formTitle string) string

; Methods in MSGHELP.LSL

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

objMsg(ObjectID String)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the CompanyForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

menuLib, msgHelpLib	library

newCompanyMode smallInt

formName	form

uio	uiObject

uioName, kPhysical	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNCLOSE_HK = "C"

TXTBTNLOCATE_HK = "L"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_COMPANY = 1015

endConst

open

Called when the dialog box is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries, checks whether the form can be opened, and sets search options.

method open(var eventInfo Event)

var

formTitle	String

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL and MSGHELP.LSL

if menuLib.open("menus") AND

msgHelpLib.open("msgHelp") then

; Set newCompanyMode to indicate that a new

; company isn't being entered

newCompanyMode=0

; Replace the Paradox menu bar with custom

; application menus using displayMenus in

; MENUS.LSL

menuLib.displayMenus(2)

; Specify that searches can use advanced

; wildcards

advancedWildcardsInLocate(yes)

; Associate formName, a Form variable, with

; COMPANY.FSL and set formTitle to its title

formName.attach()

formTitle = formName.getTitle()

; Check if the application was started properly

menuLib.checkOpen(formTitle)

; Display page one of the form

movetoPage(1)

; Specify that searches can use advanced

ignoreCaseinLocate(yes)

else

; If one of the application libraries can't be

; opened, display an error message and close the

; form

msgStop("Failure","Your working directory is "+workingDir()+

".  "+"Please change your working directory to where

 Connections is located.")

disableDefault

close()

endif

endif

endmethod

setFocus

Called when the form becomes active (also called gaining focus). It places the form in Edit mode.

method setFocus(var eventInfo Event)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Place the form in Edit mode

action(dataBeginEdit)

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button or a field, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the

; object the user is pointing to

eventInfo.getTarget(uio)

; Set uioName, a String variable, to the name of

; the object being pointed to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field" then

; If object being pointed to is a button or a field,

; display a description on the status line

msgHelplib.objMsg(formName.name + "," +

msgHelplib.pageNameof(uio) + "," + uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located within a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object

; the user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object

; the user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

   	while

      	uio.class = "Text" or uio.class = "Bitmap"

      	uio.attach(uio.ContainerName)

     	endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Company Information form. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the name

; of the key pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process the key

if kPhysical = "VK_F1" then

; If the user pressed F1, prevent Paradox

; from displaying Help

disableDefault

; Display Help by calling the pushButton

; method of HelpButton

HelpButton.pushButton()

endif

; Shortcut keys

if eventinfo.IsAltKeyDown() then

switch

; Shortcut for the Close button

case kPhysical = TXTBTNCLOSE_HK :

CloseButton.PushButton()

; Shortcut for the Locate button

case kPhysical = TXTBTNLOCATE_HK :

LocateButton.PushButton()

endswitch

endif

else

; This code executes only for the form.

endif

endmethod

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user is inserting a record, it makes the Name field active. If the user tries to delete a record, it displays a message to confirm the operation.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicks a field, prevent the Filter

; menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

switch

case eventInfo.id()=dataInsertRecord:

; If the user inserts a record, select

; the Name field

moveTo(name)

case eventInfo.id()=dataDeleteRecord:

; If the user tries to delete a record, confirm

; the operation before proceeding

disableDefault

if msgQuestion("Delete Record","Are you sure you wish to

 delete this record?")="Yes" then

; Select the name field

moveTo(name)

doDefault

endif

case eventInfo.id()=dataPostRecord or

  eventInfo.id()=dataUnlockRecord:

; If the an attempt is made to post or unlock

; the current record, check if a new record

; was being entered

if name="New Company" then

; If a new record was being entered,

; prevent the record from posting or

; being unlocked

disableDefault

endif

endSwitch

endif

endmethod

menuAction

Called when the user attempts a menu operation. It passes the menu choice to menuActivity (in MENUS.LSL) for processing.

method menuAction(var eventInfo MenuEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Set choice, a String variable, to the menu command

; chosen by the user

choice=eventInfo.menuChoice()

; Open MENUS.LSL

menuLib.open("menus")

; Process the menu choice using menuActivity

; in MENUS.LSL

menuLib.menuActivity(choice)

endif

endmethod

InitialQuickSearch

Called by the mouseDouble method of mainPage.Company and the pushButton method of mainPage.CompInfoButton (both in ContactForm). It searches the Name field of COMPANY.DB for a company name and displays the corresponding record in the Company Information form.

method initialQuickSearch(theValue string)

; Search the Name field of COMPANY.DB for

; the company name stored in theValue

locate("name",theValue)

endmethod

newCompany

Called by the createNewCompany method and the pushButton method of mainPage.CompInfoButton (both in ContactForm). It creates a new record in COMPANY.DB and displays it in the Company Information form for completion. The string passed to newCompany (startedValue) is copied into the Name field of the new record.

method newCompany(startedValue string)

; Make sure the company table frame is visible

dataFrame.visible=yes

; Insert a record into the table frame

action(dataInsertRecord)

; Set the name of the company to the value

; stored in startedValue

name=startedValue

; Set newCompanyMode to indicate that a

; new company is being added

newCompanyMode=1

endmethod


Methods

Uses

Var

Const

open

setFocus

mouseEnter

mouseExit

mouseRightUp

keyPhysical

action

menuAction

InitialQuickSearch

newCompany


Objects

HelpButton

ShortName

CloseButton

LocateButton

LastName

CompanyName


See Also

CompanyListForm (COMPLIST.FSL)

Company Information Form (User Help)


HelpButton (CompanyForm)
 HelpButton

Objects

Displays Connections user Help for the Company Information form.

pushButton

Called when a user clicks the Help button on the Company Information form or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the form

helpShowContext(helpFile,#IDH_FORMS_COMPANY)

endmethod


ShortName (CompanyForm)
 ShortName

Objects

ShortName lists an abbreviated name for the current company.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a message explaining the field's purpose.

method status(var eventInfo StatusEvent)

message("The short name is used in the body of correspondence with the contact")

endmethod


CloseButton (CompanyForm)
 CloseButton

Objects	Methods

CloseButton closes the Company Information form and copies the current company information to fields in the Contact Profile form.

Uses

Defines the argument structure of a method stored in ContactForm. CompanyForm uses this routine to copy the current company's information to the Contact Profile form.

Uses objectPal

; Method in CONTACTS.FSL

fillCompany(x string)

endUses

pushButton

Called when the user clicks the Close button on the Company Information form. It copies information about the current company to the Contact Profile form using newCompany (in ContactForm), then closes the form.

method pushButton(var eventInfo Event)

var

formOther form

endVar

if name="New Company" then

; If the Name field is set to New Company when

; the form closes, discard the current record

; and set newCompanyMode to indicate that

; a new company isn't being entered

action(dataCancelRecord)

newCompanyMode=0

endif

if newCompanyMode=1 then

; If newCompanyMode is still 1, indicating that

; a new company was created, associate formOther

; with the Contact Profile form and copy the current

; company's name to the Company field of CONTACTS.FSL

formOther.attach("Contact Profile")

formOther.fillCompany(name)

endif

; Close the form

close()

endmethod


Methods

Uses

pushButton


LocateButton (CompanyForm)
 LocateButton

Objects

LocateButton lets the user locate a particular company or contact name.

pushButton

Called when the user clicks Locate. It hides the current company information (contained in dataFrame), searches COMPANY.DB, then copies that information to the form and re-displays dataFrame.

method pushButton(var eventInfo Event)

; Hide the company table frame

dataFrame.visible=no

; Search the Name field of COMPANY.DB

; for a specific company name using

; search in MENUS.LSL

menuLib.search("Name,Company Name")

; Select the CompanyName field on the form

moveTo(companyName)

; Re-display the company table frame

dataFrame.visible=yes

endmethod


LastName (CompanyForm)
 LastName

Objects	Methods

LastName displays contact names associated with the current company. It is a calculated field that combines the contents of the FirstName and LastName fields (in CONTLIST.DB) to display a contact's full name.

[CONTLIST.LASTNAME]+", "+[CONTLIST.FIRSTNAME]

Uses

Defines the argument structure of a method stored in ContactForm. CompanyForm uses this routine to change the current contact in the Contact Profile form.

Uses objectPal

; Method in CONTACTS.FSL

locateContact(desiredValue smallInt)

endUses

mouseDouble

Called when the user double-clicks a name in the contact list. It displays the Contact Profile form and shows the contact the user double-clicked.

method mouseDouble(var eventInfo MouseEvent)

var

otherForm form

desiredValue smallInt

endVar

if self=", " then

; The user double-clicked an empty area of

; the contact list

else

; The user double-clicked a contact name

if otherForm.attach("Contact Profile") then

; If the Contact Profile form is open, retrieve

; the contact number of the contact the user

; double-clicked

dmGet("ContList","contactNumber",desiredValue)

; Make the Contact Profile form display that

; contact

otherForm.locateContact(desiredValue)

; Display the form by bringing it to the top

; of the desktop

otherForm.bringToTop()

endif

endif

endmethod

mouseMove

Called when the user moves the pointer across the contact list. It makes sure the mouse pointer retains its arrow shape (the pointer normally changes to an I-beam--a text insertion point--when it passes over a field). The arrow pointer indicates that the user can double-click the field to perform an operation.

method mouseMove(var eventInfo MouseEvent)

; Set the mouse pointer's shape to an arrow

setMouseShape(MouseArrow)

endmethod


Methods

Uses

mouseMove


CompanyName (CompanyForm)
 CompanyName

Objects

CompanyName lists the companies stored in COMPLIST.DB.

mouseMove

Called when the user moves the pointer across the company list. It makes sure the mouse pointer retains its arrow shape (the pointer normally changes to an I-beam--a text insertion point--when it passes over an editable field). The arrow pointer indicates that the user can double-click the field to perform an operation.

method mouseMove(var eventInfo MouseEvent)

; Set the mouse pointer shape to an arrow

setMouseShape(MouseArrow)

endmethod


 CompanyListForm (COMPLIST.FSL)

See Also	Objects	Methods

CompanyListForm displays in the application as the Company List dialog box, which is used when entering a company name in the Contact Profile form. It displays a list of companies already stored in Connections. The user can select a company name to insert into the Company field or display the Company Information form and create a new company.

Uses

Defines the argument structure of library methods stored in MENUS.LSL and MSGHELP.LSL. Connections uses these routines to display menus and check whether the form can be opened.

Uses objectPal

; Methods in MSGHELP.LSL

objMsg(ObjectID String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

pageNameof(ui uiObject) string

; Method in MENUS.LSL

checkOpen(formTitle string) string

endUses

Var

Defines variables used throughout the CompanyListForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

menuLib,msgHelpLib	library

formName	form

uio	uiObject

uioName, kPhysical	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNCLOSE_HK = "C"

TXTBTNNEW_HK = "N"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_COMPANYLIST = 1020

endConst

open

Called when the dialog box is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries, checks whether the form can be opened, and sets search options.

method open(var eventInfo Event)

var

formTitle	string

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL and MSGHELP.LSL

if menuLib.open("menus") AND

msgHelpLib.open("msgHelp") then

; If the application libraries can be opened,

; associate formName, a Form variable, with

; COMPLIST.FSL

formName.attach()

; Set formTitle to the form's title

formTitle = formName.getTitle()

; Check if the application started properly

menuLib.checkOpen(formTitle)

else

; If the application libraries can't be opened,

; display an error message and close the form

msgStop("Failure","Your working directory is "+workingDir()+

".  Please change your working directory to where

 Connections is located.")

disableDefault

close()

endif

; Specify that searches can use advanced wildcards

advancedWildcardsInLocate(yes)

endif

endmethod

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user tries to display a filter menu by right-clicking a field, this method prevents it.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicks a field, prevent

; the Filter menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button or a field, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

; Set uioName, a String variable, to the name of the object

; being pointed to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field" then

; If object being pointed to is a button or a field,

; display a description on the status line

msgHelplib.objMsg(formName.name + "," +

msgHelplib.pageNameof(uio) + "," + uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located within a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

while

uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Company List dialog box. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the name

; of the key pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process the key

if kPhysical = "VK_F1" then

; If the user pressed F1, prevent Paradox Help

; from displaying

disableDefault

; Display Help by calling the pushButton

; method of HelpButton

HelpButton.PushButton()

endif

if kPhysical = "VK_ESCAPE" then

; If the user presses Esc, close

; the form by calling the pushButton

; method of CloseButton

CloseButton.pushButton()

endif

; Shortcut keys

if eventinfo.IsAltKeyDown() then

switch

; Shortcut for Close button

case kPhysical = TXTBTNCLOSE_HK :

CloseButton.PushButton()

; Shortcut for New button

case kPhysical = TXTBTNNEW_HK :

NewButton.PushButton()

endswitch

endif

else

; This code executes only for the form.

endif

endmethod

InitialQuickSearch

Called by the canDepart method of mainPage.Company (in ContactForm). It searches the Name field of COMPANY.DB for a company name and highlights the corresponding record in the Company List dialog box.

method InitialQuickSearch(desiredValue string)

if desiredValue.size()>1 then

; If the length of desired value exceeds one

; character, convert only the first character

; to uppercase and append the rest of the string

; to it

desiredValue=upper(desiredValue.subStr(1,1)) +

 desiredValue.subStr(2,desiredValue.size()-1)

else

; If the value is one character, convert

; it to uppercase

desiredValue=upper(desiredValue)

endif

; Search the Name field of the Company table frame

; for the company name stored in desiredValue

company.locatePattern("name",desiredValue)

; Display the Company table frame

companyBox.visible=yes

; Select the Name field of the Company table frame

moveTo(name)

endmethod


Methods

Uses

Var

Const

open

action

mouseEnter

mouseExit

mouseRightUp

keyPhysical

InitialQuickSearch


Objects

HelpButton

CloseButton

NewButton

CompanyNameRecord.Name


See Also

CompanyForm (COMPANY.FSL)

Company List Dialog Box


thePage.HelpButton (CompanyListForm)
 HelpButton

Objects

Displays Connections user Help for the Company List dialog box.

pushButton

Called when a user clicks the Help button on the Company List dialog box or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the form

helpShowContext(helpFile,#IDH_FORMS_COMPANYLIST)

endmethod


thePage.CloseButton (CompanyListForm)
 CloseButton

Objects

CloseButton closes the Company List dialog box and copies the current company information to fields in the Contact Profile form.

pushButton

Called when the user clicks the Close button on the Company List dialog box. It closes the form and copies information about the current company to the Contact Profile form.

method pushButton(var eventInfo Event)

; Return the name of the selected company

; to the form that displayed the company list

formReturn(name)

endmethod


thePage.NewButton (CompanyListForm)
 NewButton

Objects

New lets the user create a new company using the Company Information form.

pushButton

Called when the user clicks the New button on the Company List dialog box. It returns "New Company" to the canDepart method of mainPage.Company (in ContactForm), then closes the dialog box.

method pushButton(var eventInfo Event)

var

formToOpen form

endVar

; Return New Company, which indicates that a new

; company should be created

formReturn("New Company")

endmethod


CompanyNameRecord.Name (CompanyListForm)
 CompanyNameRecord.Name

Objects	Methods

Name lists the companies that currently exist in COMPANY.DB. The user can double-click a company name (or select the name and press Enter) to copy it to the Contact Profile form.

mouseDouble

Called when the user double-clicks a name in the list. Returns the company name to the canDepart method of mainPage.Company (in ContactForm), then closes the dialog box.

method mouseDouble(var eventInfo MouseEvent)

; Return the name of the company that the user

; double-clicked to the form that displayed

; the company list

formReturn(self)

endmethod

keyPhysical

Called when the user selects a company name and presses a key. If the key pressed is Enter, the method returns the company name to the canDepart method of mainPage.Company (in ContactForm), then closes the dialog box.

method keyPhysical(var eventInfo KeyEvent)

;Process keys

if eventInfo.vChar()="VK_RETURN" then

; If the user pressed Enter,

; return the selected company name

; to the form that displayed the company

; list

disableDefault

formReturn(self)

else

if eventInfo.vChar()="VK_ESCAPE" then

; If the user presses Esc,

; return an empty string to the form

; that displayed the company list

formReturn("")

endif

endif

endmethod


Methods

mouseDouble

keyPhysical


 ContactForm (CONTACTS.FSL)

See Also	Objects	Methods

ContactForm is actually two forms in one:

mainPage is the main form for Connections, and displays in the application as the Contact Profile form. Controls on this page let the user locate any contact on file, or jump to the other forms. The form also lets users view, enter and edit details on one contact. The first page shows contact data such as name, address, and telephone numbers. It also has fields that are used to classify contacts into meaningful groups.

ContactProfilePage stores personal information about a contact and displays in the application as the Personal Information form.

Uses

Defines the argument structure of library methods stored in MENUS.LSL and MSGHELP.LSL. Connections uses these routines to display menus and help.

Uses objectPal

; Methods in MENUS.LSL

displayMenus(callingForm smallInt)

keyViol()

search(searchArguments string)

menuActivity(choice string)

; Methods in MSGHELP.LSL

objMsg(ObjectID String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the ContactForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

menuLib, msgHelpLib	library

formName	form

uio	uiObject

uioName	string

okToExit	logical

kPhysical	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNCOMPINFO_HK = "I"

TXTBTNLOCATE_HK = "L"

TXTBTNACTIVITY_HK = "A"

TXTBTNPERSONAL_HK = "S"

TXTBTNREMINDER_HK = "E"

TXTBTNFINANCIAL_HK = "N"

TXTBTNCLOSE_HK = "C"

TXTBTNEXIT_HK = "X"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_CONTACTPROFILE = 1030

#IDH_FORMS_PERSONAL = 1060

endConst

open

Called when Connections is first opened. It initializes the Contact Profile form, opens the MENUS.LSL and MSGHELP.LSL libraries, sets the two user-defined field labels (UDF1Text and UDF2Text), then specifies screen display and search options.

method open(var eventInfo Event)

var

tcSystem 	tcursor

formTitle	string

app	application

endVar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL and MSGHELP.LSL

if menuLib.open("menus") AND

msgHelpLib.open("msgHelp") then

; If the application libraries can be opened,

; hide the Toolbar

hideToolBar()

if projectViewerIsOpen() then

; If the Project View is open, close it

projectViewerClose()

endif

; Open SYSTEM.DB

if not tcSystem.open("system") OR

tcSystem.isempty() then

; If SYSTEM.DB doesn't exist or is empty, display

; an error message and close the application

msgStop("Problem","The system table cannot be opened or

is empty. Please reinstall Connections.")

close()

return

endif

; Display the user-defined field labels using

; the defaults in SYSTEM.DB

UDF1Text.text=tcSystem.userDefined1Title+":"

UDF2Text.text=tcSystem.userDefined2Title+":"

; Place SYSTEM.DB in Edit mode

tcSystem.edit()

; Set OkToOpen to indicate that the application was

; started properly

tcSystem."OkToOpen" = "Y"

; Close SYSTEM.DB

tcSystem.close()

; Delay screen refreshes (this improves

; performance)

delayScreenUpdates(yes)

; Specify that searches can use

; advanced wildcards and ignore case

advancedWildcardsInLocate(yes)

ignoreCaseinLocate(yes)

; Associated formName, a Form variable, with

; CONTACTS.FSL

formName.attach()

; Set okToExit to indicate that the application can't

; currently be closed

okToExit = false

; Set the Paradox window title to Connections

app.setTitle("Connections")

else

; If the application libraries can't be opened

; display an error message and close the form

disableDefault

msgStop("Stop","Your working directory is "+workingDir()+

".  Please change your working directory to

 where Connections is located.")

close()

return

endif

endif

endmethod

setFocus

Called when the form becomes active (also called gaining focus). It sets the menu bar and places the form in Edit mode.

method setFocus(var eventInfo Event)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Replace the Paradox menu bar with custom

; application menus using displayMenus in

; MENUS.LSL

menuLib.displayMenus(1)

;Place the form in Edit mode

action(dataBeginEdit)

endif

endmethod

close

Called when the form closes. It restores the default Paradox menus, re-displays the Toolbar, and sets the application title back to "Paradox for Windows."

method close(var eventInfo Event)

var

app application

endVar

if eventInfo.isPreFilter() then

;This code executes for each object on the form:

else

; This code executes only for the form:

; Change the menu bar back to the default

; Paradox menus

removeMenu()

; Re-display the Toolbar

showToolBar()

; Re-display the Project Viewer

projectViewerOpen()

; Set the window title back to Paradox

; for Windows

app.setTitle("Paradox for Windows")

endif

endmethod

depart

Called when the form closes. It sets makes OkToOpen, a field in SYSTEM.DB, blank. Connections uses OkToOpen to check if the application was started properly.

method depart(var eventInfo MoveEvent)

var

tcSystem	tCursor

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open SYSTEM.DB

tcSystem.open("system.db")

; Place SYSTEM.DB in Edit mode

tcSystem.edit()

; Erase the value in the OkToOpen field to

; indicate that if other application forms

; are opened, they should close because the

; application was not started properly

tcSystem.setFieldValue("OkToOpen",blank())

; Close SYSTEM.DB and save the changes

tcSystem.close()

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button, a field, or a field label, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object

; the user is pointing to

eventInfo.getTarget(uio)

; Set uioName to the name of the object being pointed

; to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field"

OR uio.class = "Text" then

; If object being pointed to is a button, a field,

; or text, display a description on the status line

msgHelplib.objMsg(formName.name + "," + msgHelplib.pageNameof(uio) + "," + uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located in a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

while

uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Contact Profile form. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the key

; pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process keys

if kPhysical = "VK_F1" then

; If the user pressed F1, prevent Paradox

; Help from displaying

disableDefault

; Associate uio, a UIObject variable, with the

; object F1 was pressed from

eventInfo.getTarget(uio)

switch

; If the user pressed F1 from the second page,

; display Help for the Personal Information

; form

case msgHelpLib.pageNameof(uio) = "mainPage" :

HelpButton.pushButton()

; If the user pressed F1 from the main page,

; display Help for the Contact Profile form

case msgHelpLib.pageNameof(uio) =

 "ContactProfilePage" :

ContactProfileHelpButton.pushButton()

endswitch

endif

; Shortcut keys

if eventinfo.IsAltKeyDown() then

switch

; Shortcut for Company Info button

case kPhysical = TXTBTNCOMPINFO_HK :

CompInfoButton.PushButton()

; Shortcut for Locate button

case kPhysical = TXTBTNLOCATE_HK :

LocateButton.PushButton()

; Shortcut for Activity button

case kPhysical = TXTBTNACTIVITY_HK :

ActivityButton.PushButton()

; Shortcut for Personal button

case kPhysical = TXTBTNPERSONAL_HK :

disableDefault

PersonalButton.PushButton()

; Shortcut for Reminder button

case kPhysical = TXTBTNREMINDER_HK :

ReminderButton.PushButton()

; Shortcut for Financial button

case kPhysical = TXTBTNFINANCIAL_HK :

FinancialButton.PushButton()

; Shortcut for Close button on the Personal

; Information form

case kPhysical = TXTBTNCLOSE_HK :

disableDefault

CloseButton.PushButton()

; Shortcut for Exit button

case kPhysical = TXTBTNEXIT_HK :

ExitButton.PushButton()

endswitch

endif

if eventInfo.isShiftKeyDown() then

; If the user tries to move between pages using

; Shift+F3 or Shift+F4, prevent it

if kPhysical = "VK_F3" or kPhysical = "VK_F4" then

disableDefault

endif

endif

else

; This code executes only for the form.

endif

endmethod

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user is inserting a record, it makes the Salutation field active. If the user tries to delete a record, it displays a message to confirm the operation.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicks a field, prevent the Filter

; menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

; Process record insertions and deletions

switch

case eventInfo.id()=dataInsertRecord:

; If the user inserts a record, select the

; Salulation field

moveTo(salutation)

case eventInfo.id()=dataDeleteRecord:

; If the user tries to delete a record

; confirm the operation before proceeding

disableDefault

if msgQuestion("Delete Record","Are you sure you wish to

 delete this record?")="Yes" then

; Select the Salutation field

moveTo(salutation)

; Delete the record (the default behavior)

doDefault

endif

endSwitch

endif

endmethod

menuAction

Called when the user attempts a menu operation. It passes the menu choice to menuActivity (in MENUS.LSL) for processing.

method menuAction(var eventInfo MenuEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Set choice, a String variable, to the menu command

; chosen by the user

choice=eventInfo.menuChoice()

; Process the menu command using menuActivity in

; MENUS.LSL

menuLib.menuActivity(choice)

endif

endmethod

error

Called when an error occurs on the form. If the error is a key violation, the keyViol method (in MENUS.LSL) is called. All other errors are handled by Paradox.

method error(var eventInfo ErrorEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

if errorCode() = peKeyViol then

; If a key violation occurred (two records with the

; same name and company), call the keyViol method

; in MENUS.LSL

menuLib.keyViol()

endif

endif

endmethod

AssignCompanyInfo

Called when a user tries to leave any of the address or phone number fields in the Contact Profile form (by selecting another field). If the field was left blank, the method fills it with information from the record in COMPANY.DB that corresponds to the company associated with the current contact.

; This method is called by the address and phone number

; fields of the form.

method AssignCompanyInfo()

var

thisField string

endVar

if subject.isBlank() and subject.isEdit() then

; If the field is blank, set it to the value

; stored in the company record associated with

; the contact

dmGet("company",subject.fieldName,thisField)

subject.value=thisField

endif

endmethod

changeFieldLabel

Called when the user double-clicks one of the two user-defined field labels (UDF1text and UDF2text). It prompts the user to enter a new field name, changes the label to reflect the new setting, then stores the revised setting in SYSTEM.DB.

method changeFieldLabel()

var

textLabel string

tc tcursor

endVar

; Set textLabel, a String variable, to the current

; value of the text

textLabel=subject.text

; Remove the colon from the end of the text

textLabel=textLabel.subStr(1,textLabel.size()-1)

; Prompt the user for a new value

textLabel.view("Enter desired label for this field:")

; Shorten the new text to 14 characters

textLabel=textLabel.subStr(1,14)

; Add a colon to the end of the text

subject.text=textLabel+":"

; Open SYSTEM.DB

tc.open("system")

; Place SYSTEM.DB in Edit mode

tc.edit()

if subject.name="UDF1text" then

; If the first user-defined field label was

; double-clicked, update the setting in SYSTEM.DB

tc.userDefined1Title=textLabel

else

; If the second user-defined field label was

; double-clicked, update the setting in SYSTEM.DB

tc.userDefined2Title=textLabel

endif

; Close SYSTEM.DB

tc.close()

endmethod

locateContact

Called by the mouseDouble method of LastName (in CompanyForm) when the user double-clicks an entry in the contacts list. It locates that contact's record and displays it in the Contact Profile form.

method locateContact(desiredValue smallInt)

; Make the form display the contact associated

; with the contact number stored in desiredValue

locate("contactNumber",desiredValue)

endmethod

updateSystemTable

Called when the user tries to display another Connections form (by double-clicking the Company field, clicking a button, and so on). If the current record was changed or is new, the method tries to post the new record. If it cannot post the record, a warning is displayed and the method returns a value that makes the calling method cancel the form change.

If the record is posted, the method copies the current contact's contactNumber field (in CONTLIST.DB) to the currentContact field (in SYSTEM.DB), then returns a value that makes the calling method proceed with the form change.

method updateSystemTable() smallInt

var

ui uiobject

tcSystem tcursor

go smallInt

endVar

; Select the Salutation field

moveTo(salutation)

; Initialize go, a smallInt variable, to indicate

; that no errors have occurred

go=1

; Associate ui, a UIObject variable, with the

; Company field

ui.attach(company)

if ui.recordStatus("New") or ui.recordStatus("Modified") then

if not action(dataPostRecord) then

; If the record displayed on the form is new or

; changed and it can't be posted, display an

; error message

msgStop("Post Record","This record could not be posted.

  Either it is not complete yet, or is a duplicate

  of an existing record.")

; Set go to indicate that a problem occurred

go=0

endif

endif

if go=1 then

; If no problems occurred while posting the record,

; open SYSTEM.DB

tcSystem.open("system")

; Place SYSTEM.DB in Edit mode

tcSystem.edit()

if tcSystem.isEmpty() then

; If SYSTEM.DB is empty, display an error message

msgStop("Problem","The system table is empty. Please

 reinstall Connections.")

return 0

endif

; Set the currentContact field to indicate the

; current contact number

tcSystem.currentContact=contactNumber

; Close SYSTEM.DB

tcSystem.close()

endif

; Return the value of go to the calling method

return go

endmethod

fillCompany

Called by the pushButton method of CloseButton (in CompanyForm) when the user closes the Company Information form. It sets the Company field on the current record of the Contact Profile form to a company name (indicated by newCompanyName).

method fillCompany(newCompanyName string)

; Set the Company field to the name stored in

; newCompanyName

company=newCompanyName

endmethod

switchNameFromActivityForm

Called by the pushButton method of LocateButton (in ActivityForm) when the user clicks Locate to display a different contact in the Contact Activity form. It calls the search method (in MENUS.LSL), then calls the pushButton method of ActivityButton to display the new contact.

; This method is called from the pushButton method of

; LocateButton in ACTIVITY.FSL when the user wants to

; search for a different contact

method switchNameFromActivityForm()

; Search CONTLIST.DB for a contact by last name,

; then display the record on the form

menuLib.search("LastName,Last Name")

; Re-display the Contact Activity form to display

; the new contact and associated records

activityButton.pushButton()

endmethod


See Also

Contact Profile Form (User Help)

Personal Information Form (User Help)


Objects

ContactProfilePage

mainPage


Methods

Uses

Var

Const

open

setFocus

close

depart

mouseEnter

mouseExit

mouseRightUp

keyPhysical

action

menuAction

error

AssignCompanyInfo

changeFieldLabel

locateContact

updateSystemTable

fillCompany

switchNameFromActivityForm


ContactProfilePage (ContactForm)
 ContactProfilePage

Objects

ContactProfilePage is the Personal Information form used by Connections to display and enter personal details about a contact (birthday, the names of family members, and so on).


Objects

ContactProfileHelpButton

CloseButton

PersonalDataBox.Birthday

PersonalDataBox.ContactName


ContactProfilePage.ContactProfileHelpButton (ContactForm)
 ContactProfilePage.ContactProfileHelpButton

Objects

HelpButton lets the user display Connections user Help for the form.

pushButton

Called when a user clicks the Help button on the Personal Information form or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the Personal Information

; form

helpShowContext(helpFile,#IDH_FORMS_PERSONAL)

endmethod


ContactProfilePage.CloseButton (ContactForm)
ContactProfilePage.CloseButton

Objects

CloseButton lets the user close the Personal Information form.

pushButton

Called when the user clicks the Close button on the Contact Profile form. It closes the form by returning the user to the first page (mainPage).

method pushButton(var eventInfo Event)

; Move to the first page of the form (Contact Profile form)

moveToPage(1)

endmethod


PersonalDataBox.Birthday (ContactForm)
 ContactProfilePage.PersonalDataBox.Birthday

See Also	Objects

Birthday lists the current contact's birthday.

changeValue

Called when the the user changes the value of the Birthday field. It asks whether a reminder of the birthday should be stored in the Reminder dialog box, then inserts the birthday as a follow-up item scheduled for the birthdate minus the number of days stored in the birthdayAdvanceDays field of SYSTEM.DB.

method changeValue(var eventInfo ValueEvent)

var

tcSystem,tcAction tcursor

thisYearsDay date

endVar

doDefault

if not self.isBlank() then

; If the field isn't blank, ask the user if

; the birthday should be added to ACTION.DB

; as a follow-up action item

if msgQuestion("Contact Birthday","Create Reminder record to

 notify you when this birthday approaches?")="Yes" then

; If the user confirms the operation,

; open SYSTEM.DB

tcSystem.open("system")

; Open ACTION.DB

tcAction.open("action")

; Place ACTION.DB in Edit mode

tcAction.edit()

; Add a record to ACTION.DB

tcAction.insertRecord()

thisYearsDay=dateVal(string(month(self))+"/"+

string(day(self))+"/"+string(year(today)))

if (thisYearsDay-tcSystem.birthdayAdvanceDays)

<today() then

; If the birthday has already occurred this

; year, add it for next year

tcAction.date=dateVal(string(month(self)) + "/"

 + string(day(self)) + "/" +

 string(year(today) + 1))

else

; If the birthday hasn't already occurred this

; year, add it for this year

tcAction.date=thisYearsDay-

tcSystem.birthdayAdvanceDays

endif

; Set the action item type to Birthday

tcAction.actionItem="BDay!"

; Set the contact number to the current contact

tcAction.contact=contactNumber

; Close ACTION.DB

tcAction.close()

; Close SYSTEM.DB

tcSystem.close()

endif

endif

endmethod


See Also

NewActivityForm (NEWACTIV.FSL)

ReminderForm (REMINDER.FSL)


PersonalDataBox.ContactName (ContactForm)
 ContactProfilePage.PersonalDataBox.ContactName

Objects

ContactName is a calculated field that combines the contents of the FirstName and LastName fields in CONTLIST.DB to display the contact's full name.

[CONTLIST.FIRSTNAME]+" "+[CONTLIST.LASTNAME]


mainPage (ContactForm)
 mainPage

Objects

mainPage displays in the application as the Contact Profile form, which is the main form for Connections. From here the user can locate any contact on file, jump to the other forms, or view, enter and edit details on one contact. The first page shows contact data such as name, address, and telephone numbers. It also has fields that are used to classify contacts into meaningful groups.


Objects

Buttons	Fields	Text

ActivityButton	Address2	UDF1text
CompInfoButton	Address	UDF2text
End	City
ExitButton	Company
FinancialButton	ContactType
HelpButton	Country
Home	Grade
LocateButton	LastName
Next	Level
PersonalButton	LocalPhone
Prior	PostalCode
ReminderButton	State


mainPage.ActivityButton (ContactForm)
 mainPage.ActivityButton

Objects

ActivityButton lets the user display the Contact Activity form.

pushButton

Called when the user clicks the Activity button on the Contact Profile form. It displays ActivityForm.

method pushButton(var eventInfo Event)

var

formToOpen form

go smallInt

endVar

; Post the current record if it is new or changed

go=updateSystemTable()

if go=1 then

; If the record was posted, open the

; Contact Activity form

formToOpen.open("activity")

; Wait for the user to finish using the form

returns=string(formToOpen.wait())

if returns = "NameChange" then

; If the form returned "NameChange," search for

; a new contact name, then re-display the form

formToOpen.close()

switchNameFromActivityForm()

else

;Otherwise, just close the form

formToOpen.close()

endif

endif

endmethod


mainPage.Address (ContactForm)
 mainPage.Address

Objects	Methods

Address lists the first line of the contact's address.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a message informing the user that the field will be automatically filled with information from the company record (address, phone number) if it is left blank.

method status(var eventInfo StatusEvent)

; Instruct the user that leaving this field blank

; fills it with information from the company record

if self.isBlank() then

message("If you don't enter an address here, the company's address will be used.")

endif

endmethod

changeValue

Called when a user changes a field's value (by selecting another field, clicking a button, and so on). It calls AssignCompanyInfo, which fills in the field with company information if the field is blank.

method changeValue(var eventInfo ValueEvent)

doDefault

; Fill in the field with information from the company

; record if it's blank

assignCompanyInfo()

endmethod


Methods

status

changeValue


mainPage.Address2 (ContactForm)
 mainPage.Address2

Objects	Methods

Address2 lists the second line of the contact's address.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a message informing the user that the field will be automatically filled with information from the company record (address, phone number) if it is left blank.

method status(var eventInfo StatusEvent)

; Instruct the user that leaving this field blank

; fills it with information from the company record

if self.isBlank() then

message("If you don't enter an address here, the company's address will be used.")

endif

endmethod

changeValue

Called when a user changes the field's value. It calls AssignCompanyInfo, which fills in the field with company information if the field is blank.

method changeValue(var eventInfo ValueEvent)

doDefault

; Fill in the field with information from the company

; record if it's blank

assignCompanyInfo()

endmethod


Methods

status

changeValue


mainPage.City (ContactForm)
 mainPage.City

Objects	Methods

City lists the city in which the contact is located.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a message informing the user that the field will be automatically filled with information from the company record (address, phone number) if it is left blank.

method status(var eventInfo StatusEvent)

; Instruct the user that leaving this field blank

; fills it with information from the company record

if self.isBlank() then

message("If you don't enter a city here, the company's city will be used.")

endif

endmethod

changeValue

Called when a user changes a field's value. It calls AssignCompanyInfo, which fills in the field with company information if the field is blank.

method changeValue(var eventInfo ValueEvent)

doDefault

; Fill in the field with information from the company

; record if it's blank

assignCompanyInfo()

endmethod


Methods

status

changeValue


mainPage.Company (ContactForm)
 mainPage.Company

Objects	Methods

Company specifies the company that employs the current contact. The user can double-click it to display the Company Information form or Company List dialog box.

Uses

Specifies the argument structure of methods in CompanyForm that are used by the object. Company uses these methods to search for values or add new companies.

Uses objectPAL

; Method in COMPLIST.FSL

initialQuickSearch(desiredValue string)

; Method in COMPANY.FSL

newCompany(startedValue string)

endUses

canDepart

Called when the user tries to leave the Company field (to enter values into other fields, display other forms, and so on). Since this field is required for every contact, this method

Displays a warning message if the field is blank and prevents the user from selecting another field.

Displays CompanyListForm if the value is 10 characters or less.

If the value is not in COMPANY.DB and exceeds 10 characters, asks if the user wants Connections to enter the value as a new company. If the user confirms the operation, the new company is added using using createNewCompany.

method canDepart(var eventInfo MoveEvent)

var

tcCompany	tcursor

listForm,companyForm	form

go smallInt

endVar

if not self.isBlank() then

; If the field isn't blank, open COMPANY.DB

tcCompany.open("company")

; Search COMPANY.DB for the name stored in

; the field

if tcCompany.locate("name",self) then

; The value matches an existing company

else

; The value doesn't match an existing

; company

; Initialize go to indicate that the Company

; List dialog box should display

go=1

; Prevent the user from departing the field

eventInfo.setErrorCode(canNotDepart)

if self.size()>10 then

; If the company name is new and exceeds 10

; characters, ask the user if they want to

; add it as a new company to COMPANY.DB

if msgQuestion("Company Name","This company cannot

 be found.  Do you wish to enter this as a new

 company?")="Yes" then

; Set go to indicate that the Company

; List dialog box shouldn't display

go=0

; Add the value as a new company to

; COMPANY.DB

createNewCompany()

endif

endif

if go=1 then

; Display the Company List dialog box

companyLookup()

if self="New Company" then

; If the value of the field is

; New Company, add a new company

; to COMPANY.DB

createNewCompany()

endif

endif

endif

else

; The field is blank; display an error message

msgStop("Company Name","You must enter a value into this field.  All contacts must be assigned to a company.")

; Prevent the user from departing the field

eventInfo.setErrorCode(canNotDepart)

endif

endmethod

depart

Called when the user departs the field. If the record is new, this method fills in the address and phone number fields of the contact record with the company address.

method depart(var eventInfo MoveEvent)

var

thisfield	string

endvar

if recordStatus("New") then

; If the current record is new, fill

; the address and phone number fields

; with information from the company record

Address.AssignCompanyInfo()

Address2.AssignCompanyInfo()

City.AssignCompanyInfo()

State.AssignCompanyInfo()

Country.AssignCompanyInfo()

PostalCode.AssignCompanyInfo()

if isblank(LocalPhone) then

dmGet("company","mainPhone",thisField)

LocalPhone=thisField

endif

endif

endmethod

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user presses Ctrl+Spacebar to display a lookup list, this method calls companyLookup to display a custom list.

method action(var eventInfo ActionEvent)

if eventInfo.ID() = dataLookUp then

; If the user tried to display a lookup table,

; disable the default behavior

disableDefault

; Display the Company List dialog box instead

companyLookup()

endif

endmethod

companyLookup

Called by the action method when the user presses Ctrl+Spacebar. It displays a list of companies (stored in COMPANY.DB).

method companyLookup()

var

listForm form

endvar

; Display the Company List dialog box

listForm.open("compList")

; Select the company name in the dialog box

; that corresponds to the value of the Company

; field

listForm.initialQuickSearch(self)

; Wait for the user to select a field

self=string(listForm.wait())

if self="New Company" then

; If the value of the field is

; New Company, add a new company

; to COMPANY.DB

createNewCompany()

endif

; Close the form

listForm.close()

endmethod

mouseDouble

Called when the user double-clicks the Company field. If the field is not blank, it checks the value of the field, then

Displays CompanyForm if the value is the name of a company stored in COMPANY.DB (the canDepart method is also called as a result of this operation).

Displays CompanyListForm if the value is not found in COMPANY.DB.

method mouseDouble(var eventInfo MouseEvent)

var

formToOpen form

endVar

if not self.isBlank() then

; If the field is not blank, post the record

; if it's changed or new

go=updateSystemTable()

if go=1 then

; If the record was posted successfully, see

; if the Company Information form is already

; open

if formToOpen.attach("Company Information") then

; If the form is already open, bring it to

; the top of the desktop

formToOpen.bringToTop()

else

; Otherwise, open the form and display it

formToOpen.open("Company")

endif

; Make the Company Information form display

; the record for the company name stored in

; the field

formToOpen.initialQuickSearch(self)

endif

endif

endmethod

mouseMove

Called when the user moves the pointer across the Company field. It makes sure the mouse pointer retains its arrow shape (the pointer normally changes to an I-beam--a text insertion point--when it passes over an editable field). The arrow pointer indicates that the user can double-click the field to perform an operation.

method mouseMove(var eventInfo MouseEvent)

; Change the mouse pointer's shape to an arrow

setMouseShape(MouseArrow)

endmethod

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with instructions for entering company names.

method status(var eventInfo StatusEvent)

if self.isBlank() then

; If the field is blank, display instructions

; for displaying the Company List dialog box

message("Press Ctrl+Spacebar to view a list of companies")

else

; Otherwise, display instructions for displaying

; the Company Information form

message("Double-click this field to view company information")

endif

endmethod

createNewCompany

Called by the canDepart method when the user tries to create a new company from the Contact Profile form. It displays CompanyForm and calls newCompany (in CompanyForm) to create the new company record.

method createNewCompany()

var

formCompany form

endVar

if formCompany.attach("Company Information") then

; If the Company Information form is already

; open, bring it to the top of the desktop

formCompany.bringToTop()

else

; Otherwise, open the form and display it

formCompany.open("Company")

endif

; Make the form create a new company using

; the value of Company

formCompany.newCompany(self)

endmethod


Methods

Uses

canDepart

depart

action

companyLookup

createNewCompany

mouseDouble

mouseMove

status


mainPage.CompInfoButton (ContactForm)
 mainPage.CompInfoButton

Objects	Methods

CompInfoButton displays the Company Information form.

Uses

Specifies the argument structure of methods in CompanyForm that are used by the object. Company uses these methods to search for values or add new companies.

Uses objectPAL

; Methods in COMPANY.FSL

initialQuickSearch(desiredValue string)

newCompany(startedValue string)

endUses

pushButton

Called when the user clicks the button. It displays CompanyForm and displays the company that employs the current contact.

method pushButton(var eventInfo Event)

var

formToOpen form

endVar

if not self.isBlank() then

; If the field isn't blank, post the record if it's

; new or changed

go=updateSystemTable()

if go=1 then

; If the record posted successfully, display

; the Company Information form

if formToOpen.attach("Company Information") then

; If the Company Information form is

; already open, bring it to the top of the

; desktop

formToOpen.bringToTop()

else

; Otherwise, open the form and display it

formToOpen.open("Company")

endif

; Display the record associated with the

; Company field's value

formToOpen.initialQuickSearch(Company.value)

endif

endif

endmethod

createNewCompany

Called when the user tries to create a new company. It displays CompanyForm and adds a new record, setting the company name to the value of Company.

method createNewCompany()

var

formCompany form

endVar

if formCompany.attach("Company Information") then

; If the Company Information form is open, bring

; it to the top of the desktop

formCompany.bringToTop()

else

; Otherwise, open and display COMPANY.FSL

formCompany.open("company")

endif

; Add a new company to the Company Information form

formCompany.newCompany(self)

endmethod


Methods

Uses

pushButton

createNewCompany


mainPage.ContactType (ContactForm)
 mainPage.ContactType

Methods	Objects

ContactType lists a code categorizing the contact (Influencer, Press Contact).

Uses

Defines the argument structure of a custom method stored in ContactTypesForm ContactType uses this routine to display popup menus.

Uses objectPal

; Method in CONTYPES.FSL

initialQuickSearch(desiredValue string)

endUses

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user presses Ctrl+Spacebar to display a lookup list, this method calls contactTypeLookup to display a custom list.

method action(var eventInfo ActionEvent)

if eventInfo.ID() = dataLookup then

; If the user presses Ctrl+Spacebar or

; right-clicks the field, prevent the

; default lookup table from displaying

disableDefault

; Display the Contact Types dialog box

contactTypeLookup()

; Post the changes

action(dataPostRecord)

endif

endmethod

contactTypeLookup

Called by the action method when the user presses Ctrl+Spacebar. It displays a list of valid contact types (stored in CONTYPES.DB).

method contactTypeLookup()

var

listForm form

endvar

; Open the Contact Types dialog box

listForm.open("Contypes")

; Select the contact type corresponding to

; the current value of the field

listForm.initialQuickSearch(self)

; Wait for the user to select a new

; contact type

self=string(listForm.wait())

endmethod

canDepart

Called when the user tries to leave the ContactType field (to enter values into other fields, display other forms, and so on). Since this field is required for every contact, this method displays a list (created using a query of the records in CONTYPES.DB) of contact types whenever the user tries to leave the field. When a valid contact type is entered, the user can leave the field.

method canDepart(var eventInfo MoveEvent)

var

tcLookup tcursor

lookupPop popUpMenu

returns string

endVar

; Open CONTYPES.DB

tcLookup.open("contypes")

if not tcLookup.qlocate(self) then

; If the value of the field isn't found in

; CONTYPES.DB, prevent the user from

; departing the field

eventInfo.setErrorCode(canNotDepart)

; Create a popup menu of valid contact types

; using CONTYPES.DB

scan tcLookup:

lookupPop.addText(tcLookup.code+" "+tcLookup.definition)

endScan

; Display the popup menu and wait for the user

; to select a contact type

returns=lookupPop.show()

; Check if the user cancelled the menu

if not returns.isBlank() then

; If the user didn't cancel the menu

; truncate their selection so only the

; first three letters (the code) appear

; in the field

self=rtrim(returns.subStr(1,3))

endif

endif

endmethod

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with instructions for entering contact types.

method status(var eventInfo StatusEvent)

if self.isBlank() then

; If the field is blank, display instructions for

; displaying a list of valid contact types

message("Press Ctrl+Spacebar for a list of available contact types")

endif

endmethod


Methods

Uses

action

contactTypeLookup

canDepart

status


mainPage.Country (ContactForm)
 mainPage.Country

Objects	Methods

Country lists the country in which the contact is located.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a message informing the user that the field will be automatically filled with information from the company record (address, phone number) if it is left blank.

method status(var eventInfo StatusEvent)

; Instruct the user that leaving this field blank

; fills it with information from the company record

if self.isBlank() then

message("If you don't enter a value here, the company's postal code will be used.")

endif

endmethod

changeValue

Called when a user changes the field's value. It calls AssignCompanyInfo, which fills in the field with company information if the field is blank.

method changeValue(var eventInfo ValueEvent)

doDefault

; Fill in the field with information from the company

; record if it's blank

assignCompanyInfo()

endmethod


Methods

status

changeValue


mainPage.toolbarBox.End (ContactForm)
 mainPage.toolbarBox.End

Objects

End lets the user display the last contact in CONTLIST.DB.

pushButton

Called when the user clicks the button. It makes the form display the last record in CONTLIST.DB.

method pushButton(var eventInfo Event)

; Display the last record in CONTLIST.DB

active.Action(DataEnd)

endmethod


mainPage.ExitButton (ContactForm)
 mainPage.ExitButton

Objects

Closes Connections after confirmation.

pushButton

Called when the user clicks Exit or chooses File | Exit. It confirms the operation, then resets the menu to Paradox defaults, reveals the Toolbar (hidden previously by the open method), then closes the form.

method pushButton(var eventInfo Event)

var

otherForm	form

endvar

; Confirm that the user wants to close the application

choice = msgQuestion("Exit Connections", "Do you want to exit " +

                     "the application?")

if choice= "Yes" then

; If the user confirms the operation, set okToExit

; to indicate that the application should close

okToExit = True

if otherForm.attach("Company Information") then

; If the Company Information form is open,

; close it

otherForm.close()

endif

; Close the Contact Profile form

close()

else

; If the user cancelled the operation, generate

; an error that prevents the form from closing

eventInfo.setErrorCode(cannotDepart)

endif

endmethod


mainPage.FinancialButton (ContactForm)
 mainPage.FinancialButton

Objects

FinancialButton lets the user display the Financial form.

pushButton

Called when the user clicks the Financial button on the Contact Profile form. It displays FinancialForm.

method pushButton(var eventInfo Event)

var

formToOpen form

go smallInt

endVar

; Post the record if it is new or changed

go=updateSystemTable()

if go=1 then

; If the record was posted, open the Financial

; form

formToOpen.open("confinan")

; Wait for the user to finish using the form

returns=string(formToOpen.wait())

endif

endmethod


mainPage.Grade (ContactForm)
 mainPage.Grade

Objects	Methods

Grade lets the user grade the prospect's interest level.

Uses

Defines the argument structure of a custom method stored in GradesForm. Grade uses this method to display a list of grades.

Uses objectPal

; Method in GRADES.FSL

initialQuickSearch(desiredValue string)

endUses

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user presses Ctrl+Spacebar to display a lookup list, this method calls gradeLookup to display a custom list.

method action(var eventInfo ActionEvent)

if eventInfo.ID() = dataLookup then

; If the user displays a lookup list by right-clicking

; the object or pressing Ctrl+Spacebar, disable

; the default lookup table

disableDefault

; Display a dialog box of valid prospect grades

gradeLookup()

; Post the change

action(dataPostRecord)

endif

endmethod

gradeLookup

Called by the action method when the user presses Ctrl+Spacebar. It displays a list of prospect grades (stored in GRADES.DB).

method gradeLookup()

var

listForm form

endvar

; Display the Prospect Grades dialog box

listForm.open("Grades")

; Select the current field value in the list

listForm.initialQuickSearch(self)

; Wait for the user to select a new value, then

; save that new value in the field

self=string(listForm.wait())

endmethod

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a description of Grade.

method status(var eventInfo StatusEvent)

; Display a description of the field on the status

; line

message("Use this field to grade this prospect's interest level.")

endmethod


Methods

Uses

status

action

gradeLookup


mainPage.HelpButton (ContactForm)
 mainPage.HelpButton

Objects

HelpButton displays Connections user Help for the Contact Profile form.

pushButton

Called when a user clicks the Help button on the Contact Profile form or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the form

helpShowContext(helpFile,#IDH_FORMS_CONTACTPROFILE)

endmethod


mainPage.toolbarBox.Home (ContactForm)
 mainPage.toolbarBox.Home

Objects

Home lets the user display the first record in CONTLIST.DB.

pushButton

Called when the user clicks the button. It makes the form display the first record in CONTLIST.DB.

method pushButton(var eventInfo Event)

; Display the first record in CONTLIST.DB

active.Action(DataBegin)

endmethod


mainPage.LastName (ContactForm)
 mainPage.LastName

Objects

LastName is the last name of the contact.

changeValue

Called when the value of LastName changes. If the field is blank it sets the dateEntered field to the current date, sorts CONTLIST.DB by contactNumber, then adds a contact number for the current record.

method changeValue(var eventInfo ValueEvent)

var

tcContact tcursor

endVar

if self.isBlank() then

; If the field is blank, set the dateEntered field to

; the current date

dateEntered=today()

; Open CONTLIST.DB

tcContact.open("ContList")

; Sort CONTLIST.DB by contact number using an index

tcContact.switchIndex("contactNumber")

; Move to the last record in the table

tcContact.end()

; Increase the contactNumber field by one

contactNumber=tcContact.contactNumber+1

endif

endmethod


mainPage.Level (ContactForm)
 mainPage.Level

Objects

Level lists the contact's rank within the organization.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with instructions for entering contact levels.

method status(var eventInfo StatusEvent)

; Display a description of the field

message("This value (e.g. 1A, 3C) designates contact's level within their organization")

endmethod


mainPage.LocalPhone (ContactForm)
 mainPage.LocalPhone

Objects	Methods

LocalPhone lists the contact's phone number.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a message informing the user that the field will be automatically filled with information from the company record (address, phone number) if it is left blank.

method status(var eventInfo StatusEvent)

if self.isBlank() then

; If the field is blank, display a message

message("If you don't enter a phone here, the company's phone will be used.")

endif

endmethod

changeValue

Called when a user changes a field's value. It fills in the field with the company phone number if the field is blank.

method changeValue(var eventInfo ValueEvent)

var

thisField string

endVar

doDefault

if isblank(eventInfo.newValue()) then

; If the field is blank, fill it with

; the company's phone number

dmGet("company","mainPhone",thisField)

self=thisField

endif

endmethod


Methods

status

changeValue


mainPage.LocateButton (ContactForm)
 mainPage.LocateButton

Objects

LocateButton lets the user search for a contact by Name, Company, or the value of one of the user-defined fields.

pushButton

Called when the user clicks the Locate button on the Contact Profile form. It calls the search method (in MENUS.LSL), which searches CONTLIST.DB for a specific record.

method pushButton(var eventInfo Event)

; Search CONTLIST.DB by Company Name, Last Name, or

; First Name

; The search method in MENUS.LSL displays a search

; form and performs the search

menuLib.search("Company,Company Name,LastName,Last Name,FirstName,First Name")

endmethod


mainPage.toolbarBox.Next (ContactForm)
 mainPage.toolbarBox.Next

Objects	Methods

Next lets the user move to the next contact in CONTLIST.DB. The user can hold down the left mouse button to cycle through the records automatically.

mouseDown

Called when the user clicks the button or points to it and holds down the left mouse button. It makes the form display the next record, and sets a timer that repeatedly calls the timer method until the user releases the button.

method mouseDown(var eventInfo MouseEvent)

; Display the next record in CONTLIST.DB

active.Action(DataNextRecord)

; Generate the timer event every 75 milliseconds

Self.SetTimer(75)

endmethod

timer

Called by the mouseDown method. If the button is held down, it advances the form to the next record.

method timer(var eventInfo TimerEvent)

if self=TRUE then

; If the button is still down, move

; to the next record in CONTLIST.DB

active.Action(DataNextRecord)

endIf

endmethod


Methods

mouseDown

timer


mainPage.PersonalButton (ContactForm)
 mainPage.PersonalButton

Objects

PersonalButton displays the Personal Information form (the second page of CONTACTS.FSL).

pushButton

Called when the user clicks Personal. It displays the Personal Information form by switching to the second page of the form (ContactProfilePage).

method pushButton(var eventInfo Event)

   ; Post the current record if it's new or changed

   go=updateSystemTable()

   if go=1 then

      ; If the record was posted, display

      ; the Personal Information form

      moveToPage(2)

   endif

endmethod


mainPage.PostalCode (ContactForm)
 mainPage.PostalCode

Objects	Methods

Country lists the postal code of the contact's address.

depart

Called when a user leaves the field (by selecting another field, clicking a button, and so on). It calls AssignCompanyInfo, which fills in the field with company information if the field is blank.

method depart(var eventInfo MoveEvent)

; Fill in the field with information from the

; company record, if needed

assignCompanyInfo()

endmethod

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a message informing the user that the field will be automatically filled with information from the company record (address, phone number) if it is left blank.

method status(var eventInfo StatusEvent)

; Instruct the user that leaving this field blank

; fills it with information from the company record

if self.isBlank() then

message("If you don't enter a value here, the company's postal code will be used.")

endif

endmethod

changeValue

Called when a user leaves the field (by selecting another field, clicking a button, and so on). It calls AssignCompanyInfo, which fills in the field with company information if the field is blank.

method changeValue(var eventInfo ValueEvent)

doDefault

; Fill in the field with information from the company

; record if it's blank

assignCompanyInfo()

endmethod


Methods

depart

status

changeValue


mainPage.toolbarBox.Prior (ContactForm)
 mainPage.toolbarBox.Prior

Objects	Methods

Prior lets the user move to the previous contact in CONTLIST.DB. The user can hold down the left mouse button to cycle through the records automatically.

mouseDown

Called when the user clicks the button or points to it and holds down the left mouse button. It makes the form display the previous record, and sets a timer that repeatedly calls the timer method until the user releases the button.

method mouseDown(var eventInfo MouseEvent)

; Display the previous record in CONTLIST.DB

active.Action(DataPriorRecord)

; Make the timer event occur every 75 milliseconds

Self.SetTimer(75)

endmethod

timer

Called by the mouseDown method. If the button is held down, it advances the form to the previous record.

method timer(var eventInfo TimerEvent)

if self=TRUE then

; If the button is being held down, move

; to the previous record in CONTLIST.DB

active.Action(DataPriorRecord)

endIf

endmethod


Methods

mouseDown

timer


mainPage.ReminderButton (ContactForm)
 mainPage.ReminderButton

Objects

ReminderButton lets the user display the Reminder form.

pushButton

Called when the user clicks the Reminder button on the Contact Profile form. It displays ReminderForm.

method pushButton(var eventInfo Event)

var

formToOpen form

go smallInt

endVar

; Post the record if it is new or changed

go=updateSystemTable()

if go=1 then

; If the record was posted, open the Reminder

; form

formToOpen.open("reminder")

; Wait for the user to finish using the form

returns=string(formToOpen.wait())

endif

endmethod


mainPage.State (ContactForm)
 mainPage.State

Objects	Methods

State lists the state or province of the contact's address.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a message informing the user that the field will be automatically filled with information from the company record (address, phone number) if it is left blank.

method status(var eventInfo StatusEvent)

; Instruct the user that leaving this field blank

; fills it with information from the company record

if self.isBlank() then

message("If you don't enter a state here, the company's state will be used.")

endif

endmethod

changeValue

Called when a user changes the field's value. It calls AssignCompanyInfo, which fills in the field with company information if the field is blank.

method changeValue(var eventInfo ValueEvent)

doDefault

; Fill in the field with information from the company

; record if it's blank

assignCompanyInfo()

endmethod


Methods

status

changeValue


mainPage.UDF1text (ContactForm)
 mainPage.UDF1text

Objects

UDF1 shows the name of the first user-defined field. The user can double-click it to change the name.

mouseDouble

Called when the user double-clicks the text. It calls changeFieldLabel, which lets the user change the text.

method mouseDouble(var eventInfo MouseEvent)

; Display a dialog box to change the value

; of the label

changeFieldLabel()

endmethod


mainPage.UDF2text (ContactForm)
 mainPage.UDF2text

Objects

UDF2 shows the name of the second user-defined field. The user can double-click it to change the name.

mouseDouble

Called when the user double-clicks the text. It calls changeFieldLabel, which lets the user change the text.

method mouseDouble(var eventInfo MouseEvent)

; Display a dialog box for changing the label

changeFieldLabel()

endmethod


 ContactTypesForm (CONTYPES.FSL)

See Also	Objects	Methods

ContactTypesForm displays in the application as the Contact Type dialog box, which is used to add or edit the contact types listed in the Contact Profile form.

Uses

Defines the argument structure of library methods stored in MSGHELP.LSL. Connections uses these routines to display menus and help.

Uses objectPal

; Method in MENUS.LSL

checkOpen(formTitle string) string

; Methods in MSGHELP.LSL

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

objMsg(ObjectID String)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the ContactTypesForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

menuLib,msgHelpLib	library

formName	form

uio	uiObject

uioName,kPhysical	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNCLOSE_HK = "C"

TXTBTNNEW_HK = "N"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_CONTACTTYPE = 1035

endConst

open

Called when the dialog box is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries, checks whether the form can be opened, and sets search options.

method open(var eventInfo Event)

var

formTitle	string

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL and MSGHELP.LSL libraries

if menuLib.open("menus")

AND msgHelpLib.open("msgHelp") then

; If the application libraries can be opened,

; Associate formName, a Form variable, with

; CONTYPES.FSL

formName.attach()

; Set formTitle to the form's title

formTitle = formName.getTitle()

; Check if the application was started properly

menuLib.checkOpen(formTitle)

else

; If the application libraries can't be opened,

; display an error message and close the form

disableDefault

msgStop("Failure","Your working directory is "+workingDir()+

".  Please change your working directory to where

 Connections is located.")

close()

endif

endif

endmethod

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user tries to display a filter menu by right-clicking a field, this method prevents it.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicks a field, prevent

; the Filter menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

endif

endmethod

InitialQuickSearch

Called by the contactTypeLookup method of ContactType (in ContactForm) when it is displaying a list of valid contact types to choose from. It selects the current value stored in ContactType.

method InitialQuickSearch(desiredValue string)

if desiredValue.size()>1 then

; If the length of desired value exceeds one

; character, convert only the first character

; to uppercase and append the rest of the string

; to it

desiredValue=upper(desiredValue.subStr(1,1))+

desiredValue.subStr(2,desiredValue.size()-1)

else

; If the value is one character, convert

; it to uppercase

desiredValue=upper(desiredValue)

endif

; Search the Code field for the value stored

; in desiredValue

Code.locatePattern("Code",desiredValue)

; Select the Code field

moveTo(Code)

endmethod

setFocus

Called when the dialog box becomes active (also called gaining focus). It places the form in Edit mode.

method setFocus(var eventInfo Event)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Place the form in Edit mode

action(dataBeginEdit)

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button or a field, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

; Set uioName, a String variable, to the name of the object

; being pointed to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field" then

; If object being pointed to is a button or a field,

; display a description on the status line

msgHelplib.objMsg(formName.name+","+

msgHelplib.pageNameof(uio)+","+uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located in a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object

; the user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

while

uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Contact Types dialog box. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the key

; that was pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process keys

if kPhysical = "VK_F1" then

; Prevent Paradox Help from displaying

disableDefault

; Display user Help for the dialog box

HelpButton.pushButton()

endif

; Shortcut keys

if eventinfo.IsAltKeyDown() then

switch

; Shortcut for Close button

case kPhysical = TXTBTNCLOSE_HK :

CloseButton.pushButton()

; Shortcut for New button

case kPhysical = TXTBTNNEW_HK :

NewButton.pushButton()

endswitch

endif

else

; This code executes only for the form.

endif

endmethod


Objects

HelpButton

CloseButton

NewButton


Methods

Uses

Var

Const

open

action

InitialQuickSearch

setFocus

mouseEnter

mouseExit

mouseRightUp

keyPhysical


See Also

Contact Type Dialog Box

ActivityTypeForm (ACTTYPES.FSL)

GradesForm (GRADES.FSL)


HelpButton (ContactTypesForm)
 HelpButton

Objects

Displays Connections user Help for the Contact Type dialog box.

pushButton

Called when a user clicks the Help button on the Contact Type dialog box or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the dialog box

helpShowContext(helpFile,#IDH_FORMS_CONTACTTYPE)

endmethod


CloseButton (ContactTypesForm)
 CloseButton

Objects

CloseButton lets the user close the Contact Type dialog box.

pushButton

Called when the user clicks the Close button. It closes the form and returns the user to the Contact Profile form.

method pushButton(var eventInfo Event)

; Return the selected code to the calling form

formReturn(Code)

; Close the dialog box

close()

endmethod


NewButton (ContactTypesForm)
 NewButton

Objects

NewButton lets the user add a new contact type to the list.

pushButton

Called when the user clicks the New button. It places CONTYPES (the table frame displayed on the form) in edit mode and adds a record to it.

method pushButton(var eventInfo Event)

; Place the form in Edit mode

action(DataBeginEdit)

; Add a record to the table frame

active.action(DataInsertRecord)

endmethod


 DefaultForm (SYSTEM.FSL)

See Also	Objects	Methods

DefaultForm displays in the application as the Defaults dialog box, which is used to customize Connections based on modem setup and Paradox configuration.

Uses

Defines the argument structure of library methods stored in MENUS.LSL and MSGHELP.LSL. Connections uses these routines to display menus and check whether the form is already open.

Uses objectPal

; Method in MENUS.LSL

checkOpen(formTitle string) string

; Methods in MSGHELP.LSL

objMsg(ObjectID String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the DefaultForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

menuLib, msgHelpLib	library

formName	form

uio	uiObject

uioName, kPhysical	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNCLOSE_HK = "C"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_SEARCH = 1045

endConst

open

Called when the dialog box is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries, checks whether the form can be opened.

method open(var eventInfo Event)

var

formTitle	string

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL and MSGHELP.LSL libraries

if menuLib.open("menus") AND

msgHelpLib.open("msgHelp") then

; If the application libraries can be opened,

; associate formName, a Form variable, with

; SYSTEM.FSL

formName.attach()

; Set formTitle to the form's title

formTitle = formName.getTitle()

; Check if the application was started properly

menuLib.checkOpen(formTitle)

else

; If the application libraries can't be opened,

; display an error message and close the form

disableDefault

msgStop("Failure","Your working directory is "+workingDir()+

".  Please change your working directory to where

 Connections is located.")

close()

endif

endif

endmethod

setFocus

Called when the form becomes active (also called gaining focus). It places the form in Edit mode.

method setFocus(var eventInfo Event)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Place the form in Edit mode

action(dataBeginEdit)

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button or a field, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

; Set uioName, a String variable, to the name of the object

; being pointed to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field" then

; If object being pointed to is a button or a field,

; display a description on the status line

msgHelpLib.objMsg(formName.name+","+msgHelpLib.pageNameof(uio)+","+uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located in a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object

; the user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

while

uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Defaults dialog box. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the key

; that was pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()	then

; Process keys

if kPhysical = "VK_F1" then

; Prevent Paradox Help from displaying

disableDefault

; Display user Help for the dialog box

HelpButton.pushButton()

endif

; Shortcut keys

if eventinfo.IsAltKeyDown() then

; Shortcut for Close button

if kPhysical = TXTBTNCLOSE_HK then

DisableDefault

sleep(100)

CloseButton.PushButton()

endif

endif

else

; This code executes only for the form.

endif

endmethod

action

Called when the user tries a form operation (inserting records, entering Edit mode, and so on). It prevents the user from deleting a record or leaving Edit mode.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicks a field, prevent the Filter

; menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

if eventInfo.id()=dataInsertRecord

or eventInfo.id()=dataDeleteRecord

or eventInfo.id()=dataEndEdit then

; Prevent the user from leaving Edit mode,

; inserting records, or deleting records

disableDefault

endif

endif

endmethod


Objects

HelpButton

CloseButton

BirthdayAdvanceDays

UserDefined1Title

UserDefined2Title


Methods

Uses

Var

Const

open

setFocus

mouseEnter

mouseExit

mouseRightUp

keyPhysical

action


See Also

Defaults Dialog Box (User Help)

NewActivityForm (NEWACTIV.FSL)

ReminderForm (REMINDER.FSL)


HelpButton (DefaultForm)
 HelpButton

Objects

HelpButton displays Connections user Help for the Defaults dialog box.

pushButton

Called when a user clicks the Help button on the Defaults dialog box or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the dialog box

helpShowContext(helpFile,#IDH_FORMS_SEARCH)

endmethod


CloseButton (DefaultForm)
 CloseButton

Objects

CloseButton lets the user close the dialog box.

pushButton

Called when a user clicks the Close button. It closes the form.

method pushButton(var eventInfo Event)

; Close the dialog box

close()

endmethod


BirthdayAdvanceDays (DefaultForm)
 BirthdayAdvanceDays

Objects

BirthdayAdvanceDays lets the user specify when a follow-up item is scheduled to remind the user about contact birthdays.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with a description of the control.

method status(var eventInfo StatusEvent)

; Display a description of the field

message("How many days in advance of birthdays should tickler records be created?")

endmethod


UserDefined1Title (DefaultForm)
 UserDefined1Title

Objects

UserDefined1Title lets the user specify a label for the second user-defined field on the Contact Profile form.

changeValue

Called when the value of the field changes. It updates the first user-defined label on the Contact Profile form to reflect the new value.

method changeValue(var eventInfo ValueEvent)

var

frm	form

endvar

if frm.attach("Contact Profile") then

; If the Contact Profile form (CONTACTS.FSL) is open,

; set the user-defined field label to its new value

frm.UDF1Text.value = string(eventInfo.newValue())+":"

endif

endmethod


UserDefined2Title (DefaultForm)
 UserDefined2Title

Objects

UserDefined2Title lets the user specify a label for the second user-defined field on the Contact Profile form.

changeValue

Called when the value of the field changes. It updates the second user-defined label on the Contact Profile form to reflect the new value.

method changeValue(var eventInfo ValueEvent)

var

frm	form

endvar

if frm.attach("Contact Profile") then

; If the Contact Profile form (CONTACTS.FSL) is open,

; set the user-defined field label to its new value

frm.UDF2Text.value = string(eventInfo.newValue())+":"

endif

endmethod


 FinancialForm (CONFINAN.FSL)

See Also	Objects	Methods

FinancialForm displays in the application as the Financial dialog box. Connections can track expenses incurred while communicating with the client, and estimated revenues. The Financial dialog box tracks expenses and estimated revenue.

Uses

Defines the argument structure of library methods stored in MENUS.LSL. and MSGHELP.LSL. Connections uses these routines to display menus, search for records, and check whether the form can be opened.

Uses objectPal

; Methods in MENUS.LSL

search(searchArguments string)

checkOpen(formTitle string) string

; Methods in MSGHELP.LSL

objMsg(ObjectID String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the FinancialForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

currentType smallInt

menuLib, msgHelpLib	library

formName	form

uio	uiObject

uioName	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

peRevenueView = 2

peExpenseView = 1

TXTBTNCLOSE_HK = "C"

TXTBTNLOCATE_HK = "L"

TXTBTNNEW_HK = "N"

TXTBTNREPORT_HK = "R"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_FINANCIAL = 1050

endConst

open

Called when the form is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries, checks whether the form is already open, sets search options, and sets the form to initially show revenues.

method open(var eventInfo Event)

var

formTitle	string

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL and MSGHELP.LSL

if menuLib.open("menus") AND

msgHelpLib.open("msgHelp") then

; If the application libraries can be opened,

; Associate formName, a Form variable, with

; CONFINAN.FSL

formName.attach()

; Set formTitle to the form's title

formTitle = formName.getTitle()

; Check if the application was started properly

menulib.checkOpen(formTitle)

; Specify that that advanced wildcards can be

; used in searches and that case is ignored

advancedWildcardsInLocate(yes)

ignoreCaseinLocate(yes)

else

; If the application libraries can't be opened,

; display an error message and close the form

msgStop("Failure","Your working directory is "+workingDir()+

".  "+ "Please change your working directory to where

 Connections is located.")

disableDefault

close()

endif

; currentType is a variable that's global to the form

; and tracks which records are displayed: expenses or

; projected revenues

currentType=peRevenueView

endif

endmethod

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user tries to display a filter menu by right-clicking a field, this method prevents it.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicks a field, prevent

; the Filter menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

endif

endmethod

arrive

Called when the form becomes active. It sets the label Financial to "Revenue."

method arrive(var eventInfo MoveEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Set the form to display projected

; revenue by default

Financial = "Revenue"

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button or a field, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

; Set uioName, a String variable, to the name of the object

; being pointed to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field" then

; If object being pointed to is a button or a field,

; display a description on the status line

msgHelplib.objMsg(formName.name + "," + msgHelplib.pageNameof(uio) + "," + uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located in a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

while

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Financial dialog box. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the name

; of the key pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process the key

if kPhysical = "VK_F1" then

; If the user pressed F1, prevent Paradox Help

; from displaying

disableDefault

; Display Help by calling the pushButton

; method of HelpButton

HelpButton.pushButton()

endif

; Shortcut keys

if eventinfo.IsAltKeyDown() then

switch

; Shortcut for Close button

case kPhysical = TXTBTNCLOSE_HK :

CloseButton.PushButton()

; Shortcut for Locate button

case kPhysical = TXTBTNLOCATE_HK :

LocateButton.PushButton()

; Shortcut for New button

case kPhysical = TXTBTNNEW_HK :

NewButton.PushButton()

; Shortcut for Report button

case kPhysical = TXTBTNREPORT_HK :

ReportButton.PushButton()

endswitch

endif

else

; This code executes only for the form.

endif

endmethod


Methods

Uses

Var

Const

open

action

arrive

mouseEnter

mouseExit

mouseRightUp

keyPhysical


Objects

thePage


See Also

Financial Dialog Box (User Help)


thePage (FinancialForm)
 thePage

Objects

thePage contains all the controls used by FinancialForm.

setFocus

Called when the form becomes active (also called gaining focus). It locates the revenue and expense records associated with the contact displayed in the Contact Profile form, then displays it and places the form in Edit mode.

method setFocus(var eventInfo Event)

var

tcSystem,tcContact tcursor

ui uiObject

endVar

; Open SYSTEM.DB to retrieve the current contact number

tcSystem.open("system")

; Open CONTLIST.DB to retrieve the current contact record

tcContact.open("ContList")

; Sort CONTLIST.DB by contact number using an index

tcContact.switchIndex("contactNumber")

; Locate the contact corresponding to the contact number

; stored in SYSTEM.DB

tcContact.qLocate(tcSystem.currentContact)

; Close SYSTEM.DB

tcSystem.close()

; Associate ui, a UIObject variable, with the Company

; field

ui.attach(company)

; Make Company show the company name associated with the

; contact record referenced by tcContact

ui.resync(tcContact)

; Update the table frame on the form to display records

; associated with the current contact

company.resyncTable()

; Display the table frame

dataFrame.visible=yes

; Place the form in Edit mode

action(dataBeginEdit)

endmethod


Objects

HelpButton

ReportButton

NewButton

DataFrame

LocateButton

CloseButton


HelpButton (FinancialForm)
 HelpButton

Objects

Displays Connections user Help for the Financial dialog box.

pushButton

Called when a user clicks the Help button on the Financial dialog box or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the form

helpShowContext(helpFile,#IDH_FORMS_FINANCIAL)

endmethod


ReportButton (FinancialForm)
 ReportButton

Objects

ReportButton lets the user print a report listing expenses and projected revenues for the current contact.

pushButton

Called when the user clicks the Report button. It prints a report (REVENUE.RSL) using the displayed records.

method pushButton(var eventInfo Event)

var

thisreport	report

endvar

; Open REVENUE.RSL

thisReport.open("Revenue")

thisReport.attach("Revenue")

; Print and close REVENUE.RSL

thisReport.print()

thisReport.close()

endmethod


NewButton (FinancialForm)
 NewButton

Objects

New lets the user add an expense or revenue record to CONFINAN.DB.

pushButton

Called when the user clicks New. Selects a record in the active list and inserts a new record for editing.

method pushButton(var eventInfo Event)

; Select the date field of the new record

ConfinanDate.moveto()

; Insert a record into the table frame

Confinan.insertRecord()

endmethod


LocateButton (FinancialForm)
 LocateButton

Objects

LocateButton lets the user locate a contact and display the records associated with it.

pushButton

Called when the user clicks Locate in the Financial dialog box. It performs a search using Record|Locate|Value.

method pushButton(var eventInfo Event)

; Select the Date field in the table frame

ConfinanDate.moveto()

; Perform a search using Paradox's Record|Locate|Value

; command

active.action(dataSearch)

endmethod


CloseButton (FinancialForm)
 CloseButton

Objects

CloseButton lets the user close the Financial dialog box.

pushButton

Called when the user clicks the Close button on the Financial dialog box. It closes the form and returns the user to the Contact Profile form.

method pushButton(var eventInfo Event)

; Close the form

close()

endmethod


FinancialForm.thePage.DataFrame
 DataFrame

Objects

DataFrame contains the expense and revenue list and information about the current contact.


Objects

DataFrame.Financial

DataFrame.Company

DataFrame.ContactName

FinancialRecord.Amount


DataFrame.Financial (Financial Form)
 DataFrame.Financial

Objects

Financial lets the user switch between viewing expenses and viewing projected revenue.

newValue

Called when the value of Financial changes. It changes the value of the TypeText label and resynschronizes COMPANY.DB.

method newValue(var eventInfo Event)

; newValue is used instead of changeValue because changeValue

; is only triggered when the user departs the field

if self.value = "Expenses" then

; If Financial is currently set to Expenses, change

; the form's subtitle to Expenses

TypeText = "Expenses:"

currentType=1

else

; If Financial is currently set to Revenue, change

; the form's subtitle to Revenue

TypeText = "Revenue:"

currentType=peRevenueView

endif

; Refresh the table frame to reflect the new settings

company.resyncTable()

endmethod


DataFrame.Company (FinancialForm)
 DataFrame.Company

Objects

Company lists the company that employs the current contact.

resyncTable

Called by the setFocus method of thePage. It associates a Tcursor with CONFINAN.DB, sorts the table by transaction type using an index, then filters out records in the table that

Are not associated with the current contact (using the contact number)

Do not match the record type indicated by currentType

The ui variable is associated with CONFINAN (a table frame on the form) and then resynschronized, displaying the remaining records on the form.

method resyncTable()

var

tcConfinan tcursor

ui uiObject

dCriteria DynArray[] AnyType

endVar

; Open CONFINAN.DB

tcConfinan.open("confinan")

; Sort CONFINAN.DB by transaction type using an index

tcConfinan.switchIndex("transactionType")

; Filter out records that are not associated with

; the current contact

; Specify criteria for a filter

dCriteria["Contact"] = string(contactNumber)

dCriteria["Type"] = string(currentType)

; Filter out records in CONFINAN that aren't

; associated with the current contact and

; displayed transaction type

tcConfinan.setGenFilter(dCriteria)

; Associate ui, a UIObject variable, with the CONFINAN

; table frame

ui.attach(confinan)

; Refresh the CONFINAN table frame to reflect the records

; shown by the new filter

ui.resync(tcConfinan)

endmethod


DataFrame.ContactName (FinancialForm)
 DataFrame.ContactName

Objects

ContactName is a calculated field that combines the contents of the FirstName and LastName fields to display the contact's full name.

[CONTLIST.FIRSTNAME]+" "+[CONTLIST.LASTNAME]


FinancialRecord.Amount (FinancialForm)
 FinancialRecord.Amount

Objects

Amount lists expense or revenue amounts.

changeValue

Called when the value of the field changes. It opens SYSTEM.DB, inserts a new record into the table frame, sets the date of the record to today's date, and sets hidden fields in the record (contact number and sequence) using values from SYSTEM.DB.

method changeValue(var eventInfo ValueEvent)

var

tcSystem tcursor

endVar

if not isBlank(eventInfo.newValue()) then

if ConfinanDate.isBlank() then

; If ConfinanDate is blank, insert a record into

; the table frame and set ConfinanDate to the

; current date

action(dataInsertRecord)

ConfinanDate=today()

endif

if sequence.isBlank() then

; Open SYSTEM.DB

tcSystem.open("system")

; If Sequence is blank, set it to the current value

; of nextActivitySequenceNo in SYSTEM.DB, then

; decrease that field's value by one

tcSystem.edit()

tcSystem.nextActivitySequenceNo=tcSystem.nextActivitySequenceNo-1

sequence=tcSystem.nextActivitySequenceNo

; Set the record's contact number to the current

; contact

contact=tcSystem.currentContact

; Set the record's transaction type to the

; displayed transaction type

financeType=currentType

; Close SYSTEM.DB

tcSystem.close()

endif

endif

endmethod


 GradesForm (GRADES.FSL)

See Also	Objects	Methods

GradesForm displays in the application as the Prospect Grades dialog box, which is used to edit the prospect grades displayed in the Contact Profile form.

Uses

Defines the argument structure of library methods stored in MENUS.LSL and MSGHELP.LSL. Connections uses these routines to display menus and help.

Uses objectPal

; Method in MENUS.LSL

checkOpen(formTitle string) string

; Methods in MSGHELP.LSL

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

objMsg(ObjectID String)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the GradesForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

menuLib, msgHelpLib	library

formName	form

uio	uiObject

uioName, kPhysical	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNCLOSE_HK = "C"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_PROSPECTGRADE = 1065

endConst

open

Called when the dialog box is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries and checks whether the dialog box can be opened.

method open(var eventInfo Event)

var

formTitle	string

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL and MSGHELP.LSL libraries

if menuLib.open("menus") AND

msgHelpLib.open("msgHelp") then

; If the application libraries can be opened,

; associate formName, a Form variable, with

; GRADES.FSL

formName.attach()

; Set formTitle to the form's title

formTitle = formName.getTitle()

; Check if the application was started properly

menuLib.checkOpen(formTitle)

else

disableDefault

; If the application libraries can't be opened,

; display an error message and close the form

msgStop("Failure","Your working directory is "+workingDir()+

".  Please change your working directory to where

 Connections is located.")

close()

endif

endif

endmethod

setFocus

Called when the dialog box becomes active (also called gaining focus). It places the form in Edit mode.

method setFocus(var eventInfo Event)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Place the form in Edit mode

action(dataBeginEdit)

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button or a field, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

; Set uioName, a String variable, to the name of the object

; being pointed to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field" then

; If object being pointed to is a button or a field,

; display a description on the status line

msgHelpLib.objMsg(formName.name + "," + msgHelpLib.pageNameof(uio) + "," + uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located in a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object

; the user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

while

uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Prospect Grades dialog box. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the key

; that was pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process keys

if kPhysical = "VK_F1" then

; Prevent Paradox Help from displaying

disableDefault

; Display user Help for the dialog box

HelpButton.pushButton()

endif

; Shortcut keys

if eventinfo.IsAltKeyDown() then

; Shortcut for the Close Button

if kPhysical = TXTBTNCLOSE_HK then

CloseButton.PushButton()

endif

endif

else

; This code executes only for the form.

endif

endmethod

action

Called when the user tries a form operation (inserting records, entering Edit mode, and so on). If the user tries to insert a record, it cancels the operation, displaying a message to the user. It also prevents the user from displaying the filters menu by right-clicking on a field.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicks a field, prevent the

; the Filter menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

if eventInfo.id()=dataInsertRecord

or eventInfo.id()=dataDeleteRecord then

; If the user tries to insert or delete a record,

; display a warning message and prevent the

; action

disableDefault

msgStop("Prospect Grades","You can't insert or delete

 prospect grades.  Change the definition of an

 existing grade.")

endif

endif

endmethod

InitialQuickSearch

Called by the gradeLookup method of Grade (in ContactForm) when it is displaying a list of valid prospect grades to choose from. It selects the current value stored in Grade.

method InitialQuickSearch(desiredValue string)

if desiredValue.size()>1 then

; If the length of desiredValue exceeds one

; character, convert only the first character

; to uppercase and append the rest of the string

; to it

desiredValue=upper(desiredValue.subStr(1,1))+

desiredValue.subStr(2,desiredValue.size()-1)

else

; If the value is one character, convert

; it to uppercase

desiredValue=upper(desiredValue)

endif

; Search the ProspectGrade field for the value stored

; in desiredValue

ProspectGrade.locatePattern("ProspectGrade",desiredValue)

; Select the ProspectGrade field

moveTo(ProspectGrade)

endmethod


Methods

Uses

Var

Const

open

setFocus

mouseEnter

mouseExit

mouseRightUp

keyPhysical

action

InitialQuickSearch


Objects

HelpButton

CloseButton

GradeRecord.Definition

GradeRecord.ProspectGrade


See Also

Prospect Grades Dialog Box (User Help)

ContactTypesForm (CONTYPES.FSL)

ActivityTypeForm (ACTTYPES.FSL)


HelpButton (GradesForm)
 HelpButton

Objects

Displays Connections user Help for the Prospect Grades dialog box.

pushButton

Called when a user clicks the Help button on the Prospect Grades dialog box or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the dialog box

helpShowContext(helpFile,#IDH_FORMS_PROSPECTGRADE)

endmethod


CloseButton (GradesForm)
 CloseButton

Objects

CloseButton lets the user close the Prospect Grades dialog box.

pushButton

Called when the user clicks the Close button. It closes the form and returns the user to the Contact Profile form.

method pushButton(var eventInfo Event)

; Return the selected prospect grade

; to the calling form

formreturn(ProspectGrade)

; Close the dialog box

close()

endmethod


GradeRecord.Definition (GradesForm)
 Definition

Objects

Definition lists the definition of each prospect grade.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with instructions for entering prospect grades.

method status(var eventInfo StatusEvent)

; Display instructions for adding and deleting

; prospect grades

message("Use <Ins> and <Ctrl-Del> keys to add & delete records")

endmethod


GradeRecord.ProspectGrade (GradesForm)
 ProspectGrade

Objects

ProspectGrade lists each prospect grade.

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with instructions for entering prospect grades.

method status(var eventInfo StatusEvent)

; Display instructions for adding and deleting

; prospect grades

message("Use <Ins> and <Ctrl-Del> keys to add & delete records")

endmethod


 NewActivityForm (NEWACTIV.FSL)

See Also	Objects	Methods

NewActivityForm displays in the application as the New Activity dialog box, which is used to add an activity to the list displayed in the Contact Activity form. Activities correspond to communications the user has with the contact. It can also create and store follow-up items to remind the user of things to do on the contact's behalf (using the Reminder dialog box).

Uses

Defines the argument structure of library methods stored in MENUS.LSL and MSGHELP.LSL. Also defines the argument structure of functions in DIALPHON.DLL. Connections uses these routines to display menus and dial phone numbers (on systems with a modem).

Uses DialPhon

; Functions in DIALPHON.DLL

Dial(ComPort CPTR,InitString CPTR,PhoneNumber CPTR) CWORD

HangUp() CWORD

endUses

Uses ObjectPal

; Method in REMINDER.FSL

decrementActivitySequence()

; Method in MENUS.FSL

checkOpen(formTitle string) string

; Methods in MSGHELP.FSL

objMsg(ObjectID String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the NewActivityForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

currentComPort,currentPrefix string

tc	tCursor

menuLib,msgHelpLib	library

formName	form

uio	uiObject

uioName,kPhysical,returns	string

component array[] string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNDIAL_HK = "D"

TXTBTNBEGIN_HK = "B"

TXTBTNEND_HK = "E"

TXTBTNCLOSE_HK = "C"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_NEWACTIVITY = 1055

endConst

open

Called when the dialog box is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries and checks whether the dialog box can be opened.

method open(var eventInfo Event)

var

formTitle	string

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL and MSGHELP.LSL libraries

if menuLib.open("menus") AND

msgHelpLib.open("msgHelp") then

; If the application libraries can be opened,

; associate formName, a Form variable, with

; NEWACTIV.FSL

formName.attach()

; Set formTitle to the form's title

formTitle = formName.getTitle()

; Check if the application was started properly

menuLib.checkOpen(formTitle)

else

; If the application libraries can't be opened,

; display an error message and close the form

disableDefault

msgStop("Failure","Your working directory is "+workingDir()+

".  Please change your working directory to where

 Connections is located.")

close()

endif

endif

endmethod

setFocus

Called when the form becomes active (also called gaining focus). It creates a new activity record and displays it on the form for editing.

method setFocus(var eventInfo Event)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Place the form in Edit mode

action(dataBeginEdit)

if fullName.isBlank() then

; If the fullName field is blank, created a new record

newRecord()

endif

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button or a field, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

; Set uioName, a String variable, to the name of the object

; being pointed to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field" then

; If object being pointed to is a button or a field,

; display a description on the status line

msgHelpLib.objMsg(formName.name+","+msgHelpLib.pageNameof(uio)+

","+uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located in a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object

; the user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

while

uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the New Activity dialog box. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the key

; that was pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process keys

switch

case kPhysical = "VK_INSERT" :

; If the user tries to press Insert, prevent it from

; inserting a record

disableDefault

msgStop("Problem","You can't insert a record into this form using the Insert key.")

case kPhysical = "VK_F1":

; Prevent Paradox Help from displaying

disableDefault

; Display user Help for the dialog box

HelpButton.PushButton()

endswitch

; Shortcut keys

if eventInfo.isAltKeyDown() then

switch

case kPhysical = "VK_BACK" :

; If Alt+Backspace was pressed, prevent it

; from undoing the current operation

disableDefault

; Shortcut for the Dial button

case kPhysical = TXTBTNDIAL_HK :

DisableDefault

sleep(100)

DialButton.PushButton()

; Shortcut for the Begin button

case kPhysical = TXTBTNBEGIN_HK :

DisableDefault

sleep(100)

BeginButton.PushButton()

; Shortcut for the End button

case kPhysical = TXTBTNEND_HK :

DisableDefault

sleep(100)

EndButton.PushButton()

; Shortcut for the Close button

case kPhysical = TXTBTNCLOSE_HK :

DisableDefault

sleep(100)

CloseButton.PushButton()

endswitch

endif

else

; This code executes only for the form.

endif

endmethod

action

Called when the user attempts a form operation (editing records, entering Edit mode, and so on). It prevents the user from deleting a record or leaving edit mode.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicks a field, prevent the

; Filter menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

if eventInfo.id()=dataDeleteRecord or eventInfo.id()=dataEndEdit then

; If the user tries to delete a record or leave

; Edit mode, prevent it and display an error

disableDefault

msgStop("Problem","You may not perform this action.")

endif

endif

endmethod

newRecord

Called by the open method. It inserts a new record into ACTIVITY.DB, and opens SYSTEM.DB to retrieve the current COM port and dialing prefix settings.

method newRecord()

var

tcSystem,tc tcursor

formOther form

endVar

; Insert a record into ACTIVITY.DB

action(dataInsertRecord)

; Open SYSTEM.DB

tcSystem.open("system")

; Retrieve the current COM port and dialing prefix

; from SYSTEM.DB

currentComPort=tcSystem.comPort

currentPrefix=tcSystem.dialPrefix

; Open CONTLIST.DB

tc.open("ContList")

; Sort CONTLIST.DB by contact number using an index

tc.switchIndex("contactNumber")

; Find the contact record associated with the current

; contact number

tc.qLocate(tcSystem.currentContact)

; Set the date of the activity to the current date

dateFields=today()

; Set the sequence number to a unique value

sequenceNumber=tcSystem.nextActivitySequenceNo

; Set the contact number to the current contact

contact=tcSystem.currentContact

if formOther.attach("Reminder") then

; If the Reminder form (REMINDER.FSL) is open,

; use its custom method to decrease the value

; of the nextActivitySequenceNo field by one

formOther.decrementActivitySequence()

else

; If the Reminder form isn't open, edit SYSTEM.DB

; and decrease the value of the nextActivitySequenceNo

; field by one

tcSystem.edit()

tcSystem.nextActivitySequenceNo =

tcSystem.nextActivitySequenceNo-1

endif

; Close SYSTEM.DB

tcSystem.close()

; Update the contact name, company, and phone number

fullName=tc.firstName+" "+tc.lastName

company=tc.company

phone=tc.localPhone

; Close CONTLIST.DB

tc.close()

endmethod


Objects

HelpButton

CloseButton

DialButton

FollowupActionItem

ActivityDetailBox.ActionItem

BeginButton

EndButton


Methods

Uses

Var

Const

open

setFocus

mouseEnter

mouseExit

mouseRightUp

keyPhysical

action

newRecord


See Also

ActivityForm (ACTIVITY.FSL)

Contact Activity Form (User Help)


HelpButton (NewActivityForm)
 HelpButton

Objects

Displays Connections user Help for the New Activity dialog box.

pushButton

Called when a user clicks the Help button on the New Activity dialog box or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the form

helpShowContext(helpFile,#IDH_FORMS_NEWACTIVITY)

endmethod


CloseButton (NewActivityForm)
 CloseButton

Objects

CloseButton lets the user close the New Activity dialog box.

pushButton

Called when the user clicks the Close button on the New Activity dialog box. It closes the form and returns the user to the Contact Activity form.

method pushButton(var eventInfo Event)

var

tcActivity tcursor

endVar

if followUpActionItem.isBlank() and not followupDate.isBlank() then

; If the user specified a follow-up action item date but not an

; activity/action item code, display an error message

msgStop("Exit Form","You have specified a follow-up date without

 a follow-up action item.  Correct this and try again.")

else

if actionItem.isBlank() then

; If the actionItem field is blank, cancel the record

; insertion

action(dataCancelRecord)

else

; If the actionItem field isn't blank, ask if the

; new activity should be save

if msgQuestion("New Activity","Save this new

activity?")="Yes" then

; If the user confirms the operation,

; save the record

if not (followupDate.isBlank() or

followupActionItem.isBlank()) then

; If the followupDate and followupActionItem

; fields are not blank, open ACTION.DB

tcActivity.open("action")

; Place ACTION.DB in Edit mode

tcActivity.edit()

; Add a record to ACTION.DB

tcActivity.insertRecord()

; Set the fields of the new record

tcActivity.date=followupDate

tcActivity.actionItem=followupActionItem

tcActivity.contact=contact

tcActivity.comments=followupComments

; Close ACTION.DB (also saves the new record)

tcActivity.close()

endif

else

; If the user cancels the operation, cancel

; the record

action(dataCancelRecord)

endif

endif

; Close the form

close()

endif

endmethod


DialButton (NewActivityForm)
 DialButton

Objects

Dial lets the user dial a contact's phone number and log the duration of the call.

pushButton

Called when the user clicks the Dial button. It dials the number (using a function in a .DLL file) and calls the pushButton method of BeginButton to time the call.

method pushButton(var eventInfo Event)

var

formToOpen form

numberToCall string

endVar

; Open SYSTEM.DB

tc.open("System")

if tc."ComPort" <> "None" then

msgInfo("Dial Phone Number","Click OK button on this dialog once

 connection is established.")

hangUp()

; If the COM port was specified, erase the contents of

; the endTime and duration fields

endTime.blank()

duration.blank()

; Get the number to call

numberToCall=string(phone)

; Dial the number using the modem connected to the specified

; COM port

Dial(currentComPort,"ATDT",currentPrefix+numberToCall)

; Start timing the call

beginButton.pushButton()

else

; If the COM port wasn't specified, display instructions

; for setting it

msgStop("Stop!","No modem has been installed.  "+

  "Choose Options|Defaults to change the setting.")

endif

endmethod


FollowupActionItem (NewActivityForm)
 FollowupActionItem

Objects	Methods

FollowupActionItem lets the user add follow-up activities to the Reminder form.

Var

Defines variables used throughout the FollowupActionItem methods.

Var

lookupTC tcursor

lookupPop popUpMenu

returns string

component array[] string

endVar

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with instructions for entering action items.

method status(var eventInfo StatusEvent)

if not followupDate.isBlank()  then

; If the field contains a value, display instructions for

; viewing a list of valid activity/action item codes

message("Press Ctrl+Spacebar for a list of available action items")

endif

endmethod

canArrive

Called when the user tries to select the field. If FollowUpDate is blank, this method displays a warning message and prevents the user from selecting FollowUpActionItem.

method canArrive(var eventInfo MoveEvent)

if FollowUpDate.isblank() then

; If the user hasn't set a follow-up date, prevent

; the user from selecting the field and display

; an error message

eventInfo.setErrorCode(cannotArrive)

message("Please specify follow up action date.")

disableDefault

; Make FollowupActionItem blank

self.blank()

; Select the FollowUpDate field

moveto(FollowUpDate)

endif

endmethod

canDepart

Called when the user tries to leave the FollowUpActionItem field (by selecting another field, closing the form, and so on). It displays a list of valid action item types if one is not already entered in the field.

method canDepart(var eventInfo MoveEvent)

if eventInfo.reason() <> RefreshMove then

; If the method wasn't triggered by a form refresh,

; open ACTTYPES.DB

lookupTC.open("acttypes")

if not lookupTC.qlocate(self) AND

not DateFields.isblank() then

; If the current value of the field doesn't match an action

; code stored in ACTTYPES.DB, display a popup menu of

; valid activity/action item codes

followcreateLookup()

if self.isblank() then

; If the field is blank, prevent the user from selecting

; another field

eventInfo.setErrorCode(canNotDepart)

endif

endif

endif

endmethod

action

Called when the user attempts a form operation. If the user presses Ctrl+Spacebar, this method displays a popup menu of valid action item codes by calling the followCreateLookup method.

method action(var eventInfo ActionEvent)

; If the user tries to display a lookup table, substitute

; a popup menu (displayed by followCreateLookup) instead

if eventInfo.ID() = dataLookup then

disabledefault

followCreateLookup()

endif

endmethod

createLookup

Called by the action method when the user tries to display lookup help. It displays a popup menu of valid action item codes (stored in ACTTYPES.DB).

method followCreateLookup()

; Open ACTTYPES.DB

lookupTC.open("acttypes")

; Clear the popup menu

lookupPop.empty()

scan lookupTC:

; For each record in ACTTYPES.DB, add a popup menu item

; showing an activity/action item code

lookupPop.addText(lookupTC.actionCode+" -"+lookupTC.definition)

endScan

; Display the popup menu and wait for the user to

; choose a value

returns=lookupPop.show()

if not returns.isBlank() then

; If the user didn't cancel the menu, extract the

; selected activity code from the string

returns.breakApart(component)

self=component[1]

endif

endmethod


Methods

Var

status

canArrive

canDepart

action

followCreateLookup


ActivityDetailBox.ActionItem (NewActivityForm)
 ActivityDetailBox.ActionItem

Objects	Methods

ActionItem lets the user specify the activity being performed (phone call, research, and so on).

Var

Defines variables used throughout the ActionItem methods.

var

lookupTC tcursor

lookupPop popUpMenu

returns string

component array[] string

endVar

status

Called when Paradox tries to display a message on the status line. It replaces the message on the status line with instructions for entering action items.

method status(var eventInfo StatusEvent)

if self.isBlank() then

; If the field doesn't contain a value, display instructions for

; viewing a list of valid activity/action item codes

message("Press Ctrl+Spacebar for a list of available action items")

endif

endmethod

canDepart

Called when the user tries to leave the ActionItem field (by selecting another field, closing the form, and so on). It displays a list of valid action item types if one is not already entered in the field.

method canDepart(var eventInfo MoveEvent)

; Open ACTTYPES.DB

lookupTC.open("acttypes")

if (not DateFields.isblank()) AND

((not lookupTC.qlocate(self)) OR self.isblank()) then

; If DateFields doesn't contain a date, and the field

; value is either blank or doesn't match an action

; code stored in ACTTYPES.DB, prevent the user from

; departing the field and display a popup menu of

; valid activity/action item codes

eventInfo.setErrorCode(canNotDepart)

createLookup()

endif

endmethod

action

Called when the user attempts a form operation. If the user presses Ctrl+Spacebar, this method displays a popup menu of valid action item codes by calling the createLookup method.

method action(var eventInfo ActionEvent)

; If the user tries to display a lookup table, substitute

; a popup menu (displayed by createLookup) instead

if eventInfo.ID() = datalookup then

disableDefault

createLookup()

endif

endmethod

createLookup

Called by the action method when the user tries to display lookup help. It displays a popup menu of valid action item codes (stored in ACTTYPES.DB).

method createLookup()

; Open ACTTYPES.DB

lookupTC.open("acttypes")

; Clear the popup menu

lookupPop.empty()

scan lookupTC:

; For each record in ACTTYPES.DB, add a popup menu item

; showing an activity/action item code

lookupPop.addText(lookupTC.actionCode+" -"+lookupTC.definition)

endScan

; Display the popup menu and wait for the user to

; choose a value

returns=lookupPop.show()

if not returns.isBlank()	then

; If the user didn't cancel the menu, extract the

; selected activity code from the string

returns.breakApart(component)

self=component[1]

endif

endmethod


Methods

status

canDepart

action

createLookup


BeginButton (NewActivityForm)
 BeginButton

Objects

BeginButton lets the user start timing an activity.

pushButton

Called when the user clicks the Begin button. It copies the current system time to the BeginTime field.

method pushButton(var eventInfo Event)

; Set the beginTime field to the current time

beginTime=time()

; Copy beginTime to the current record

dmPut("activity","time",beginTime)

endmethod


EndButton (NewActivityForm)
 EndButton

Objects

EndButton lets the user stop timing an activity

pushButton

Called when the user clicks the End button. It ends a modem connection if one is open, copies the current time to EndTime, then stores the difference between EndTime and BeginTime in Duration.

method pushButton(var eventInfo Event)

var

goEnd smallInt

durationTime dateTime

durationSeconds smallInt

endVar

; Set goEnd to indicate that no errors have occurred

goEnd=1

if not endTime.isBlank() then

; If the endTime field already contains a value, ask if the new

; time should replace it

if msgQuestion("End Time","You previously specified an end time.  Would you like to reset the end time to this later value?")="No" then

; Set goEnd to indicate that a problem occurred

goEnd=0

endif

endif

if goEnd=1 then

; If goEnd indicates no problems, set the endTime field to the

; current time

endTime=time()

; Set the durationTime field to the elapsed time

; between the time stored in beginTime and the time stored

; in endTime

durationTime=dateTime(endTime)-dateTime(beginTime)

durationSeconds=second(durationTime)

if durationSeconds<10 then

; If the elapsed time is less than 10 seconds, reformat

; the time appropriately

duration=string(minute(durationTime))+":0"+string(durationSeconds)

else

; If the elapsed time is greater than 10 seconds, reformat

; the time appropriately

duration=string(minute(durationTime))+":"+string(durationSeconds)

endif

endif

endmethod


 ReminderForm (REMINDER.FSL)

See Also	Objects	Methods

ReminderForm displays in the application as the the Reminder dialog box, which is used to display a calendar and list of follow-up items for the date selected in the calendar. Follow-up items are reminders of promises made to a contact, contact birthdays or issues, and so on (follow-up items are created using the New Activity dialog box).

Uses

Defines the argument structure of library methods stored in MENUS.LSL and MSGHELP.LSL. Connections uses these routines to display menus and help.

Uses objectPal

; Method in MENUS.LSL

checkOpen(formTitle string) string

; Methods in MSGHELP.LSL

objMsg(ObjectID String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the ReminderForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

currentMonth,currentDay,currentYear,dayNumber,alreadyConf smallInt

tcSystem tcursor

menuLib,msgHelpLib	library

formName	form

uio	uiObject

uioName,kPhysical	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNCLOSE_HK = "C"

TXTBTNNEW_HK = "A"

TXTBTNRETURN_HK = "L"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_REMINDER = 1070

endConst

open

Called when the dialog box is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries, checks whether the form can be opened, asks if older follow-up items should be moved to the current date, and sets the calendar to the current system date.

method open(var eventInfo Event)

var

TcSystem tcursor

formTitle	string

endVar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

if menuLib.open("menus") AND

msgHelpLib.open("msgHelp") then

; If the application libraries can be opened,

; associate formName, a Form variable, with

; REMINDER.FSL

formName.attach()

; Set formTitle to the form's title

; using checkOpen in MENUS.LSL

formTitle = formName.getTitle()

; Check if the application was started properly

if menuLib.checkOpen(formTitle) <> "False" then

if msgQuestion("Reminder","Do you wish to move all past unfulfilled action items to today's date?")="Yes" then

; Set date of all unfulfilled action items to today

resettingText.visible=yes

actToday()

else

; Display a "please wait" message

resettingText.text="Retrieving Today's Unfulfilled Action Items One Moment Please..."

resettingText.visible=yes

endif

; Open SYSTEM.DB

tcSystem.open("system")

; Place SYSTEM.DB in Edit mode

tcSystem.edit()

; Set the currentDate field to the current date

tcSystem.currentDate=today()

; Close SYSTEM.DB

tcSystem.close()

; Set the date displayed by the form to the current date

currentMonth=month(today())

currentDay=day(today())

currentYear=year(today())

dayNumber=0

alreadyConf=0

endif

else

; If the application libraries can't be opened,

; display an error message and close the form

disableDefault

msgStop("Failure","Your working directory is "+workingDir()+

".  Please change your working directory to where

 Connections is located.")

close()

endif

endif

endmethod

setFocus

Called when the form becomes active (also called gaining focus). It places the form in Edit mode and sets the displayed date to the current system date.

method setFocus(var eventInfo Event)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Place the form in Edit mode

action(dataBeginEdit)

if currentDate.isblank() then

; If the currentDate field is blank, set

; it to today's date

TodayButton.pushButton()

endif

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button or a field, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object

; the user is pointing to

eventInfo.getTarget(uio)

; Set uioName to the name of the object being pointed

; to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field"

then

; If object being pointed to is a button or a field,

; display a description on the status line

msgHelpLib.objMsg(formName.name+","+msgHelpLib.pageNameof(uio)+

","+uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located in a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

while

uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Reminder dialog box. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

; Set kPhysical, a String variable, to the key

; pressed

kPhysical = eventInfo.VChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process keys

if kPhysical = "VK_F1" then

; The user pressed F1, prevent Paradox Help

; from displaying

disableDefault

; Associate uio, a UIObject variable, with the

; object F1 was pressed from

eventInfo.getTarget(uio)

switch

; If the user pressed F1 from the main page,

; display Help for the Reminder form

case msgHelpLib.pageNameof(uio) = "Page1" :

HelpButton.pushButton()

; If the user pressed F1 from the second page,

; display Help for the Activity/Action Item Comment form

; form

case msgHelpLib.pageNameof(uio) = "Page2" :

page2HelpButton.pushButton()

endswitch

endif

; Shortcut keys

if eventinfo.IsAltKeyDown() then

switch

; Shortcut for the Close button

case kPhysical = TXTBTNCLOSE_HK :

CloseButton.PushButton()

; Shortcut for the New button

case kPhysical = TXTBTNNEW_HK :

ActivityButton.PushButton()

; Shortcut for the Close button of the second page

case kPhysical = TXTBTNRETURN_HK :

disableDefault

ReturnButton.PushButton()

endswitch

endif

else

; This code executes only for the form.

endif

endmethod

action

Called when the user tries a form operation (inserting records, entering Edit mode, and so on). It prevents the user from inserting records.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicks a field, prevent the Filter

; menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

if eventInfo.id()=dataInsertRecord then

; Prevent the user from inserting records

disableDefault

msgStop("Problem","You are not allowed to insert a new

record here")

action(dataCancelRecord)

endif

if eventInfo.id() = dataDeleteRecord then

if active.TableName = "ACTION.DB" AND alreadyConf = 0 then

; If the user tries to delete a record from

; ACTION.DB and it hasn't already been confirmed,

; confirm the deletion

disableDefault

if msgQuestion("Action Items","Are you sure you wish

 to delete this action item?")="Yes" then

doDefault

moveto(currentDate)

; Check if deleting the record empties the

; follow-up item list and hide it if needed

if ActionItem.isBlank() then

; Hide the list

if actionItemArea.visible=yes then

actionItemArea.visible=no

activityButton.visible=no

noActionItemsText.visible=yes

endif

else

; Display the list

if actionItemArea.visible=no then

actionItemArea.visible=yes

activityButton.visible=yes

noActionItemsText.visible=no

endif

endif

endif

endif

endif

endif

endmethod

pushButton

Called when the user clicks a UI object that does not have a pushButton method attached to it. It checks whether the name of the clicked object starts with Day. If it does, the method sets the calendar date to the day of the month displayed by that UI object. This method enables the calendar day buttons that are displayed in the form.

method pushButton(var eventInfo Event)

var

targObj	UIObject

newDay	smallInt

activeLabel string

endVar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associated targObj, a UIObject variable, with the object the

; user clicked

   eventInfo.getTarget(targObj)

; Set activeLabel, a String variable, to the name of the object

; clicked

activeLabel=targObj.name

if activeLabel.subStr(1,3)="Day" then

; If the name starts with "Day," extract the day number

if size(targObj.labelText)>0 then

; If the object has a label, update the date

; displayed on the form

newDay=smallInt(targObj.labelText)

currentDate=dateVal(string(month(currentDate))+"/"+

string(newDay)+"/"+string(year(currentDate)))

endif

endif

else

; This code executes only for the form.

endif

endmethod

decrementActivitySequence

Called by the newRecord method of NewActivityForm. It decreases the value of the nextSequenceNumber field (in SYSTEM.DB) by 1.

method decrementActivitySequence()

var

nextSequenceNumber number

endVar

; Get the current activity sequence number from SYSTEM.DB

dmGet("system","nextActivitySequenceNo",nextSequenceNumber)

; Decrease its value by one

dmPut("system","nextActivitySequenceNo",nextSequenceNumber-1)

endmethod

actToday

Called by the open method when the user specifies that old follow-up items should be moved to the current date. It runs a CHANGETO query on ACTION.DB that changes the Date field of all unfulfilled (Fulfilled field 0) follow-up items to the current system date.

method actToday()

var

q	Query

endvar

; This query searches ACTION.DB for all unfulfilled action items

; dated earlier than the current date, then changes them to the

; current date

q = Query

 ACTION.DB | Date                  | Fulfilled |

           | <today,changeto today | not 1     |

EndQuery

; Run the query

q.executeQBE()

endmethod


Objects

Page1

Page2


Methods

Uses

Var

Const

open

setFocus

mouseEnter

mouseExit

mouseRightUp

keyPhysical

action

pushButton

decrementActivitySequence

actToday


See Also

Reminder Dialog Box (User Help)

NewActivityForm (NEWACTIV.FSL)


Page1 (ReminderForm)
 Page1

Objects

Page1 displays in the application as the main Reminder dialog box (Page2 displays as the Action Item Comment form).


Objects

Page1.ActionItemArea

Page1.ActivityButton

Page1.CalendarFrame

Page1.CloseButton

Page1.currentDate

Page1.HelpButton

Page1.TodayButton


Page1.ActionItemArea (ReminderForm)
 Page1.ActionItemArea

Objects

ActionItemArea contains controls for viewing the list of follow-up items associated with the date in currentDate, and buttons to delete or move follow-up items.


Objects

ActionItemArea.DeleteButton

ActionItemArea.MoveButton

ActionItemArea.ContactName

ActionTFrameRecord.Fulfilled

ActionTFrameRecord.ActionItem


ActionItemArea.DeleteButton (ReminderForm)
 ActionItemArea.DeleteButton

Objects

Deletes the selected follow-up item.

pushButton

Called when a user clicks the Delete Item button in the Reminder dialog box. It removes the selected follow-up item from ACTIVITY.DB.

method pushButton(var eventInfo Event)

; Select the ActionItem field of the table frame

moveto(ActionItem)

; Delete the selected record

ACTIONTABLE.deleteRecord()

endmethod


ActionItemArea.MoveButton (ReminderForm)
 ActionItemArea.MoveButton

Objects

Moves the selected follow-up item to another date.

pushButton

Called when a user clicks the Move Item button on the Reminder dialog box. It changes the date of the selected follow-up item.

method pushButton(var eventInfo Event)

var

newDate	date

tc	tCursor

endvar

; Set newDate to the current date

newDate=today()

; Display newDate so the user can edit it

newDate.view("Enter New Date For This Item:")

; Confirm the operation

if msgQuestion("Action Items","Are you sure you wish to move this action item from "+string(currentDate)+" to "+string(newDate)+"?")="Yes" then

; Open ACTION.DB

tc.open("action")

; Place ACTION.DB in Edit mode

tc.edit()

; Add a record

tc.insertRecord()

; Set it to the new date

tc.date=newDate

; Copy other field values from the selected record

tc.contact=contactNumber

tc.actionItem=ActionItem

tc.comments=comments

tc.fulfilled=fulfilled

; Set alreadyConfto indicate that the upcoming record deletion

; does not need confirmation (usually displayed by the action

; method)

alreadyConf=1

; Delete the selected record (not the new one)

ACTIONTABLE.deleteRecord()

; Close ACTION.DB

tc.close()

; Indicate that future record deletions require confirmation

alreadyConf=0

endif

endmethod


ActionItemArea.ContactName (ReminderForm)
 ActionItemArea.ContactName

Objects

ContactName is a calculated field that displays the contact associated with the selected follow-up item.

MIN([CONTLIST.FIRSTNAME])+" "+MIN([CONTLIST.LASTNAME])


ActionTFrameRecord.Fulfilled (ReminderForm)
 ActionTFrameRecord.Fulfilled

Objects

Fulfilled is a list of check boxes that indicate whether a follow-up action was already performed.

newValue

Called when the value of a check box in Fulfilled changes. It sets the text of the check box to reflect the new setting.

method newValue(var eventInfo Event)

if self=1 then

; If the user checked the checkbox, display Yes by it

fulfilledText="Yes"

else

; Otherwise, display No by it

fulfilledText="No"

endif

endmethod


ActionTFrameRecord.ActionItem (ReminderForm)
 ActionTFrameRecord.ActionItem

Objects

ActionItem lists the follow-up items associated with the date in currentDate.

mouseDouble

Called when the user double-clicks an item in the ActionItem list. It displays the Action Item Comment form (Page2), which shows details about the follow-up item.

method mouseDouble(var eventInfo MouseEvent)

; Display details about the action item the user

; double-clicked

moveToPage(2)

endmethod


Page1.ActivityButton (ReminderForm)
 Page1.ActivityButton

Objects

Displays the Contact Activity form.

pushButton

Called when a user clicks the Activity button on the Reminder dialog box. It displays the contact associated with the selected follow-up item in the Contact Activity form.

method pushButton(var eventInfo Event)

var

formToOpen form

go smallInt

endVar

if not contactNumber.isBlank() then

; If the contactNumber field isn't blank, store

; the current contact number in SYSTEM.DB

dmPut("system","currentContact",contactNumber)

action(dataPostRecord)

; Display the Contact Activity form

formToOpen.open("activity")

returns=string(formToOpen.wait())

else

; No activity items are displayed

msgStop("Display Activity","You may only display activity for a

 contact currently showing an acton item.")

endif

endmethod


Page1.CalendarFrame (ReminderForm)
 Page1.CalendarFrame

Objects	Methods

CalendarFrame contains controls for changing the value of currentDate, which determines what follow-up items are displayed.

Var

Defines variables used throughout the CalendarFrame methods.

Var

thisMonth smallInt

endVar

mouseEnter

Called whenever a mouse pointer passes over an object in the calendar frame. It displays instructions on using controls in the frame.

method mouseEnter(var eventInfo MouseEvent)

; Display a description of the calendar buttons

message("Click on desired day to view action items for that date")

endmethod

newMonth

Called by the pushButton methods of NextMonthButton and PriorMonthButton. It adjusts the number of days in the month, the year, and the value of currentDate when needed.

method newMonth()

if currentDay>28 and thisMonth=2 then

; If the current month is February, set the number

; of days to 28

currentDay=28

endif

if currentDay>30 and

(thisMonth=4

or thisMonth=6

or thisMonth=9

or thisMonth=11) then

; If the current month is April, June, September, or November,

; set the number of days to 30

currentDay=30

endif

; Retrieve the current year from the displayed date

currentYear=year(currentDate)

switch

case thisMonth>12 :

; If the displayed month is December, advance the calendar

; frame to January of the next year

thisMonth=1

currentYear=currentYear+1

case thisMonth<1 :

; If the displayed month is January, change the calendar

; frame to December of the previous year

thisMonth=12

currentYear=currentYear-1

endSwitch

; Change the displayed date

currentDate=dateVal(string(thisMonth)+"/"+string(currentDay)+"/"+string(currentYear))

endmethod


Methods

Var

mouseEnter

newMonth


Objects

CalendarFrame.PriorMonthButton

CalendarFrame.PriorYearButton

CalendarFrame.NextMonthButton

CalendarFrame.NextYearButton


CalendarFrame.PriorMonthButton (ReminderForm)
 CalendarFrame.PriorMonthButton

Objects

Moves the date in currentDate back a month.

pushButton

Called when a user clicks the prior month button on the Reminder dialog box. It decreases the value in currentDate by one month, then calls the newMonth method.

method pushButton(var eventInfo Event)

; Decrease the current month number

thisMonth=month(currentDate)-1

; Make the displayed date one month earlier

newMonth()

endmethod


CalendarFrame.PriorYearButton (ReminderForm)
 CalendarFrame.PriorYearButton

Objects

Moves the date in currentDate back a year.

pushButton

Called when a user clicks the prior year button on the Reminder dialog box. It decreases the value in currentDate by one year.

method pushButton(var eventInfo Event)

; Make the displayed date one year earlier

currentDate=dateVal(string(month(currentDate))+"/"+

string(currentDay)+"/"+string(year(currentDate)-1))

endmethod


CalendarFrame.NextMonthButton (ReminderForm)
 CalendarFrame.NextMonthButton

Objects

Advances the date in currentDate one month.

pushButton

Called when a user clicks the next month button on the Reminder dialog box. It increases the value in currentDate by one month, then calls the newMonth method.

method pushButton(var eventInfo Event)

; Increase the current month number

thisMonth=month(currentDate)+1

; Make the displayed date one month later

newMonth()

endmethod


CalendarFrame.NextYearButton (ReminderForm)
 CalendarFrame.NextYearButton

Objects

Advances the date in currentDate one year.

pushButton

Called when a user clicks the next year button on the Reminder dialog box. It increases the value in currentDate by one year.

method pushButton(var eventInfo Event)

; Make the displayed date one year later

if year(currentDate)+1 > 9999 then

msgStop("Stop","Cannot set the year greater than 9999.")

currentDate=dateVal(string(month(currentDate))+"/"+

string(currentDay)+"/"+string(year(currentDate)))

return

endif

currentDate=dateVal(string(month(currentDate))+"/"+

string(currentDay)+"/"+string(year(currentDate)+1))

endmethod


Page1.CloseButton (ReminderForm)
 Page1.CloseButton

Objects

CloseButton lets the user close the Reminder dialog box.

pushButton

Called when the user clicks the Close button. Closes the form and returns the user to the Contact Profile form.

method pushButton(var eventInfo Event)

; Close the form

close()

endmethod


Page1.currentDate (ReminderForm)
 Page1.currentDate

Objects	Methods

currentDate shows the date of the follow-up items being displayed. The user can edit currentDate directly or change its value using CalendarFrame controls.

Var

Defines variables used throughout the currentDate methods.

Var

maxDays,x smallInt

buttonName,firstActionItem string

thisButton uiObject

currentTime dateTime

endVar

keyPhysical

Called when the user presses a key, it prevents the user from deleting the current record.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.isControlKeyDown() then

if eventInfo.vCharCode()=46 then

;<Ctrl-Delete> was pressed

disableDefault

msgStop("Reminder","You may not delete this default record.")

endif

endif

endmethod

newValue

Called when the value of currentDate changes. It makes the date's day number red in the month display, redraws the day buttons if needed, and hides the follow-up item list if no items are associated with the date.

method newValue(var eventInfo Event)

if not self.isBlank() then

action(dataPostRecord)

; If the field isn't blank, clear calendar button labels

if dayNumber>0 then

; Change the current day's font from red to black

buttonName="dayText"+string(dayNumber+currentDay-1)

thisButton.attach(buttonName)

thisButton.font.Color=black

endif

; If calendar has to be redrawn, clear button labels

; from 1st row and last 2 rows

if dayNumber>0 and (month(dateVal(currentDate))<>currentMonth or year(dateVal(currentDate))<>currentYear) then

for x from 1 to 7

buttonName="day"+string(x)

calendarFrame.(buttonName).labelText=""

buttonName="day"+string(x+28)

calendarFrame.(buttonName).labelText=""

buttonName="day"+string(x+35)

calendarFrame.(buttonName).labelText=""

endFor

endif

; Set variables associated with the displayed date

calcCurrent()

; Set the calendar button labels

setLabel()

endif

; Get the first record in the table frame

dmGet("action","actionItem",firstActionItem)

if firstActionItem.isBlank() then

; If there's no first record, hide the table frame

if actionItemArea.visible=yes then

actionItemArea.visible=no

activityButton.visible=no

noActionItemsText.visible=yes

endif

else

; Otherwise, display the frame

if actionItemArea.visible=no then

actionItemArea.visible=yes

activityButton.visible=yes

noActionItemsText.visible=no

endif

endif

endmethod

calcCurrent

Called by the newValue method of currentDate. It calculates the number of days in the month indicated by currentDate.

method calcCurrent()

; Get the month stored in currentDate's value

currentMonth=month(dateVal(currentDate))

; Assume the month contains 31 days

maxDays=31

switch

; Change the number of days depending on the month

case currentMonth=1:monthName.value="January"

case currentMonth=2:monthName="February"

currentTime=dateTime("1:00:00 AM "+currentDate)

if currentTime.isLeapYear() then

maxDays=29

else

maxDays=28

endif

case currentMonth=3:

monthName="March"

case currentMonth=4:

monthName="April"

maxDays=30

case currentMonth=5:

monthName="May"

case currentMonth=6:

monthName="June"

maxDays=30

case currentMonth=7:

monthName="July"

case currentMonth=8:

monthName="August"

case currentMonth=9:

monthName="September"

maxDays=30

case currentMonth=10:

monthName="October"

case currentMonth=11:

monthName="November"

maxDays=30

case currentMonth=12:

monthName="December"

endSwitch

; Set the displayed day and year

currentDay=day(dateVal(currentDate))

currentYear=year(dateVal(currentDate))

yearNumber=currentYear

dayNumber=dowOrd(dateVal(string(currentMonth)+"/1/"+

string(currentYear)))

endmethod

setLabel

Called by the newValue method of currentDate. It redraws the day buttons displayed in the calendar frame, and makes the day corresponding to the day in currentDate red.

method setLabel()

for x from 1 to 37

if x>maxDays then

; If x exceeds the number of days in the month,

; quit out of the for loop

quitLoop

endif

if (dayNumber+x-1)>37 then

quitLoop

endif

; Calculate the name of the day button to set

buttonName="day"+string(dayNumber+x-1)

; Set the number displayed on the button

calendarFrame.(buttonName).labelText=string(x)

if x=currentDay then

; If x is the day of the displayed date, color it red

buttonName="dayText"+string(dayNumber+currentDay-1)

thisButton.attach(buttonName)

thisButton.font.Color=red

endif

endFor

endmethod


Methods

Var

keyPhysical

newValue

calcCurrent

setLabel


Page1.HelpButton (ReminderForm)
 Page1.HelpButton

Objects

Displays Connections user Help for the Reminder dialog box.

pushButton

Called when a user clicks the Help button on the Reminder dialog box or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the form

helpShowContext(helpFile,#IDH_FORMS_REMINDER)

endmethod


Page1.TodayButton (ReminderForm)
 Page1.TodayButton

Objects

TodayButton lets the user view follow-up items associated with the current system date.

pushButton

Called when a user clicks the Today button. It sets the value of currentDate to the system date.

method pushButton(var eventInfo Event)

; Set the displayed date to the current date

currentDate=today()

endmethod


Page2 (ReminderForm)
 Page2

Objects

Page2 displays in the application as the Action Item Comment form. It displays details about a particular follow-up item.


Objects

Page2.page2HelpButton

Page2.page2ContactName

Page2.ReturnButton


Page2.page2HelpButton (ReminderForm)
 Page2.page2HelpButton

Objects

Displays Connections user Help for the Action Item Comment form.

pushButton

Called when a user clicks the Help button on the Action Item Comment form or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the page

helpShowContext(helpFile,#IDH_FORMS_REMINDER)

endmethod


Page2.page2ContactName (ReminderForm)
 Page2.page2ContactName

Objects

page2ContactName is a calculated field that shows the name of the contact associated with the current follow-up item.

MIN([CONTLIST.FIRSTNAME])+" "+MIN([CONTLIST.LASTNAME])


Page2.ReturnButton (ReminderForm)
 Page2.ReturnButton

Objects

ReturnButton lets the user return to the main Reminder dialog box from the Action Item Comment form.

pushButton

Called when the user clicks the Close button. It returns the user to the first page of the form (Page1).

method pushButton(var eventInfo Event)

; Display the first page of the form

moveToPage(1)

endmethod


 SearchForm (SEARCH.FSL)

See Also	Objects	Methods

SearchForm is displayed by the Locate button on various Connections forms. It is used to search for a specific contact in CONTLIST.DB.

Uses

Defines the argument structure of library methods stored in MENUS.LSL and MSGHELP.LSL. Connections uses these routines to display menus and help.

Uses objectPal

; Method in MENUS.LSL

checkOpen(formTitle string) string

; Methods in MSGHELP.LSL

objMsg(ObjectID String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

pageNameof(ui uiObject) string

endUses

Var

Defines variables used throughout the CompanyForm methods. See Common Variables for more information on common variables used throughout Connections.

Var

arg array[] string

menuLib, msgHelpLib	Library

formName	form

uio	uiObject

uioName	string

endVar

Const

Defines constants used by Connections to provide shortcut keys and help to the user.

Const

TXTBTNOK_HK = "O"

TXTBTNCANCEL_HK = "C"

helpfile = ":WORK:CONNUSER.HLP"

#IDH_FORMS_SEARCH = 1072

endConst

open

Called when the dialog box is opened. It opens the MENUS.LSL and MSGHELP.LSL libraries, checks whether the form can be opened, and sets search options.

method open(var eventInfo Event)

var

formTitle	string

endvar

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

else

; This code executes only for the form.

; Open MENUS.LSL and MSGHELP.LSL libraries

if menuLib.open("menus") AND

msgHelpLib.open("msgHelp") then

; If the application libraries can be opened,

; associate formName, a Form variable, with

; SEARCH.FSL

formName.attach()

; Set formTitle to the form's title

formTitle = formName.getTitle()

; Check if the application was started properly

menuLib.checkOpen(formTitle)

else

; If the application libraries can't be opened,

; display an error message and close the form

disableDefault

msgStop("Failure","Your working directory is "+workingDir()+".  Please change your working directory to where Connections is located.")

close()

endif

endif

endmethod

action

Called when the user attempts a form operation (inserts a record, places the form in Edit mode, and so on). If the user is trying to display a filters menu by right-clicking a field, this method prevents it.

method action(var eventInfo ActionEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; If the user right-clicks a menu, prevent the

; Filter menu from displaying

if eventInfo.ID() = EditProperties then

eventInfo.setErrorCode(userError)

endif

else

; This code executes only for the form.

endif

endmethod

mouseEnter

Called whenever the mouse pointer passes over an object on the dialog box (a field, a button, and so on). It sets uio to the object being pointed to, checks whether the object is a button, a field, or a field label, then gets the name of the object and passes the information to objMsg (in MSGHELP.LSL), which displays a brief description of the object on the status line.

method mouseEnter(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

; Set uioName, a String variable, to the name of the object

; being pointed to

uioName = uio.name

if uio.class = "Button" OR uio.class = "Field"

OR uio.class = "Text" then

; If object being pointed to is a button, a field,

; or text, display a description on the status line

msgHelpLib.objMsg(formName.name+","+msgHelpLib.pageNameof(uio)+

","+uioName)

endif

else

; This code executes only for the form.

endif

endmethod

mouseExit

Called when the mouse pointer no longers points to an object. It sets uio to the object the mouse stopped pointing to, then clears the status line if the object is not a bitmap and is not located in a button. It works in conjunction with mouseEnter to ensure that control descriptions do not display when invalid.

method mouseExit(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object

; the user is pointing to

eventInfo.getTarget(uio)

if uio.class <> "Bitmap" and uio.container.class<>"Button" then

; If the object isn't a bitmap and its container

; isn't a button, clear the status line

message("")

endif

else

; This code executes only for the form.

endif

endmethod

mouseRightUp

Called when the user right-clicks an object. It checks the type of the object, then it displays code help for the container using createObjMenu (in MSGHELP.LSL).

method mouseRightUp(var eventInfo MouseEvent)

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Associate uio, a UIObject variable, with the object the

; user is pointing to

eventInfo.getTarget(uio)

   if uio.name <> "TelephoneBitMap" then

; While the object referenced by uio is a label

; or a bitmap, associate uio with the object's

; container. This lets the user right-click

; anywhere on a button to display programmer's Help

while

uio.class = "Text" or uio.class = "Bitmap"

uio.attach(uio.ContainerName)

endWhile

endif

; If the object is a field, prevent the Filter menu

; from displaying

if uio.class = "Field" then

eventInfo.setErrorCode(userError)

endif

; Display a popup menu using createObjMenu in MSGHELP.LSL

msgHelpLib.createObjMenu(formName, msgHelpLib.pageNameOf(uio), uio)

else

; This code executes only for the form.

endif

endmethod

keyPhysical

Called when the user presses a key. It enables the shortcut keys available to the Search form. It checks the key, then performs the desired operation using a switch statement.

method keyPhysical(var eventInfo KeyEvent)

var

kPhysical String

endvar

; Set kPhysical, a String variable, to the key

; that was pressed

kPhysical = eventInfo.vChar()

if eventInfo.isPreFilter()

then

; This code executes for each object on the form.

; Process keys

switch

case kPhysical = "VK_F1":

; Prevent Paradox Help from displaying

disableDefault

; Display user Help for the dialog box

HelpButton.pushButton()

case kPhysical = "VK_ESCAPE":

; User pressed Esc; return Cancel to

; the calling form, which then closes

; the dialog box

 	formReturn("Cancel")

endswitch

; Shortcut keys

if eventinfo.IsAltKeyDown() then

switch

; Shortcut for OK button

case kPhysical = TXTBTNOK_HK :

DisableDefault sleep(100)

OKButton.PushButton()

; Shortcut for Cancel button

case kPhysical = TXTBTNCANCEL_HK :

DisableDefault sleep(100)

CancelButton.PushButton()

endswitch

endif

else

; This code executes only for the form.

endif

endmethod

seed

Called by the search method in MENUS.LSL. Arguments is a comma-delimited list of field names to search. The method extracts the field names, stores them in an array, then copies the field names into fieldList (a List object on the form).

method seed(arguments string)

var

x smallInt

endVar

; arguments is a list of field names to search,

; separated by commas

; Store each field name in arguments in the arg array

arguments.breakApart(arg,",")

; For every two strings in arg, starting from the end

for x from arg.size() to 1 step -2

; Select a position in the field list

thePage.SearchDetailBox.searchFields.fieldList.list.selection=smallInt(x/2)

; Store the field name in that position

thePage.SearchDetailBox.searchFields.fieldList.list.value=arg[x]

endFor

; Select the first field in the list

searchFields.value=arg[2]

endmethod


See Also

MENUS.LSL


Methods

Uses

Var

Const

open

action

mouseEnter

mouseExit

mouseRightUp

keyPhysical

seed


Objects

CancelButton

OKButton

HelpButton

searchFields.fieldList

desiredValue


CancelButton (SearchForm)
 CancelButton

Objects

CancelButton lets the user cancel the search operation.

pushButton

Called when a user clicks the Cancel button. It closes the form without performing a search.

method pushButton(var eventInfo Event)

; Return Cancel, which cancels the operation

; and makes the calling form close the dialog box

formReturn("Cancel")

endmethod


OKButton (SearchForm)
 OKButton

Objects

OKButton lets the user perform the search operation.

pushButton

Called when a user clicks the OK button. It closes the form and performs the search.

method pushButton(var eventInfo Event)

var

fieldSelection smallInt

endVar

if not desiredValue.isblank() then

; If the desiredValue field isn't blank

; return the name of the field to search

; and the value in desiredValue, separated

; by commas

fieldSelection=arg.indexOf(searchFields)

formReturn(arg[fieldSelection-1]+","+desiredValue.upper())

endif

endmethod


HelpButton (SearchForm)
 HelpButton

Objects

Displays Connections user Help for the Search form.

pushButton

Called when a user clicks the Help button on the Search form or presses F1. It displays Connections user Help for the form.

method pushButton(var eventInfo Event)

; Display user Help for the dialog box

helpShowContext(helpFile,#IDH_FORMS_SEARCH)

endmethod


searchFields.fieldList (SearchForm)
 searchFields.fieldList

Objects

fieldList lists the fields a user can search.

mouseClick

Called when the user clicks a field in the field list. It selects the desiredValue field. (It also selects the item the user clicked, which is the object's default behavior.)

method mouseClick(var eventInfo MouseEvent)

; Select the desiredValue field

moveTo(desiredValue)

endmethod


desiredValue (SearchForm)
 desiredValue

Objects	Methods

desiredValue lets the user specify the string to search for.

arrive

Called when the desiredValue field is about to become selected. It sets the searchText object to a string explaining desiredValue's purpose.

method arrive(var eventInfo MoveEvent)

; Change the title displaying above the field

; so that it mentions the field being searched

searchText.text="Search for "+searchFields.value+" value:"

endmethod

keyPhysical

Called when the user presses a key while desiredValue is selected. It copies the index of the selected field name into fieldSelection, then returns a comma-delimited string in the following format:

FieldName,Value

FieldName is the selected field name; Value is the current value of desiredValue, converted to uppercase. This information is used by the search method in MENUS.LSL to perform the search.

method keyPhysical(var eventInfo KeyEvent)

var

fieldSelection smallInt

endVar

if eventInfo.vCharCode()=VK_RETURN then

; If the user presses Enter,

; return the name of the field to search

; and the value in desiredValue, separated

; by commas

fieldSelection=arg.indexOf(searchFields)

formReturn(arg[fieldSelection-1]+","+self.upper())

endif

endmethod


Methods

arrive

keyPhysical


 MENUS.LSL

See Also	Methods

MENUS.LSL contains custom methods for displaying and managing menus, searching CONTLIST.DB, and displaying help.

Uses

Defines the argument structure of custom methods stored in other Connections forms.

Uses objectPal

; Method in SEARCH.FSL

seed(arg string)

endUses

Var

Defines variables used throughout the MENUS.LSL methods.

Var

fText,recText,oText,rText,wText,hText,mainText array[12] string

endVar

Const

Defines constants used by Connections to display menus and help.

Const

; The locations of Connections user

; and programmer's Help

helpfile = ":WORK:CONNUSER.HLP"

proghelp = ":WORK:CONNPROG.HLP"

; The menu commands installed by Connections

#IDH_MENUS_FILE_PRINT = "&Print"

#IDH_MENUS_FILE_PRINTERSETUP = "Printer &Setup"

#IDH_MENUS_FILE_QUIT = "&Exit"

#IDH_MENUS_RECORD_UNDOCHANGE = "&Undo Changes\tAlt+BackSpace"

#IDH_MENUS_RECORD_NEXTRECORD = "Ne&xt Record\tPgDn"

#IDH_MENUS_RECORD_PRIORRECORD = "&Prior Record\tPgUp"

#IDH_MENUS_RECORD_NEWRECORD = "&New Record\tIns"

#IDH_MENUS_RECORD_DELETERECORD = "&Delete Record\tCtrl+Del"

#IDH_MENUS_OPTIONS_DEFAULTS = "&Defaults..."

#IDH_MENUS_OPTIONS_CONTACTTYPES = "&Contact Types..."

#IDH_MENUS_OPTIONS_PROSPECTGRADES = "Prospect &Grades..."

#IDH_MENUS_OPTIONS_ACTIVITY_ACTION = "&Activity/Action Items..."

#IDH_MENUS_OPTIONS_DISPLAYSPEEDBAR = "Display &Toolbar "

#IDH_MENUS_REPORTS_CONTACTLIST = "&Contact List"

#IDH_MENUS_REPORTS_PROJECTREVENUE = "Projected &Revenue"

#IDH_MENUS_WINDOW_CURRENTWINDOW = "Current Open Windows"

#IDH_MENUS_HELP_CONTENTS = "&Contents"

#IDH_MENUS_HELP_SEARCH = "&Search"

#IDH_MENUS_HELP_FORM = "&Form"

#IDH_MENUS_FILE = "&File"

#IDH_MENUS_RECORD = "&Record"

#IDH_MENUS_OPTIONS = "&Options"

#IDH_MENUS_REPORTS = "Re&ports"

#IDH_MENUS_WINDOWS = "&Window"

; Help context numbers for the Contents screen

; of Connections and the Forms overview topic

#IDH_FORMS_CONTENTS = 1040

#IDH_CONNECTIONS_CONTENTS = 1000

endConst

open

Called when the library is opened by a form. It defines constants used by Connections to display help.

; This method creates constants used by

; Connections to display user Help

method open(var eventInfo Event)

fText[1]=#IDH_MENUS_FILE_PRINT

fText[2]=#IDH_MENUS_FILE_PRINTERSETUP

fText[3]=#IDH_MENUS_FILE_QUIT

recText[1]=#IDH_MENUS_RECORD_UNDOCHANGE

recText[2]=#IDH_MENUS_RECORD_NEXTRECORD

recText[3]=#IDH_MENUS_RECORD_PRIORRECORD

recText[4]=#IDH_MENUS_RECORD_NEWRECORD

recText[5]=#IDH_MENUS_RECORD_DELETERECORD

oText[1]=#IDH_MENUS_OPTIONS_DEFAULTS

oText[2]=#IDH_MENUS_OPTIONS_CONTACTTYPES

oText[3]=#IDH_MENUS_OPTIONS_PROSPECTGRADES

oText[4]=#IDH_MENUS_OPTIONS_ACTIVITY_ACTION

oText[5]=#IDH_MENUS_OPTIONS_DISPLAYSPEEDBAR

rText[1]=#IDH_MENUS_REPORTS_CONTACTLIST

rText[2]=#IDH_MENUS_REPORTS_PROJECTREVENUE

wText[1]=#IDH_MENUS_WINDOW_CURRENTWINDOW

hText[1]=#IDH_MENUS_HELP_CONTENTS

hText[2]=#IDH_MENUS_HELP_SEARCH

hText[3]=#IDH_MENUS_HELP_FORM

mainText[1]=#IDH_MENUS_FILE

mainText[2]=#IDH_MENUS_RECORD

mainText[3]=#IDH_MENUS_OPTIONS

mainText[4]=#IDH_MENUS_REPORTS

mainText[5]=#IDH_MENUS_WINDOWS

mainText[6]="&Help"

endmethod

displayMenus

Called by the open method of CompanyForm and the setFocus method of ContactForm. It replaces the default Paradox menus with Connections menus.

; This method replaces the Paradox menus with application

; specific menus. callingForm is a code indicating the form

; that called the method. 1 for CONTACTS.FSL, or 2 for

; COMPANY.FSL

method displayMenus(callingForm smallInt)

var

mainMenu	menu

fPop,recPop,oPop,rPop,wPop,hPop	popUpMenu

loopValue smallInt

endVar

; Create the File menu

fPop.addText(fText[1])

fPop.addText(fText[2])

; If CONTACTS.FSL is calling the method,

; add File|Quit to the File menu

; This ensures that the user can't quit

; from the Company Information form

if callingForm=1 then

fPop.addSeparator()

fPop.addText(fText[3])

endif

; Create the Record menu

recPop.addtext(recText[1])

recPop.addSeparator()

recPop.addtext(recText[2])

recPop.addtext(recText[3])

recPop.addSeparator()

recPop.addtext(recText[4])

recPop.addtext(recText[5])

; Create the Options menu

oPop.addText(oText[1])

oPop.addSeparator()

for loopValue from 2 to 4

oPop.addtext(oText[loopValue])

endFor

oPop.addSeparator()

oPop.addText(oText[5])

; Create the Reports menu

for loopValue from 1 to 2

rPop.addtext(rText[loopValue])

endFor

; Create the Windows menu

wPop.addStaticText(wText[1])

; Create the Help menu

hPop.addText(hText[1])

hPop.addSeparator()

hPop.addText(hText[2])

hPop.addSeparator()

hPop.addText(hText[3])

; Add the menus to the Paradox menu bar

mainMenu.addPopUp(mainText[1],fPop)

mainMenu.addPopUp(mainText[2],recPop)

mainMenu.addPopUp(mainText[3],oPop)

mainMenu.addPopUp(mainText[4],rPop)

mainMenu.addPopUp(mainText[5],wPop)

mainMenu.addPopUp(mainText[6],hPop)

; Display the revised menu bar

mainMenu.show()

endmethod

menuActivity

Called by the menuAction method of ContactForm and CompanyForm. It performs a Connections menu operation. The menu constant stored in choice determines the operation to perform.

; This method is called from CONTACTS.FSL and COMPANY.FSL

; whenever the user chooses a menu item

method menuActivity(choice string)

var

thisApp	application

thisForm	form

active	UIobject

thisReport report

fileString string

tc tcursor

errorCode anytype

endVar

; Associates active, a UIObject variable, with the

; object that called the method

active.attach(self)

switch

;File menu operations

case choice=#IDH_MENUS_FILE_PRINT:

; If File|Print was chosen,

; print the active form using

; Paradox's File|Print command

active.menuAction(menuFilePrint)

case choice=#IDH_MENUS_FILE_PRINTERSETUP:

; If File|Printer Setup was chosen,

; display a dialog to change or

; configure the current printer

; using Paradox's File|Printer Setup

; command

active.menuAction(menuFilePrinterSetup)

case choice=#IDH_MENUS_FILE_QUIT:

; If File|Quit was chosen,

; close the application by calling

; the pushButton method of ExitButton (the

; same as clicking the Exit button on the

; Contact Profile form

thisform.attach()

thisform.ExitButton.pushButton()

; Record menu operations

case choice=#IDH_MENUS_RECORD_UNDOCHANGE:

action(dataCancelRecord)

case choice=#IDH_MENUS_RECORD_NEXTRECORD:

action(dataNextRecord)

case choice=#IDH_MENUS_RECORD_PRIORRECORD:

action(dataPriorRecord)

case choice=#IDH_MENUS_RECORD_NEWRECORD:

action(dataInsertRecord)

case choice=#IDH_MENUS_RECORD_DELETERECORD:

action(dataDeleteRecord)

; Options menu operations

case choice=#IDH_MENUS_OPTIONS_DEFAULTS:

; If Options|Defaults was chosen,

; open SYSTEM.FSL (the Defaults dialog

; box) and wait for the user to manipulate

; the dialog box and close it

thisForm.open("system")

returns=string(thisForm.wait())

case choice=#IDH_MENUS_OPTIONS_CONTACTTYPES:

; If Options|Contact Types was chosen,

; open CONTYPES.FSL (the Contact Type dialog

; box) and wait for the user to manipulate

; the dialog box and close it

thisForm.open("contypes")

returns=string(thisForm.wait())

case choice=#IDH_MENUS_OPTIONS_PROSPECTGRADES:

; If Options|Prospect Grades was chosen,

; open GRADES.FSL (the Prospect Grades dialog

; box) and wait for the user to manipulate

; the dialog box and close it

thisForm.open("grades")

returns=string(thisForm.wait())

case choice=#IDH_MENUS_OPTIONS_ACTIVITY_ACTION:

; If Options|Activity/Action Items was chosen,

; open ACTTYPES.FSL (the Activity/Action Item

; dialog box) and wait for the user to manipulate

; the dialog box and close it

thisForm.open("acttypes")

returns=string(thisForm.wait())

case choice=#IDH_MENUS_OPTIONS_DISPLAYSPEEDBAR:

; If Options|Display Toolbar was chosen,

if isToolBarShowing() then

; Hide the Toolbar if it isn't already hidden

; and uncheck the menu command

hideToolBar()

setMenuChoiceAttribute(oText[5],MenuNotChecked)

   else

; Display the Toolbar if it isn't already

; displayed and check the menu command

showToolBar()

setMenuChoiceAttribute(oText[5],MenuChecked)

endif

; Reports menu

case choice=#IDH_MENUS_REPORTS_CONTACTLIST:

; If Reports|Contact List was chosen,

; open CONTACTS.RSL, a report

thisReport.open("contacts")

case choice=#IDH_MENUS_REPORTS_PROJECTREVENUE:

; If Reports|Projected Revenue was chosen,

; open REVENUE.RSL, a report

thisReport.open("revenue")

; Help menu operations

case choice=#IDH_MENUS_HELP_FORM:

; If Help|Forms was chosen,

; display the Forms topic

; of CONNUSER.HLP (the helpfile constant)

helpShowContext(helpfile,#IDH_FORMS_CONTENTS)

case choice=#IDH_MENUS_HELP_CONTENTS:

; If Help|Contents was chosen,

; display the Contents topic

; of CONNUSER.HLP

helpShowContext(helpfile,#IDH_CONNECTIONS_CONTENTS)

endSwitch

endmethod

KeyViol

Called by the error method of ContactForm when a key violation occurs. It displays a message warning the user that the current record cannot be stored because it is not unique.

; This method is called by CONTACTS.FSL when the user tries

; to enter a record that generates a key violation. See

; Paradox Help for more information on key violations

method KeyViol()

msgStop("Data Entry","You are trying to enter a record that has the same Company, First Name, and Last Name of an existing record. Enter a different name or company.")

endmethod

search

Called by the pushButton method of LocateButton in all Connections forms. It displays SearchForm, then uses the information to search CONTLIST.DB for a contact.

; This method is called by all forms with a Locate button

; It displays SEARCH.FSL (the Search dialog box) to let the

; user specify a field and value to search for.

; searchArguments is a comma-delimited list of fields the

; user can search

method search(searchArguments string)

var

formDialog form

returnsvalue,searchField string

searchArray array[] string

endVar

; Display SEARCH.FSL, the Search dialog box

formDialog.open("search")

; Pass SEARCH.FSL the field names that can

; be searched

formDialog.seed(searchArguments)

; Wait for the user to select a field to search,

; enter a search string, then choose OK

returnsvalue=string(formDialog.wait())

; SEARCH.FSL returns the field to search and the

; value to find, separated by commands

; SEARCH.FSL returns "Cancel" if the user

; cancelled the Search dialog box

; Close the dialog box

formDialog.close()

; Break out the field to search and value to find

; into searchArray (a String array)

returnsvalue.breakApart(searchArray,",")

if returnsvalue<>"Cancel" then

; If the user didn't cancel the operation,

; perform the search

searchField=searchArray[1]

searchValue=searchArray[2]

; ^ is appended to the start of the search value so

; that only field values starting with the string are

; found

if not locatePattern(searchField,string("^",searchValue)) then

; If the search fails, display a message

msgStop("Locate "+searchField,"No record was found starting with the value you specified.")

endif

endif

endmethod

checkOpen

Called by the open method of all Connections forms. It checks whether the form was opened by START.SSL. If it was not, an error message is displayed.

; This method checks if the user is opening a form

; without opening STARTUP.SSL or CONTACTS.SSL first

method checkOpen(formTitle string) string

var

tc	tCursor

s string

endvar

; Open SYSTEM.DB, which contains a field

; that signals whether the application

; was started properly

tc.open("System")

; OkToOpen (in SYSTEM.DB) is set to Y if the

; application is started by STARTUP.SSL or

; CONTACTS.SSL

if isblank(tc."OkToOpen") then

; If OkToOpen is blank,

; Tell the user to open the application

; using STARTUP.SSL for CONTACTS.FSL

; instead of opening an application form

; directly, then close the form

msgStop("Sorry","This form must be opened from script \"Start.ssl\" or \"Contacts.fsl\".")

formTitle.close()

; If the Toolbar isn't showing

if not isToolBarShowing() then

; Display the Toolbar and

; remove any custom menus

; added by Connections

showToolBar()

removeMenu()

endif

; Since OkToOpen is not set, return False

; to indicate that the form should not open

s = "False"

else

; Since OkToOpen is set, return True

; to indicate that the form can open

s = "True"

endif

; The form that called this method uses the value stored

; in s to determine whether it should open or not

return s

endmethod


Methods

Uses

Var

Const

open

displayMenus

menuActivity

KeyViol

search

checkOpen


See Also

Menus (User Help)

MSGHELP.LSL

SearchForm (SEARCH.FSL)

Libraries (Paradox Help)


 MSGHELP.LSL

See Also	Methods

MSGHELP.LSL contains custom methods for displaying help.

Uses

Defines the argument structure of custom methods stored is various Connections forms.

Uses objectPal

; Methods in NEWACTIV.FSL

createLookup()

followCreateLookup()

; Methods in CONTACTS.FSL

companyLookup()

gradeLookup()

contactTypeLookup()

endUses

Var

Defines variables used throughout the MSGHELP.LSL methods.

Var

arObjectID,arMsgText array[130] string

arContextID array[130] Number

tcMsg, objHelptc	tCursor

endVar

Const

Defines constants used by Connections to display help.

Const

; The Help files used by Connections

helpfile = ":WORK:CONNUSER.HLP"

proghelp = ":WORK:CONNPROG.HLP"

endConst

open

Called when the library is opened by a form. It defines constants used by Connections to display help.

; This method

;	* Opens MSGHELP.DB, a table of Help context ID's used

;	  by Connections to display Programmer's Help

;	* Creates two arrays used by Connections to display

;	  instructions on the status line when the user points

;	  to an object

method open(var eventInfo Event)

objHelptc.open("MsgHelp.db")

; This array contains object names. Connections searches

; this array using its string, then passes the index to

; arMsgText to display context-sensitive instructions

; on the status line

arObjectID [1] = "ActivityForm,thePage,Action"

arObjectID [2] = "ActivityForm,thePage,CloseButton"

arObjectID [3] = "ActivityForm,thePage,ContactName"

arObjectID [4] = "ActivityForm,thePage,HelpButton"

arObjectID [5] = "ActivityForm,thePage,LocateButton"

arObjectID [6] = "ActivityForm,thePage,NewButton"

arObjectID [7] = "ActivityForm,thePage,thePage"

arObjectID [8] = "ActivityTypeForm,thePage,CloseButton"

arObjectID [9] = "ActivityTypeForm,thePage,HelpButton"

arObjectID [10] = "ActivityTypeForm,thePage,NewButton"

arObjectID [11] = "ActivityTypeForm,thePage,TelephoneBitMap"

arObjectID [12] = "ActivityTypeForm,thePage,thePage"

arObjectID [13] = "CompanyForm,thePage,CloseButton"

arObjectID [14] = "CompanyForm,thePage,CompanyName"

arObjectID [15] = "CompanyForm,thePage,HelpButton"

arObjectID [16] = "CompanyForm,thePage,LastName"

arObjectID [17] = "CompanyForm,thePage,LocateButton"

arObjectID [18] = "CompanyForm,thePage,MainPhone"

arObjectID [19] = "CompanyForm,thePage,ShortName"

arObjectID [20] = "CompanyForm,thePage,TelePhoneBitMap"

arObjectID [21] = "CompanyForm,thePage,thePage"

arObjectID [22] = "CompanyListForm,thePage,CloseButton"

arObjectID [23] = "CompanyListForm,thePage,HelpButton"

arObjectID [24] = "CompanyListForm,thePage,Name"

arObjectID [25] = "CompanyListForm,thePage,NewButton"

arObjectID [26] = "CompanyListForm,thePage,TelephoneBitMap"

arObjectID [27] = "ContactForm,ContactProfilePage,Birthday"

arObjectID [28] = "ContactForm,ContactProfilePage,CloseButton"

arObjectID [29] = "ContactForm,ContactProfilePage,ContactName"

arObjectID [30] = "ContactForm,ContactProfilePage,ContactProfileHelpButton"

arObjectID [31] = "ContactForm,mainPage,ActivityButton"

arObjectID [32] = "ContactForm,mainPage,Address"

arObjectID [33] = "ContactForm,mainPage,Address2"

arObjectID [34] = "ContactForm,mainPage,City"

arObjectID [35] = "ContactForm,mainPage,Company"

arObjectID [36] = "ContactForm,mainPage,CompInfoButton"

arObjectID [37] = "ContactForm,mainPage,ContactType"

arObjectID [38] = "ContactForm,mainPage,Country"

arObjectID [39] = "ContactForm,mainPage,End"

arObjectID [40] = "ContactForm,mainPage,ExitButton"

arObjectID [41] = "ContactForm,mainPage,FinancialButton"

arObjectID [42] = "ContactForm,mainPage,Grade"

arObjectID [43] = "ContactForm,mainPage,HelpButton"

arObjectID [44] = "ContactForm,mainPage,Home"

arObjectID [45] = "ContactForm,mainPage,LastName"

arObjectID [46] = "ContactForm,mainPage,Level"

arObjectID [47] = "ContactForm,mainPage,LocalPhone"

arObjectID [48] = "ContactForm,mainPage,LocateButton"

arObjectID [49] = "ContactForm,mainPage,Next"

arObjectID [50] = "ContactForm,mainPage,Next1"

arObjectID [51] = "ContactForm,mainPage,PersonalButton"

arObjectID [52] = "ContactForm,mainPage,PostalCode"

arObjectID [53] = "ContactForm,mainPage,Prior"

arObjectID [54] = "ContactForm,mainPage,Prior1"

arObjectID [55] = "ContactForm,mainPage,ReminderButton"

arObjectID [56] = "ContactForm,mainPage,State"

arObjectID [57] = "ContactForm,mainPage,TelephoneBitMap"

arObjectID [58] = "ContactForm,mainPage,UDF1text"

arObjectID [59] = "ContactForm,mainPage,UDF2text"

arObjectID [60] = "ContactForm,mainPage,UserDefined1"

arObjectID [61] = "ContactForm,mainPage,UserDefined2"

arObjectID [62] = "ContactTypesForm,thePage,CloseButton"

arObjectID [63] = "ContactTypesForm,thePage,HelpButton"

arObjectID [64] = "ContactTypesForm,thePage,NewButton"

arObjectID [65] = "ContactTypesForm,thePage,TelephoneBitMap"

arObjectID [66] = "DefaultForm,thePage,BirthdayAdvanceDays"

arObjectID [67] = "DefaultForm,thePage,CloseButton"

arObjectID [68] = "DefaultForm,thePage,DialPrefix"

arObjectID [69] = "DefaultForm,thePage,HelpButton"

arObjectID [70] = "DefaultForm,thePage,TelephoneBitMap"

arObjectID [71] = "FinancialForm,thePage,Amount"

arObjectID [72] = "FinancialForm,thePage,CloseButton"

arObjectID [73] = "FinancialForm,thePage,Company"

arObjectID [74] = "FinancialForm,thePage,ContactName"

arObjectID [75] = "FinancialForm,thePage,Financial"

arObjectID [76] = "FinancialForm,thePage,HelpButton"

arObjectID [77] = "FinancialForm,thePage,LocateButton"

arObjectID [78] = "FinancialForm,thePage,NewButton"

arObjectID [79] = "FinancialForm,thePage,ReportButton"

arObjectID [80] = "FinancialForm,thePage,TelephoneBitMap"

arObjectID [81] = "FinancialForm,thePage,thePage"

arObjectID [82] = "GradesForm,thePage,CloseButton"

arObjectID [83] = "GradesForm,thePage,Definition"

arObjectID [84] = "GradesForm,thePage,HelpButton"

arObjectID [85] = "GradesForm,thePage,ProspectGrade"

arObjectID [86] = "GradesForm,thePage,TelephoneBitMap"

arObjectID [87] = "NewActivityForm,thePage,ActionItem"

arObjectID [88] = "NewActivityForm,thePage,BeginButton"

arObjectID [89] = "NewActivityForm,thePage,CloseButton"

arObjectID [90] = "NewActivityForm,thePage,DialButton"

arObjectID [91] = "NewActivityForm,thePage,EndButton"

arObjectID [92] = "NewActivityForm,thePage,FollowupActionItem"

arObjectID [93] = "NewActivityForm,thePage,HelpButton"

arObjectID [94] = "NewActivityForm,thePage,TelephoneBitMap"

arObjectID [95] = "ReminderForm,Page1,ActionItem"

arObjectID [96] = "ReminderForm,Page1,ActivityButton"

arObjectID [97] = "ReminderForm,Page1,CalendarFrame"

arObjectID [98] = "ReminderForm,Page1,CalendarFrame"

arObjectID [99] = "ReminderForm,Page1,CloseButton"

arObjectID [100] = "ReminderForm,Page1,ContactName"

arObjectID [101] = "ReminderForm,Page1,CurrentDate"

arObjectID [102] = "ReminderForm,Page1,DeleteButton"

arObjectID [103] = "ReminderForm,Page1,FulfilledButton"

arObjectID [104] = "ReminderForm,Page1,HelpButton"

arObjectID [105] = "ReminderForm,Page1,MoveButton"

arObjectID [106] = "ReminderForm,Page1,NextMonthButton"

arObjectID [107] = "ReminderForm,Page1,NextYearButton"

arObjectID [108] = "ReminderForm,Page1,PriorMonthButton"

arObjectID [109] = "ReminderForm,Page1,PriorYearButton"

arObjectID [110] = "ReminderForm,Page1,TelephoneBitMap"

arObjectID [111] = "ReminderForm,Page1,TodayButton"

arObjectID [112] = "ReminderForm,Page2,page2ContactName"

arObjectID [113] = "ReminderForm,Page2,page2HelpButton"

arObjectID [114] = "ReminderForm,Page2,ReturnButton"

arObjectID [115] = "SearchForm,thePage,CancelButton"

arObjectID [116] = "SearchForm,thePage,desiredValue"

arObjectID [117] = "SearchForm,thePage,fieldList"

arObjectID [118] = "SearchForm,thePage,HelpButton"

arObjectID [119] = "SearchForm,thePage,OKButton"

arObjectID [120] = "SearchForm,thePage,TelephoneBitMap"

; This array contains context-sensitive instructions that

; display on the status line when the user points to an

; object

arMsgText [1] = ""

arMsgText [2] = "Close the form"

arMsgText [3] = ""

arMsgText [4] = "Display Help for the Contact Activity dialog box"

arMsgText [5] = "Locate specific activity records or choose a different contact"

arMsgText [6] = "Create a new activity"

arMsgText [7] = ""

arMsgText [8] = "Close the form"

arMsgText [9] = "Display Help for the Activity/Action Item dialog box"

arMsgText [10] = "Create a new activity"

arMsgText [11] = ""

arMsgText [12] = ""

arMsgText [13] = "Close the form"

arMsgText [14] = "Click a company name to view that record"

arMsgText [15] = "Display Help for the Company Information form"

arMsgText [16] = "Double-Click a contact name to view that record"

arMsgText [17] = "Locate a company by name"

arMsgText [18] = ""

arMsgText [19] = ""

arMsgText [20] = ""

arMsgText [21] = ""

arMsgText [22] = "Close the form"

arMsgText [23] = "Display Help for the Company List dialog box"

arMsgText [24] = "Double-click a company or select it and press <Enter>"

arMsgText [25] = "Add a new company"

arMsgText [26] = ""

arMsgText [27] = ""

arMsgText [28] = "Return to the Contact Profile form"

arMsgText [29] = ""

arMsgText [30] = "Display Help for the Contact Profile form"

arMsgText [31] = "List all activity records for the contact"

arMsgText [32] = ""

arMsgText [33] = ""

arMsgText [34] = ""

arMsgText [35] = "Double-click this field to view company information"

arMsgText [36] = "View Company Information form"

arMsgText [37] = ""

arMsgText [38] = ""

arMsgText [39] = "Last record"

arMsgText [40] = "Exit application"

arMsgText [41] = "View expenses and projected income for the contact"

arMsgText [42] = ""

arMsgText [43] = "Display Help for the Contact Profile form"

arMsgText [44] = "First Record"

arMsgText [45] = ""

arMsgText [46] = ""

arMsgText [47] = ""

arMsgText [48] = "Locate a contact by name, company or other information"

arMsgText [49] = "Next record"

arMsgText [50] = "Next record set"

arMsgText [51] = "View personal information and comments for the contact"

arMsgText [52] = ""

arMsgText [53] = "Previous record"

arMsgText [54] = "Previous record set"

arMsgText [55] = "Display a calendar of follow-up action items"

arMsgText [56] = ""

arMsgText [57] = ""

arMsgText [58] = "Double-click this label to change it"

arMsgText [59] = "Double-click this label to change it"

arMsgText [60] = ""

arMsgText [61] = ""

arMsgText [62] = "Close the form"

arMsgText [63] = "Display Help for the Contact Types dialog box"

arMsgText [64] = "Create a new contact type"

arMsgText [65] = ""

arMsgText [66] = ""

arMsgText [67] = "Close the form"

arMsgText [68] = ""

arMsgText [69] = "Display Help for the Defaults dialog box"

arMsgText [70] = ""

arMsgText [71] = ""

arMsgText [72] = "Close the form"

arMsgText [73] = ""

arMsgText [74] = ""

arMsgText [75] = "Select expense or revenue view for this activity"

arMsgText [76] = "Display Help for the Financial dialog box"

arMsgText [77] = "Locate a transaction in the list"

arMsgText [78] = "Create a new activity"

arMsgText [79] = "Print report"

arMsgText [80] = ""

arMsgText [81] = ""

arMsgText [82] = "Close the form"

arMsgText [83] = ""

arMsgText [84] = "Display Help for the Prospect Grades dialog box"

arMsgText [85] = ""

arMsgText [86] = ""

arMsgText [87] = ""

arMsgText [88] = "Set the Begin Time value without dialing the modem"

arMsgText [89] = "Close the form"

arMsgText [90] = "Dial the contact's phone and set the Begin Time value"

arMsgText [91] = "Hangup the phone and set the End Time value"

arMsgText [92] = ""

arMsgText [93] = "Display Help for the New Activity dialog box"

arMsgText [94] = ""

arMsgText [95] = "Double-click for more information"

arMsgText [96] = "List activity records for the contact shown below"

arMsgText [97] = ""

arMsgText [98] = ""

arMsgText [99] = "Close the form"

arMsgText [100] = ""

arMsgText [101] = ""

arMsgText [102] = ""

arMsgText [103] = "Check this if you've already followed up on the item"

arMsgText [104] = "Display Help for the Reminder dialog box"

arMsgText [105] = ""

arMsgText [106] = "Change to next month"

arMsgText [107] = "Change to next month"

arMsgText [108] = "Change to prior month"

arMsgText [109] = "Change to prior month"

arMsgText [110] = ""

arMsgText [111] = "Return the calendar to today's date"

arMsgText [112] = ""

arMsgText [113] = "Display Help for the Reminder dialog box"

arMsgText [114] = "Return to the Reminder dialog box"

arMsgText [115] = "Cancel search"

arMsgText [116] = ""

arMsgText [117] = ""

arMsgText [118] = "Display Help for the Search dialog box"

arMsgText [119] = "Search the selected field for a value or criterion"

arMsgText [120] = ""

endmethod

objMsg

Called by the mouseEnter method of all Connections forms. It displays a message (retrieved from arMsgText) describing the control the user is pointing to.

; This method is called by the mouseEnter method of all

; Connections forms. It displays context sensitive

; information about the object the user is pointing to with

; the mouse. ObjectID is string containing the form, page,

; and name of the object, separated by commas.

method objMsg(ObjectID String)

; The information to display is found by searching

; arObjectID for the string stored in ObjectID.

; The index of the string in arObjectID is used

; to find the appropriate information in arMsgText

if arObjectID.indexof(ObjectID) <> 0 then

message(arMsgText[arObjectID.indexof(ObjectID)])

endif

endmethod

pageNameof

Called by the mouseEnter and mouseRightUp methods of all Connections forms. It takes the object name stored in ui and retrieves its page name.

; This method is used by the mouseEnter and mouseRightUp

; methods to find the page name of the object the user is

; pointing to

method pageNameof(ui uiObject) string

var

s string

endvar

; This while statement works its way up the container

; hierarchy, associating ui, a UIObject variable, with

; the container of the current object until the object

; is a page or the object has no container

while ui.Class <> "Page" AND ui.ContainerName <> ""

   ui.attach(ui.ContainerName)

endWhile

if ui.class = "Page" then

; If the page was found, return its name

s = ui.name

else

; Otherwise, return an empty string

s = ""

endif

return s

endmethod

createObjMenu

Called by the mouseRightUp method of all Connections forms. It displays a popup menu letting the user display Connections Programmer's Help (the topic to display is identified by searching arContextID).

; This method is called by the mouseRightUp method of all

; Connections forms when the user right-clicks an object

; It displays a popup menu that lets the user display

; programmer's Help or a lookup value list (if available)

method createObjMenu(var formName Form, pageName String, uio UIObject)

var

p PopUpMenu

choice String

frm	form

tc	tCursor

endvar

; Locate the record in MSGHELP.DB that corresponds to the

; object the user right-clicked

if not objHelpTc.Locate("Form Name", formName.Name, "Page Name", pageName, "Object ID", uio.name) then

; If the object wasn't found in the table, move to the

; record for TelephoneBitmap, which contains the context

; id for the main form's Help

objHelpTc.Locate("Form Name", formName.Name, "Page Name", pageName, "Object ID", "TelephoneBitMap")

endif

; Create the popup menu

p.empty()

p.addStaticText("Object Properties")

p.addSeparator()

p.addText("Code Help")

; If the object uses a lookup table, add a Lookup List

; command to the menu that displays the lookup table

switch

case formName.name = "NewActivityForm":

; ActionItem and FollowupActionItem are

; in NEWACTIV.FSL

if (uio.name = "FollowupActionItem" AND

not isblank(formName.FollowUpDate)) OR

uio.name = "ActionItem" then

p.addText("Lookup List")

endif

case formName.name = "ContactForm":

; Company, Grade and ContactType are

; in CONTACTS.FSL

if uio.name = "Company" OR

uio.name = "Grade" OR

uio.name = "ContactType" then

p.addText("Lookup List")

endif

endswitch

; Display the popup menu and store the command chosen

; by the user in choice

choice=p.Show()

; Process the menu selection

switch

case choice = "Code Help" :

; Show programmer's Help for the object using

; the context ID stored in MSGHELP.DB

helpShowContext(proghelp, objHelptc."Context ID")

case choice = "Lookup List" :

; Display the lookup values available to the

; object. Since each lookup list is slightly

; different, a different method is called depending

; on the object

switch

case uio.name = "ActionItem" :

formName.ActionItem.createLookup()

case uio.name = "FollowupActionItem":

formName.FollowupActionItem.followCreateLookup()

case uio.name = "Company":

formName.Company.companyLookup()

case uio.name = "Grade":

formName.Grade.gradeLookup()

case uio.name = "ContactType":

formName.ContactType.contactTypeLookup()

endswitch

endswitch

endmethod


See Also

MENUS.LSL

Libaries (Paradox Help)


Methods

Var

Const

open

objMsg

pageNameof

createObjMenu


 START.SSL

See Also

START.SSL lets the user start Connections.

run

Called when the user runs START.SSL. It changes the title of the window to Connections, loads ContactForm, and hides the Toolbar.

; This method starts Connections

method run(var eventInfo Event)

var

projForm,formToOpen form

app	Application

lib	Library

tcSystem	tCursor

tblSystem	string

endVar

; Set the Paradox window's title

app.setTitle("Connections")

if tcSystem.open("System") then

; If SYSTEM.DB can be opened, place it in Edit mode

tcSystem.edit()

if tcSystem.isempty() then

; If SYSTEM.DB is empty, display an error message

; and close the application

msgStop("Problem","The system table is empty. Please reinstall Connections.")

return

endif

; Set OkToOpen field to Y

tcSystem."OkToOpen" = "Y"

; OkToOpen ensures that the application can only

; be started from START.SSL or CONTACTS.FSL

; Close SYSTEM.DB and hide the Paradox Toolbar

tcSystem.close()

hideToolBar()

if projectViewerIsOpen() then

; If the Project View is open, close it

projectViewerClose()

endif

; Display the Contact Profile Form

formToOpen.open("contacts")

; If SYSTEM.DB can't be opened

else

; Since the user is probably starting

; the application from the wrong directory,

; advise them of this and close the script

msgStop("Sorry!","Your working directory is "+workingDir()+".  Please change your working directory to where Connections is located.")

close()

endif

endmethod


See Also

ContactForm (CONTACTS.FSL)