home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************************
- * PROGRAM: Search.wfm
- *
- * WRITTEN BY: Borland Samples Group
- *
- * DATE: 5/93
- *
- * UPDATED: 6/94
- *
- * REVISION: $Revision: 1.26 $
- *
- * VERSION: dBASE FOR WINDOWS 5.0
- *
- * DESCRIPTION: This form executes a simple search. It will accept a value
- * and search for it using the current index. It allows the
- * calling program to handle the results. The entered value
- * is attached to the OkButton, so the calling program can
- * search for it in whatever way it needs.
- *
- * PARAMETERS: None
- *
- * CALLS: Buttons.cc (for custom controls)
- *
- * USAGE: DO Search.wfm
- * or
- * (this is how Search is called from Orders.mnu and Customer.mnu)
- * set procedure to Search.wfm additive
- * local f
- * f = new Search()
- * f.mdi = .f. && modal forms cannot be mdi
- * selected = f.ReadModal()
- * seek f.value
- *
- *******************************************************************************
- #include <Messdlg.h>
- set ldCheck off
- ** END HEADER -- do not remove this line*
- * Generated on 05/18/94
- *
- LOCAL f
- f = NEW SEARCHFORM()
- f.Open()
-
- CLASS SEARCHFORM OF FORM
- Set Procedure To BUTTONS.CC Additive
- this.OnOpen = CLASS::ONOPEN
- this.OnClose = CLASS::ONCLOSE
- this.OnSelection = CLASS::ONSELECTION
- this.MousePointer = 1
- this.Text = "Search"
- this.Width = 36.79
- this.Top = 7.29
- this.Left = 33.98
- this.Height = 6.00
- this.Minimize = .F.
- this.Maximize = .F.
- this.HelpFile = ""
- this.HelpId = ""
-
- DEFINE RECTANGLE SEARCHRECT OF THIS;
- PROPERTY;
- ColorNormal "N/W",;
- Text "&Search for:",;
- Height 2.92,;
- Width 34.31,;
- Top 0.54,;
- Left 1.32,;
- Border .T.
-
- DEFINE ENTRYFIELD SEARCHENTRY OF THIS;
- PROPERTY;
- ColorNormal "B/W",;
- Width 31.67,;
- Top 1.60,;
- Left 2.64,;
- Height 1.32,;
- Value " ",;
- FontSize 11.00,;
- Border .T.,;
- ColorHighLight "B+/W*"
-
- DEFINE OKBUTTON OKSEARCHBUTTON OF THIS;
- PROPERTY;
- Width 14.11,;
- Top 3.98,;
- Left 4.00,;
- Height 1.50,;
- Default .T.
-
- DEFINE CANCELBUTTON CANCELSEARCHBUTTON OF THIS;
- PROPERTY;
- OnClick .f.,;
- Width 14.11,;
- Top 3.98,;
- Left 19.50,;
- Height 1.50,;
- Group .F.,;
- Id 0
-
- ****************************************************************************
- procedure OnOpen
- ****************************************************************************
- set procedure to Sampproc additive
- && if Search was called from customer/
- if type("this.keyName") <> "U" && orders with the keyName property assigned
- this.text = FormatStr("Search -- %1", this.keyName)
- this.searchEntry.picture = this.formatting
- endif
- this.searchEntry.SetFocus()
-
- ****************************************************************************
- procedure OnClose
- ****************************************************************************
- close procedure Buttons.cc, Sampproc.prg
-
- ****************************************************************************
- procedure OnSelection(controlId)
- ****************************************************************************
- if controlId <> 0 && If Cancel wasn't selected
- form.value = form.searchEntry.value
- endif
- form.Close()
- ENDCLASS
-