home *** CD-ROM | disk | FTP | other *** search
- ******************************************************************************
- * PROGRAM: Equipmnt.wfm
- *
- * WRITTEN BY: Borland Samples Group
- *
- * DATE: 5/93
- *
- * UPDATED: 5/95
- *
- * REVISION: $Revision: 1.58 $
- *
- * VERSION: Visual dBASE
- *
- * DESCRIPTION: This program allows changing equipment for the AirBorland
- * airlines -- it uses a main display form (defined here), and
- * other dialog forms (changeq.wfm, getflts.wfm) for obtaining
- * information for its display.
- *
- * PARAMETERS: None
- *
- * CALLS: Equipmnt.mnu (Menu for this form)
- * Changeq.wfm (Form for changing equipment)
- * Equipmnt.qbe (View of tables)
- * Buttons.cc (Custom Controls file)
- *
- * USAGE: DO Equipmnt.wfm
- *
- *******************************************************************************
- create session
- set talk off
- set ldCheck off
-
-
- ** END HEADER -- do not remove this line*
- * Generated on 07/06/95
- *
- parameter bModal
- local f
- f = new EQUIPMNTFORM()
- if (bModal)
- f.mdi = .F. && ensure not MDI
- f.ReadModal()
- else
- f.Open()
- endif
- CLASS EQUIPMNTFORM OF FORM
- Set Procedure To &_dbwinhome.samples\BUTTONS.CC additive
- this.OnOpen = CLASS::ONOPEN
- this.OnClose = CLASS::ONCLOSE
- this.Height = 21.1758
- this.MenuFile = "EQUIPMNT.MNU"
- this.Minimize = .F.
- this.MousePointer = 1
- this.ColorNormal = "N/GB+"
- this.Maximize = .F.
- this.Text = "Flight Equipment Management"
- this.Width = 72
- this.View = "EQUIPMNT.QBE"
- this.Top = 0
- this.MDI = .F.
- this.Left = 13.5
-
- DEFINE IMAGE LOGOIMAGE OF THIS;
- PROPERTY;
- Height 7.5293,;
- Width 71.6738,;
- DataSource "FILENAME AIRBRLND.BMP",;
- Alignment 2,;
- Left 0.6592
-
- DEFINE TEXT TITLE OF THIS;
- PROPERTY;
- Height 1.4131,;
- ColorNormal "B/GB+",;
- Text "Flight Information",;
- Width 80.332,;
- Top 7.4688,;
- Alignment 1,;
- FontSize 14,;
- Left -1.832
-
- DEFINE BROWSE FLIGHTSBROWSE OF THIS;
- PROPERTY;
- Height 4.1191,;
- Modify .F.,;
- CUATab .T.,;
- ColorNormal "N/W",;
- Fields "FLIGHTS->FLIGHT_NO\H='FLIGHT NO'\12,FLIGHTS->ORIGIN\8,FLIGHTS->DEST\H='DESTINATION'\14,FLIGHTS->PRICE\12,FLIGHTS->DATE\12,FLIGHTS->DEPARTURE\12,FLIGHTS->ARRIVAL\16",;
- Width 70.5,;
- ShowRecNo .F.,;
- Alias "Flights",;
- Top 8.9395,;
- Left 1
-
- DEFINE PUSHBUTTON EQUIPBUTTON OF THIS;
- PROPERTY;
- Height 2.7646,;
- ColorNormal "B/W",;
- Text "Change Equipment",;
- Width 21.333,;
- OnClick CLASS::CHANGEEQUIPMNT,;
- Top 14.5879,;
- Default .T.,;
- Group .T.,;
- FontSize 12,;
- Left 50
-
- DEFINE ENTRYFIELD PLANEENTRY OF THIS;
- PROPERTY;
- Height 1.1309,;
- ColorNormal "B/GB+",;
- Width 19.833,;
- Top 13.3984,;
- DataLink "AIRCRDB->AIRCRAFT",;
- Border .F.,;
- Enabled .F.,;
- FontSize 12,;
- Left 1
-
- DEFINE IMAGE PLANEIMAGE OF THIS;
- PROPERTY;
- Height 6.2354,;
- Width 47,;
- Top 14.5879,;
- DataSource "BINARY AIRCRDB->IMAGE",;
- Alignment 1,;
- Left 1
-
- DEFINE SAMPLEINFOBUTTON EQUIPMNTINFOBUTTON OF THIS;
- PROPERTY;
- Height 1.1768,;
- Width 3.5,;
- Top 19.7051,;
- Group .T.,;
- Left 68
-
- procedure OnOpen
- *******************************************************************************
- private fld
-
- set exact off
- set fields to
- set fields off
- shell(.F.)
-
- *** Create arrays for use in GetFlts.wfm in order to bring it up faster
-
- public originAr, destAr
- local curRecCnt
- private fld, tagName
-
- *** Make array of unique origins
- use flights in select() alias temp
- select temp
- tagName = field(2) + "UN"
- set order to &tagName && Origin unique tag
- count to curRecCnt && For declaring array
- declare originAr[curRecCnt,1]
- fld = field(2) && Origin field
- copy to array originAr field &fld
-
- *** Make array of unique destinations
- tagName = field(3) + "UN"
- set order to &tagName && Destination unique tag
- count to curRecCnt && For declaring array
- declare destAr[curRecCnt,1]
- fld = field(3) && Dest field
- copy to array destAr field &fld
- use
-
- select flights && Return to original workarea
- form.equipmntInfoButton.sampleName = "Equipmnt.wfm"
-
-
- *******************************************************************************
-
- procedure OnClose
- *******************************************************************************
-
- release originAr, destAr
- shell(.T.)
-
-
-
- *******************************************************************************
-
- procedure ChangeEquipmnt
-
- * Change plane for currently selected flight
- *******************************************************************************
- local curAircraft, newAircraft
-
- curAircraft = flights->aircraft && Save current aircraft
- newAircraft = CLASS::CallChangeEqForm(curAircraft)
- if curAircraft <> newAircraft && Only change table with new aircraft
- replace flights->aircraft with newAircraft
- refresh
- endif
-
-
- *******************************************************************************
-
- function CallChangeEqForm(curAircraft)
-
- * Open modally form ChangeEq, which allows changing the plane currently used.
- * ChangeEq.wfm has a listbox of plane names, and an image of the name currently
- * highlighted in the listbox. The image is defined on a binary field of
- * Aircrdb.dbf, and the listbox is defined on its name field, so the image
- * changes as you move through the listbox.
- *******************************************************************************
- local changeEqForm, childRec, retVal
-
- childRec = recno("aircrdb") && This is for highlighting current
- set procedure to &_dbwinhome.samples\Changeq.wfm additive
- && plane in the Changeq form's listbox
- create session
- set talk off
-
- changEqForm = new ChangEqForm()
- changEqForm.mdi = .F.
- changEqForm.value = curAircraft
- changEqForm.childRec = childRec
- changEqForm.Readmodal()
-
- retVal = changEqForm.value
- changEqForm.Release()
- close procedure &_dbwinhome.samples\Changeq.wfm
-
- return retVal && Return the new airplane
-
-
- ENDCLASS
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-