ClickText()

Summary

Allows the user to enter text on the current map or layout.

Syntax

text_added = ClickText(array location, color clr, string font, string initial_text, boolean multiline)

Argument Contents
location An array containing either a scope or two (2) coordinates that define the location at which the user adds the text
clr The color in which the text is displayed (currently ignored)
font The font in which the text is displayed
initial_text The text shown when the editing rectangle is first displayed
multiline "True" if multiline editing is permitted; "False" (the default) if it is not

Returns

A string indicating the text entered by the user.

Notes

  • When used in a layout, the location must be an array of coordinates and not a scope.

  • ClickText() does not create a text annotation; it only allows the user to enter text at a location.

  • If the value of the Multiline option is "False" ClickText() ignores the size of the font specified (although it must still be specified) and sets the font to fill the rectangle vertically.

  • This function should be called only from a macro that is activated from the menus, or from a tool in a toolbox or toolbar. Calling it from any other type of dialog box often causes confusion about which window is active (the dialog box, versus the map).

Example

// Let the user drag a rectangle on the screen...
rect = ClickRect(,)
text = ClickText({rect}, ColorRGB(65000,0,0), "Arial|24", null, null)

Error Codes

Error Type Meaning
Error No location was specified or the location was specified as a scope for a layout
Escape There is no current window, the current window is neither a map nor a layout, or the user pressed Esc while entering the text

See Also

Function Summary
ClickLayout() Allows user to edit annotations in the current map or layout.