The newsearchgadget statement creates a search gadget in the current form.
Parameters
This statement has one parameter:template – dictionary that contains options for constructing a search gadget (see discussion below).
Description
This statement creates a search gadget in the current form. Search gadgets are normally combined with a Text List or Matrix object, but this statement allows you to create a “loose” search gadget that is not automatically connected with another object.
This example creates a 200 point wide search gadget 20 points from upper left hand corner of the form.
newsearchgadget initializedictionary(
"TOPORIGIN",20,
"LEFTORIGIN",20,
"WIDTH",300,
"VARIABLE","searchForThis"
)
There are about a dozen options you can specify in the dictionary, each of which is described below.
These specify the position of the new search gadget. These must be specified in points from the upper left hand corner of the form. If not specified, the default for both values is 36 (1/2 inch).
This is the width of the search gadget, in points. If omitted, the default is 200.
The name of the variable that will contain the text being searched for. This variable will be updated immediately every time a key is pressed. If omitted, the variable name will be searchText.
The prompt text, if any, that appears in the search gadget. If omitted, the prompt will be Search.
The search gadget tool tip (if any). If omitted, there won’t be any tooltip.
The font used for the search gadget. If omitted, #SystemFont
will be used.
The text size (in points) used for the search gadget. If omitted, the size will be 13 points.
Set this to false()
if you don’t want the gadget to include a clear button (the x button on the right). If included, the button will automatically have the necessary code to clear the search variable.
Set this to false()
if you don’t want the gadget to include a search icon (the magnifying glass icon on the left).
By default, clicking on the search icon doesn’t do anything. If you want something to happen (for example a pop-up menu), put the necessary code in this option.
This option allows you to specify a tag value that will assigned to all of the objects in the constructed gadget. If no tag value is specified, the tag will be _Constructor_SearchGadget
.
This option allows you to specify a name that will be assigned to all of the objects in the constructed gadget. If no name is specified, “” will be used.
See Also
History
Version | Status | Notes |
10.0 | New | New in this version. |