newsearchgadget
newsearchgadget
TEMPLATE

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.

#### TOPORIGIN and LEFTORIGIN

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).

#### WIDTH

This is the width of the search gadget, in points. If omitted, the default is 200.

#### VARIABLE

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.

#### PROMPT

The prompt text, if any, that appears in the search gadget. If omitted, the prompt will be Search.

#### TOOLTIP

The search gadget tool tip (if any). If omitted, there won’t be any tooltip.

#### FONT

The font used for the search gadget. If omitted, `#SystemFont` will be used.

#### FONTSIZE

The text size (in points) used for the search gadget. If omitted, the size will be 13 points.

#### CLEARBUTTON

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.

#### SEARCHICON

Set this to `false()` if you don’t want the gadget to include a search icon (the magnifying glass icon on the left).

#### SEARCHICONCODE

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.

#### TAG

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`.

#### NAME

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

- constructformdataeditors -- creates a column of form elements for editing data fields (or variables).
- constructlineitems -- creates a grid of line items.
- constructlistmatrix -- creates a text list or matrix in the current form.
- constructmailinglabel -- creates the form elements for printing mailing labels.
- constructreport -- creates a report in the current form.
- constructtabpanel -- creates a tab panel in the current form.
- formconstructordialog -- opens a generic form constructor dialog.

History

Version | Status | Notes
10.0 | New | New in this version.