home *** CD-ROM | disk | FTP | other *** search
- //--------------------------------------------------------------
- //
- // Sample Guide.wfm
- //
- // Run this form to learn about the sample projects
- // that come with Visual dBASE
- //
- // Dependencies: SAMPLES.DBF
- // SAMPLE.JPG
- // RESOURCE.DLL
- //
- // BDE Alias: VDBSAMPLES
- //
- // Visual dBASE Samples Group
- //
- // $Revision: 1.20 $
- //
- // Copyright (c) 1997, Borland International, Inc.
- // All rights reserved.
- //
- //---------------------------------------------------------------
- #define ALLTRIM(x) LTRIM(RTRIM(x))
- SET TALK OFF
- ** END HEADER -- do not remove this line
- //
- // Generated on 10/24/97
- //
- parameter bModal
- local f
- f = new SampleGuideForm()
- if (bModal)
- f.mdi = false // ensure not MDI
- f.readModal()
- else
- f.open()
- endif
-
- class SampleGuideForm of FORM
- with (this)
- onOpen = {|| this.showFormatBar(false)}
- open = class::FORM_OPEN
- scaleFontSize = 8
- scaleFontBold = false
- height = 14.5909
- left = 25.7143
- top = 2.3636
- width = 56.1429
- text = "Sample Guide"
- background = "filename sample.jpg"
- icon = "resource #89"
- endwith
-
-
- this.SESSION1 = new SESSION()
- this.SESSION1.parent = this
- with (this.SESSION1)
- left = 0
- top = 0
- lockRetryInterval = 0
- endwith
-
-
- this.VDBSAMPLE1 = new DATABASE()
- this.VDBSAMPLE1.parent = this
- with (this.VDBSAMPLE1)
- left = 4
- top = 0
- databaseName = "VDBSAMPLE"
- session = form.SESSION1
- active = true
- endwith
-
-
- this.SAMPLE1 = new QUERY()
- this.SAMPLE1.parent = this
- with (this.SAMPLE1)
- left = 8
- top = 0
- database = form.vdbsample1
- sql = 'SELECT * FROM "SAMPLE.DBF" ORDER BY Sample'
- active = true
- endwith
-
-
-
-
- this.TITLE = new TEXT(this)
- with (this.TITLE)
- height = 2
- left = 2
- top = 0.5
- width = 52
- metric = 0
- colorNormal = "black"
- alignVertical = 1
- alignHorizontal = 1
- transparent = true
- fontName = "MS Sans Serif"
- fontSize = 8
- fontItalic = true
- text = "<h3>Visual dBASE Sample Guide</h3>"
- borderStyle = 6
- pageno = 0
- endwith
-
-
- this.LABELPROJ = new TEXT(this)
- with (this.LABELPROJ)
- height = 1
- left = 3
- top = 2.8
- width = 17
- metric = 0
- colorNormal = "BtnText"
- alignVertical = 1
- transparent = true
- fontName = "MS Sans Serif"
- fontSize = 8
- fontBold = true
- text = "Sample Project:"
- endwith
-
-
- this.BUTTONOPEN = new PUSHBUTTON(this)
- with (this.BUTTONOPEN)
- onClick = class::BUTTONOPEN_ONCLICK
- height = 1.7727
- left = 3
- top = 12
- width = 22
- text = "&Open Project"
- metric = 0
- upBitmap = "RESOURCE:2 PS_OPEN"
- fontName = "MS Sans Serif"
- fontSize = 8
- group = true
- colorNormal = "BtnText/BtnFace"
- value = false
- endwith
-
-
- this.BUTTONRUN = new PUSHBUTTON(this)
- with (this.BUTTONRUN)
- onClick = class::BUTTONRUN_ONCLICK
- height = 1.7727
- left = 29
- top = 12
- width = 24
- text = "&Run Application"
- metric = 0
- upBitmap = "RESOURCE:2 PS_RUN"
- fontName = "MS Sans Serif"
- fontSize = 8
- group = true
- colorNormal = "BtnText/BtnFace"
- value = false
- endwith
-
-
- this.COMBOPROJ = new COMBOBOX(this)
- with (this.COMBOPROJ)
- onChange = class::COMBOPROJ_ONCHANGE
- height = 1.2
- left = 22
- top = 2.8
- width = 31
- metric = 0
- fontName = "MS Sans Serif"
- fontSize = 8
- sorted = true
- style = 2
- endwith
-
-
- this.EDITORDESCRIPT = new EDITOR(this)
- with (this.EDITORDESCRIPT)
- height = 6
- left = 3
- top = 5.5
- width = 50
- metric = 0
- value = ""
- modify = false
- fontName = "MS Sans Serif"
- fontSize = 8
- cuaTab = true
- endwith
-
-
- this.LABELMAIN = new TEXT(this)
- with (this.LABELMAIN)
- height = 1
- left = 3
- top = 4.1
- width = 17
- metric = 0
- colorNormal = "BtnText"
- alignVertical = 1
- transparent = true
- fontName = "MS Sans Serif"
- fontSize = 8
- fontBold = true
- text = "Main Source:"
- endwith
-
-
- this.ENTRYMAIN = new ENTRYFIELD(this)
- with (this.ENTRYMAIN)
- enabled = false
- height = 1.05
- left = 22
- top = 4.1
- width = 31
- metric = 0
- colorHighLight = ""
- fontName = "MS Sans Serif"
- fontSize = 8
- value = "Entryfield1"
- borderStyle = 7
- endwith
-
-
- // {Linked Method} form.open
- function FORM_open
- local rSample
- rSample = this.sample1.rowset
- rSample.first()
-
- // add custom properties
- this.sourceFolder = _dbwinhome + ALLTRIM(rSample.fields["Source Folder"].value) + "\"
- this.prjFolder = _dbwinhome + ALLTRIM(rSample.fields["Project Folder"].value) + "\"
-
- this.sDatabase = ALLTRIM(rSample.fields["BDE Alias"].value)
- this.sPjx = this.prjFolder + rSample.fields["Project File"].value
- this.sMain = this.sourceFolder + rSample.fields["Main"].value
- with ( this )
- buttonOpen.enabled := FILE( this.sPjx )
- buttonRun.enabled := FILE( this.sMain )
- entryMain.value := rSample.fields["Main"].value
- editorDescript.value := rSample.fields["Description"].value
- endwith
- class::fillCombo()
- return ( SAMPLEGUIDEFORM::open() )
-
- // {Linked Method} form.comboproj.onChange
- function COMBOPROJ_onChange
- local rSample, bFound
- local rSample
- rSample = this.form.sample1.rowset
- bFound = rSample.applyLocate("Sample = '" + this.value + "'")
- if ( bFound )
- this.form.sourceFolder := _dbwinhome + ALLTRIM(rSample.fields["Source Folder"].value) + "\"
- this.form.prjFolder := _dbwinhome + ALLTRIM(rSample.fields["Project Folder"].value) + "\"
-
- this.form.sDatabase := ALLTRIM(rSample.fields["BDE Alias"].value)
- this.form.sPjx := this.form.prjFolder + rSample.fields["Project File"].value
- this.form.sMain := this.form.sourceFolder + rSample.fields["Main"].value
- with ( this.form )
- buttonOpen.enabled := FILE( this.form.sPjx )
- buttonRun.enabled := FILE( this.form.sMain )
- entryMain.value := rSample.fields["Main"].value
- editorDescript.value := rSample.fields["Description"].value
- endwith
- endif
- return ( bFound )
-
- function fillCombo
- local rSample, i
- rSample = this.sample1.rowset
- this.comboProj.options = new Array( rSample.count() )
- rSample.first()
- i = 1
- do while ( not rSample.endOfSet )
- this.comboProj.options[i] := rSample.fields["Sample"].value
- rSample.next()
- i++
- enddo
- with ( this.comboProj )
- dataSource := "ARRAY form.comboProj.options"
- value := this.comboProj.options[1]
- endwith
- return (i)
-
- // {Linked Method} form.buttonopen.onClick
- function buttonOpen_onClick
- MODIFY PROJECT ( this.form.sPjx )
- class::changeFolder( this.form.sourceFolder )
- return ( this.form.sPjx )
-
- // {Linked Method} form.buttonrun.onClick
- function buttonRun_onClick
- local bCD, rSample, bOpen, bFound
- rSample = this.form.sample1.rowset
- bOpen = false
- bFound = rSample.applyLocate("Sample = '" + this.form.comboProj.value + "'")
- if ( bFound )
- bCD = this.form.sample1.rowset.fields["Change Folder"].value
- if ( ( not this.form.sDatabase == null ) and ;
- ( not isblank( this.form.sDatabase ) ) )
- for i = 1 to _app.databases.size
- if ( _app.databases[i].databaseName == this.form.sDatabase )
- bOpen := true
- endif
- next
- if ( not bOpen )
- if ( not SET("DATABASE") == this.form.sDatabase )
- OPEN DATABASE ( this.form.sDatabase )
- endif
- endif
- endif
- SET DATABASE TO ( this.form.sDatabase )
- if ( bCD )
- class::changeFolder( this.form.sourceFolder )
- else
- class::changeFolder( _dbwinhome + "Samples" )
- endif
- DO ( this.form.sMain )
- if ( bCD )
- this.form.close()
- endif
- endif
- return ( bCD )
-
- function changeFolder( sFolder )
- PRIVATE macro
- macro = '"' + sFolder + '"'
- CD ¯o.
- return (SET("DIRECTORY"))
- endclass
-