home *** CD-ROM | disk | FTP | other *** search
- *******************************************************************************
- * PROGRAM: Animvcr.wfm
- *
- * WRITTEN BY: Borland Samples Group
- *
- * DATE: 6/95
- *
- * UPDATED:
- *
- * REVISION: $Revision: 1.4 $
- *
- * VERSION: Visual dBASE
- *
- * DESCRIPTION: This program shows the ability of Visual dBASE to traverse a
- * table and display its contents in a form, using custom
- * controls.
- *
- * PARAMETERS: None
- *
- * CALLS: Buttons.cc (Custom Controls file)
- * Animals.qbe (View of table -- you can also use Animsql.qbe,
- * which uses local SQL to
- * accomplish the same tasks)
- *
- * USAGE: DO Animvcr.wfm
- *
- ********************************************************************************
- create session
- set talk off
- set ldCheck off
- shell(.F.)
- _app.speedbar = .F.
-
- ** END HEADER -- do not remove this line*
- * Generated on 06/23/95
- *
- parameter bModal
- local f
- f = new ANIMVCRFORM()
- if (bModal)
- f.mdi = .F. && ensure not MDI
- f.ReadModal()
- else
- f.Open()
- endif
- CLASS ANIMVCRFORM OF FORM
- Set Procedure To &_dbwinhome.samples\BUTTONS.CC additive
- Set Procedure To &_dbwinhome.custom\VCR.CC additive
- this.OnOpen = CLASS::ONOPEN
- this.OnClose = CLASS::ONCLOSE
- this.View = "ANIMALS.QBE"
- this.Text = "Animals"
- this.OnNavigate = CLASS::ONNAVIGATE
- this.Left = 20
- this.Top = 0
- this.Height = 13.1875
- this.Width = 63.666
- this.OnSize = CLASS::ONSIZE
- this.Maximize = .F.
- this.Minimize = .F.
- this.ColorNormal = "BtnFace"
-
- DEFINE RECTANGLE INFORECTANGLE OF THIS;
- PROPERTY;
- FontSize 6.5,;
- BorderStyle 1,;
- Text "",;
- MousePointer 3,;
- Left 0.1973,;
- Top 0.0977,;
- Height 13.0273,;
- Width 63.1357,;
- ColorNormal "BtnFace"
-
- DEFINE TEXT TITLETEXT OF THIS;
- PROPERTY;
- FontName "Times New Roman",;
- FontSize 22,;
- Text "Animals of the World",;
- Alignment 4,;
- Left 1,;
- Top 0.5,;
- Height 1.5625,;
- Width 61.666,;
- FontBold .F.,;
- ColorNormal "R/BtnFace"
-
- DEFINE TEXT NAMETEXT OF THIS;
- PROPERTY;
- FontName "Arial",;
- FontSize 10,;
- FontItalic .T.,;
- Text "Name",;
- Alignment 5,;
- Left 2,;
- Top 3.2344,;
- Height 1.3906,;
- Width 7,;
- FontBold .F.,;
- ColorNormal "B/BtnFace"
-
- DEFINE ENTRYFIELD NAMEENTRY OF THIS;
- PROPERTY;
- Enabled .F.,;
- FontName "Arial",;
- FontSize 10,;
- ColorHighLight "N/GB+",;
- DataLink "NAME",;
- Left 10.8311,;
- Top 3.2344,;
- Height 1.3906,;
- Width 16.502,;
- ColorNormal "N/GB+"
-
- DEFINE TEXT SIZETEXT OF THIS;
- PROPERTY;
- FontName "Arial",;
- FontSize 10,;
- FontItalic .T.,;
- Text "Size",;
- Alignment 5,;
- Left 2,;
- Top 4.7637,;
- Height 1.2988,;
- Width 7,;
- FontBold .F.,;
- ColorNormal "B/BtnFace"
-
- DEFINE ENTRYFIELD SIZEENTRY OF THIS;
- PROPERTY;
- Enabled .F.,;
- FontName "Arial",;
- FontSize 10,;
- ColorHighLight "N/GB+",;
- DataLink "SIZE",;
- Left 10.8311,;
- Top 4.7637,;
- Height 1.2988,;
- Width 5.002,;
- ColorNormal "N/GB+"
-
- DEFINE TEXT WEIGHTTEXT OF THIS;
- PROPERTY;
- FontName "Arial",;
- FontSize 10,;
- FontItalic .T.,;
- Text "Weight",;
- Alignment 5,;
- Left 2,;
- Top 6.2344,;
- Height 1.3906,;
- Width 7,;
- FontBold .F.,;
- ColorNormal "B/BtnFace"
-
- DEFINE ENTRYFIELD WEIGHTENTRY OF THIS;
- PROPERTY;
- Enabled .F.,;
- FontName "Arial",;
- FontSize 10,;
- ColorHighLight "N/GB+",;
- DataLink "WEIGHT",;
- Left 10.8311,;
- Top 6.2344,;
- Height 1.3906,;
- Width 5.002,;
- ColorNormal "N/GB+"
-
- DEFINE TEXT AREATEXT OF THIS;
- PROPERTY;
- FontName "Arial",;
- FontSize 10,;
- FontItalic .T.,;
- Text "Area",;
- Alignment 5,;
- Left 2,;
- Top 7.7637,;
- Height 1.2988,;
- Width 7,;
- FontBold .F.,;
- ColorNormal "B/BtnFace"
-
- DEFINE ENTRYFIELD AREAENTRY OF THIS;
- PROPERTY;
- Enabled .F.,;
- FontName "Arial",;
- FontSize 10,;
- ColorHighLight "N/GB+",;
- DataLink "AREA",;
- Left 10.8311,;
- Top 7.7637,;
- Height 1.2988,;
- Width 24.335,;
- ColorNormal "N/GB+"
-
- DEFINE RECTANGLE IMAGERECT OF THIS;
- PROPERTY;
- BorderStyle 2,;
- Text "",;
- Left 36.5,;
- Top 3.0977,;
- Height 9.5898,;
- Width 26.166,;
- ColorNormal "BtnFace"
-
- DEFINE IMAGE ANIMALIMAGE OF THIS;
- PROPERTY;
- Left 36.6641,;
- Top 3.1475,;
- Height 9.415,;
- Width 25.6689,;
- DataSource "BINARY BMP"
-
- DEFINE CLOSEBUTTON CLOSEANIMALSBUTTON OF THIS;
- PROPERTY;
- SpeedTip "Close this form",;
- Text "",;
- Left 31,;
- Top 11.3125,;
- Default .T.,;
- Height 1.4375,;
- Width 4,;
- Group .T.,;
- SpeedBar .T.
-
- DEFINE SAMPLEINFOBUTTON ANIMVCRINFOBUTTON OF THIS;
- PROPERTY;
- Text "",;
- Left 59.5,;
- Top 0.2979,;
- Height 1.2021,;
- Width 3.5,;
- Group .T.
-
- DEFINE VCRBUTTONS VCRFIRSTBUTTON1 OF THIS;
- PROPERTY;
- Left 2,;
- Top 11.25,;
- Height 1.4375,;
- Width 4
-
- PROCEDURE OnOpen
- ****************************************************************************
-
- *** Do calculations in another workarea so form is not affected
- use animals again in select() order name alias temp
- go bottom in temp
- form.lastRec = recno("temp")
- go top in temp
- form.firstRec = recno("temp")
- use in temp
- ***
-
- form.animvcrInfoButton.sampleName = "Animvcr.wfm"
- form.closeAnimalsButton.SetFocus()
-
-
- ****************************************************************************
-
- PROCEDURE NEXT_OnClick
-
- * Go to next record.
- ****************************************************************************
-
- NEXTBUTTON::OnClick()
- if recno() = form.lastRec && If on last record, move to prevButton
- form.prevAnimalButton.setfocus()
- endif
-
-
- ****************************************************************************
-
- PROCEDURE PREV_OnClick
-
- * Go to previous record.
- ****************************************************************************
-
- PREVBUTTON::OnClick()
- if recno() = form.firstRec && If on first record, move to nextButton
- form.nextAnimalButton.setfocus()
- endif
-
-
- ****************************************************************************
-
- PROCEDURE OnNavigate
-
- * If animal has size > 10, change background color of the size entryfield
- * to red.
- ****************************************************************************
-
- if size > 10
- form.sizeEntry.colornormal = "gb+/r"
- form.statusmessage = "Animal has size > 10."
- else
- form.sizeEntry.colornormal = "n/gb+"
- form.statusmessage = ""
- endif
-
-
- ****************************************************************************
-
- PROCEDURE OnSize ( SizeType, NewWidth, NewHeight )
-
- * Resize main form rectangle as the form is resized.
- ****************************************************************************
-
- form.infoRectangle.height = max(NewHeight -.2, 0)
- form.infoRectangle.width = max(NewWidth - .5, 0)
-
-
- ****************************************************************************
-
- PROCEDURE OnClose
-
- * Clean up.
- ****************************************************************************
-
- close procedure &_dbwinhome.samples\Buttons.cc, &_dbwinhome.custom\Vcr.cc
-
- _app.speedbar = .T.
- shell(.T.)
-
- ENDCLASS
-
-
-
-
-
-
-
-
-
-