Contents
MAST Programmer's Help Contents

This table of contents lists every form and page that has code attached to it in the MAST application. It also includes the library, MASTLIB.LSL, which is used by the application. Click a topic to display its associated material.

ABTMAST.FSL

ABTMAST Form

DIVEBIO.FSL

DIVEBIO Form

DIVEBIO.marineLifePage

DIVEPLAN.FSL

DIVEPLAN Form

DIVEPLAN.mainPage

DIVEPLAN.resultsPage

DIVESITE.FSL

DIVESITE Form

DIVESITE.destsPage

DIVESITE.sitesPage

DIVEWRCK.FSL

DIVEWRCK Form

DIVEWRCK.wrecksPage

LOOKLIST.FSL

lookList Form

MASTORD.FSL

order Form

order.orderPg

order.orderPg2

VIDEOBAR.FSL

videoBar Form

MASTLIB.LSL

MASTLIB.LSL Library


DIVEWRCK

Methods

mouseEnter

mouseExit

mouseRightUp

keyPhysical

menuAction

Procedures

customMenu

Var, Const, and Uses windows

Var window

Const window

Uses window

Methods and procedures from MASTLIB.LSL

clearPageValues

createObjMenu

mastObjMsg

setPageValues

pageNameOf

returnisCalled

setisCalledTrue

setisCalledFalse


diveWrck.mouseEnter
mouseEnter

diveWrck.mouseEnter

A form-level messaging routine that displays names of objects (excluding Text and Bitmap classes) in the status bar depending on mouse cursor position. Uses the Mastlib library method, mastLib.mastObjMsg.

method mouseEnter(var eventInfo MouseEvent)

; Form level messaging system that evaluates each object as mouse enters it,

; and looks up the appropriate message from MsgHelp.db under control

; of mastObjMsg library method.

; prevent repeat method calls

if eventInfo.isPreFilter() then

eventInfo.getTarget(Uio)  ; what is the object?

  	uioName = uio.Name

   ; exclude text and bitmap objects, and noise names

if uio.name <> self.name AND  ; eliminate message if form

(uio.class = "Field" OR uio.class = "Multirecord" OR uio.class = "Button")

     then

   mastLib.mastObjMsg(formName.name, mastlib.pageNameOf(uio), uioName)

endif

endif

endmethod


diveWrck.mouseExit
mouseExit

diveWrck.mouseExit

Clears the mouseEnter status bar message when the mouse cursor leaves an object's region.

method mouseExit(var eventInfo MouseEvent)

; prevent repeat MouseExits

if eventInfo.isPreFilter() then

eventInfo.getTarget(uio)  ; what is the object?

if uio.class <> "Text" and uio.class <> "Bitmap" then

   message("")

endif

endif

endmethod


diveWrck.mouseRightUp
mouseRightUp

diveWrck.mouseRightUp

Calls the Mastlib library createObjMenu method when the right mouse button is released. This creates the Code Help menu. If you click on a Text or Bitmap object, the Help menu for the containing object appears because the objects have no code attached.

method mouseRightUp(var eventInfo MouseEvent)

; Calls a mastlib.createObjMenu() method that displays an object

; level help menu.

; prevent repeat method calls

if eventInfo.isPreFilter() then

   eventInfo.getTarget(uio) ; what is the object?

   ;if object not diveFlagBox bitmap,

   ;find ui container if object text or bitmap

   if uio.name <> "diveFlagBox" and uio.name <> "diveFlagBox1" then

     	while

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

      	uio.attach(uio.ContainerName)

     	endWhile

   endif

mastLib.createObjMenu(formName, mastlib.pageNameOf(uio), uio)

endif

endmethod


diveWrck.keyPhysical
keyPhysical

diveWrck.keyPhysical

Intercepts specified keystrokes and then performs an appropriate pushButton or moveTo call. For example, Alt+A calls acceptBttn.pushButton, and Alt+G calls passengerBttn.moveTo. F1 is also intercepted to call helpShowContext.

method keyPhysical(var eventInfo KeyEvent)

var

  theKey String

endvar

theKey = eventInfo.vChar()  ; tell me what key was pressed

if eventInfo.isPreFilter() then

if eventInfo.isAltKeyDown() then

switch

case theKey = "A" or theKey = "a" : disableDefault

acceptBttn.pushbutton()

case theKey = "C" or theKey = "c" : disableDefault

cancelBttn.pushbutton()

case theKey = "D" or theKey = "d" : disableDefault

intactBttn.moveto()

case theKey = "E" or theKey = "e" : disableDefault

clearMyQueryBttn.pushbutton()

case theKey = "G" or theKey = "g" : disableDefault

passengerBttn.moveto()

case theKey = "I" or theKey = "i" : disableDefault

treasureBttn.moveto()

case theKey = "S" or theKey = "s" : disableDefault

wreckFld.moveto()

otherwise: doDefault

     endswitch

   else

  switch

   	case theKey = "VK_F1" : disableDefault

helpShowContext(helpfile, 20005)

   	otherwise : doDefault

 endSwitch

  endif

endif

endmethod


diveWrck.menuAction
menuAction

diveWrck.menuAction

Tests the string returned by a diveWrck.customMenu selection and calls the appropriate method. For example, choosing the Cancel item calls cancelBttn.pushButton. Choosing Next calls active.action(DataNextRecord). An ampersand (&) in the menu item makes the following key a hot key. For example, &Cancel calls cancelBttn.pushButton when Alt+C is pressed.

method menuAction(var eventInfo MenuEvent)

var

  mc String

  aboutFm Form

endvar

if eventInfo.isPrefilter()

  then

doDefault

else

; what menu option has been chosen?

mc = eventInfo.menuChoice()

switch

  	 case mc = "&Accept"          : acceptBttn.pushbutton()

    case mc = "&Cancel"          : cancelBttn.pushbutton()

 case mc = "Cl&ear"           : clearMyQueryBttn.pushButton()

    case mc = "&First\tCtrl+F11" : myBar.firstButton.pushButton()

    case mc = "&Last\tCtrl+F12"  : myBar.lastButton.pushButton()

    case mc = "&Next\tF12"       : myBar.nextButton.pushButton()

    case mc = "&Previous\tF11"   : myBar.priorButton.pushButton()

    case mc = "&Contents"        : helpShowIndex(helpFile)

    case mc = "&Using Help"      : helpOnHelp()

case mc = "&About MAST"      : mastLib.setIsCalledTrue()

 ; block user from closing form with System menu

 case eventInfo.ID() = MenuControlClose :

eventInfo.setErrorCode(1)

myBar.hide()

formReturn(True)

endSwitch

endIf

endmethod


diveWrck.customMenu
customMenu

diveWrck.customMenu

Custom procedure attached to the form. Called by diveWrck.wrecksPage.open to display the Wrecks selection menu.

proc customMenu()

Var

 mainMenu Menu

 dropMenu1, dropMenu2, dropMenu3 popUpMenu

endVar

; this custom proc displays a custom menu

dropMenu1.addText("&Accept")

dropMenu1.addText("&Cancel")

dropMenu1.addText("Cl&ear")

mainMenu.addPopUp("Se&lections", dropMenu1)

dropMenu2.addtext("&First\tCtrl+F11")

dropMenu2.addtext("&Last\tCtrl+F12")

dropMenu2.addtext("&Next\tF12")

dropMenu2.addtext("&Previous\tF11")

mainMenu.addPopUp("Rec&ord", dropMenu2)

dropMenu3.addText("&Contents")

dropMenu3.addText("&Using Help")

mainMenu.addPopUp("&Help", dropMenu3)

mainMenu.show()

endproc


diveWrck.Var
diveWrck Var Window

Variables declared in a form's Var window are visible to all objects in the form.

Var

uioName String

formName, myBar Form

wasCalled Logical

uio UIObject

mastLib Library

endVar


diveWrck.Const
diveWrck Const Window

Constants declared in a form's Const window are visible to all objects in the form.

Const

helpFile = ":WORK:Mastuser.hlp"

endConst


diveWrck.Uses
diveWrck Uses Window

The Uses window declares external routines used by this form. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPal

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

mastObjMsg(formText String, pageName String, objID String)

setPageValues(formName String, pageName String) Logical

pageNameOf(ui UIObject) String

returnIsCalled() Logical

setIsCalledTrue()

setIsCalledFalse()

enduses


DIVEWRCK.wrecksPage

Methods

open

close

setFocus

clearPageObjects

Uses window

Uses


diveWrck.wrecksPage.open
open

diveWrck.wrecksPage.open

This form must be called from DIVEPLAN.FSL; it cannot be run directly. Opens the MASTLIB.LSL library if found in the WORK directory. Opens a custom SpeedBar (VIDEOBAR.FSL) and positions it in the upper left corner of screen. Calls the customMenu procedure to display the Wrecks selection menu.

method open(var eventInfo Event)

; This open method will not open Divewrck.fsl unless it

; has been called from Diveplan.fsl. The variable isCalled in

; Mastlib.lsl has to be set to True for Divewrck to be opened.

; isCalled is set to True by mastlib.setIsCalledTrue() which is

; invoked by the pushbutton method on Diveplan.

delayScreenUpdates(Yes)

;open library (make sure that it is in the WORK directory)

if not mastLib.Open("MastLib", GlobalToDesktop) then

  msgStop("Failure", "Mastlib could not be opened.")

  formReturn(false)

else

;  wasCalled = mastLib.returnIsCalled()

  if wasCalled = False then

     msgStop("Stop!", "You cannot open this form directly. It must be opened from Diveplan.fsl.")

     close()

  else

     ;display custom menu

     customMenu()

     formName.attach()

  endif

endif

delayScreenUpdates(No)

endmethod


diveWrck.wrecksPage.close
close

diveWrck.wrecksPage.close

Closes the VIDEOBAR.FSL SpeedBar.

method close(var eventInfo Event)

   ; Videbar is open

   if mastlib.isVCROpen()

     then

      ; close videobar

      myBar.close()

      mastlib.VCRisClosed()

   endif

endmethod


diveWrck.wrecksPage.setFocus
setFocus

diveWrck.wrecksPage.setFocus

Displays the VIDEOBAR.FSL SpeedBar, opening it first, if necessary.

method setFocus(var eventInfo Event)

var

   x, y, w, h LongInt

endvar

; videoBar is already open

if MastLib.isVCROpen()

  then

if myBar.isAssigned()

  then

; Videobar open -- attach it to this form

myBar.bringToTop()

myBar.setCallFormName(getTitle(), 5500, 400)

else

; attach to Videobar

myBar.attach(mastLib.vcrName())

myBar.bringToTop()

myBar.setCallFormName(getTitle(), 5500, 400)

endif

else

; Videobar not open -- open it

myBar.Open("Videobar.fsl")

myBar.setCallFormName(getTitle(), 5500, 400)

mastLib.VCRisOpen()

endif

endmethod


DIVEWRCK.wrecksPage.clearPageObjects
clearPageObjects

DIVEWRCK.wrecksPage.clearPageObjects

Clears all field objects on the page by setting their values to the empty string ("").

method clearPageObjects(pageName String) Logical

; This custom methods clears all objects on that page that have been

; selected.

var

pageObjTc TCursor

   fieldObj UIObject

endVar

; list all the selectable fields on the page

mastLib.listPageObjects(formName.name, pageName)

; open tcursor on list of selectable fields

pageObjTc.open("Objlist.db")

; clear all selected fields

scan pageObjTc :

   fieldObj.attach(pageObjTc."Object Path")

if fieldObj  <> ""

 	  then

fieldObj = ""

endIf

endScan

; clear form.page values in Qbeval.db

mastLib.clearPageValues(formName.Name, pageName)

RETURN TRUE

endmethod


DIVEWRCK.wrecksPage.Uses
DIVEWRCK.wrecksPage Uses Window

The Uses window declares external routines used by this form. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPal

clearPageValues(formText String, pageName String)

setCallFormName(const CallerTitle String, xPos LongInt, yPos LongInt)

isVCROpen() Logical

VCRisOpen()

VCRisClosed()

vcrName() String

endUses


DIVEWRCK.wrecksPage.Ship_Name.newValue
newValue

DIVEWRCK.wrecksPage.Ship_Name.newValue

Resets the value of the Ship_Name field object when a new ship has been selected in the Shipwreck drop-down list.

method newValue(var eventInfo Event)

; the wreckFld drop-down needs to updated to reflect

; new Ship Name field value

if self <> wreckFld then

   wreckFld = self

endif

endmethod


DIVEWRCK.wrecksPage.wreckFld

Methods

changeValue

newValue


DIVEWRCK.wrecksPage.wreckFld.changeValue
changeValue

DIVEWRCK.wrecksPage.wreckFld.changeValue

Checks to see if the value of this field object matches the value of Ship_Name . If not, the two fields are resynchronized.

method changeValue(var eventInfo ValueEvent)

var

  newValStr String

  shipTc TCursor

endVar

;what is the new value?

newValStr = eventInfo.newValue()

;if the new value is not the same as the Ship Name field

;and new value is not blank, resync fields

if newValStr <> Ship_Name and newValStr <> ""

  then

;resync fields

   shipTc.attach(Ship_Name)

   shipTc.Locate("Ship Name", newValStr)

   Ship_Name.moveToRecord(shipTc)

endif

endmethod


DIVEWRCK.wrecksPage.wreckFld.newValue
newValue

DIVEWRCK.wrecksPage.wreckFld.newValue

Posts the new value of this field object to trigger its built-in changeValue method.

method newValue(var eventInfo Event)

; commit the field if the user has changed it

; in order to cause a changeValue

if eventInfo.reason() = EditValue

  then

   self.action(EditCommitField)

endif

endmethod


DIVEWRCK.wrecksPage.WreckList

METHODS

open

pushButton


DIVEWRCK.wrecksPage.WreckList.open
open

DIVEWRCK.wrecksPage.WreckList.open

Fills this list with entries from the Ship_Name fields of SHIPWRCK.DB.

method open(var eventInfo Event)

self.dataSource = "[Shipwrck.Ship Name]"

endmethod


DIVEWRCK.wrecksPage.WreckList.pushButton
pushButton

DIVEWRCK.wrecksPage.WreckList.pushButton

Commits the value selected from WreckList to WreckFld.

method pushButton(var eventInfo Event)

wreckFld.action(EditCommitField)

endmethod


DIVEWRCK.wrecksPage.acceptBttn.pushButton
pushButton

DIVEWRCK.wrecksPage.acceptBttn.pushButton

Uses Mastlib.setPageValues to post the selected shipwreck criteria and return to DIVEPLAN.FSL. Also hides the custom SpeedBar.

 method pushButton(var eventInfo Event)

eventInfo.getTarget(uio)

; assign page values to Qbeval.db

mastLib.setPageValues(formName.name, mastlib.pageNameof(uio))

; hide Videobar

myBar.hide()

formReturn(True)

endmethod


DIVEWRCK.wrecksPage.helpButton.pushButton
pushButton

DIVEWRCK.wrecksPage.helpButton.pushButton

Displays Help by calling helpShowContext. The value 20005 is a context ID for an item in the help file. In a larger application, it's a good idea to define constants for such values.

method pushButton(var eventInfo Event)

helpShowContext(helpfile, 20005)

endmethod


DIVEWRCK.wrecksPage.cancelBttn.pushButton
pushButton

DIVEWRCK.wrecksPage.cancelBttn.pushButton

Hides the custom SpeedBar and returns to DIVEPLAN.FSL with no further processing.

method pushButton(var eventInfo Event)

; hide Videobar

myBar.hide()

;return to divePlan without any processing

formReturn(True)

endmethod


DIVEWRCK.wrecksPage.clearMyQueryBttn.pushButton
pushButton

DIVEWRCK.wrecksPage.clearMyQueryBttn.pushButton

Clears current selected shipwreck values using MastLib.clearPageValues. Called by choosing the Clear Query button.

method pushButton(var eventInfo Event)

; what is the object?

eventInfo.getTarget(uio) ; what is the object?

; clear field objects and also Qbeval.db values

clearPageObjects(Mastlib.pageNameOf(Uio))

endmethod


DIVEBIO

Methods

mouseEnter

mouseExit

mouseRightUp

keyPhysical

menuAction

Procedures

customMenu

Var, Const, and Uses windows

Var window

Const window

Uses window

Methods and procedures from MASTLIB.LSL

clearPageValues

createObjMenu

mastObjMsg

setPageValues

pageNameOf

returnisCalled

setisCalledTrue

setisCalledFalse


DIVEBIO.mouseEnter
mouseEnter

DIVEBIO.mouseEnter

A form-level messaging routine that displays the names of objects (excluding Text and Bitmap classes) in the status bar depending on mouse cursor position. Uses the Mastlib library method masLib.mastObjMsg.

method mouseEnter(var eventInfo MouseEvent)

; prevent repeat mouseEnter calls

if eventInfo.isPreFilter() then

eventInfo.getTarget(uio)  ; what is the object?

  	uioName = uio.Name

   ; exclude text and bitmap objects, and noise names

if uio.name <> self.name AND  ; eliminate message if form

(uio.class = "Field" OR uio.class = "Multirecord" OR uio.class = "Button")

     then

   mastLib.mastObjMsg(formName.name, mastlib.pageNameOf(uio), uioName)

endif

endif

endmethod


DIVEBIO.mouseExit
mouseExit

DIVEBIO.mouseExit

Clears the mouseEnter status bar message when the mouse cursor leaves an object's region.

method mouseExit(var eventInfo MouseEvent)

; prevent repeat mouseExit calls

if eventInfo.isPreFilter() then

eventInfo.getTarget(uio)  ; what is the object?

if uio.class <> "Text" and uio.class <> "Bitmap" then

   message("")

endif

endif

endmethod


DIVEBIO.mouseRightUp
mouseRightUp

DIVEBIO.mouseRightUp

Calls the Mastlib library createObjMenu method when the right mouse button is released. This creates the Code Help menu. If you click on a Text or Bitmap object, the Help menu for the containing object appears because the objects have no code attached.

method mouseRightUp(var eventInfo MouseEvent)

; Calls a mastlib.createObjMenu() method that displays an object

; level help menu.

; prevent repeat method calls

if eventInfo.isPreFilter() then

   eventInfo.getTarget(uio) ; what is the object?

   ;if object not diveFlagBox bitmap,

   ;find ui container if object text or bitmap

   if uio.name <> "diveFlagBox" and uio.name <> "diveFlagBox1" then

    	while

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

      	uio.attach(uio.ContainerName)

     	endWhile

   endif

mastLib.createObjMenu(formName, mastlib.pageNameOf(uio), uio)

endif

endmethod


DIVEBIO.keyPhysical
keyPhysical

DIVEBIO.keyPhysical

Intercepts specified keystrokes and then performs an appropriate pushButton or moveTo call (or invokes the help system, if you press F1). For example, Alt+A calls acceptBttn.pushButton.

method keyPhysical(var eventInfo KeyEvent)

var

  theKey String

endvar

theKey = eventInfo.vChar()  ; tell me what key was pressed

if eventInfo.isPreFilter() then

if eventInfo.isAltKeyDown() then

switch

case theKey = "A" or theKey = "a" : disableDefault

acceptBttn.pushbutton()

case theKey = "C" or theKey = "c" : disableDefault

cancelBttn.pushbutton()

case theKey = "E" or theKey = "e" : disableDefault

clearMyQueryBttn.pushbutton()

case theKey = "M" or theKey = "m" : disableDefault

commonFld.moveto()

case theKey = "S" or theKey = "s" : disableDefault

latinFld.moveto()

otherwise: doDefault

endswitch

else

switch

case theKey = "VK_F1" : disableDefault

helpShowContext(helpfile, 20002)

otherwise : doDefault

endSwitch

endif

endif

endmethod


DIVEBIO.menuAction
menuAction

DIVEBIO.menuAction

Tests the string returned by a menu selection and calls the appropriate method. For example, choosing the Cancel item calls cancelBttn.pushButton. Choosing Next calls myBar.nextButton.pushButton(). An ampersand (&) in the menu item makes the following key a hot key. For example, &Cancel calls cancelBttn.pushButton when Alt+C is pressed.

method menuAction(var eventInfo MenuEvent)

var

 mc String

 aboutFM Form

endvar

if eventInfo.isPrefilter() then

doDefault

else

; what menu option has been chosen?

mc = eventInfo.menuChoice()

switch

case mc = "&Accept"          : acceptBttn.pushbutton()

case mc = "&Cancel"          : cancelBttn.pushbutton()

case mc = "Cl&ear"           : clearMyQueryBttn.moveto()

case mc = "&First\tCtrl+F11" : myBar.firstButton.pushButton()

case mc = "&Last\tCtrl+F12"  : myBar.lastButton.pushButton()

case mc = "&Next\tF12"       : myBar.nextButton.pushButton()

case mc = "&Previous\tF11"   : myBar.priorButton.pushButton()

case mc = "&Contents"        : helpShowContext(helpFile, 20002)

case mc = "&Using Help"      : helpOnHelp()

case mc = "&About MAST"      : mastLib.setIsCalledTrue()

; if aboutFm.open("Abtmast.fsl") then

; aboutFm.Wait()  ;modal dialog opened

; aboutFm.Close() ;now close it

; mastLib.setIscalledFalse()

; endif

  ; block user from closing form with System menu

case eventInfo.ID() = MenuControlClose :

eventInfo.setErrorCode(1)

myBar.hide()

formReturn(True)

endswitch

endif

endmethod


DIVEBIO.customMenu
customMenu

DIVEBIO.customMenu

Called by diveBio.marineLifePage.open to build and display the diveBio selection menu.

proc customMenu()

Var

 MainMenu Menu

 dropMenu1, dropMenu2, dropMenu3 popUpMenu

endVar

; this custom proc displays a custom menu

dropMenu1.addText("&Accept")

dropMenu1.addText("&Cancel")

dropMenu1.addText("Cl&ear")

mainMenu.addPopUp("Se&lections", dropMenu1)

dropMenu2.addtext("&First\tCtrl+F11")

dropMenu2.addtext("&Last\tCtrl+F12")

dropMenu2.addtext("&Next\tF12")

dropMenu2.addtext("&Previous\tF11")

mainMenu.addPopUp("Rec&ord", dropMenu2)

dropMenu3.addText("&Contents")

dropMenu3.addText("&Using Help")

dropMenu3.addText("&About MAST")

mainMenu.addPopUp("&Help", dropMenu3)

mainMenu.show()

endproc


DIVEBIO.Var
DIVEBIO Var Window

Variables declared in the form's Var window are visible to all objects in the form.

Var

uioName String

formName, myBar Form

wasCalled Logical

uio UIObject

choice, newVal String

mastLib Library

fishTc TCursor

endVar


DIVEBIO.Const
DIVEBIO Const Window

Constants declared in the form's Const window are visible to all objects in the form.

Const

helpFile = ":work:mastuser.hlp"

  ; path to Help file must be hardcoded (or file must be on path)

endConst


DIVEBIO.Uses
DIVEBIO Uses Window

The Uses window declares external routines used by this form. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPal

clearPageValues(formName String, pageName String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

mastObjMsg(formName String, pageName String, objID String)

setPageValues(formName String, pageName String) Logical

pageNameOf(ui UIObject) String

returnIsCalled() Logical

setIsCalledTrue()

setIsCalledFalse()

enduses


DIVEBIO.marineLifePage

METHODS

open

close

setFocus

Uses window

Uses window


DIVEBIO.marineLifePage.open
open

DIVEBIO.marineLifePage.open

This form must be called from DIVEPLAN.FSL; it cannot be called directly. Opens the MASTLIB.LSL library if found in the WORK directory. Opens a custom SpeedBar (VIDEOBAR.FSL) and positions it in the topright corner of screen. Calls the customMenu procedure to display the diveBio selection menu.

method open(var eventInfo Event)

; This open method will not open Divebio.fsl unless it

; has been called from Diveplan.fsl. The variable isCalled in

; Mastlib.lsl has to be set to True for Divebio to be opened.

; isCalled is set to True by mastlib.setIsCalledTrue() which is

; invoked by the pushbutton method on Diveplan.

delayScreenUpdates(Yes)

;open library (make sure that it is in the WORK directory)

if not mastLib.Open("MastLib", GlobalToDesktop) then

  msgStop("Failure", "Mastlib could not be opened.")

  formReturn(false)

else

  wasCalled = mastLib.returnIsCalled()

  if wasCalled = False then

    msgStop("Stop!", "You cannot open this form directly. It must be opened from Diveplan.fsl.")

    close()

  else

 ;display custom menu

 customMenu()

 formName.attach()

  endif

endif

delayScreenUpdates(No)

endmethod


DIVEBIO.marineLifePage.close
close

DIVEBIO.marineLifePage.close

Closes the attached VIDEOBAR.FSL SpeedBar.

method close(var eventInfo Event)

  ; Videbar is open

  if mastlib.isVCROpen()

 then

     ; close videbar

  myBar.close()

  mastlib.VCRisClosed()

  endif

endmethod


diveBio.marineLifePage.setFocus
setFocus

DIVEBIO.marineLifePage.setFocus

Displays the VIDEOBAR.FSL SpeedBar, opening it first, if necessary.

method setFocus(var eventInfo Event)

var

x, y, w, h LongInt

endvar

; videoBar is already open

if MastLib.isVCROpen()

  then

if myBar.isAssigned()

  then

; Videobar open -- attach it to this form

myBar.bringToTop()

myBar.setCallFormName(getTitle(), 5500, 1050)

else

; attach to Videbar

myBar.attach(mastlib.vcrName())

myBar.bringToTop()

myBar.setCallFormName(getTitle(), 5500, 1050)

endif

else

; Videobar not open -- open it

myBar.Open("Videobar.fsl")

myBar.setCallFormName(getTitle(), 5500, 1050)

mastLib.VCRisOpen()

endif

endmethod


diveBio.marineLifePage.Uses
DIVEBIO.marineLifePage Uses Window

The Uses window declares external routines used by this form. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPal

VCRisOpen()

VCRisClosed()

isVCROpen() Logical

vcrName() String

listPageObjects(formName String, pageName String) Logical

endUses


DIVEBIO.marineLifePage.commonFld

METHODS

newValue

changeValue


DIVEBIO.marineLifePage.commonFld.newValue
newValue

DIVEBIO.marineLifePage.commonFld.newValue

Commits the Common Name value of the selected species to the commonFld field object. This value is used later by DIVEPLAN.destqbe to find matching sites.

method newValue(var eventInfo Event)

;Ok, let's commit the field if the user has changed it

if eventInfo.reason() = EditValue then

   self.action(EditCommitField)

endif

endmethod


DIVEBIO.marineLifePage.commonFld.changeValue
changeValue

DIVEBIO.marineLifePage.commonFld.changeValue

Checks to see if the selected Species Common Name field has changed. If so, all field values are reset.

method changeValue(var eventInfo ValueEvent)

; what is the new value?

newVal = eventInfo.newValue()

; if the new value is not the same as the Common name field

if newVal <> biolife.fishMRO.Common_Name then

;resync fields

   fishTc.attach(biolife.fishMRO)

   fishTc.Locate("Common Name", newVal)

   biolife.fishMRO.moveToRecord(fishTc)

   latinFld = Species_Name

endif

endmethod


DIVEBIO.marineLifePage.commonList.open
open

DIVEBIO.marineLifePage.commonList.open

Fills the list with entries from the Common_Name field of BIOLIFE.DB.

method open(var eventInfo Event)

;fill list with Common Name field of Biolife.db

self.dataSource = "[Biolife.Common Name]"

endmethod


DIVEBIO.marineLifePage.latinFld

Methods

newValue

changeValue


DIVEBIO.marineLifePage.latinFld.newValue
newValue

DIVEBIO.marineLifePage.latinFld.newValue

Commits the Latin Name value of the selected Species to the latinFld field object. This value is used later by DIVEPLAN.destqbe to find matching sites.

method newValue(var eventInfo Event)

;Ok, let's commit the field if the user has changed it

if eventInfo.reason() = EditValue then

   self.action(EditCommitField)

endif

endmethod


DIVEBIO.marineLifePage.latinFld.changeValue
changeValue

DIVEBIO.marineLifePage.latinFld.changeValue

Checks to see if the selected Species Latin Name field has changed. If so, the selected Common Name field is set to match and displayed.

method changeValue(var eventInfo ValueEvent)

;what is the new value?

newVal = eventInfo.newValue()

;if the new value is not the same as the Species Name field

if newVal <> Species_Name then

;resync fields

   fishTc.attach(biolife.fishMRO)

   fishTc.Locate("Species Name", newVal)

   biolife.fishMRO.moveToRecord(fishTc)

   commonFld = fishTC."Common Name"

endif

endmethod


DIVEBIO.marineLifePage.latinList.open
open

DIVEBIO.marineLifePage.latinList.open

Fills the list with entries from the Latin_Name ("Species Name") field of BIOLIFE.DB.

method open(var eventInfo Event)

;fill list with Species Name field of Biolife.db

self.dataSource = "[Biolife.Species Name]"

endmethod


DIVEBIO.marineLifePage.Graphic.newValue
newValue

DIVEBIO.marineLifePage.Graphic.newValue

If the selected Common_Name field changes, resets CommonFld and LatinFld field objects and displays the corresponding graphic from BIOLIFE.DB.

method newValue(var eventInfo Event)

if Common_Name <> CommonFld then

   CommonFld = Common_Name

LatinFld = Species_Name

endif

endmethod


DIVEBIO.marineLifePage.acceptBttn.pushButton
pushButton

DIVEBIO.marineLifePage.acceptBttn.pushButton

Uses Mastlib.setPageValues to post the selected marine life species and returns to DIVEPLAN.FSL. Also hides the custom SpeedBar.

method pushButton(var eventInfo Event)

eventInfo.getTarget(uio)  ; what object is this?

; assign field values to Qbeval.db

MastLib.setPageValues(formName.name, MastLib.pageNameOf(uio))

; hide Videbar

myBar.hide()

formReturn(True)

endmethod


DIVEBIO.marineLifePage.helpButton.pushButton
pushButton

DIVEBIO.marineLifePage.helpButton.pushButton

Displays Help by calling helpShowContext. The value 20002 is a context ID for an item in the help file. In a larger application, it's a good idea to define constants for such values.

method pushButton(var eventInfo Event)

helpShowContext(helpfile, 20002)

endmethod


DIVEBIO.marineLifePage.cancelBttn.pushButton
pushButton

DIVEBIO.marineLifePage.cancelBttn.pushButton

Hides the custom SpeedBar and returns to DIVEPLAN.FSL with no further processing.

method pushButton(var eventInfo Event)

; hide Videbar

myBar.hide()

; return to Diveplan without any processing

formReturn(True)

endmethod


DIVEBIO.marineLifePage.clearMyQueryBttn.pushButton
pushButton

DIVEBIO.marineLifePage.clearMyQueryBttn.pushButton

Called by choosing the Clear Query button. Clears current selected marine life values using MastLib.clearPageValues.

method pushButton(var eventInfo Event)

; what is the object?

eventInfo.getTarget(uio) ; what is the object?

; clear form.page values in Qbeval.db

mastLib.clearPageValues(formName.Name, mastlib.pageNameOf(uio))

endmethod


ABTMAST

Methods

open

mouseRightUp

keyPhysical

Var, Const, and Uses Windows

Var window

Const window

Uses window

Methods and procedures from library MASTLIB.LSL

createObjMenu

pageNameOf

returnIsCalled


abtMast.open
open

ABTMAST.open

The ABTMAST form must be called from DIVEPLAN.FSL; it cannot be called directly. Opens ABTMAST.FSL. Opens the MASTLIB.LSL library if found in the WORK directory.

; This open method will not open Abtmast.fsl unless it

; has been called from Diveplan.fsl. The variable isCalled in

; Mastlib.lsl has to be set to True for Abtmast to be opened.

; isCalled is set to True by mastlib.setIsCalledTrue() which is

; invoked by the pushbutton method on Diveplan.

method open(var eventInfo Event)

if not eventInfo.isPreFilter()

  then

;open library (make sure that it is in the WORK directory)

if not mastLib.open("MastLib", globalToDesktop) then

msgStop("Failure", "Mastlib could not be opened.")

close()

else

wasCalled = mastLib.returnIsCalled()

if wasCalled = False then

msgStop("Stop!", "You cannot open this form directly. It must be opened from Diveplan.fsl.")

close()

else

formName.attach()

endif

endif

endif

endmethod


ABTMAST.mouseRightUp
mouseRightUp

ABTMAST.mouseRightUp

Calls the Mastlib library createObjMenu method when the right mouse button is released. This creates the Code Help menu. If you click on a Text or Bitmap object, the Help menu for the containing object is displayed because the objects have no code attached.

method mouseRightUp(var eventInfo MouseEvent)

; Calls a mastlib.createObjMenu() method that displays an object

; level help menu.

; prevent repeat method calls

if eventInfo.isPreFilter() then

eventInfo.getTarget(uio) ; what is the object?

   ;if object not diveFlagBox bitmap,

   ;find ui container if object text or bitmap

   if uio.name <> "diveFlagBox" then

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

      	uio.attach(uio.ContainerName)

     	endWhile

   endif

mastLib.createObjMenu(formName, mastlib.pageNameOf(uio), uio)

endif

endmethod


ABTMAST.keyPhysical
keyPhysical

ABTMAST.keyPhysical

Intercepts F1 to call helpShowContext. The value 20000 is a context ID for an item in the help file. In a larger application, it's a good idea to define constants for such values.

method keyPhysical(var eventInfo KeyEvent)

; if F1 pressed, display help for divePlan

if eventInfo.isFirstTime()

then

if eventInfo.vChar() = "VK_F1" then

disableDefault

helpShowContext(helpfile, 20000)

endif

endif

endmethod


abtMast.Var
ABTMAST Var Window

Variables declared in the form's Var window are visible to all objects in the form.

Var

   callerFm Form

uio UIObject

formName Form

mastLib Library

wasCalled Logical

endVar


abtMast.Const
ABTMAST Const Window

Constants declared in the form's Const window are visible to all objects in the form.

Const

   helpfile = ":WORK:mastuser.hlp"

endConst


abtMast.Uses
ABTMAST Uses Window

The Uses window declares external routines used by this form. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPal

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

pageNameOf(ui UIObject) String

returnIsCalled() Logical

endUses


abtMast.abtPg.Button16.pushButton
pushButton

ABTMAST.abtPg.Button16.pushButton

Returns control to DIVEPLAN.

method pushButton(var eventInfo Event)

formReturn()

endmethod


DIVEPLAN

Methods

close

keyPhysical

mouseEnter

mouseExit

mouseRightUp

destqbe

Var, Const, and Uses Windows

Var window

Const window

Uses window

Methods and procedures from library MASTLIB.LSL

clearPageValues

createObjMenu

mastObjMsg

pageNameOf

setlsCalledTrue

setlsCalledFalse


DIVEPLAN.close
close

DIVEPLAN.close

Restores the Paradox SpeedBar and removes the custom menu.

method close(var eventInfo Event)

if eventInfo.isPrefilter()

  then

   doDefault

else

   ; close Divebio

if bioFm.isAssigned() then

      bioFm.close()

   endif

   ; close Divesite

   if siteFm.isAssigned() then

     siteFm.close()

   endif

   ; close Divewrck

   if wreckFm.isAssigned() then

     wreckFm.close()

   endif

   ; close Mastord

   if bookFm.isAssigned() then

     mastlib.formCanClose()

     bookFm.close()

   endif

;restore SpeedBar

  	showSpeedBar()

;remove custom menu and restore default menu

removeMenu()

;close open help

  	helpQuit(helpfile)

; now close the form

endif

endmethod


DIVEPLAN.keyphysical
keyPhysical

DIVEPLAN.keyPhysical

Intercepts keystrokes and translates them to method calls, if appropriate.

method keyPhysical(var eventInfo KeyEvent)

; Form level keyphysical to trap hot keys.

; Will trap F1 (Help) calls.

var

  theKey String

  thePage String

endvar

if eventInfo.isPreFilter() then

   thePage = mastlib.pagenameOf(active)  ; tell me the page

   theKey = eventInfo.vChar()  ; tell me what key was pressed

switch

     case thePage = "mainPage" :

     if eventInfo.isAltKeyDown() then

       switch

case theKey = "E" or theKey = "e" : disableDefault

mainPage.clearQueryBttn.pushButton()

case theKey = "M" or theKey = "m" : disableDefault

mainPage.bioButton.pushButton()

case theKey = "P" or theKey = "p" : disableDefault

mainPage.processButton.pushButton()

case theKey = "S" or theKey = "s" : disableDefault

mainPage.siteButton.pushButton()

case theKey = "W" or theKey = "w" : disableDefault

mainPage.wreckButton.pushButton()

case theKey = "X" or theKey = "x" : disableDefault

mainPage.exitButton.pushButton()

 	otherwise: doDefault

endswitch

     else

switch

case theKey = "VK_F1" :	disableDefault

helpShowContext(helpFile, 20000)

otherwise : doDefault

endSwitch

endif

     case thePage = "resultsPage" :

     if eventInfo.isAltKeyDown() then

 switch

case theKey = "B" or theKey = "b" : disableDefault

resultsPage.bookItBttn.pushButton()

case theKey = "M" or theKey = "m" : disableDefault

resultsPage.mainPageBttn.pushButton()

case theKey = "X" or theKey = "x" : disableDefault

resultsPage.exitButton.pushButton()

otherwise: doDefault

     	 endswitch

     else

  	 switch

case theKey = "VK_F1" : disableDefault

helpShowContext(helpFile, 20001)

   	otherwise : doDefault

 	 endSwitch

  	  endif

   endswitch

else

  doDefault

endif

endmethod


DIVEPLAN.mouseEnter
mouseEnter

DIVEPLAN.mouseEnter

A form-level messaging routine that displays the names of objects in the status bar depending on the mouse cursor position. Uses the Mastlib library method, masLib.mastObjMsg.

method mouseEnter(var eventInfo MouseEvent)

; prevent repeat MouseEnter calls

if eventInfo.isPreFilter() then

eventInfo.getTarget(uio)  ; what is the object?

   uioName = uio.Name

   ; exclude text and bitmap objects, and noise names

if uio.name <> self.name AND  ; eliminate message if form

  (uio.class = "Field" OR uio.class = "Multirecord" OR uio.class = "Button")

     then

   mastLib.mastObjMsg(formName.name, mastlib.pageNameOf(uio), uioName)

endif

endif

endmethod


DIVEPLAN.mouseExit
mouseExit

DIVEPLAN.mouseExit

Clears the mouseEnter status bar message when the mouse cursor leaves an object's region.

method mouseExit(var eventInfo MouseEvent)

; prevent repeat mouseExit calls

if eventInfo.isPreFilter() then

eventInfo.getTarget(uio) ; what is the object?

;exiting from an object that has displayed a mouseEnter message

if uio.class <> "Text" and uio.class <> "Bitmap" then

 	message("")

endif

endif

endmethod


DIVEPLAN.mouseRightUp
mouseRightUp

DIVEPLAN.mouseRightUp

Calls the Mastlib library createObjMenu method when the right mouse button is released. This creates the Code Help menu.

method mouseRightUp(var eventInfo MouseEvent)

; prevent repeat method calls

if eventInfo.isPreFilter() then

eventInfo.getTarget(uio) ; what is the object?

;if object not diveFlagBox bitmap,

;find ui container if object text or bitmap

if uio.name <> "diveFlagBox" and uio.name <> "diveFlagBox1" then

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

      	uio.attach(uio.ContainerName)

     	endWhile

   endif

mastLib.createObjMenu(formName, mastlib.pageNameOf(uio), uio)

endif

endmethod


DIVEPLAN.destqbe
destqbe

DIVEPLAN.destqbe

Searches QBEVAL.DB and assigns values from it to a query (destQBE) made on DEST.DB. The values in QBEVAL.DB are set when the user makes selections in any or all of the following files: DIVESITE.FSL, DIVEWRCK.FSL, and DIVEBIO.FSL. Matching destinations are written to POSSDEST.DB. Returns False if QBEVAL.DB cannot be opened. destQBE is triggered by choosing Process in mainPage.pageMenu or by choosing the Process button.

method destqbe() Logical

var

   i SmallInt

destQBE Query

qbeValTc TCursor

destName, avgTemp, accom, nLife, siteName, siteHi, shipCat,

shipInt, shipCond, skill, shipName, commonName, speciesName String

endvar

if not qbeValTc.Open("QbeVal.db") then

msgStop("Problem", "Couldn't open Qbeval.db")

return false

endif

; Examine Qbeval.db record-by-record and assign the values in the

; Query Value field to variables that are included in destQBE.

Scan qbeValTc :

switch

case qbeValTc."Field Name" = "Accomodations"    :

accom = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Site Highlight"   :

siteHi = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Night Life"       :

nLife = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Site Name"        :

siteName = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Destination Name" :

destName = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Category"         :

shipCat = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Interest"         :

shipInt = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Condition"        :

shipcond = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Avg Temperature"  :

avgTemp = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Ship Name"        :

shipName = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Common Name"      :

commonName = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Species Name"     :

speciesName = qbeValTc."Query Value"

case qbeValTc."Field Name" = "Skill Level"      :

skill = qbeValTc."Query Value"

endswitch

endScan

; Define query. Include in the query the variables that have been

; assigned from Qbeval.db.

Switch

;Shipwrck and biolife criteria chosen

Case (not shipname.isBlank() or not shipCat.isBlank() or

not shipInt.isBlank() or not shipCond.isBlank()) and

  (not commonName.isBlank() or not speciesName.isBlank()) :

destQBE = Query

answer: :work:possdest.db

 Dest | Destination No | Destination Name |  Avg Temp (F)  | Avg Temp (C) |

       | Check _destno  | Check ~destName  | Check ~avgTemp | Check        |

 Dest | Spring Temp (F) | Spring Temp (C) | Summer Temp (F) | Summer Temp (C) |

      | Check           | Check           | Check           | Check           |

 Dest | Fall Temp (F) | Fall Temp (C) | Winter Temp (F) | Winter Temp (C) |

      | Check         | Check         | Check           | Check           |

 Dest | Accomodations |  Night Life  | Body of Water | Travel Cost |

      | Check ~accom  | Check ~nLife | Check         | Check       |

 Sites |       Site No       | Destination No | Site Name | Site Highlight |

       | _shipsite, _biosite | _destno        | ~siteName | ~siteHi        |

 Sites | Skill Level |

       | ~skill      |

 Shipwrck | Ship Name |  Site No  | Category | Interest |

          | ~shipName | _shipsite | ~shipCat | ~shipInt |

 Shipwrck | Condition |

          | ~shipCond |

 Biosite | Species No | Site No  |

         | _specno    | _biosite |

 Biolife | Species No | Common Name   | Species Name  |

         | _specno    | ~commonName   | ~speciesName  |

Endquery

;Shipwrck but not Biolife criteria chosen

Case 	(not shipname.isBlank() or not shipCat.isBlank() or not shipInt.isBlank() or

      	not shipCond.isBlank()) and (commonName.isBlank() and speciesName.isBlank()) :

destQBE = Query

answer: :work:possdest.db

 Dest | Destination No | Destination Name |  Avg Temp (F)  | Avg Temp (C) |

      | Check _destno  | Check ~destName  | Check ~avgTemp | Check        |

 Dest | Spring Temp (F) | Spring Temp (C) | Summer Temp (F) | Summer Temp (C) |

      | Check           | Check           | Check           | Check           |

 Dest | Fall Temp (F) | Fall Temp (C) | Winter Temp (F) | Winter Temp (C) |

      | Check         | Check         | Check           | Check           |

 Dest | Accomodations |  Night Life  | Body of Water | Travel Cost |

      | Check ~accom  | Check ~nLife | Check         | Check       |

 Sites |  Site No  | Destination No | Site Name | Site Highlight |

       | _shipsite | _destno        | ~siteName | ~siteHi        |

 Sites | Skill Level |

       | ~skill      |

 Shipwrck | Ship Name |  Site No  | Category | Interest |

          | ~shipName | _shipsite | ~shipCat | ~shipInt |

 Shipwrck | Condition |

          | ~shipCond |

Endquery

;Biolife but not Shipwrck criteria chosen

   Case shipname.isBlank() and shipCat.isBlank() and

        shipInt.isBlank() and shipCond.isBlank()

        and not commonName.isBlank() and not speciesName.isBlank() :

destQBE = Query

answer: :work:possdest.db

 Dest | Destination No | Destination Name |  Avg Temp (F)  | Avg Temp (C) |

      | Check _destno  | Check ~destName  | Check ~avgTemp | Check        |

 Dest | Spring Temp (F) | Spring Temp (C) | Summer Temp (F) | Summer Temp (C) |

      | Check           | Check           | Check           | Check           |

 Dest | Fall Temp (F) | Fall Temp (C) | Winter Temp (F) | Winter Temp (C) |

      | Check         | Check         | Check           | Check           |

 Dest | Accomodations |  Night Life  | Body of Water | Travel Cost |

      | Check ~accom  | Check ~nLife | Check         | Check       |

 Sites |  Site No | Destination No | Site Name | Site Highlight |

       | _biosite | _destno        | ~siteName | ~siteHi        |

 Sites | Skill Level |

       | ~skill      |

 Biosite | Species No | Site No  |

         | _specno    | _biosite |

 Biolife | Species No | Common Name   | Species Name  |

         | _specno    | ~commonName   | ~speciesName  |

Endquery

   ;no Shipwrck or Biolife criteria

   Case shipname.isBlank() and shipCat.isBlank() and

        shipInt.isBlank() and shipCond.isBlank()

        and commonName.isBlank() and speciesName.isBlank() :

destQBE = Query

answer: :work:possdest.db

 Dest | Destination No | Destination Name |  Avg Temp (F)  | Avg Temp (C) |

      | Check _destno  | Check ~destName  | Check ~avgTemp | Check        |

 Dest | Spring Temp (F) | Spring Temp (C) | Summer Temp (F) | Summer Temp (C) |

      | Check           | Check           | Check           | Check           |

 Dest | Fall Temp (F) | Fall Temp (C) | Winter Temp (F) | Winter Temp (C) |

      | Check         | Check         | Check           | Check           |

 Dest | Accomodations |  Night Life  | Body of Water | Travel Cost |

      | Check ~accom  | Check ~nLife | Check         | Check       |

 Sites | Destination No | Site Name | Site Highlight |

       | _destno        | ~siteName | ~siteHi        |

 Sites | Skill Level |

       | ~skill      |

endQuery

Endswitch

writeQBE(destQBE, "Diveqbe")

; Execute destQuery (defined above) and write the results to Possdest.db.

; Possdest.db is used by Mastord.fsl to book trips.

if not executeQBE(destQBE, ":work:Possdest.db") then

   msgInfo("Error","Query could not be processed!")

   return FALSE

endif

return TRUE

endmethod


DIVEPLAN.Var
DIVEPLAN Var Window

Variables declared in the form's Var window are visible to all objects in the form.

Var

uioName String

uio UIObject

formName, siteFm, wreckFm, bioFm, bookFm, aboutFm Form

mastLib Library

closeVCRLg Logical

endVar


DIVEPLAN.Const
DIVEPLAN Const Window

Constants declared in the form's Const window are visible to all objects in the form.

Const

helpfile = ":WORK:mastuser.hlp"

; path to Help file must be hardcoded (or file must be on path)

endConst


DIVEPLAN.Uses
DIVEPLAN Uses Window

The Uses window declares external routines used by this form. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPal

clearPageValues(formName String, pageName String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

mastObjMsg(formName String, pageName String, objID String)

pageNameOf(ui UIObject) String

setIsCalledTrue()

setIsCalledFalse()

endUses


DIVEPLAN.mainPage

Methods

arrive

menuAction

open

Procedures

pageMenu


DIVEPLAN.mainPage.arrive
arrive

DIVEPLAN.mainPage.arrive

Sets mainPage title to "Main" and displays a custom pop-up menu by calling the mainPage.pageMenu procedure.

method arrive(var eventInfo MoveEvent)

; define page title

setTitle("Main")

;display custom Speedbar for page

pageMenu()

endmethod


DIVEPLAN.mainPage.menuAction
menuAction

DIVEPLAN.mainPage.menuAction

Tests the string returned by a mainPage menu selection and calls the appropriate method. For example, choosing the Marine Life menu item calls bioButton.pushButton. Choosing Results moves you to the resultsPage.

method menuAction(var eventInfo MenuEvent)

var

 mc String

endvar

; what menu option has been chosen?

mc = eventInfo.menuChoice()

switch

  case mc = "&Sites"             : siteButton.pushbutton()

  case mc = "&Marine Life"       : bioButton.pushbutton()

  case mc = "&Wrecks"            : wreckButton.pushbutton()

  case mc = "&Process"           : processButton.pushbutton()

  case mc = "Cl&ear"             : clearQueryBttn.pushbutton()

  case mc = "E&xit"              : exitButton.pushbutton()

  case mc = "&Results"           : resultsPage.moveto()

  case mc = "&Contents"          : helpShowContext(helpFile, 10000)

  case mc = "&Using Help"        : helpOnHelp()

  case mc = "&About MAST"        : mastLib.setIsCalledTrue()

if aboutFm.open("Abtmast.fsl") then

aboutFm.Wait()  ; modal dialog opened

aboutFm.Close() ; now close it

mastLib.setIscalledFalse()

endif

endswitch

endmethod


DIVEPLAN.mainPage.open
open

DIVEPLAN.mainPage.open

Opens the Mastlib library, hides the Paradox SpeedBar, and clears the query.

method open(var eventInfo Event)

; if the file is not in :WORK:, don't allow open

if not isFile("diveplan.fsl") then

msgInfo("Startup Error!", "The MAST application files must be in the working directory.")

close()

endif

;open library (make sure that it is in the WORK directory)

if not mastLib.open("MastLib", globalToDesktop) then

msgStop("Failure", "Mastlib could not be opened")

endif

; associate form UIObject name with formName var

formName.attach()

hideSpeedBar()

maximize()

clearQueryBttn.pushbutton()

endmethod


DIVEPLAN.mainPage.pageMenu
pageMenu

DIVEPLAN.mainPage.pageMenu

Called by mainPage.arrive to display the mainPage menu.

proc pageMenu()

Var

 mainMenu Menu

 mainPop1, mainPop2 popUpMenu

endVar

; this custom proc displays a menu for Main page

; define menu

mainPop1.addText("&Sites")

mainPop1.addText("&Marine Life")

mainPop1.addText("&Wrecks")

mainPop1.addSeparator()

mainPop1.addText("&Process")

mainPop1.addText("Cl&ear")

mainPop1.addText("E&xit")

mainMenu.addPopUp("Se&lections", mainPop1)

mainMenu.addText("&Results")

mainPop2.addText("&Contents")

mainPop2.addText("&Using Help")

mainPop2.addText("&About MAST")

mainMenu.addPopUp("&Help", mainPop2)

mainMenu.show()

endproc


DIVEPLAN.mainPage.processButton.pushButton
pushButton

DIVEPLAN.mainPage.processButton.pushButton

Called by choosing Process in pageMenu. Calls destqbe to process the query. Displays any matches on the resultsPage.

method pushButton(var eventInfo Event)

; temporarily bind foundTF to Dest.db

resultsPage.foundTF.tableName = "Dest.db"

; remove Possdest.db if it is already part of the data model

; so that you can repeat the query

if DMHasTable("Possdest.db")

  then

DMRemovetable("Possdest.db")

endif

; run query here

Try

If Not destqbe() Then

      Return

   Endif

onFail  ; query failed - quit method

fail(1, "Couldn't open Qbeval.db")

Endtry

; query succesful - add query answer (possdest.db) to

; data model and bind foundTF to it

resultsPage.foundTF.tablename = "Possdest.db"

; remove dest.db from the data model

DMRemoveTable("Dest.db")

; move to results page to display chosen destinations

resultsPage.moveTo()

endmethod


DIVEPLAN.mainPage.helpButton.pushButton
pushButton

DIVEPLAN.mainPage.helpButton.pushButton

Displays Help by calling helpShowContext. The value 20000 is a context ID for an item in the help file. In a larger application, it's a good idea to define constants for such values.

method pushButton(var eventInfo Event)

;provide help on this page

helpShowContext(helpFile, 20000)

endmethod


DIVEPLAN.mainPage.exitButton.pushButton
pushButton

DIVEPLAN.mainPage.exitButton.pushButton

Displays a Quit MAST dialog box. Calls close to close the form if Yes is chosen.

method pushButton(var eventInfo Event)

; ask user if they really wants to close diveplan

choice = msgQuestion("Quit M*A*S*T", "Do you want to quit the application?")

; if user clicks Yes button, close diveplan

if choice = "Yes"

  then

   close()

endif

endmethod


DIVEPLAN.mainPage.clearQueryBttn.pushButton
pushButton

DIVEPLAN.mainPage.clearQueryBttn.pushButton

Clears current query in QBEVAL.DB by using a CHANGETO query to change the Query Value field in each record to blank.

method pushButton(var eventInfo Event)

var

clearQuery 	Query

endVar

; build the string

clearQuery=Query

qbeval.db | Query Value     |

          | changeto blank  |

EndQuery

executeQBE(clearQuery)

; empty Possdest.db

if isTable("Possdest.db")

  then

empty("Possdest.db")

endif

endmethod


DIVEPLAN.mainPage.bioButton.pushButton
pushButton

DIVEPLAN.mainPage.bioButton.pushButton

Opens DIVEBIO.FSL, maximizes it, and gives it focus.

method pushButton(var eventInfo Event)

; open Divebio.fsl

; Divebio already open -- display it and put it into wait state

if isAssigned(bioFM)

  then

bioFm.bringtoTop()

bioFm.wait()  ; put Divebio into wait state

; user returned -- hide Divebio

bioFm.hide()

maximize()

mainPage.moveTo()

else

  ; Divebio not open -- open it

  mastLib.setIsCalledTrue()

  if bioFM.Open("Divebio", WinStyleMaximize)

  	then

 bioFm.Wait()  ; put Divebio into wait state

 ; user returned -- hide Divebio

 	 bioFm.hide()

    maximize()

 mainPage.moveTo()

  else

 ; open failed

 msgInfo("Status", "Sorry, the Marine Life form is not available")

 mastlib.setIsCalledFalse()

  endif

endif

endmethod


DIVEPLAN.mainPage.siteButton.pushButton
pushButton

DIVEPLAN.mainPage.siteButton.pushButton

Opens DIVESITE.FSL, maximizes it, and gives it focus.

method pushButton(var eventInfo Event)

; open Divesite.fsl

; Divesite already open -- display it and put into wait state

if isAssigned(siteFM)

  then

siteFm.bringtoTop()

siteFm.wait()  ; put Divesite into wait state

; user returned -- hide Divesite

siteFm.hide()

maximize()

mainPage.moveTo()

else

  ; Divesite not open -- open it

  mastLib.setIsCalledTrue()

  if siteFM.Open("Divesite", WinStyleMaximize)

    then

     siteFm.Wait()  ; put Divesite into wait state

  ; user returned -- hide Divesite

     siteFm.hide()

  maximize()

  mainPage.moveTo()

  else

  msgInfo("Status", "Sorry, the Sites form is not available")

  mastlib.setIsCalledFalse()

  endif

endif

endmethod


DIVEPLAN.mainPage.wreckButton.pushButton
pushButton

DIVEPLAN.mainPage.wreckButton.pushButton

Opens DIVEWRCK.FSL, maximizes it, and gives it focus.

method pushButton(var eventInfo Event)

; open Divewrck.fsl

; Divewrck already open -- display it and put it into wait state

if isAssigned(wreckFM)

  then

wreckFm.bringtoTop()

wreckFm.wait()  ; put Divewrck into wait state

; user returned -- hide Divewrck

wreckFm.hide()

maximize()

mainPage.moveTo()

else

  ; Divewrck not open -- open it

  mastLib.setIsCalledTrue()

  if wreckFM.Open("Divewrck", WinStyleMaximize)

  	 then

  wreckFm.Wait() ; put Divewrck into wait state

  ; user returned -- hide Divewrck

     wreckFm.hide()

  maximize()

  mainPage.moveTo()

  else

  ; Open failed

  msgInfo("Status", "Sorry, the Ship Wreck form is not available")

     mastlib.setIsCalledFalse()

  endif

endif

endmethod


DIVEPLAN.resultsPage

Methods

arrive

menuAction

Procedures

pageMenu


DIVEPLAN.resultsPage.arrive
arrive

DIVEPLAN.resultsPage.arrive

Sets resultsPage title to "Results" and displays a custom pop-up menu by calling the resultsPage.pageMenu procedure.

method arrive(var eventInfo MoveEvent)

; display new page title & menu

setTitle("Vacations")

pageMenu()

endmethod


DIVEPLAN.resultsPage.menuAction
menuAction

DIVEPLAN.resultsPage.menuAction

Tests the string returned by a resultsPage menu selection and calls the appropriate method. For example, choosing the Book It! menu item calls bookItBttn.pushButton. Choosing Main moves you to the mainPage.

method menuAction(var eventInfo MenuEvent)

var

 mc String

endvar

; what menu option has been chosen?

mc = eventInfo.menuChoice()

switch

  case mc = "&Book It!"            : bookItBttn.pushbutton()

  case mc = "E&xit"                : exitButton.pushbutton()

  case mc = "&Main"                : mainPage.moveto()

  case mc = "&First\tCtrl+F11"     : active.action(DataBegin)

  case mc = "&Last\tCtrl+F12"      : active.action(DataEnd)

  case mc = "&Next\tF12"           : active.action(DataNextRecord)

  case mc = "&Previous\tF11"       : active.action(DataPriorRecord)

  case mc = "&Insert\tIns"         : active.action(DataInsertRecord)

  case mc = "&Delete\tCtrl+Del"    : active.action(DataDeleteRecord)

  case mc = "C&ancel Changes\tAlt+Bksp" : active.action(DataCancelRecord)

  case mc = "&Contents"            : helpShowContext(helpFile, 10000)

  case mc = "&Using Help"          : helpOnHelp()

  case mc = "&About MAST"          : mastLib.setIsCalledTrue()

if aboutFm.open("Abtmast.fsl") then

; modal dialog opened

aboutFm.Wait()

; now close it

aboutFm.Close()

mastLib.setIscalledFalse()

endif

endswitch

endmethod


DIVEPLAN.resultsPage.pageMenu
pageMenu

DIVEPLAN.resultsPage.pageMenu

Called by resultsPage.arrive to display a custom pop-up menu.

proc pageMenu()

Var

 resultsMenu Menu

 dropMenu1, dropMenu2, dropMenu3 popUpMenu

endVar

; this custom proc displays a menu for Results page

dropMenu1.addText("&Book It!")

dropMenu1.addText("E&xit")

resultsMenu.addPopUp("Des&tination", dropMenu1)

resultsMenu.addText("&Main")

dropMenu2.addtext("&First\tCtrl+F11")

dropMenu2.addtext("&Last\tCtrl+F12")

dropMenu2.addtext("&Next\tF12")

dropMenu2.addtext("&Previous\tF11")

dropMenu2.addSeparator()

dropMenu2.addtext("&Insert\tIns")

dropMenu2.addtext("&Delete\tCtrl+Del")

dropMenu2.addtext("C&ancel Changes\tAlt+Bksp")

resultsMenu.addPopUp("Rec&ord", dropMenu2)

dropMenu3.addText("&Contents")

dropMenu3.addText("&Using Help")

dropMenu3.addText("&About MAST")

resultsMenu.addPopUp("&Help", dropMenu3)

resultsMenu.show()

endproc


DIVEPLAN.resultsPage.helpButton.pushButton
pushButton

DIVEPLAN.resultsPage.helpButton.pushButton

Displays Help by calling helpShowContext. The value 20001 is a context ID for an item in the help file. In a larger application, it's a good idea to define constants for such values.

method pushButton(var eventInfo Event)

helpShowContext(helpFile, 20001)

endmethod


DIVEPLAN.resultsPage.bookItBttn.pushButton
pushButton

DIVEPLAN.resultsPage.bookItBttn.pushButton

Opens the MASTORD.FSL form, maximizes the window, and awaits user input.

method pushButton(var eventInfo Event)

; open Mastord.fsl

; Mastord already open -- display it and put into wait state

if isAssigned(bookFM)

  then

bookFm.bringtoTop()

bookFm.wait()

; user returned -- hide Divesite

bookFm.hide()

mainPage.moveTo()

maximize()

else

  ; Mastord not open -- so open it

  mastLib.setIsCalledTrue()

  if bookFM.Open("Mastord", WinStyleMaximize)

    then

     bookFm.Wait()  ; put Divesite into wait state

; user returned -- hide Divesite

bookFm.hide()

  maximize()

  mainPage.moveTo()

else

msgInfo("Status", "Sorry, the Sites form is not available")

mastlib.setIsCalledFalse()

  endif

endif

endmethod


DIVEPLAN.resultsPage.mainPageBttn.pushButton
pushButton

DIVEPLAN.resultsPage.mainPageBttn.pushButton

Moves users to the mainPage by calling mainPage.moveTo.

method pushButton(var eventInfo Event)

mainPage.moveTo()

endmethod


DIVEPLAN.resultsPage.exitButton.pushButton
pushButton

DIVEPLAN.resultsPage.exitButton.pushButton

Displays a Quit MAST dialog box. Calls close to close the form if Yes is chosen.

method pushButton(var eventInfo Event)

; ask user if they really wants to close diveplan

choice = msgQuestion("Quit M*A*S*T", "Do you want to quit the application?")

; if user clicks Yes button, close diveplan

if choice = "Yes"

  then

   close()

endif

endmethod


DIVESITE

Methods

keyPhysical

menuAction

mouseEnter

mouseExit

mouseRightUp

Var, Const, and Uses windows

Var window

Const window

Uses window

Methods and procedures from library MASTLIB.LSL

clearPageValues

createObjMenu

mastObjMsg

setPageValues

pageNameOf

returnlsCalled

setlsCalledTrue

setlsCalledFalse


DIVESITE.keyPhysical
keyPhysical

DIVESITE.keyPhysical

Intercepts keystrokes and translates them to method calls, if appropriate.

method keyPhysical(var eventInfo KeyEvent)

; Form level keyPhysical to trap hot keys.

; Will trap F1 (Help) calls.

var

  theKey String

  thePage String

endvar

if eventInfo.isPreFilter() then

   thePage = mastlib.pagenameOf(active)

   theKey = eventInfo.vChar()  ; tell me what key was pressed

switch

     case thePage = "sitesPage" :

     if eventInfo.isAltKeyDown() then

       switch

case theKey = "A" or theKey = "a" : disableDefault

sitesPage.acceptBttn.pushButton()

case theKey = "C" or theKey = "c" : disableDefault

sitesPage.cancelBttn.pushButton()

case theKey = "D" or theKey = "d" : disableDefault

sitesPage.destsPageBttn.pushButton()

case theKey = "E" or theKey = "e" : disableDefault

sitesPage.clearMyQueryBttn.pushButton()

case theKey = "F" or theKey = "f" : disableDefault

sitesPage.reefs.moveTo()

case theKey = "M" or theKey = "m" : disableDefault

sitesPage.cheap.moveTo()

case theKey = "N" or theKey = "n" : disableDefault

sitesPage.sleepy.moveTo()

case theKey = "S" or theKey = "s" : disableDefault

sitesPage.sitesField.moveTo()

case theKey = "V" or theKey = "v" : disableDefault

sitesPage.skillFld.moveTo()

case theKey = "W" or theKey = "w" : disableDefault

sitesPage.subTropical.moveTo()

otherwise: doDefault

endswitch

     else

switch

case theKey = "VK_F1" : disableDefault

helpShowContext(helpFile, 20004)

   	otherwise : doDefault

endSwitch

  	  endif

     case thePage = "destsPage" :

     if eventInfo.isAltKeyDown() then

 switch

case theKey = "A" or theKey = "a" : disableDefault

destsPage.acceptBttn.pushButton()

case theKey = "C" or theKey = "c" : disableDefault

destsPage.cancelBttn.pushButton()

case theKey = "D" or theKey = "d" : disableDefault

destsPage.dest.destination_Name.moveTo()

case theKey = "E" or theKey = "e" : disableDefault

destsPage.clearMyQueryBttn.pushButton()

case theKey = "I" or theKey = "i" : disableDefault

destsPage.sites.site_Name.moveTo()

case theKey = "T" or theKey = "t" : disableDefault

destsPage.addToChoicesBttn.pushButton()

case theKey = "S" or theKey = "s" : disableDefault

destsPage.sitesPageBttn.pushButton()

case theKey = "R" or theKey = "r" : disableDefault

destsPage.clearChoicesBttn.pushButton()

otherwise: doDefault

endswitch

     else

  	 switch

   	case theKey = "VK_F1" : disableDefault

helpShowContext(helpFile, 20004)

   	otherwise : doDefault

 	 endSwitch

  	  endif

   endswitch

else

  doDefault

endif

endmethod


DIVESITE.menuAction
menuAction

DIVESITE.menuAction

Prevents you from using the control menu to close the form.

method menuAction(var eventInfo MenuEvent)

if eventInfo.isPreFilter()

then

doDefault

else

  ; block user from closing form with System menu

  if eventInfo.ID() = MenuControlClose then

    	 eventInfo.setErrorCode(1)

       ; if Videobar is displayed, hide it

       if isAssigned(myBar) then

         myBar.hide()

       endif

 formReturn(True)

     endif

endif

endmethod


DIVESITE.mouseEnter
mouseEnter

DIVESITE.mouseEnter

A form-level messaging routine that displays names of objects in the status bar depending on mouse cursor position. Uses the Mastlib library method masLib.mastObjMsg.

method mouseEnter(var eventInfo MouseEvent)

; prevent repeat methods calls

if eventInfo.isPreFilter()

  then

eventInfo.getTarget(uio) ; what is the object?

   uioName = uio.Name

   ; exclude text and bitmap objects, and noise names

if uio.name <> self.name AND  ; eliminate message if form

(uio.class = "Field" OR uio.class = "Multirecord" OR uio.class = "Button")

     then

   mastLib.mastObjMsg(formName.name, mastlib.pageNameOf(uio), uioName)

endif

endif

endmethod


DIVESITE.mouseExit
mouseExit

DIVESITE.mouseExit

Clears the mouseEnter status bar message when the mouse cursor leaves an object's region.

method mouseExit(var eventInfo MouseEvent)

; prevent repeat mouseExit

if eventInfo.isPreFilter() then

eventInfo.getTarget(uio)  ; what is the object?

if uio.class <> "Text" and uio.class <> "Bitmap" then

 message("")

endif

endif

endmethod


DIVESITE.mouseRightUp
mouseRightUp

DIVESITE.mouseRightUp

Calls the Mastlib library createObjMenu method when the right mouse button is released. This creates the Code Help menu.

method mouseRightUp(var eventInfo MouseEvent)

; Calls a mastlib.createObjMenu() method that displays an object

; level help menu.

; prevent repeat method calls

if eventInfo.isPreFilter()

  then

   eventInfo.getTarget(uio) ; what is the object?

   ; if object not diveFlagBox bitmap,

   ; find ui container if object text or bitmap

   if uio.name <> "diveFlagBox1"  and uio.name <> "smlDiveFlagBox" then

     while

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

      uio.attach(uio.ContainerName)

     endWhile

   endif

mastLib.createObjMenu(formName, mastlib.pageNameOf(uio), uio)

endif

endmethod


DIVESITE.Var
DIVESITE Var Window

Variables declared in the form's Var window are visible to all objects in the form.

Var

formName, aboutFm Form

wasCalled Logical

uio UIObject

mastLib Library

endVar


DIVESITE.Const
DIVESITE Const Window

Constants declared in the form's Const window are visible to all objects in the form.

Const

helpFile = ":WORK:mastuser.hlp"

; path to Help file must be hardcoded (or file must be on path)

endConst


DIVESITE.Uses
DIVESITE Uses Window

The Uses window declares external routines used by this form. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPal

clearPageValues(formName String, pageName String)

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

mastObjMsg(formName String, pageName String, objID String)

setPageValues(formName String, pageName String) Logical

pageNameOf(ui UIObject) String

returnIsCalled() Logical

setIsCalledTrue()

setIsCalledFalse()

endUses


DIVESITE.destsPage

Methods

close

arrive

depart

menuAction

setFocus

Procedures

pageMenu

Var, Const, and Uses windows

Var window

Uses window


DIVESITE.destsPage.close
close

DIVESITE.destsPage.close

Closes the form and the custom SpeedBar.

method close(var eventInfo Event)

; Videbar is open

if mastlib.isVCROpen()

  then

      ; close videbar

myBar.close()

mastlib.VCRisClosed()

   endif

endmethod


DIVESITE.destsPage.arrive
arrive

DIVESITE.destsPage.arrive

Sets destsPage title to "Destinations" and sets up a custom menu by calling the destsPage.pageMenu procedure.

method arrive(var eventInfo MoveEvent)

; change page title

setTitle("Destinations")

; display custom menu

pageMenu()

endmethod


DIVESITE.destsPage.depart
depart

DIVESITE.destsPage.depart

Hides the custom SpeedBar.

method depart(var eventInfo MoveEvent)

; Hide videobar

myBar.Hide()

endmethod


DIVESITE.destsPage.menuAction
menuAction

DIVESITE.destsPage.menuAction

Tests the string returned by a destsPage menu selection and calls the appropriate method. For example, choosing the Sites item calls sitesPageBttn.pushButton.

method menuAction(var eventInfo MenuEvent)

var

 mc String

endvar

; what menu option has been chosen?

mc = eventInfo.menuChoice()

switch

  case mc = "&Accept"          : acceptBttn.pushbutton()

  case mc = "C&ancel"          : cancelBttn.pushbutton()

  case mc = "Cl&ear"           : clearMyQueryBttn.pushbutton()

  case mc = "&Sites"           : sitesPageBttn.pushbutton()

  case mc = "&First\tCtrl+F11" : myBar.firstButton.pushButton()

  case mc = "&Last\tCtrl+F12"  : myBar.lastButton.pushButton()

  case mc = "&Next\tF12"       : myBar.nextButton.pushButton()

  case mc = "&Previous\tF11"   : myBar.priorButton.pushButton()

  case mc = "&Contents"        : helpShowContext(helpFile, 20003)

  case mc = "&Using Help"      : helpOnHelp()

  case mc = "&About MAST"      : mastLib.setIsCalledTrue()

if aboutFm.open("Abtmast.fsl") then

; modal dialog opened

aboutFm.Wait()

; now close it

aboutFm.Close()

mastLib.setIscalledFalse()

endif

endswitch

endmethod


DIVESITE.destsPage.setFocus
setFocus

DIVESITE.destsPage.setFocus

Displays the custom  SpeedBar VIDEOBAR.FSL, opening it first, if necessary.

method setFocus(var eventInfo Event)

var

   x, y, w, h LongInt

endvar

; videoBar is already open

if MastLib.isVCROpen()

  then

if myBar.isAssigned()

  then

; Videobar open -- attach it to this form

         myBar.bringToTop()

myBar.setCallFormName(getTitle(), 5500, 400)

else

; attach to Videbar

myBar.attach(mastlib.vcrName())

         myBar.bringToTop()

myBar.setCallFormName(getTitle(), 5500, 400)

endif

else

; Videobar not open -- open it

myBar.Open("Videobar.fsl")

myBar.setCallFormName(getTitle(), 5500, 400)

mastLib.VCRisOpen()

endif

endmethod


DIVESITE.destsPage.pageMenu
pageMenu

DIVESITE.destsPage.pageMenu

Called by destsPage.arrive to display the Select Destinations menus.

proc pageMenu()

Var

 pageMenu Menu

 dropMenu1, dropMenu2, dropMenu3 popUpMenu

endVar

; this custom proc displays a menu for Sites page

; define menu

dropMenu1.addText("&Accept")

dropMenu1.addText("&Cancel")

dropMenu1.addText("Cl&ear")

pageMenu.addPopUp("Se&lections", dropMenu1)

pageMenu.addText("&Sites")

dropMenu2.addtext("&First\tCtrl+F11")

dropMenu2.addtext("&Last\tCtrl+F12")

dropMenu2.addtext("&Next\tF12")

dropMenu2.addtext("&Previous\tF11")

pageMenu.addPopUp("Rec&ord", dropMenu2)

dropMenu3.addText("&Contents")

dropMenu3.addText("&Using Help")

dropMenu3.addText("&About MAST")

pageMenu.addPopUp("&Help", dropMenu3)

pageMenu.show()

endproc


DIVESITE.destsPage.Var
DIVESITE.destsPage Var Window

Variables declared in the form's Var window are visible to all objects in the form.

var

DestNo Number

DestTc, TempDestTc	TCursor

endvar


DIVESITE.destsPage.Uses
DIVESITE.destsPage Uses Window

The destPage Uses window declares external routines used by this page. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPal

setCallFormName(const CallerTitle String,

                             xPos LongInt, yPos LongInt)

vcrName() String

VCRisOpen()

VCRisClosed()

isVCROpen() Logical

endUses


DIVESITE.destsPage.clearChoicesBttn.pushButton
pushButton

DIVESITE.destsPage.clearChoicesBttn.pushButton

Clears the current destination choices and sets the list count to 0, which empties the list.

method pushButton(var eventInfo Event)

; empty destList

destlist.choices.list.count = 0

endmethod


DIVESITE.destsPage.AddtoChoicesBttn.pushButton
pushButton

DIVESITE.destsPage.AddtoChoicesBttn.pushButton

Called by choosing the Add to List button (AddToChoicesBttn). Adds selected destinations from DEST.DB to deslist. These destinations are added to QBEVAL.DB when the Accept button is chosen.

method pushButton(var eventInfo Event)

var

destVal String

i, listCount SmallInt

endVar

if active.name = "Destination_Name"

  then

listCount = destList.choices.list.count

destVal = dest.Destination_Name.value

; make sure that the destination is not already in destlist

for i from 1 to listCount

destList.choices.list.selection = i

if destList.choices.list.value = destVal

        then

msgInfo("Already in the list.", destVal)

return

endIf

endFor

; add item to destlist

listCount = listCount + 1

destList.choices.list.count = listCount

destList.choices.list.selection = listCount

destList.choices.list.value = destVal

endIf

endmethod


DIVESITE.destsPage.choices.open
open

DIVESITE.destsPage.choices.open

Sets list.count property of the list object to 0, which empties the list.

method open(var eventInfo Event)

self.list.count = 0

endmethod


DIVESITE.destsPage.sitesPageBttn.pushButton
pushButton

DIVESITE.destsPage.sitesPageBttn.pushButton

Moves focus to sitesPage.

method pushButton(var eventInfo Event)

sitesPage.moveTo()

endmethod


DIVESITE.destsPage.clearMyQueryBttn.pushButton
pushButton

DIVESITE.destsPage.clearMyQueryBttn.pushButton

Clears current query values using MastLib.clearPageValues.

method pushButton(var eventInfo Event)

clearChoicesBttn.pushButton()

eventInfo.getTarget(uio)  ; what is the object?

mastLib.clearPageValues(formName.name, mastlib.pageNameOf(uio))

endmethod


DIVESITE.destsPage.cancelBttn.pushButton
pushButton

DIVESITE.destsPage.cancelBttn.pushButton

Hides the custom SpeedBar and returns to DIVEPLAN.FSL with no further processing.

method pushButton(var eventInfo Event)

; Hide videobar

myBar.Hide()

; return to Diveplan without any processing

formreturn(True)

endmethod


DIVESITE.destsPage.helpButton.pushButton
pushButton

DIVESITE.destsPage.helpButton.pushButton

Displays Help by calling helpShowContext. The value 20003 is a context ID for an item in the help file. In a larger application, it's a good idea to define constants for such values.

method pushButton(var eventInfo Event)

helpShowContext(helpfile, 20003)

endmethod


DIVESITE.destsPage.acceptBttn.pushButton
pushButton

DIVESITE.destsPage.acceptBttn.pushButton

Called by choosing the Accept button. Builds the destination string from current selected destinations and passes it as Query Value to QBEVAL.DB.

method pushButton(var eventInfo Event)

var

   destString String

tcDest, tc	TCursor

i, listCount SmallInt

endVar

destString = "" ; initialize destination string

eventInfo.getTarget(uio)

mastlib.clearPageValues(formName.Name, Mastlib.pageNameOf(uio))

; we must now fill assign destinations to QBEVAL.DB

listCount = destList.choices.list.count

IF listCount > 0

  then	; there are destinations

tc.Open("QBEVal.db")

if not tc.Locate("Query ID", 5)

then msgStop("Problem", "Couldn't locate Destination field in QBEVal")

else

tc.Edit() ; edit QBEVAL.DB

if listCount > 1

        then

      for i from 1 to listCount

; build a destination list string

destList.choices.list.selection = i

if destString <> ""

              then

destString = destList.choices.list.value +" OR " + destString

else

destString = destList.choices.list.value

endif

endfor

else

destString = destList.choices.list.value

endif

; assign destinations string to Query Value

tc."Query Value".value = destString

tc.endEdit()

tc.Close()

endif

endif

; hide VideoBar

myBar.Hide()

formReturn(True)

endmethod


DIVESITE.sitesPage

Methods

arrive

menuAction

open

clearPageObjects

Procedures

pageMenu

Uses window

Uses


DIVESITE.sitesPage.arrive
arrive

DIVESITE.sitesPage.arrive

Sets sitesPage title to "Sites" and displays a custom pop-up menu by calling the sitesPage.pageMenu procedure.

method arrive(var eventInfo MoveEvent)

; define title

setTitle("Sites")

; display custom menu

pageMenu()

endmethod


DIVESITE.sitesPage.menuAction
menuAction

DIVESITE.sitesPage.menuAction

Tests the string returned by a sitesPage menu selection and calls the appropriate method. For example, choosing the Accept item calls acceptBttn.pushButton.

method menuAction(var eventInfo MenuEvent)

var

 	mc String

endvar

; what menu option has been chosen?

mc = eventInfo.menuChoice()

switch

  case mc = "&Accept"       	: acceptBttn.pushbutton()

  case mc = "&Cancel"       	: cancelBttn.pushbutton()

  case mc = "Cl&ear"        	: clearMyQueryBttn.pushbutton()

  case mc = "&Destinations" 	: destsPageBttn.pushbutton()

  case mc = "&Contents"     	: helpShowContext(helpFile, 20004)

  case mc = "&Using Help"   	: helpOnHelp()

  case mc = "&About MAST" 	: mastLib.setIsCalledTrue()

if aboutFm.open("Abtmast.fsl") then

; modal dialog opened

aboutFm.Wait()

; now close it

aboutFm.Close()

mastLib.setIscalledFalse()

endif

endswitch

endmethod


DIVESITE.sitesPage.open
open

DIVESITE.sitesPage.open

This form must be called from DIVEPLAN.FSL; it cannot be run directly. Opens the MASTLIB.LSL library if found in the WORK directory.

method open(var eventInfo Event)

; This open method will not open Divesite.fsl unless it

; has been called from Diveplan.fsl. The variable isCalled in

; Mastlib.lsl has to be set to True for Divesite to be opened.

; isCalled is set to True by mastlib.setIsCalledTrue() which is

; invoked by the pushbutton method on Diveplan.

delayScreenUpdates(Yes)

;open library (make sure that it is in the WORK directory)

if not mastLib.Open("MastLib", GlobalToDesktop) then

  msgStop("Failure", "Mastlib could not be opened.")

  formReturn(false)

else

  wasCalled = mastLib.returnIsCalled()

  if wasCalled = False then

  msgStop("Stop!", "You cannot open this form directly. It must be opened from Diveplan.fsl.")

  close()

  else

 ; associate form UIObject name with formName var

 formName.attach()

 ; Make sure "divers" alias is defined, otherwise

 ; dataSource property will use Sites.db in model. This would present

 ; a problem as sites in data model is detail table, which

 ; would constrain the dataSource property of sitesField.sitesList.

 addAlias("divers", "standard", getAliasPath("Work"))

  endif

endif

delayScreenUpdates(No)

endmethod


DIVESITE.sitesPage.clearPageObjects
clearPageObjects

DIVESITE.sitesPage.clearPageObjects

Clears all field objects on this page by assigning them a value of "" (empty string).

method clearPageObjects(pageName String) Logical

; This custom method clears all objects on that page that have been

; selected.

var

pageObjTc TCursor

fieldObj UIObject

endVar

; list all the selectable fields on the page

mastLib.listPageObjects(formName.name, pageName)

; open tcursor on list of selectable fields

pageObjTc.open("Objlist.db")

; clear all selected fields

scan pageObjTc :

   fieldObj.attach(pageObjTc."Object Path")

if fieldObj  <> ""

 	  then

fieldObj = ""

endIf

endScan

; clear form.page values in Qbeval.db

mastLib.clearPageValues(formName.Name, pageName)

RETURN TRUE

endmethod


DIVESITE.sitesPage.pageMenu
pageMenu

DIVESITE.sitesPage.pageMenu

Called by sitesPage.arrive to display a custom pop-up menu.

proc pageMenu()

Var

 pageMenu Menu

 dropMenu1, dropMenu2 popUpMenu

endVar

; this custom proc displays a menu for Sites page

; define menu

dropMenu1.addText("&Accept")

dropMenu1.addText("&Cancel")

dropMenu1.addText("Cl&ear")

pageMenu.addPopUp("Se&lections", dropMenu1)

pageMenu.addText("&Destinations")

dropMenu2.addText("&Contents")

dropMenu2.addText("Using Help")

dropMenu2.addText("&About MAST")

pageMenu.addPopUp("&Help", dropMenu2)

pageMenu.show()

endproc


DIVESITE.sitesPage.Uses
DIVESITE.sitesPage Uses Window

The sitesPage Uses window declares external routines used by this page. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPal

   listPageObjects(formName String, pageName String) Logical

endUses


DIVESITE.sitesPage.sitesList.open
open

DIVESITE.sitesPage.sitesList.open

Fills this list with items from the Site Name field of SITES.DB.

method open(var eventInfo Event)

; Field filled from non-linked Sites.db. The alias :WORK: is

; used to define path of Sites.db, otherwise Sites.db in data model

; would be used.

self.dataSource = "[:WORK:Sites.Site Name]"

endmethod


DIVESITE.sitesPage.acceptBttn.pushButton
pushButton

DIVESITE.sitesPage.acceptBttn.pushButton

Called using menuAction by choosing the Accept Button. Uses Mastlib.setPageValues to post the selected site values (Accommodations, Site Highlight, and Night Life) to the appropriate fields in QBEVAL.DB. The Average Temperature field requires special handling to map, for example, "cold" to "<=69".

method pushButton(var eventInfo Event)

var

   tempVal String

Tc	TCursor

endVar

; We need to do some special processing to post to the Accomodations,

; Site Highlight, Night Life and Avg Temperature fields in QBEVAL.DB.

; With the exception of Avg Temperature - which requires special treatment -

; the setPageValues() method in Mastlib.lsl is called to do the processing.

eventInfo.getTarget(uio)

MastLib.setPageValues(formName.name, mastlib.pageNameOf(uio))

tc.Open("QBEVal.db")

tc.Edit()

; locate QBEVAL.DB Avg Temperature record

if not tc.Locate("Query ID", 9)

  then

   msgStop("Problem", "Couldn't locate Avg Temperature record in QBEVal")

else

tempVal = ""

if cold <> ""

then tempVal = "<=69"

endif

if subTropical <> ""

then

if tempVal <> "" THEN

tempVal = "<=79"

else

tempVal = ">=70, <=79"

endif

endif

if tropical <> ""

  then

if tempVal = "" THEN

tempVal = ">=80"

else

tempVal= tempVal+" OR >=80"

endif

endif

; set the value

tc."Query Value".value = tempVal

endif

tc.endEdit()

tc.close()

; return to DivePlan

formReturn(True)

endmethod


DIVESITE.sitesPage.clearMyQueryBttn.pushButton
pushButton

DIVESITE.sitesPage.clearMyQueryBttn.pushButton

Clears the current query values using MastLib.clearPageValues.

method pushButton(var eventInfo Event)

; what is the object?

eventInfo.getTarget(uio) ; what is the object?

; clear field objects and also Qbeval.db values

clearPageObjects(Mastlib.pageNameOf(Uio))

endmethod


DIVESITE.sitesPage.cancelBttn.pushButton
pushButton

DIVESITE.sitesPage.cancelBttn.pushButton

Returns to DIVEPLAN.FSL with no further processing.

method pushButton(var eventInfo Event)

; return to diveplan without any processing

formreturn(True)

endmethod


DIVESITE.sitesPage.destsPageBttn.pushButton
pushButton

DIVESITE.sitesPage.destsPageBttn.pushButton

Moves user to the destsPage.

method pushButton(var eventInfo Event)

destsPage.moveto()

endmethod


DIVESITE.sitesPage.helpButton.pushButton
pushButton

DIVESITE.sitesPage.helpButton.pushButton

Provides Help by calling helpShowContext. The value 20004 is a context ID for an item in the help file. In a larger application, it's a good idea to define constants for such values instead of hard-coding them.

method pushButton(var eventInfo Event)

helpShowContext(helpfile, 20004)

endmethod


lookList

Methods

open

close

menuAction

keyPhysical

mouseRightUp

showMe

Var, Const, and Uses windows

Var window

Uses window

Methods and procedures from MASTLIB.LSL

getLookUpTitle

getDataSource

setDataSource


lookList.open
open

lookList.open

Opens the MASTLIB.LSL library. The GlobalToDesktop makes this instance of the library available to other forms, provided the other forms also use GlobalToDesktop.

method open(var eventInfo Event)

if eventInfo.isPreFilter()

  then

    ;code here executes for each object in form

  else

    ;code here executes just for form itself

  	mastLib.open("mastlib.lsl", GlobalToDesktop)

formName.attach()

endif

endmethod


lookList.close
close

lookList.close

Closes the MASTLIB.LSL library.

method close(var eventInfo Event)

if eventInfo.isPreFilter()

  then

    ;code here executes for each object in form

  else

    ;code here executes just for form itself

    mastLib.close()

endif

endmethod


lookList.menuAction
menuAction

lookList.menuAction

This code executes when you use the control menu to close the form. It disables the default response and calls cancelButton.pushButton instead. As a result, closing the form via the control menu has the same effect as choosing the Cancel button.

method menuAction(var eventInfo MenuEvent)

if eventInfo.isPreFilter() then

; This code executes for each object on the form.

if eventInfo.id() = menuControlClose then

disableDefault

cancelBttn.pushButton()

endIf

else

; This code executes only for the form.

endif

endmethod


lookList.keyPhysical
keyPhysical

lookList.keyPhysical

Intercepts the Esc key to call cancelBttn.pushButton. Intercepts Alt+A to move to the List All button.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.isFirstTime() then

   if eventInfo.vCharCode() = VK_ESCAPE then

disableDefault

cancelBttn.pushButton()

endIf

if eventInfo.isAltKeyDown() then

if eventInfo.vChar() = "A" then

listAllBttn.moveTo()

endIf

endIf

endIf

endmethod


lookList.mouseRightUp
mouseRightUp

lookList.mouseRightUp

Calls the Mastlib library createObjMenu method when the right mouse button is released. This creates the Code Help menu. If you click on a Text or Bitmap object, the Help menu for the containing object is displayed because the objects have no code attached.

method mouseRightUp(var eventInfo MouseEvent)

; Calls mastlib.createObjMenu() to display a pop-up menu

; for the object you just right-clicked.

if eventInfo.isPreFilter()  then

   eventInfo.getTarget(uio) ; Which object was clicked?

                            ; If it's not the diveFlagBox bitmap,

                            ; find its container if it's a text object or a bitmap

    if uio.name <> "diveFlagBox"  then

      while

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

         uio.attach(uio.ContainerName)

      endWhile

   endif

mastLib.createObjMenu(formName, mastlib.pageNameOf(uio), uio)

endif

endmethod


lookList.showMe
showMe

lookList.showMe

Initializes the LookList dialog box form and makes it visible.

method showMe(const theTitle String, const listDataSource String)

setTitle(theTitle)

lookPg.lookUpFld.lookUpList.dataSource = listDataSource

lookPg.lookUpFld.lookUpList.list.selection = 1 ; highlight first value in list

if listDataSource = "[possdest.Destination Name]" then

listAllBttn.visible = True

else

listAllBttn.visible = False

endIf

lookUpFld.moveTo()

bringToTop()

endmethod


lookList.Var
lookList Var Window

Variables declared in the form's Var window are visible to all objects in the form.

Var

mastLib Library

uio UIObject

formName Form

endVar


lookList.Uses
lookList Uses Window

The Uses window declares external routines used by this form. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPAL

getLookUpTitle() String

getDataSource() String

setDataSource(const dataSrc String)

createObjMenu(var formName Form,  pageName String, uio UIObject)

pageNameOf(ui UIObject) STRING

endUses


lookList.lookPg.listAllBttn.pushButton
pushButton

lookList.lookPg.listAllBttn.pushButton

This button is displayed as a check box. When the button is checked, lookUpList displays all the destination fields in DEST.DB; otherwise the listing is restricted to the selected destination fields in POSSDEST.DB.

method pushButton(var eventInfo Event)

doDefault

switch

case self.value = True :

lookupFld.lookupList.dataSource = "[dest.Destination Name]"

case self.value = False :

lookupFld.lookupList.dataSource = "[possdest.Destination Name]"

endSwitch

endmethod


lookList.lookPg.cancelBttn.pushButton
pushButton

lookList.lookPg.cancelBttn.pushButton

Returns control to the calling method with no further processing.

method pushButton(var eventInfo Event)

  	formReturn("")

endmethod


lookList.lookPg.okBttn.pushButton
pushButton

lookList.lookPg.okBttn.pushButton

Returns control to the calling method with the selected field value.

method pushButton(var eventInfo Event)

formReturn(lookupFld.lookupList.list.value)

endmethod


lookList.lookPg.lookupFld

Methods

keyPhysical

newValue


lookList.lookPg.lookupFld.keyPhysical
keyPhysical

lookList.lookPg.lookupFld.keyPhysical

Intercepts the Return keystroke and call okBttn.pushButton.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.vCharCode() = VK_RETURN then

disableDefault

okBttn.pushButton()

endIf

endmethod


lookList.lookPg.lookupFld.newValue
newValue

lookList.lookPg.lookupFld.newValue

Displays the new value of this field by calling message(self.value).

method newValue(var eventInfo Event)

message(self.value)

endmethod


lookList.lookPg.lookupList.mouseDouble
mouseDouble

lookList.lookPg.lookupList.mouseDouble

Converts a double click to okBttn.pushButton.

method mouseDouble(var eventInfo MouseEvent)

okBttn.pushButton() ; make double-click = push OK

endmethod


videoBar

Methods

open

keyChar

mouseRightUp

keyPhysical

setCallFormName

Var, Const, and Uses windows

Var window

Const window

Uses window


videoBar.open
open

videoBar.open

Opens the MASTLIB.LSL library if found in the WORK directory. The GlobalToDesktop makes this instance of the library available to other forms, provided the other forms also use GlobalToDesktop.

method open(var eventInfo Event)

if not eventInfo.isPreFilter()

  then

;open library (make sure that it is in the WORK directory)

if not mastLib.open("MastLib", globalToDesktop)

then

msgStop("Failure", "Mastlib could not be opened.")

close()

else

formName.attach()

endif

endif

endmethod


videoBar.keyChar
keyChar

videoBar.keyChar

Intercepts the keystrokes "f", "p", "n", and "l" to invoke the pushButton methods of firstButton, priorButton, nextButton, and lastButton respectively.

method keyChar(var eventInfo KeyEvent)

switch

case eventInfo.char() = "f" : firstButton.pushButton()

case eventInfo.char() = "p" : priorButton.pushButton()

case eventInfo.char() = "n" : nextButton.pushButton()

case eventInfo.char() = "l" : lastButton.pushButton()

endswitch

endmethod


videoBar.mouseRightUp
mouseRightUp

videoBar.mouseRightUp

Calls the Mastlib library createObjMenu method when the right mouse button is released. This creates the Code Help menu. If you click on a Text or Bitmap object, the Help menu for the containing object is displayed because the objects have no code attached.

method mouseRightUp(var eventInfo MouseEvent)

; Calls a mastlib.createObjMenu() method that displays an object

; level help menu.

; prevent repeat method calls

if eventInfo.isPreFilter() then

; set focus to Videobar

bringToTop()

eventInfo.getTarget(uio) ; what is the object?

;find ui container if object text or bitmap

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

uio.attach(uio.ContainerName)

endWhile

mastLib.createObjMenu(formName, mastlib.pageNameOf(uio), uio)

; return focus to caller form

callerFm.bringToTop()

endif

endmethod


VIDEOBAR.keyPhysical
keyPhysical

VIDEOBAR.keyPhysical

Intercepts keystrokes and translates them to method calls, if appropriate. The values 20002, 20003, and 20005 are context IDs for items in the help file. In a larger application, it's a good idea to define constants for such values.

method keyPhysical(var eventInfo KeyEvent)

; if F1 pressed, display help for calling form (callerFm)

if eventInfo.isFirstTime()

  then

if eventInfo.vChar() = "VK_F1"

then

disableDefault

; what form was videoBar opened by?

Switch

Case callerFm.name = "diveBio" : helpShowContext(helpfile, 20002)

Case callerFm.name = "diveSite" : helpShowContext(helpfile, 20003)

Case callerFm.name = "diveWrck" : helpShowContext(helpfile, 20005)

Endswitch

endif

endif

endmethod


videoBar.setCallFormName
setCallFormName

videoBar.setCallFormName

Sets the position of the custom SpeedBar depending on the name of the calling form.

method setCallFormName(const callerTitle String, xPos LongInt, yPos LongInt)

   ; position VCR depending on calling form

var

   	x, y, w, h LongInt

endvar

; attach calling form to VCR bar

callerFm.attach(callerTitle)

; get videobar position

  	getPosition(x, y, w, h)

; reposition videobar per page parameters

   setPosition(xPos, yPos, w, h)

   ;  set focus on caller form

   callerFm.bringToTop()

endmethod


videoBar.Var
videoBar Var Window

Variables declared in the form's Var window are visible to all objects in the form.

Var

callerFm Form

uio UIObject

formName Form

mastLib Library

wasCalled Logical

endVar


videoBar.Const
videoBar Const Window

Constants declared in the form's Const window are visible to all objects in the form.

Const

helpFile = ":work:mastuser.hlp"

; path to Help file must be hard-coded (or file must be on path)

endConst


videoBar.Uses
videoBar Uses Window

The Uses window declares external routines used by this form. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPal

createObjMenu(var formName Form,

                 pageName String, uio UIObject)

pageNameOf(ui UIObject) String

returnIsCalled() Logical

   VCRisClosed()

endUses


videoBar.videoPg.lastButton.pushButton
pushButton

videoBar.videoPg.lastButton.pushButton

Selects the last record using callerFm.action(DataEnd). For example, if DIVEWRCK.FSL is the calling form, this method displays the last record of SHIPWRCK.DB.

method pushButton(var eventInfo Event)

callerFm.bringToTop()

callerFm.active.action(DataEnd)

endmethod


videoBar.videoPg.nextButton.pushButton
pushButton

videoBar.videoPg.nextButton.pushButton

Displays the next record using callerFm.action(DataNextRecord). For example, if DIVEBIO.FSL is the calling form, selects the next record of BIOLIFE.DB using callerFm.action(DataNextRecord) and displays all the information for that record.

method pushButton(var eventInfo Event)

callerFm.bringToTop()

callerFm.active.action(DataNextRecord)

endmethod


videoBar.videoPg.priorButton.pushButton
pushButton

videoBar.videoPg.priorButton.pushButton

Selects the previous record using callerFm.action(DataPriorRecord). For example, if DIVEBIO.FSL is the calling form, this method selects the previous record of BIOLIFE.DB using callerFm.action(DataNextRecord) and displays all the information for that record.

method pushButton(var eventInfo Event)

callerFm.bringToTop()

callerFm.active.action(DataPriorRecord)

endmethod


videoBar.videoPg.firstButton.pushButton
pushButton

videoBar.videoPg.firstButton.pushButton

Selects the first record using callerFm.action(DataBegin). For example, if DIVEBIO.FSL is the calling form, this method selects the first record of BIOLIFE.DB using callerFm.action(DataNextRecord) and displays all the information for that record.

method pushButton(var eventInfo Event)

callerFm.bringToTop()

callerFm.active.action(DataBegin)

endmethod


order

Methods

open

mouseEnter

mouseExit

mouseRightUp

keyPhysical

menuAction

Procedures

OrderOK

numberOfWeeks

getMsgObj

doLookUP

destinationCost

Var, Const, and Uses windows

Var window

Const window

Uses window

Methods and procedures from MASTLIB.LSL

pageNameOf

MastObjMsg

createObjMenu

setLookUpTitle

setDataSource


order.open
open

order.open

When the orders form opens, code attached to its built-in open method executes. This code performs several tasks to initialize the form.

method open(var eventInfo Event)

if not eventInfo.isPreFilter() then ; code executes for the form itself

if not isFile("mastord.fsl") then

msgInfo("Startup Error!",

              "The MAST application files must be in the working directory.")

close()

endif

; open library to share among forms

MASTLib.open("MastLib", GlobalToDesktop)

if not mastLib.isCanClose() then

hideSpeedBar()

mastLib.FormCanClose()

hiddenBar = True ; hiddenBar page-level variable that tells whether this form

                       ; hid the SpeedBar, or whether it was hidden by another form.

maximize()       ; because we weren't called by DivePlan, maximize the form.

else

hiddenBar = False

endIf

msgTC.open("msgHelp.db") ; open the messaging table

blankAsZero(Yes)

endif

endmethod


order.mouseEnter
mouseEnter

order.mouseEnter

Displays messages about the fields and multi-records when the mouse cursor enters their region.

method mouseEnter(var eventInfo MouseEvent)

var

uio UIObject

endvar

if eventInfo.isPreFilter() then

; code here executes for each object in the form

eventInfo.getTarget(uio)  ; what is the object?

if uio.name <> self.name AND  ; eliminate message if form

(uio.class = "Field" OR uio.class = "Multirecord" OR uio.class = "Button") then

 mastLib.MASTObjMsg(formName.Name, mastlib.pageNameOf(uio), uio.name)

endif

else

; code here executes just for the form itself

endIf

endmethod

See also

order.getMsgObj


order.mouseExit
mouseExit

order.mouseExit

When the mouse leaves a field or multi-record object, mouseExit clears the message generated by a previous mouseEnter call.

method mouseExit(var eventInfo MouseEvent)

var

uio UIObject

endvar

if eventInfo.isPreFilter() then

; code here executes for each object in the form

eventInfo.getTarget(uio)  ; what is the object?

if uio.name <> self.name AND uio.class="Field" then  ; eliminate message if form

message("")

endif

else

; code here executes just for the form itself

endIf

endmethod


order.mouseRightUp
mouseRightUp

order.mouseRightUp

This code executes whenever you right-click an object in the orders form. It finds out which object was the target of the click, then calls the custom method createObjMenu from the MastLib library to create a pop-up menu for the target object.

Notice that the code is placed in the isPreFilter clause so it executes before the form dispatches the event to the target object. For example, when you right-click a field object, the event goes to the form first, this code executes to respond to the event before the form dispatches the event to the field object.

method mouseRightUp(var eventInfo MouseEvent)

; Calls mastlib.createObjMenu() to display a pop-up menu

; for the object you just right-clicked.

if eventInfo.isPreFilter()  then

   eventInfo.getTarget(uio) ; Which object was clicked?

                            ; If it's not the diveFlagBox bitmap,

                            ; find its container if it's a text object or a bitmap

    if uio.name <> "diveFlagBox1"  then

      while

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

         uio.attach(uio.ContainerName)

      endWhile

   endif

mastLib.createObjMenu(formName, mastlib.pageNameOf(uio), uio)

endif

endmethod


order.keyPhysical
keyPhysical

order.keyPhysical

Uses hotKey to intercept the F1 key and various Alt+key combinations. The call to isPreFilter ensures that the following code executes before the form dispatches the event to the target object.

method keyPhysical(var eventInfo KeyEvent)

var

theKey String

targetPage UIObject

result Logical

endvar

if eventInfo.isPreFilter() then

theKey = eventInfo.vChar()

if eventInfo.isAltKeyDown() then

targetPage.attach(mastLib.pageNameOf(active))

Result = targetPage.hotKey(eventInfo)

if Result then ; if the page handled the key

    ; (hotKey is a custom method attached to the page)

sleep()

disableDefault ; block the default response

return

endIf

else

IF theKey = "VK_F1" THEN

disableDefault

IF mastLib.pageNameOf(active)="orderPg" THEN

helpShowContext(HELPFILE, HEADERHELP)

ELSE

helpShowContext(HELPFILE, DETAILHELP)

ENDIF

ENDIF

endif

endIf

endmethod


order.menuAction
menuAction

order.menuAction

This code prevents the user from using the Control menu to close the form.

method menuAction(var eventInfo MenuEvent)

if eventInfo.isPreFilter()

then	; This executes for each object on the form.

doDefault

else	; This code executes only for the form.

; block user from closing form

If eventInfo.ID() = MenuCanClose

and mastlib.isCanClose() = False then

eventInfo.setErrorCode(1)

formReturn(True)

disableDefault

Endif

endif

endmethod


order.OrderOK
OrderOK

order.OrderOK

Verifies that each required field in DIVECUST.DB and DIVEORDS.DB has a value. Returns False for any blank field.

proc orderOK() Logical

; This procedure returns true if all vacation information fields

; contains a value; otherwise, it returns false.

if Order_No.isBlank() or Destination.isBlank() or

   no_Of_People.isBlank() or depart_Date.isBlank() or

   return_Date.isBlank() or payment_Method.isBlank() then

return False

else

return True

endIf

endProc


order.numberOfWeeks
numberOfWeeks

order.numberOfWeeks

Returns the number of weeks, calculated using the values of the Depart_Date and Return_Date field objects.

Proc numberOfWeeks() Number

var

      nWeeks

      Number

   endVar

nWeeks = ceil(Number(Date(Return_Date.value) - Date(Depart_Date.value)))/7

if nWeeks > 0 then

return(nWeeks)

else

return(1)

endIf

endProc


order.getMsgObj
getMsgObj

order.getMsgObj

Given an object, searches the message table, MSGHELP.DB, and returns a cursor to the matching message. Used by order.mouseEnter to display messages appropriate to the mouse cursor position.

proc getMsgObj(uio UIObject, msgType String) String

; see if this container name exists in the messaging table

if msgTC.locate("Form Name", "order", "Object ID", uio.name) then

return msgTC.(msgType)

else

return ""

endif

endProc


order.doLookup
doLookup

order.doLookup

This custom procedure displays a dialog form that contains a list from which the user can choose a value. The argument theTitle specifies the text to display in the title bar of the dialog form, and the argument listDataSource specifies the table to use as a data source for the list.

The code in the try...onFail block tries to make the dialog form visible so the user can make a choice, and then make it invisible when the user is finished. This is faster than opening and closing the dialog form each time it's used.

doLookup is called by the built-in keyPysical method of the Name field object and the Destination field object.

proc doLookUp(const theTitle String, const listDataSource String) String

var

listVal String

endvar

try

listForm.showMe(theTitle, listDataSource)

; showMe is a custom method attached to lookList.fsl

onFail

try

listForm.hide() ; try to do something that requires the form to be open

onFail

listForm.open("lookList.fsl")

endTry

retry

endTry

listVal = listForm.wait()

try

listForm.hide()

onFail

if errorCode() = peFormClosed then

; If the user closed the dialog box, there's no need to hide it.

return ""

endIf

endTry

formName.bringToTop()

return listVal

endProc


order.destinationCost
destinationCost

order.destinationCost

This custom procedure returns the cost of a trip to a given destination.

proc destinationCost() NUMBER

var

destTC	TCURSOR

newCost	NUMBER

endVar

IF destination.isBlank() THEN

RETURN 0

ENDIF

destTC.open("dest.db")

IF destTC.locate("Destination Name", STRING(destination.value)) THEN

newCost = destTC."Travel Cost"

ELSE

newCost = 0

ENDIF

destTC.close()

RETURN newCost

endproc


order.Var
order Var Window

Variables declared in the form's Var window are visible to every object in the form.

Var

MASTLib	LIBRARY

formName,

listForm  FORM

   uio 	UIObject

msgTC,

destTC,

tc	TCURSOR

delRec 	String

hiddenBar	Logical

newCust,

newOrder,

sumItems,

   numWeeks,

destCost	Number

endVar


order.Const
order Const Window

Constants declared in the form's Const window are visible to every object in the form.

Const

TAXRATE    = .07 ; 7%

RENTALRATE = .15 ; 15%

HELPFILE   = ":WORK:mastuser.hlp" ; path to Help file

HEADERHELP = LongInt(20006)

DETAILHELP = LongInt(20007)

endConst


order.Uses
order Uses Window

The Uses window declares external routines used by this form. The routines can be stored in a DLL, an ObjectPAL library, or another form. The following code declares methods stored in the ObjectPAL library MASTLIB. The first line includes the ObjectPAL keyword to indicate that the methods are written in ObjectPAL, rather than in some other programming language used to create a DLL.

Uses ObjectPAL

; routines stored in MASTLIB.LSL (library)

pageNameOf(ui UIObject) STRING

MASTObjMsg(formName String, pageName String, objID String)

createObjMenu(var formName Form,  pageName String, uio UIObject)

setLookUpTitle(const lookTtl String)

setDataSource(const lookSrc String)

; custom method attached to LOOKLIST.FSL (form)

showMe(const theTitle String, const listDataSource String)

   ; Tells you if you can close the form from the Control menu

   isCanClose() Logical

   formCanClose()

endUses


order.orderPg2

Methods

open

arrive

menuAction

hotKey

Procedures

setLineOrdMnu

Var, Const, and Uses Windows

Var window

Const window


order.orderPg2.open
open

order.orderPg2.open

Calls setLineOrdMn to display the Equipment Orders menu.

method open(var eventInfo Event)

setLineOrdMnu()

endmethod


order.orderPg2.arrive
arrive

order.orderPg2.arrive

Displays the menu for this page and associates a TCursor with the current record of the  DIVEITEM table frame. The TCursor is used by calculated fields on this page.

method arrive(var eventInfo MoveEvent)

lineMnu.show()

tc.attach(diveItem)

doDefault

endmethod


order.orderPg2.menuAction
menuAction

order.orderPg2.menuAction

This code sets the display attributes of menu items and calls the appropriate action from a selection from any of the line order menus. For example, selecting First triggers a DIVEITEM.action(DataBegin) call. Choosing Book It! returns you to orderPg, the main order page. Display attributes are set by testing for eventInfo.id = MenuInit. When you click an item in the menu bar, it generates a MenuInit event just before it displays the drop-down menu. In that instant, you can specify menu choice display attributes.

method menuAction(var eventInfo MenuEvent)

var

menuID SmallInt

retVal Logical

endVar

menuID = eventInfo.id()

if eventInfo.id() = MenuInit then

try

retVal = active.Editing

onFail

return

endTry

if retVal = True then

if active.SelectedText <> "" then

setMenuChoiceAttributeByID(UserMenu + EdCut, MenuEnabled)

setMenuChoiceAttributeByID(UserMenu + EdCopy, MenuEnabled)

else

setMenuChoiceAttributeByID(UserMenu + EdCut,

      	                              MenuGrayed + MenuDisabled)

setMenuChoiceAttributeByID(UserMenu + EdCopy,

                                    MenuGrayed + MenuDisabled)

endIf

endIf

endIf

SWITCH

; Vacation menu

CASE menuID = UserMenu + VacaBooking : orderPg.moveTo()

; Edit menu

CASE menuID = UserMenu + EdCut   : active.menuAction(MenuEditCut)

CASE menuID = UserMenu + EdCopy  : active.menuAction(MenuEditCopy)

CASE menuID = UserMenu + EdPaste : active.menuAction(MenuEditPaste)

; Record menu

CASE menuID = UserMenu + RecFirst  : active.action(DataBegin)

CASE menuID = UserMenu + RecLast   : active.action(DataEnd)

CASE menuID = UserMenu + RecNext   : active.action(DataNextRecord)

CASE menuID = UserMenu + RecPrev   : active.action(DataPriorRecord)

CASE menuID = UserMenu + RecIns    : active.action(DataInsertRecord)

CASE menuID = UserMenu + RecDel    : active.action(DataDeleteRecord)

CASE menuID = UserMenu + RecCancel : active.action(DataCancelRecord)

; Help menu

CASE menuID = UserMenu + HelpUsingHelp  : helpShowContext(HELPFILE, DETAILHELP)

CASE menuID = UserMenu + HelpSystemHelp : helpOnHelp()

CASE menuID = UserMenu + HelpHelpIndex  : helpShowIndex(HELPFILE)

endSwitch

endmethod

See also

order.orderPg2.setLineOrdMnu


order.orderPg2.hotKey
hotKey

order.orderPg2.hotKey

An auxiliary procedure used by order.keyPhysical. It allows keyPhysical to call either orderPg.hotKey or orderPg2.hotKey depending on the active page. This hotKey intercepts keystrokes and performs appropriate moveTo and pushButton actions.  If the actions are successful, True is returned, otherwise False is returned. Keystrokes that aren't intercepted here return False.

method hotKey(var eventInfo KeyEvent) Logical

var

theKey String

endvar

if eventInfo.isAltKeyDown() then

theKey = eventInfo.vChar()

switch

case theKey = "B" : return bookingBttn.pushButton()

case theKey = "I" : return diveItem.itemRecord.Item_No.moveTo()

case theKey = "N" : return noteBttn.pushButton()

case theKey = "Q" : return DIVEITEM.itemRecord.Qty.moveTo()

case theKey = "R" : return DIVEITEM.itemRecord.Rental_Sale.moveTo()

case theKey = "S" : return subTotalBox.Ship_Via.moveTo()

otherwise         : return False

endSwitch

endIf

endmethod


order.orderPg2.setLineOrdMnu
setLineOrdMnu

order.orderPg2.setLineOrdMnu

Called by orderPg2.open to create the three drop-down menus that make up the Line Order menu.

proc setLineOrdMnu()

vacationPop.addText("&Booking", MenuEnabled, UserMenu + VacaBooking)

lineMnu.addPopup("&Vacation", vacationPop)

editPop.addText("Cu&t", MenuGrayed + MenuDisabled, UserMenu + EdCut)

editPop.addText("&Copy", MenuGrayed + MenuDisabled, UserMenu + EdCopy)

editPop.addText("&Paste", MenuGrayed + MenuDisabled, UserMenu + EdPaste)

lineMnu.addPopUp("&Edit", editPop)

recordPop.addText("&First\tCtrl + F11", MenuEnabled, UserMenu + RecFirst)

recordPop.addText("&Last\tCtrl + F12", MenuEnabled, UserMenu + RecLast)

recordPop.addText("&Next\tF12", MenuEnabled,  UserMenu + RecNext)

recordPop.addText("&Previous\tF11", MenuEnabled,  UserMenu + RecPrev)

recordPop.addSeparator()

recordPop.addText("&Insert\tINS", MenuEnabled,  UserMenu + RecIns)

recordPop.addText("&Delete\tCtrl + DEL", MenuEnabled, UserMenu + RecDel)

recordPop.addText("&Cancel Changes\tAlt + Bksp", MenuEnabled, UserMenu + RecCancel)

lineMnu.addPopUp("&Record", recordPop)

helpPop.addText("&Using Help", MenuEnabled, UserMenu + 301)

helpPop.addText("Help &Index", MenuEnabled, UserMenu + 302)

helpPop.addText("System &Help", MenuEnabled, UserMenu + 303)

lineMnu.addPopup("&Help",helpPop)

endProc


order.orderPg2.Var
order.orderPg2 Var Window

These variables are visible to all objects in this page of the form, but not to objects in the first page.

Var

lineMnu Menu

vacationPop, editPop, recordPop, helpPop PopUpMenu

endVar


order.orderPg2.Const
order.orderPg2 Const Window

These constants are visible to all objects in this page of the form, but not to objects in the first page.

Const

VacaBooking = 101

EdCut = 201

EdCopy = 202

EdPaste = 203

RecFirst = 301

RecLast = 302

RecNext = 303

RecPrev = 304

RecIns = 305

RecDel = 306

RecCancel = 307

HelpUsingHelp = 401

HelpHelpIndex = 402

HelpSystemHelp = 403

endConst


order.orderPg2.bookingBttn

Methods

action

pushButton


order.orderPg2.bookingBttn.action
action

order.orderPg2.bookingBttn.action

This code executes when you press Enter to push the button. By default, Paradox generates a FieldEnter action and moves focus to the next object in the tab order (in this case, the next object is helpBttn). In htis case, though, the desired behavior is to move back to the first page. This is accomplished by manipulating helpBttn's TabStop property and calling doDefault to execute the default code for the action.

method action(var eventInfo ActionEvent)

if eventInfo.id() = FieldEnter then ; if the user presses Enter

helpBttn.TabStop = False

doDefault

helpBttn.TabStop = True

endIf

endmethod


order.orderPg2.bookingBttn.pushButton
pushButton

order.orderPg2.bookingBttn.pushButton

Moves the user to the main order page using orderPg.moveTo. Before moving, this code makes sure the item record is complete and updates field values.

method pushButton(var eventInfo Event)

doDefault

if subTotalBox.Ship_Via.isBlank() and

diveItem.nRecords > 0 then

msgInfo("Incomplete order", "Enter a shipping vendor.")

subTotalBox.ship_Via.moveTo()

else

setMouseShape(mouseWait)

Subtotal = subTotal2

Total_Invoice = Total_Invoice2

orderPG.moveTo()

setMouseShape(mouseArrow)

endIf

endmethod


order.orderPg2.noteBttn.pushButton
pushButton

order.orderPg2.noteBttn.pushButton

Opens an Editor window allowing the user to enter and edit line item notes in the Notes memo field of DIVEITEM.DB for the record at the current order number.

method pushButton(var eventInfo Event)

var

curr_ID	Number

noteText String

endVar

delayScreenUpdates(Yes)

curr_ID = Item_No

doDefault

diveItem.itemRecord.Item_No.moveTo()

diveItem.Locate("Item No",  curr_ID)

noteText = Line_Note

noteText.view("Line item notes")

Line_Note = noteText

delayScreenUpdates(No)

endmethod


order.orderPg2.helpBttn.pushButton
pushButton

order.orderPg2.helpBttn.pushButton

Displays the Equipment Orders screen of the MASTUSER.HLP file using helpShowContext with context ID specified by the DETAILHELP constant. Compare with the order.orderPg.helpBttn.pushButton, which displays the Main Order Entry screen of MASTUSER.HLP.

method pushButton(var eventInfo Event)

doDefault

helpShowContext(HELPFILE, DETAILHELP)

endmethod


order.orderPg2.DIVEITEM

Methods

arrive

action

getDescription

Var window

Var window


order.orderPg2.DIVEITEM.arrive
arrive

order.orderPg2.DIVEITEM.arrive

When focus moves to DIVEITEM, this code executes and attaches a TCursor to the current record.

method arrive(var eventInfo MoveEvent)

tc.attach(diveItem)

endmethod


order.orderPg2.DIVEITEM.action
action

order.orderPg2.DIVEITEM.action

This code specifies custom responses to the following actions: arrive, delete, lock, unlock, post, and insert. It also specifies how to handle key violations.

method action(var eventInfo ActionEvent)

var

newValue Number

actionID	smallInt

endvar

setMouseShape(mouseWait)

delayScreenUpdates(Yes)

actionID = eventInfo.id()

switch

case actionID = dataArriveRecord :

subTotal2.action(dataRecalc)

case actionID = DataDeleteRecord :

Message("Now deleting ordered item (" +

        String(Item_No) + ")...")

if not self.Locked then

if not Item_no.isBlank() and not Qty.isBlank() then

self.action(dataLockRecord)

self.action(dataPostRecord)

endIf

endIf

delRec = "Yes"

doDefault

Message("")

case actionID = DataLockRecord :

if not self.locked then

doDefault

On_Hand = On_Hand + Qty

else

disableDefault

endIf

case actionID = DataUnlockRecord :

if not Item_No.isBlank() or not Qty.isBlank() then

On_Hand = On_Hand - Qty

If self.action(dataPostRecord) then

doDefault

else

disableDefault

On_Hand = On_Hand + Qty

beep()

msgInfo("Can't save item order", "Make sure you've " +

        "entered a item number and a quantity that " +

        "hasn't already been ordered.")

eventInfo.setErrorCode(cannotDepart)

return

endIf

else

disableDefault

beep()

msgInfo("Can't save record", "Make sure you've entered " +

        "a valid item number and quantity.")

diveItem.itemRecord.Item_No.moveTo()

eventInfo.setErrorCode(cannotDepart)

endIf

case actionID = DataPostRecord :

if self.touched then

if Rental_Sale = "Rental" then

Price = Sale_Price * numWeeks * rentalRate

else

Price = Sale_Price

endIf

Line_Total = Price * Qty

cPrice.action(dataRecalc)

cLine_Total.action(dataRecalc)

endIf

doDefault

if errorCode() = peKeyViol then

beep()

msgInfo("Duplicate Item Number", "Choose a different " +

        "item number to save this record or press <Ctrl+" +

        "Del> to cancel (and delete) it.")

endIf

case actionID = DataInsertRecord :

doDefault

ItemRecord.Item_no.moveTo()

otherwise : doDefault

endSwitch

delayScreenUpdates(No)

setMouseShape(mouseArrow)

endmethod


order.orderPg2.DIVEITEM.getDescription
getDescription

order.orderPg2.DIVEITEM.getDescription

Opens a LOOKLIST form (if not already open) to display a list of available item descriptions from DIVESTOK.DB using the LOOKLIST.showMe custom procedure. If an item is selected from the list, the corresponding record is retrieved from DIVESTOK.DB.

method getDescription()

var

itemDesc AnyType

endVar

try

listForm.showMe("Stock Items", "[divestok.description]")

; call custom method attached to lookList.fsl

onFail

listForm.open("looklist.fsl")

retry

endTry

itemDesc = listForm.wait()

if listForm.isAssigned() and listForm.Focus then

listForm.hide()

endIf

BringToTop()

If itemDesc <> "" THEN ; if chose an item

; Lookup up the item to get the item number

stockTC.open("diveStok.db")

IF StockTC.locate("Description", itemDesc) THEN

DIVEITEM.itemRecord.item_No.value = StockTC."Item No"

   ; filling in item number automatically fills in description

ENDIF

DIVEITEM.itemRecord.Qty.moveTo()

endif

endmethod


order.orderPg2.DIVEITEM.Var
order.orderPg2.DIVEITEM Var Window

These variables are visible to all the objects contained by DIVEITEM.

Var

stockTC tCursor

endVar


order.orderPg2.Qty

Methods

arrive

changeValue


order.orderPg2.Qty.arrive
arrive

order.orderPg2.Qty.arrive

If the Item_No field object for the current record does not contain a value, this code moves focus to it.

method arrive(var eventInfo MoveEvent)

; This method helps ensure an Item number is entered before

; a quantity.

If Item_No.isBlank() then

Item_No.moveTo()

Endif

endmethod


order.orderPg2.Qty.changeValue
changeValue

order.orderPg2.Qty.changeValue

Compares the quantity in stock with the quantity ordered. If there are enough in stock, this code calculates the price and sends a DataRecalc action to the cLine_Total field object. Next, stock levels are updated and checked against the Reorder Point field in DIVESTOK.DB. A Reorder message is displayed when stock is low.

method changeValue(var eventInfo ValueEvent)

var newQty Number endVar

newQty = eventInfo.newValue()

if newQty > On_Hand then

beep()

msgInfo("Invalid Quantity", "There are only " +

        String(On_Hand) + " units in stock. Enter " +

        "smaller quantity.")

Qty.moveTo()

disableDefault

else

doDefault

if cLine_Total > 0 then

Line_Total = Qty * cPrice

cLine_Total.action(DataRecalc)

endIf

if On_Hand - Qty <= reOrder_Point then

msgInfo("Time to Reorder Item " + string(Item_No),

        "There are " + String(On_Hand - Qty) +

        " units left in stock.")

endIf

endIf

endmethod


order.orderPg2.Rental_Sale.newValue
newValue

order.orderPg2.Rental_Sale.newValue

Calculates the appropriate price for a sale or a rental, then sends DataRecalc actions to the appropriate calculated fields.

method newValue(var eventInfo Event)

if eventInfo.reason() = editValue then

if Rental_Sale = "Sale" then

      Price = Sale_Price

   else

      Price = Sale_Price * rentalRate * numWeeks

   endIf

Line_Total = Price * Qty

cPrice.action(DataRecalc)

cLine_Total.action(DataRecalc)

endIf

endmethod


order.orderPg2.buyButton.keyPhysical
keyPhysical

order.orderPg2.buyButton.keyPhysical

This code executes when you press the right, up, or down arrow key and overrides the default response.

method keyPhysical(var eventInfo KeyEvent)

   disableDefault

Switch

      Case eventInfo.vChar() = "VK_RIGHT" :

action(FieldForward)

Case eventInfo.vChar() = "VK_UP"   :

action(FieldUp)

      Case eventInfo.vChar() = "VK_DOWN" :

action(FieldDown)

Otherwise : doDefault

endSwitch

endmethod


order.orderPg2.rentalButton.keyPhysical
keyPhysical

order.orderPg2.rentalButton.keyPhysical

This code executes when you press the right, up, or down arrow key and overrides the default response.

method keyPhysical(var eventInfo KeyEvent)

   disableDefault

Switch

      Case eventInfo.vChar() = "VK_LEFT" :

action(FieldBackward)

Case eventInfo.vChar() = "VK_UP"   :

action(FieldUp)

      Case eventInfo.vChar() = "VK_DOWN" :

action(FieldDown)

Otherwise : doDefault

endSwitch

endmethod


order.orderPg2.Item_No.keyPhysical
keyPhysical

order.orderPg2.Item_No.keyPhysical

This code executes when you press Ctrl + Space. It calls the custom method getDescription to display a dialog form you can use to look up equipment.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.isControlKeyDown() and eventInfo.vCharCode() = VK_SPACE then

disableDefault

getDescription() ; custom method attached to DIVEITEM table frame

endIf

endmethod


order.orderPg2.Subtotal2.calcField
calcField

order.orderPg2.Subtotal2.calcField

The following code is not attached to any built-in method. Subtotal2 is a calculated field, and this code calculates its value by calling cSum to get the sum of the values in the Line Total field.

iif(diveItem.nRecords > 0, tc.cSum("Line Total"), 0)


order.orderPg2.Ship_Via.changeValue
changeValue

order.orderPg2.Ship_Via.changeValue

Moves focus to bookingBttn.

method changeValue(var eventInfo ValueEvent)

doDefault

bookingBttn.moveTo()

endmethod


order.orderPg2.vacCost2.calcField
calcField

order.orderPg2.vacCost2.calcField

The following code is not attached to any built-in method. vacCost2 is a calculated field, and this code calculates its value. It displays the value of the VacationCost field for the current record.

vacationCost


order.orderPg2.Total_Invoice2.calcField
calcField

order.orderPg2.Total_Invoice2.calcField

The following code is not attached to any built-in method. Invoice2 is a calculated field, and this code calculates its value by adding the values of three other fields.

vacationCost + Ship_Cost + subTotal2


order.orderPg

Methods

open

close

arrive

menuAction

hotKey

Procedures

setMainOrdMnu

Var, Const, and Uses windows

Var window

Const window


order.orderPg.open
open

order.orderPg.open

Calls setMainOrdMnu to display the orderPg menu, puts the form into Edit mode, and associates the formName variable with this form.

method open(var eventInfo Event)

delayScreenUpdates(Yes)

setMouseShape(MouseWait)

setMainOrdMnu()

formName.attach()

action(DataBeginEdit) ; place form into edit mode

setMouseShape(MouseArrow)

doDefault

delayScreenUpdates(No)

endmethod


order.orderPg.close
close

order.orderPg.close

Closes any open lookList window before closing the order form, lcoses the Help system, and restores the SpeedBar.

method close(var eventInfo Event)

try

listForm.close()

onFail

errorClear() ; If it's already closed, OK.

doDefault

endTry

 helpQuit(HELPFILE)

; hiddenBar is a page-level variable. It tells whether this form hid

;  the SpeedBar, or whether it was already hidden by another form.

if hiddenBar then

showSpeedBar()

endIf

endmethod


order.orderPg.arrive
arrive

order.orderPg.arrive

Displays the orderPg menu by calling mainMnu.show.

 method arrive(var eventInfo MoveEvent)

mainMnu.show()

endmethod


order.orderPg.menuAction
menuAction

order.orderPg.menuAction

Calls the appropriate action based on the selection made from the orderPg menu. For example, selecting First triggers an active.action(DataBegin) call. Display attributes are set by testing for eventInfo.id = MenuInit. When you click an item in the menu bar, it generates a MenuInit event just before it displays the drop-down menu. In that instant, you can specify menu choice display attributes.

method menuAction(var eventInfo MenuEvent)

var

menuID SmallInt

numRecs, i Number

tc	TCursor

retVal Logical

endVar

menuID = eventInfo.id()

if eventInfo.id() = MenuInit then

try

retVal = active.Editing

onFail

return

endTry

if retVal = True then

if active.SelectedText <> "" then

setMenuChoiceAttributeByID(UserMenu + EdCut, MenuEnabled)

setMenuChoiceAttributeByID(UserMenu + EdCopy, MenuEnabled)

else

setMenuChoiceAttributeByID(UserMenu + EdCut,

                                    MenuGrayed + MenuDisabled)

setMenuChoiceAttributeByID(UserMenu + EdCopy,

                                    MenuGrayed + MenuDisabled)

endIf

endIf

endIf

SWITCH

; Order menu

CASE menuID = UserMenu + OrdFindCust :

DIVECUST."Name".findCust() ; custom method attached to Name

CASE menuID = UserMenu + OrdOrderEquip :

orderPg2.moveTo()

CASE menuID = UserMenu + OrdExit :

saveBttn.pushButton()

CASE menuID = UserMenu + OrdPrint :

menuAction(MenuFilePrint) ; prints a snapshot of the form (both pages)

; Edit menu

CASE menuID = UserMenu + EdCut :

active.menuAction(MenuEditCut)

CASE menuID = UserMenu + EdCopy :

active.menuAction(MenuEditCopy)

CASE menuID = UserMenu + EdPaste :

active.menuAction(MenuEditPaste)

; Record menu

CASE menuID = UserMenu + RecFirst :

active.action(DataBegin)

CASE menuID = UserMenu + RecLast :

active.action(DataEnd)

CASE menuID = UserMenu + RecNext :

active.action(DataNextRecord)

CASE menuID = UserMenu + RecPrev :

active.action(DataPriorRecord)

CASE menuID = UserMenu + RecIns :

active.action(DataInsertRecord)

CASE menuID = UserMenu + RecDel :

active.action(DataDeleteRecord)

CASE menuID = UserMenu + RecCancel :

active.action(DataCancelRecord)

; Help menu

CASE menuID = UserMenu + HelpUsingHelp :

helpOnHelp()

CASE menuID = UserMenu + HelpSystemHelp :

helpShowContext(HELPFILE, HEADERHELP)

CASE menuID = UserMenu + HelpHelpIndex :

helpShowIndex(HELPFILE)

ENDSWITCH

endmethod

See also

setMainOrdMnu


order.orderPg.hotKey
hotKey

order.orderPg.hotKey

An auxiliary procedure used by  the form's keyPhysical method. The form calls either orderPg.hotKey or orderPg2.hotKey depending on the active page. This hotKey intercepts specified keys to perform various moveTo and pushButton actions. Other keystrokes return False. If the actions are successful, True is returned, otherwise False is returned. For example, Alt+N calls DIVECUST."Name".moveTo.

method hotKey(var eventInfo KeyEvent) Logical

var

theKey String

endvar

if eventInfo.isAltKeyDown() then

theKey = eventInfo.vChar()

switch

case theKey = "A" : return DIVECUST.Street.moveTo()

case theKey = "D" : return DIVEORDS.Destination.moveTo()

case theKey = "F" : return DIVECUST."Name".findCust()

case theKey = "I" : return DIVECUST.City.moveTo()

case theKey = "L" : return DIVECUST.Phone.moveTo()

case theKey = "M" : return DIVEORDS.Payment_Method.moveTo()

case theKey = "N" : return DIVECUST."Name".moveTo()

case theKey = "P" : return DIVEORDS.Depart_Date.moveTo()

case theKey = "Q" : return equipmentOrdersButton.pushButton()

case theKey = "S" : return DIVECUST.State_Prov.moveTo()

case theKey = "T" : return DIVEORDS.No_Of_People.moveTo()

case theKey = "U" : return DIVEORDS.Return_Date.moveTo()

case theKey = "V" : return vacationInfoBttn.pushButton()

case theKey = "X" : return saveBttn.pushButton()

case theKey = "Y" : return DIVECUST.Country.moveTo()

case theKey = "Z" : return DIVECUST.Zip_Postal_Code.moveTo()

otherwise         : return False

endSwitch

endIf

endmethod


order.orderPg.setMainOrdMnu
setMainOrdMnu

order.orderPg.setMainOrdMnu

Called by orderPg.open to create the drop-down menus that make up the orderPg menu.

proc setMainOrdMnu()

orderPop.addText("&Find Customer", MenuEnabled, UserMenu + OrdFindCust)

orderPop.addText("&Order Equipment", MenuEnabled, UserMenu + OrdOrderEquip)

orderPop.addSeparator()

orderPop.addText("&Print", MenuEnabled, UserMenu + OrdPrint)

orderPop.addText("E&xit", MenuEnabled, UserMenu + OrdExit)

mainMnu.addPopup("&Order", orderPop)

editPop.addText("Cu&t", MenuGrayed + MenuDisabled, UserMenu + EdCut)

editPop.addText("&Copy", MenuGrayed + MenuDisabled, UserMenu + EdCopy)

editPop.addText("&Paste", MenuEnabled, UserMenu + EdPaste)

mainMnu.addPopup("&Edit", editPop)

recordPop.addText("&First\tCtrl + F11", MenuEnabled, UserMenu + RecFirst)

recordPop.addText("&Last\tCtrl + F12", MenuEnabled, UserMenu + RecLast)

recordPop.addText("&Next\tF12", MenuEnabled,  UserMenu + RecNext)

recordPop.addText("&Previous\tF11", MenuEnabled,  UserMenu + RecPrev)

recordPop.addSeparator()

recordPop.addText("&Insert\tINS", MenuEnabled,  UserMenu + RecIns)

recordPop.addText("&Delete\tCtrl + DEL", MenuEnabled, UserMenu + RecDel)

recordPop.addText("&Cancel Changes\tAlt + Bksp", MenuEnabled, UserMenu + RecCancel)

mainMnu.addPopUp("&Record", recordPop)

helpPop.addText("&Using Help", MenuEnabled, UserMenu + HelpUsingHelp)

helpPop.addText("Help &Index", MenuEnabled, UserMenu + HelpHelpIndex)

helpPop.addText("System &Help", MenuEnabled, UserMenu + HelpSystemHelp)

mainMnu.addPopup("&Help", helpPop)

endproc


order.orderPg.Var
order.orderPg Var Window

These variables are visible to all objects contained by this page, but not to objects in orderPg2.

Var

orderPop,

editPop,

equipmentPop,

recordPop,

helpPop	PopUpMenu

mainMnu	Menu

endVar


order.orderPg.Const
order.orderPg Const Window

These constants are visible to all objects contained by this page, but not to objects in orderPg2.

Const

OrdFindCust = 101

OrdOrderEquip = 102

OrdExit = 103

OrdPrint = 104

EdCut = 201

EdCopy = 202

EdPaste = 203

RecFirst = 301

RecLast = 302

RecNext = 303

RecPrev = 304

RecIns = 305

RecDel = 306

RecCancel = 307

HelpUsingHelp = 401

HelpHelpIndex = 402

HelpSystemHelp = 403

endConst


order.orderPg.helpBttn.pushButton
pushButton

order.orderPg.helpBttn.pushButton

Displays the Main Order Entry screen of the MASTUSER.HLP file using helpShowContext with the context ID value assigned to the HEADERHELP constant (declared in the forms' Const window). Compare with order.orderPg2.helpBttn.pushButton, which displays the Equipment Orders screen of MASTUSER.HLP.

method pushButton(var eventInfo Event)

doDefault

helpShowContext(HELPFILE, HEADERHELP)

endmethod


order.orderPg.DIVECUST.action
action

order.orderPg.DIVECUST.action

DIVECUST is a multi-record object holding the Order Header (Customer Name & Address, Customer No., and so on). The code attached to its built-in action method specifies responses to certain actions (identified using eventInfo.id).

method action(var eventInfo ActionEvent)

; This method traps for actions on diveCust and takes a variety

; of actions, depending on the action that was trapped.

var

custTB	tCursor

actionID smallInt

endvar

setMouseShape(mouseWait)

delayScreenUpdates(Yes)

actionID = eventInfo.id()

switch

case actionID = DataUnlockRecord :

action(dataPostRecord)

doDefault

case actionID = DataPostRecord :

if not Name.isBlank() and

   not Street.isBlank() and

   not City.isBlank() and

   not Phone.isBlank() then

if diveItem.nRecords > 0 and diveItem.touched then

diveItem.action(dataPostRecord)

endIf

if diveOrds.nRecords > 0 and diveOrds.touched then

diveOrds.action(dataPostRecord)

endIf

doDefault

else

beep()

msgInfo("Need Customer Information", "Enter this customer's " +

        "name, address, city, and phone number before saving " +

        "this record. To cancel (and delete) it, press. <Ctrl+Del>.")

disableDefault

endIf

; If a record is inserted, then calculate a new customer number

; and post the record containing the new number.

case actionID = DataInsertRecord :

doDefault

custTB.attach(diveCust)

; Lock table to prevent others from writing to it

; while we get a new Customer Number.

if lock(custTB, "Write") then

Customer_No.value = custTB.cMax("Customer No") + 1

unlock(custTB, "Write")

endIf

newCust = Customer_No.value

diveCust.Name.moveTo()

; if a record is deleted, then see if it contains any useful

; information.  If not, simply delete it.  If there is useful

; customer data, display a confirmation dialog and let the

; user choose the action they want.

case actionID = DataDeleteRecord:

if DIVECUST.Name.isBlank() then

delRec = "Yes"

else

delRec = msgYesNoCancel("Delete?",

   "Delete information for " +

DIVECUST.Name.value + "?")

endIf

delayScreenUpdates(Yes)

switch

case delRec = "Yes":

Message("Now deleting information for " + diveCust.Name.value)

; If there are orders attached to this customer, then

; delete them.

while diveOrds.nRecords > 0

diveOrds.action(DataDeleteRecord)

if delRec <> "Yes" then

quitLoop

endIf

endWhile

; if the user cancelled an order delete action, then

; _don't_ delete this customer; otherwise, delete this

; record.

if delRec <> "Yes" then

disableDefault

else

 	doDefault

endIf

case delRec = "No":

disableDefault

case delRec = "Cancel":

disableDefault

eventInfo.setErrorCode(cannotDepart)

otherwise : doDefault

endSwitch

message("")

endSwitch

delayScreenUpdates(No)

setMouseShape(mouseArrow)

endmethod


order.orderPg.Name

Methods

keyPhysical

findCust


order.orderPg.Name.keyPhysical
keyPhysical

order.orderPg.Name.keyPhysical

Intercepts a Ctrl+Space keystroke to call the custom method findCust.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.isControlKeyDown() and eventInfo.vCharCode() = VK_SPACE then

disableDefault

findCust() ; custom method attached to self

                ; (not proc, because it's also called

                ; by objects outside its containership hierarchy)

endif

endmethod


order.orderPg.Name.findCust
findCust

order.orderPg.Name.findCust

Custom method called by Name.keyPhysical when a Ctrl+Space keystroke is detected. findCust first checks the Name field object of the current DIVECUST.DB record and deletes the record if Name is blank. A customer lookup list is then displayed by listForm.showMe, allowing customer selection. The selected customer is located in DIVECUST.DB and a new order record is inserted in DIVEORDS.DB using DIVEORDS.action(DataInsertRecord).

method findCust() Logical

var

custListName AnyType

endVar

custListName = doLookUp("Customer Lookup", "[Divecust.Name]")

if custListName <> "" then

if DIVECUST.locate("Name", custListName) then

return True

else

msgInfo("Find Customer", "Couldn't find " + custListName)

endIf

else

return False

endIf

endmethod


order.orderPg.saveBttn.pushButton

This code makes sure the current record is complete, then returns control to the DIVEPLAN form (or closes the Orders form, if it was run stand-alone).

method pushButton(var eventInfo Event)

doDefault

if diveCust.touched or

diveOrds.touched then

if diveCust.action(dataPostRecord) then

formReturn(True)  ; exit or return to DIVEPLAN.FSL

else

msgInfo("Can't Exit Yet", "You have an incomplete " +

        "customer or vacation record.  Finish the " +

        "records (so they can be saved) or delete " +

        "(and cancel) them.")

diveCust.Name.moveTo()

endIf

else

formReturn(True)

endIf

endmethod


order.orderPg.vacationInfoBttn

Methods

arrive

depart

keyPhysical

pushButton


order.orderPg.vacationInfoBttn.arrive
arrive

order.orderPg.vacationInfoBttn.arrive

Changes the button label color to white when the cursor arrives at vacationInfoBttn.

method arrive(var eventInfo MoveEvent)

self.bLabel.color = White

endmethod


order.orderPg.vacationInfoBttn.depart
depart

order.orderPg.vacationInfoBttn.depart

Restores the button label color to gray when the mouse cursor departs vacationInfoBttn.

method depart(var eventInfo MoveEvent)

self.bLabel.color = Gray

endmethod


order.orderPg.vacationInfoBttn.keyPhysical
keyPhysical

order.orderPg.vacationInfoBttn.keyPhysical

Overrides this button's default response to the down arrow key.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.vChar() = "VK_DOWN" then

disableDefault

diveOrds.Destination.moveTo()

endIf

endmethod


order.orderPg.vacationInfoBttn.pushButton
pushButton

order.orderPg.vacationInfoBttn.pushButton

Invites selection of destination information using order.orderPg.Destination.moveTo.

method pushButton(var eventInfo Event)

doDefault

Destination.moveTo()

endmethod


order.orderPg.State_Prov.keyPhysical
keyPhysical

order.orderPg.State_Prov.keyPhysical

Overrides this field object's default response to the up arrow and down arrow keys.

method keyPhysical(var eventInfo KeyEvent)

disableDefault

switch

case eventInfo.vChar() = "VK_DOWN" :

Country.moveTo()

case eventInfo.vChar() = "VK_UP" :

Street.moveTo()

otherwise: doDefault

endSwitch

endmethod


order.orderPg.Country.keyPhysical
keyPhysical

order.orderPg.Country.keyPhysical

Overrides this field object's default response to the down arrow key.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.vChar() = "VK_DOWN" then

disableDefault

Phone.moveTo()

endIf

endmethod


order.orderPg.Zip_Postal_Code.keyPhysical
keyPhysical

order.orderPg.Zip_Postal_Code.keyPhysical

Overrides this field object's default response to the down arrow key.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.vChar() = "VK_DOWN" then

disableDefault

State_Prov.moveTo()

endIf

endmethod


order.orderPg.DIVEORDS

Methods

action

Var window

Var window


order.orderPg.DIVEORDS.action
action

order.orderPg.DIVEORDS.action

The code attached to DIVEORDS' built-in action method specifies responses to certain actions (identified using eventInfo.id). For example, if the action is DataDeleteRecord, a non-blank record is deleted after a confirming dialog. Blank records are deleted without question and the delRec flag is set to Yes.

method action(var eventInfo ActionEvent)

var

actionID smallInt

 endVar

setMouseShape(mouseWait)

delayScreenUpdates(Yes)

actionID = eventInfo.id()

switch

case actionID = dataArriveRecord :

if diveOrds.Order_no.isAssigned() then

numWeeks = numberOfWeeks()

destCost = destinationCost()

diveOrds.action(dataRecalc)

endIf

case actionID = DataInsertRecord:

doDefault

Order_No.construct()

newOrder = Order_No.value

Sale_Date.construct()

Destination.moveTo()

case actionID = DataDeleteRecord :

if Order_No.isBlank() or Destination.isBlank() then

delRec = "Yes"

doDefault

else

delRec = msgYesNoCancel("Delete?",

   "Delete information for order " +

Order_No.value + "?")

If delRec = "Yes" then

Message("Now deleting order " + String(Order_No))

; First, delete any equipment that was ordered

   	      while diveItem.nRecords > 0

diveItem.action(DataDeleteRecord)

endwhile

doDefault

Message("")

else

disableDefault

endIf

endIf

case actionID = DataUnlockRecord :

action(DataPostRecord)

doDefault

case actionID = DataPostRecord :

if targetPg = "orderPg2" then

doDefault

else

if diveOrds.touched and orderOK() then

diveOrds.action(dataRecalc)

Total_Invoice = cTotal_Invoice

VacationCost = cVacationCost

doDefault

if errorCode() <> 0 then

errorShow()

endIf

else

if not diveOrds.recordStatus("New") then

beep()

msgInfo("Incomplete order","There is information missing " +

"from this order. Fill in all fields to save it or " +

"delete it to cancel.")

disableDefault

endIf

endIf

endIf

case actionID = DataNextRecord:

doDefault

if Order_No.isBlank() then

Order_No.construct()

Sale_Date.construct()

Destination.moveTo()

endIf

case actionID = DataArriveRecord :

destCost = destinationCost()

case actionID = dataDesign :

diveCust.Name.moveto()

doDefault

otherwise : doDefault

endSwitch

delayScreenUpdates(No)

setMouseShape(MouseArrow)

endmethod


order.orderPg.DIVEORDS.var
order.orderPg.DIVEORDS Var Window

Variables declared in a page's Var window are visible to all objects the page contains. They are not visible to objects on other pages.

Var

  newCost Number

endVar


order.orderPg.Record53.canDepart
canDepart

order.orderPg.Record53.canDepart

This code makes sure the record is complete before it allows you to depart.

method canDepart(var eventInfo MoveEvent)

var

eReason smallInt

endVar

eReason = eventInfo.reason()

If eReason = userMove or eReason = shutDownMove or

   eReason = palMove then

if not Order_No.isBlank() then

If not orderOK() then

beep()

msgInfo("Incomplete Vacation Order", "Either " +

        "fill in all fields in the Vacation " +

        "Information form (so it can be saved) " +

        "or delete (and cancel) the order.")

diveOrds.Destination.moveTo()

eventInfo.setErrorCode(cannotDepart)

endIf

endIf

endIf

endmethod


order.orderPg.equipmentOrdersButton

Methods

arrive

depart

keyPhysical

pushButton


order.orderPg.equipmentOrdersButton.arrive
arrive

order.orderPg.equipmentOrdersButton.arrive

Changes the button label color to white when this object gets focus.

method arrive(var eventInfo MoveEvent)

self.bLabel.color = White

endmethod


order.orderPg.equipmentOrdersButton.Depart
depart

order.orderPg.equipmentOrdersButton.depart

Restores the button label color to gray when this object loses focus.

method depart(var eventInfo MoveEvent)

self.bLabel.color = Gray

endmethod


order.orderPg.equipmentOrdersButton.keyPhysical
keyPhysical

order.orderPg.equipmentOrdersButton.keyPhysical

Overrides this object's default response to the down arrow key.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.vChar() = "VK_DOWN" then

disableDefault

beep()

endIf

endmethod


order.orderPg.equipmentOrdersButton.pushButton
pushButton

order.orderPg.equipmentOrdersButton.pushButton

Moves user to order.OrderPg2 where equipment orders are entered.

method pushButton(var eventInfo Event)

doDefault

if orderOK() then

setMouseShape(mouseWait)

if diveCust.touched then

diveCust.action(dataPostRecord)

endIf

if diveOrds.touched then

diveOrds.action(dataPostRecord)

endIf

orderPg2.moveTo()

else

beep()

msgInfo("Incomplete Vacation Order", "Enter values " +

        "into all the vacation information fields " +

        "before ordering equipment.")

diveOrds.Destination.moveTo()

eventInfo.setErrorCode(cannotDepart)

endIf

setMouseShape(mouseArrow)

endmethod


order.orderPg.Sale_Date.construct
construct

order.orderPg.Sale_Date.construct

Sets the value of the Sale_Date field object to the current date as returned by today.

method construct()

; fill in sale date with today's date

self.value = today()

endmethod


order.orderPg.Order_No.construct
construct

order.orderPg.Order_No.construct

Increments the value of the Order_No field object by 1 and posts the result to DIVEORDS.DB. The table is locked during this update.

method construct()

var ordTC tCursor endVar

ordTC.open(diveOrds.tableName)

; Lock table to prevent others from writing to it

; while we get a new Order Number.

if lock(ordTC, "Write") then

diveOrds.Order_No.value = ordTC.cMax("Order No") + 1

unlock(ordTC, "Write")

endIf

endmethod


order.orderPg.Return_Date

Methods

keyPhysical

changeValue


order.orderPg.Return_Date.keyPhysical
keyPhysical

order.orderPg.Return_Date.keyPhysical

Overrides this object's default response to the down arrow key.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.vChar() = "VK_DOWN" then

disableDefault

action(fieldForward)

endIf

endmethod


order.orderPg.Return_Date.changeValue
changeValue

order.orderPg.Return_Date.changeValue

Commits the new value. Checks that the new value of Return_Date is greater than the value of Depart_Date (unless both are blank). A stop dialog box is displayed and departure is blocked by eventInfo.setErrorCode(CanNotDepart) in the event of an invalid Return_Date.

method changeValue(var eventInfo ValueEvent)

   var

   newDate Date

   endVar

newDate = eventInfo.newValue()

If NOT newDate.isBlank() and NOT Depart_Date.isBlank() and

    newDate < Depart_Date.value then

msgInfo("Invalid Return Date", "Enter a return date later than " +

        "the departure date.")

eventInfo.setErrorCode(canNotDepart)

else

if newDate <> self.value then

doDefault

numWeeks = numberOfWeeks()

vacationCost.action(dataRecalc)

endIf

endIf

endmethod


order.orderPg.Depart_Date.changeValue
changeValue

order.orderPg.Depart_Date.changeValue

Commits the new value. Checks that the new value of the Depart_Date field object is less than or equal to the Return_Date value (unless both are blank).  A dialog box is displayed and departure is blocked by eventInfo.setErrorCode(CanNotDepart) in the event of an invalid Depart_Date.

method changeValue(var eventInfo ValueEvent)

   var

   newDate Date

   endVar

newDate = eventInfo.newValue()

IF NOT newDate.isBlank() and NOT Return_Date.isBlank() AND

       newDate > Return_Date THEN

beep()

msgInfo("Invalid Depature Date","Enter a date earlier than the " +

        "return date.")

eventInfo.setErrorCode(canNotDepart)

disableDefault

Else

if newDate <> self.Value then

numWeeks = numberOfWeeks()

vacationCost.action(dataRecalc)

doDefault

endIf

endIf

endmethod


order.orderPg.Destination

Methods

canDepart

changeValue

keyPhysical

Procedures

getDestList


order.orderPg.Destination.canDepart
canDepart

order.orderPg.Destination.canDepart

Makes sure this field contains a valid destination before allowing you to move to another object.

method canDepart(var eventInfo MoveEvent)

var

destTC	TCursor

endvar

   if not destTC.open("dest.db") then

msgInfo("Error", "Could Not Open Dest table")

Return

endif

   if Self.recordStatus("Modified") then

if destTC.locate("Destination Name", self.value) then

destCost = destTC."Travel Cost"

VacationCost = 0

cVacationCost.action(dataRecalc)

else

if self.value <> "" then

beep()

message("That destination is not in the table.")

eventInfo.setErrorCode(CanNotDepart)

endIf

endIf

endIf

endmethod


order.orderPg.Destination.changeValue
changeValue

order.orderPg.Destination.changeValue

This code makes sure the value of the Destination field object is a valid destination (stored in DEST.DB).

method changeValue(var eventInfo ValueEvent)

var

destTC	tCursor

newDest	String

endVar

newDest = eventInfo.newValue()

IgnoreCaseInLocate(Yes)

destTC.open("DEST.DB")

If destTC.locate("Destination Name", newDest) then

doDefault

else

disableDefault

beep()

msgInfo("Invalid Destination", "Choose a destination " +

        "shown in the list that appears when you press " +

        "<Ctrl+Space> or choose Record | Cancel Changes " +

        "to cancel this change.")

eventInfo.setErrorCode(cannotDepart)

endIf

destTC.close()

endmethod


order.orderPg.Destination.keyPhysical
keyPhysical

order.orderPg.Destination.keyPhysical

Intercepts Ctrl+Space to call Destination.getDestList.

method keyPhysical(var eventInfo KeyEvent)

if eventInfo.isControlKeyDown() and eventInfo.vCharCode() = VK_SPACE then

disableDefault

getDestList() ; custom proc attached to self

else

if eventInfo.vChar() = "VK_DOWN" then

disableDefault

No_of_People.moveTo()

endIf

endIf

endmethod


order.orderPg.Destination.getDestList
getDestList

order.orderPg.Destination.getDestList

Searches POSSDEST.DB (possible destinations) for prior selections made in DIVESITE. If any are found, these destinations are listed by Destination Name in a LOOKLIST form for user selection. If POSSDEST is empty, every destination in DEST.DB is listed. The method calls doLookUp and waits for a selection which is assigned to this Destination's value. The list is then hidden and control returns to the caller.

proc getDestList()

var

destName, listDataSource STRING

possDestTB Table

endVar

; If we have records in POSSDEST.DB table (possible destinations),

; it means the user selected destinations from the front end.

; If not, then use the full destinations table.

; This allows the order form to be used stand-alone,

; or in conjunction with the front end.

possDestTB.attach("possDest.db")

If possDestTB.isEmpty() THEN ; choose from DEST.DB

listDataSource = "[dest.Destination Name]"

else

listDataSource = "[possdest.Destination Name]"

endIf

destName = doLookUp("Destination", listDataSource)

; call custom proc attached to the form

self.value = destName

endproc


order.orderPg.No_Of_People.changeValue
changeValue

order.orderPg.No_Of_People.changeValue

Commits the new value of this field object and updates the vacation cost using action(DataRecalc).

method changeValue(var eventInfo ValueEvent)

doDefault

vacationCost.action(dataRecalc)

endmethod


order.orderPg.Payment_Method

Methods

open

canDepart

keyPhysical

Procedures

getPayMethList

getCreditInfo

getCardNum

getExpDate

Var window

Var window


order.orderPg.Payment_Method.open
open

order.orderPg.Payment_Method.open

When this field object opens, the following code executes to initialize an array of payment methods.

method open(var eventInfo Event)

; Initialize Array ccTypes, declared in self's Var window.

; The array is used by custom procs attached to self.

ccTypes[1] = "AmEx"

ccTypes[2] = "Diners Club"

ccTypes[3] = "Discover"

ccTypes[4] = "Master Card"

ccTypes[5] = "Visa"

endmethod


order.orderPg.Payment_Method.canDepart
canDepart

order.orderPg.Payment_Method.canDepart

This code makes sure the field object's value is a valid payment method before allowing you to move to another object.

method canDepart(var eventInfo MoveEvent)

If Order_No.isBlank() then

doDefault

Else

Switch

Case Payment_Method = "AmEx" or

   	  Payment_Method = "Diners Club" or

     Payment_Method = "Visa" or

     Payment_Method = "Master Card" or

     Payment_Method = "Discover" :

if ccNumber.isBlank() or self.Touched then

if not getCardNum() then

beep()

msgInfo("Invalid Credit Card Number", "You must " +

        "enter a credit card number to choose " +

        Payment_Method + ".")

eventInfo.setErrorCode(cannotDepart)

disableDefault

endIf

endIf

if ccExpDate.isBlank() or self.Touched then

if not getExpDate() then

beep()

msgInfo("Invalid Expiration Date", "You must " +

        "enter a valid expiration date to choose " +

  Payment_Method + ".")

eventInfo.setErrorCode(cannotDepart)

disableDefault

endIf

endIf

Case Payment_Method = "Cash" or

     Payment_Method = "Check" or

     Payment_Method = "Money Order" :

if not ccNumber.isBlank() then

ccNumber.blank()

endIf

if not ccExpDate.isBlank() then

   ccExpDate.blank()

endIf

Otherwise:

beep()

msgInfo("Invalid Payment Method", "Choose a payment " +

        "method that appears when you press <Ctrl+" +

        "Space> or choose Record | Cancel Changes to " +

        "restore an earlier payment method.")

eventInfo.setErrorCode(cannotDepart)

disableDefault

endSwitch

endIf

endmethod


order.orderPg.Payment_Method.keyPhysical
keyPhysical

order.orderPg.Payment_Method.keyPhysical

This code intercepts Ctrl+Space to call Payment_Method.getPayMethList. It also overrides this object's default response to the right arrow key.

method keyPhysical(var eventInfo KeyEvent)

switch

case eventInfo.isControlKeyDown() and

     eventInfo.vCharCode() = VK_SPACE :

disableDefault

getPayMethList() ; custom proc attached to self

case eventInfo.vCharCode() = VK_RIGHT :

disableDefault

diveOrds.action(FieldForward)

endswitch

endmethod


order.orderPg.Payment_Method.getPayMethList
getPayMethList

order.orderPg.Payment_Method.getPayMethList

Creates and displays a pop-up menu of payment methods. When you choose an item from the pop-up menu, it is assigned to the Payment_Method field object.

proc getPayMethList()

var

payMain, payCC PopUpMenu

payChoice String

payMethX, payMethY LongInt

oldPos, payMethPos Point

endVar

payCC.addArray(ccTypes)

payMain.addStaticText("Payment Methods")

payMain.addSeparator()

payMain.addText("Cash")

payMain.addText("Check")

payMain.addPopUp("Credit Card", payCC)

payMain.addText("Money Order")

payMethPos = self.position

payMethX = payMethPos.x()

payMethY = payMethPos.y()

oldPos = self.position

DIVEORDS.convertPointWithRespectTo(orderPg, oldPos, payMethPos)

payMethX = payMethPos.x()

payMethY = paymethPos.y()

payChoice = payMain.show(payMethX, payMethY)

self.value = payChoice

endproc


order.orderPg.Payment_Method.getCreditInfo
getCreditInfo

order.orderPg.Payment_Method.getCreditInfo

This custom procedure calls another custom procedure (getCardNum) to get the credit card number. If you enter a valid number, the call to getExpDate gets the expiration date.

proc getCreditInfo()

var

oldCC String

endVar

oldCC = ccNumber

if getCardNum() then ; custom proc defined below

getExpDate()      ; custom proc defined below

else

Payment_Method.moveTo()

ccNumber = oldCC

return

endIf

endProc


order.orderPg.Payment_Method.getCardNum
getCardNum

order.orderPg.Payment_Method.getCardNum

This custom procedure is called by another custom procedure, getCreditInfo. It uses a view dialog box to prompt you for a credit card number.

proc getCardNum() Logical

var

ccNum String

endvar

ccNum = "Enter card number here:"

ccNum.view("Enter card number:")

if ccNum <> "" and ccNum <> "Enter card number here:" then

CcNumber.value = ccNum.subStr(1, 20)

return True

else

CcNumber.blank()

return False

endIf

endProc


order.orderPg.Payment_Method.getExpDate
getExpDate

order.orderPg.Payment_Method.getExpDate

This custom procedure is called by the custom procedure getCreditInfo. It uses a view dialog box to prompt you for an expiration date. Subesquent code makes sure you've entered a valid date, and that your credit card has not expired.

proc getExpDate()

var

ccDate,

oldDate	 Date

endVar

oldDate = ccExpDate

ccDate = Date(01/01/99)

ccDate.view("Enter expiration date")

if ccDate < Today() then

msgInfo("Invalid Date", "Credit card has expired. Choose " +

        "a different payment method.")

Payment_Method.moveTo()

else

try

Date(ccDate)

ccExpDate.value = ccDate

onFail

msgStop("Enter a valid date", "Invalid date: " + String(ccDate))

getExpDate()

endTry

endIf

endProc


order.orderPg.Payment_Method.Var
order.orderPg.Payment_Method Var Window

Variables declared here are only visible to the Payment_method field object.

Var

ccTypes Array[5] String

endVar


order.orderPg.Group91.depart
depart

order.orderPg.Group91.depart

This code checks field values and calls action(DataRecalc) to force the calculated field cTotal_Invoice to recalculate.

method depart(var eventInfo MoveEvent)

If not Destination.isBlank() and

   not no_Of_People.isBlank() and

   not depart_Date.isBlank() and

   not return_Date.isBlank() then

numWeeks = numberOfWeeks()

destCost = destinationCost()

VacationCost = destCost * numWeeks * no_Of_People

cTotal_Invoice.action(dataRecalc)

endIf

endmethod


MASTLIB.LSL
MASTLIB.LSL Library

Methods

clearPageValues

createObjMenu

formCanClose

getDataSource

getLookUpTitle

isCanClose

isVCROpen

listPageObjects

MASTObjMsg

open

pageNameOf

returnisCalled

setDataSource

setIsCalledTrue

setIsCalledFalse

setLookUpTitle

setPageValues

VCRisOpen

vcrName

VCRisClosed

Var and Const windows

Var window

Const window


MASTLIB.clearPageValues
clearPageValues

MASTLIB.clearPageValues

Clears any previous Query Value for the page (given by the pageName argument) of the form given by the formName argument. The two arguments map to a Query ID through QBEMAP.DB. The Query ID then locates the entry in QBEVAL.DB. Called prior to setPageValues.

See also

MASTLIB.setPageValues

method clearPageValues(formName String, pageName String)

var

   myQuery Query

endVar

; clear Qbeval.db values for this page

myQuery=Query

qbemap.db | Form Name   | Page ID    | Query ID |

          | ~formName   | ~pageName  | _qID     |

qbeval.db | Query ID | Query Value     |

          | _qID     | changeto blank  |

EndQuery

executeQBE(myQuery)

endmethod


MASTLIB.createObjMenu
createObjMenu

MASTLIB.createObjMenu

Creates and displays an object-sensitive pop-up menu. Called with formName, pageName, and UIObject arguments passed by the formName.mouseRightUp method. The target object is determined by the focus (mouse cursor position, for example) but some objects (such as texts or bitmaps) are excluded by mouseRightUp for particular forms. An object menu is only created and displayed if an entry for the target object is located in MSGHELP.DB. The standard menu option is Code Help. Other options depend on the target object. For example, if Graphic has the focus, the About Fish option is added. createObjMenu also processes the menu choices.

See also

DIVEWRCK.mouseRightUp,

DIVEBIO.mouseRightUp,

DIVEPLAN.mouseRightUp,

MASTORD.mouseRightUp

DIVESITE.mouseRightUp

method createObjMenu(var formName Form, pageName String, uio UIObject)

; This is generalized object menu system called by mouseRightDown methods.

; It provides object help by locating the object's name in MsgHelp.db

; and then offers the user a PopUpMenu with "Object Help" as the standard

; option. If the user selects "Object Help" from the menu, an info box

; is displayed containing the object's help text contained in Msghelp.

; STEPS:

; First, determine if MsgHelp is successfully opened and, if it is,

; locate the object in the table. Not all objects have help. If the

; object is found in MsgHelp, display a standard object help pop- up menu.

; Next, add to the PopUpMenu any additional items that only pertain to

; the object. Finally, process the menu choice that the user selects.

var

p PopUpMenu

endvar

; opened object help table already --

; now locate matching formName.pageName.object

if objHelpTc.Locate("Form Name", formName.Name, "Page Name", pageName, "Object ID", uio.name)

  then

  ; build menu

  p.empty() ; First, empty old items

  p.addStaticText("Object Properties")

  p.addSeparator()

  p.addText("Code Help")

  ; add menu items to standard "About Object"

switch

 case uio.name = "processButton" : p.addText("View Query")

 case uio.name = "diveFlagBox"   : p.addText("About MAST")

 case uio.name = "Graphic"       : p.addText("&About Fish")

 case uio.name = "shipWrecks"    : p.addText("&Choose Wreck")

endswitch

choice=p.Show()

; process menu choices

switch

 case choice = "Code Help"  :

helpShowContext(proghelp, objHelptc."Context ID")

 case choice = "View Query" :

qRpt.open("Qval.rsl")

qRpt.setTitle("View Query")

 case choice = "About MAST" :

setIsCalledTrue()

if aboutFm.open("Abtmast.fsl") then ; modal dialog opened

aboutFm.Wait()

aboutFm.Close() ; now close it

setIscalledFalse()

endif

 case choice = "&About Fish" :

formName.marineLifePage.notes.moveTo()

 case choice = "&Choose Wreck" :

formName.wreckFld = self."Ship Name".value

formName.wreckFld.moveto()

endswitch

endif

; that's it folks!

endmethod


MASTLIB.formCanClose
formCanClose

MASTLIB.formCanCLose

Sets a flag to indicate that a form can be closed.

method formCanClose()

canClose = True

endmethod


MASTLIB.getDataSource
getDataSource

MASTLIB.getDataSource

Returns the item stored at the ListSource index of the TitleAndSource DynArray declared in MASTLIB.LSL.

See also

MASTLIB.setDataSource

method getDataSource() String

return TitleAndSource["ListSource"] ; return value stored in DynArray

endmethod


MASTLIB.getLookUpTitle
getLookUpTitle

MASTLIB.getLookUpTitle

Returns the item stored at the LookUpTitle index of TitleAndSource a DynArray declared in MASTLIB.LSL.

See also

MASTLIB.setLookUpTitle

method getLookUpTitle() String

return(TitleAndSource["LookUpTitle"])

endmethod


MASTLIB.isCanClose
isCanClose

MASTLIB.isCanClose

Checks the value of the variable canClose to report whether a form can close.

method isCanClose() Logical

; is Diveplan asking for a close

if isAssigned(canClose)

  then

return canClose

; Diveplan hasn't asked for close -- cannot close form

else

return False

endif

endmethod


MASTLIB.isVCROpen
isVCROpen

MASTLIB.isVCROpen

Reports whether a custom SpeedBar is open.

method isVCROpen() Logical

; is VCR open?

if isAssigned(VCROpenLg)

; Videobar has been opened

  then

return VCROpenLg

; Videobar has not been opened

else

return False

endif

endmethod


MASTLIB.listPageObjects
listPageObjects

MASTLIB.listPageObjects

Gets the values of objects on the current page and writes them to a table.

method listPageObjects(formName String, pageName String) Logical

; This method runs a query (pageObjsQBE) to find all value setting

; objects on the current form & page, sending the results to Objlist.db.

var

pageObjsQBE Query

endVar

pageObjsQBE = Query

qbeMap.db | Form Name  | Page ID    | Object Path |

                  |  ~formName |  ~pageName | Check       |

endQuery

executeQBE(pageObjsQBE, "Objlist.db")

RETURN TRUE

endmethod


MASTLIB.MASTObjMsg
MASTObjMsg

MASTLIB.MASTObjMsg

Opens MSGHELP.DB and tries to locate an entry matching the given formName, pageName, and ObjID arguments. If found, the Message Text value is displayed in a message.

method MASTObjMsg(formName String, pageName String, ObjID String)

;locate matching formName.pageName.object

If myMsgTc.locate("Form Name", formName, "Page Name", pageName, "Object ID", ObjID)

then message(myMsgTc."Message Text".value)

endif

endmethod


MASTLIB.open
open

MASTLIB.open

Opens MSGHELP.DB, a table that stores help messages.

method open(var eventInfo Event)

if not objHelpTc.Open("Msghelp.db") then

  ; failed to open object help table -- inform user

    msgStop("Problem", "Couldn't open MsgHelp.db")

endif

if not myMsgTC.open("Msghelp.db") then

    msgStop("Problem", "Couldn't open MsgHelp.db")

endif

endmethod


MASTLIB.pageNameOf
pageNameOf

MASTLIB.pageNameOf

Returns the name of the page that contains the UIObject specified in the argument ui. A null string is returned if no containing page is found.

method pageNameOf(ui UIObject) String

; this method returns page name for the current object

var s string endvar

while ui.Class <> "Page" and ui.ContainerName <> ""

   ui.attach(ui.ContainerName)

endWhile

if ui.class = "Page" then s = ui.name

   else s = ""

endif

return s

endmethod


MASTLIB.returnisCalled
returnisCalled

MASTLIB.returnisCalled

Returns the value (True or False) assigned to the MASTLIB variable isCalled. Returns False if no value has been assigned. isCalled is tested by the open methods of DIVESITE, DIVEWRCK, DIVEBIO, and ABTMAST to ensure that these forms are opened only by DIVEPLAN.

method returnIsCalled() Logical

if not isCalled.isAssigned()

then

isCalled = False

endif

return isCalled

endmethod


MASTLIB.setDataSource
setDataSource

MASTLIB.setDataSource

Assigns the lookSrc string argument to the ListSource index of TitleAndSource, a DynArray declared in MASTLIB.LSL

See also

MASTLIB.getDataSource

method setDataSource(const lookSrc String)

TitleAndSource["ListSource"] = lookSrc

endmethod


MASTLIB.setisCalledTrue
setIsCalledTrue

MASTLIB.setIsCalledTrue

Sets the MASTLIB variable isCalled to True. isCalled is used to prevent the opening of certain forms directly rather than by DIVEPLAN.

See also

MASTLIB.returnisCalled

method setIsCalledTrue()

isCalled = True

endmethod


MASTLIB.setisCalledFalse
setIsCalledFalse

MASTLIB.setIsCalledFalse

Sets the MASTLIB variable isCalled to False. isCalled is used to prevent the opening of certain forms directly rather than by DIVEPLAN.

See also

MASTLIB.returnisCalled

method setIsCalledFalse()

isCalled = False

endmethod


MASTLIB.setLookUpTitle
setLookUpTitle

MASTLIB.setLookUpTitle

Assigns the lookTtl string argument to the LookUpTitle index in TitleAndSource DynArray (declared in MASTLIB.LSL).

See also

MASTLIB.getLookUpTitle

method setLookUpTitle(const lookTtl String)

TitleAndSource["LookUpTitle"] = lookTtl ; set value of DynArray item

endmethod


MASTLIB.setPageValues
setPageValues

MASTLIB.setPageValues

Runs a query to find all value objects (vacation criteria) selected on the given formName and pageName arguments. Called by the acceptBttn methods of wrecksPage, destsPage, and marineLifePage to collect, in QBEVAL.DB, the selected criteria for possible destinations. The query results are sent to the TCursor newValsTc. QBEVAL.DB is searched by DIVEPLAN.destqbe to find matching destinations in DEST.DB.

See also

MASTLIB.clearPageValues,

DIVEPLAN.destqbe

method setPageValues(formName String, pageName String) Logical

; This method runs a query (mapValQBE) to find all value objects on

; the current form & page, sending the results to a tCursor named

; newValsTc.

var

newValsTC, valCursor TCursor

mapValQBE Query

fieldObj UIObject

endVar

clearPageValues(formName, pageName) ; clear QBEVAL.DB Query Value values

mapValQBE = Query

qbeMap.db | Form Name  | Page ID    | Query ID  | Object Path |

 |  ~formName |  ~pageName | _qID      | Check       |

qbeVal.db | Query ID   | Field Name |

                   | _qID       | Check      |

endQuery

executeQBE(mapValQBE, newValsTc)

valCursor.open("qbeVal.db")

valCursor.edit()

scan newValsTC :

   valCursor.locate("Field Name", newValsTC."Field Name")

   fieldObj.attach(newValsTC."Object Path")

if not isBlank(fieldObj.value) then

if isBlank(valCursor."Query Value") then

valCursor."Query Value" = fieldObj.value

else

valCursor."Query Value" = valCursor."Query Value" + " OR " + fieldObj.value

endIf

endIf

endScan

valCursor.endEdit()

RETURN TRUE

endmethod


MASTLIB.VCRisOpen
VCRisOpen

MASTLIB.VCRisOpen

Sets a flag to indicate that a custom SpeedBar is open.

method VCRisOpen()

VCROpenLg = True

endmethod


MASTLIB.vcrName
vcrName

MASTLIB.vcrName

Returns the text in the title bar of a custom SpeedBar.

method vcrName() String

    ; return Videbar title

    return "Click button to change record"

endmethod


MASTLIB.VCRisClosed
VCRisClosed

MASTLIB.VCRisCLosed

Sets a flag to indicate that a custom SpeedBar is closed.

method VCRisClosed()

; videobar closed

VCROpenLg = False

endmethod


MASTLIB.Var
MASTLIB Var Window

These variables are visible to all methods and procedures in this library.

Var

canClose, isCalled, VCROpenLg Logical

TitleAndSource DynArray[] String ; 2 fields: LookUpTitle and ListSource

myMsgTc, objHelpTc Tcursor

qRpt Report

aboutFm Form

endVar


MASTLIB.Const
MASTLIB Const Window

These constants are visible to all methods and procedures in this library.

Const

  proghelp = ":WORK:Mastprog.hlp"

endConst