GRIDPLUS2 - Text Find Commands
Home Reference Manpage Examples Download License Contact

Text Find Commands

GRIDPLUS provides two commands which can be used to search the contents of a text widget for a specified string (See Example 7).

gpfindSearch text widget using paramters passed to the gpfind command.
gpfind_dialogUses the "Find" dialog to search the specified text widget.

Using the gpfind Command

The gpfind command can be used to search the contents of a text widget for a specified string. The direction of the search, forwards (default) -or- backwards is optional. Subsequent calls to gpfind will search for the next match in the specified direction. When a match is found, if necessary, the display will scroll to have the matching text visible. The matching text is highlighted and selected.

Syntax:-

gridplus::gpfind item string ?direction?

Examples

gpfind .mytext "Test string"

Searches the ".mytext" widget for the string "Test string" forwards from the cursor, or the begining of the widget if the cursor has not been positioned.

gpfind .mytext "Test string" backwards

Searches the ".mytext" widget for the string "Test string" backwards from the cursor, or the begining of the widget if the cursor has not been positioned.

Using the gpfind_dialog Command

The gpfind_dialog command can be used to search the contents of a text widget using the "Find" dialog. When a match is found, if necessary, the display will scroll to have the matching text visible. The matching text is highlighted and selected.

The item name of the text widget is optional. If the item name is not specified then the dialog will search (if it is a text widget) the widget which currently has focus.

gridplus::gpfind_dialog ?item?

The "Find" dialog is the same as that used by the right-click pop-up menu "Find" option:-

Examples

gpfind_dialog .mytext

Searches the ".mytext" widget according the options specified in the "Find" dialog. The search will be be from the cursor position, or the begining of the widget if the cursor has not been positioned.


Copyright © 2008 Adrian Davis.