home *** CD-ROM | disk | FTP | other *** search
- //--------------------------------------------------------------
- //
- // Fleet.prg - Fleet Manager Application Class
- //
- // Main procedure for the Fleet application. This file defines
- // FleetApp which contains methods for opening all forms and dialogs.
- //
- // Dependencies: < See SET PROCEDURE list at the top of the
- // FleetApp constructor. >
- //
- // Visual dBASE Samples Group
- //
- // $Revision: 1.12 $
- //
- // Copyright (c) 1997, Borland International, Inc.
- // All rights reserved.
- //
- //---------------------------------------------------------------
-
- local app, sRunFolder
- private sAppFolder
- SET TALK OFF
- sRunFolder = SET("DIRECTORY")
- sAppFolder = SUBSTR( PROGRAM(0), 1, ;
- LEN( PROGRAM( 0 ) ) - ( LEN( PROGRAM() ) + 4 ) )
- sRunFolder := '"' + sRunFolder + '"'
- sAppFolder := '"' + sAppFolder + '"'
- SET DIRECTORY TO &sAppFolder.
-
- app = new FleetApp( sRunFolder )
- return ( app.open() )
-
- class FleetApp( sRunFolder )
- SET PROCEDURE TO PROGRAM(0)
- SET PROCEDURE TO "fleetbar.prg" ADDITIVE
- SET PROCEDURE TO "fdatabar.prg" ADDITIVE
- SET PROCEDURE TO "ftree.pop" ADDITIVE
- SET PROCEDURE TO "aircraft.wfm" ADDITIVE
- SET PROCEDURE TO "fleet.wfm" ADDITIVE
- SET PROCEDURE TO "ftree.wfm" ADDITIVE
- SET PROCEDURE TO "fabout.wfm" ADDITIVE
- SET PROCEDURE TO "schedule.wfm" ADDITIVE
- SET PROCEDURE TO "genwizard.wfm" ADDITIVE
- SET PROCEDURE TO "repview.wfm" ADDITIVE
- SET PROCEDURE TO "repview.pop" ADDITIVE
- SET PROCEDURE TO "reportbar.prg" ADDITIVE
-
- this.restoreFolder = sRunFolder
- this.mainForm = new fleetForm()
- this.mainForm.app = this
-
- function open
- local t
- CLOSE FORMS
- SHELL( false )
- SET DESIGN OFF
- this.mainForm.height := 2.5
- t = new FleetToolbar()
- this.mainForm.open()
- t.attach( this.mainForm )
- return ( this.mainForm.setFocus() )
-
- function close
- local bRuntime
- bRuntime = ( "runtime" $ LOWER( VERSION(0) ) )
- if ( bRuntime )
- quit
- else
- PRIVATE sFolder
- sFolder = this.restoreFolder
- SET DIRECTORY TO &sFolder.
- CLOSE FORMS
- SET DESIGN ON
- shell( true, true )
- endif
- SET PROCEDURE TO
- return ( bRuntime )
-
- function openAircraftForm
- local f
- f = new AircraftForm()
- return ( class::openDataForm( f ) )
-
- function openFleetTreeForm
- local f
- f = new FTreeForm()
- f.app = this
- f.mdi := false
- return ( f.open() )
-
- function openScheduleForm
- local f
- f = new ScheduleForm()
- f.width := 50 // hide dialog buttons
- f.height := f.height + 1.5 // add room for toolbar
- return ( class::openDataForm( f ) )
-
- function openScheduleAsDialog( item )
- local f
- f = new scheduleForm()
- f.mdi := false
- f.rowset.applyLocate('"Flight Date" = ' + item.sFlightDate + ;
- ' AND "Flight ID" = ' + item.sFlightID + ;
- ' AND "Aircraft ID" = ' + item.sAircraftID )
- return ( f.readModal() )
-
- function readWizard
- local f
- f = new GenWizardForm()
- f.mdi := true
- return ( f.readModal() )
-
-
- function openDataForm( f )
- local bOpen
- f.app = this
- f.mdi := false
- f.visible := false
- f.open()
- DO "fdatabar.prg" with f
- f.visible := true
- return ( f.setFocus() )
-
- function viewFlightReport
- local f
- f = new RepViewForm()
- with ( f )
- mdi := false
- repView.filename := "flight.rep"
- endwith
- return ( f.open() )
-
- function viewAircraftReport
- local f
- f = new RepViewForm()
- with ( f )
- mdi := false
- repView.filename := "aircraft.rep"
- endwith
- return ( f.open() )
-
- endclass
-