Skip to main content

lockText

Type

property

Summary

Specifies whether the contents of a field can be selected and changed by the user.

Syntax

set the lockText of <field> to {true | false}

Description

Use the lockText property to prevent users from changing the text in a field.

When a field's lockText property is false, the field can be edited: the user can select text, delete text, type, cut, copy, and paste. The cursor becomes an I-beam when the mouse pointer is over the field. When the user clicks in the field, no mouseDown, mouseUp, mouseStillDown, mouseDoubleDown, or mouseDoubleUp messages are sent. (However, if the user Control-clicks or right-clicks, these messages are sent regardless of the field's lockText setting.)

When a field's lockText property is true, the user cannot edit the contents of the field. The cursor does not change when the mouse pointer is over the field, and clicking the field sends all normal mouse messages to it. (A handler can change the contents of a field with the put command and can select text using the select command, regardless of the lockText setting.)

If a field's lockText and traversalOn properties are both set to true, the user can select text, but not change it, and can scroll within the field using the keyboard. If the lockText is true and the traversalOn is false, the user can neither select nor edit the field's text. If the lockText is false and the traversalOn is true, the field can be edited.

Examples

set the lockText of the foundField to false

glossary: property, handler, mouse pointer, command, message

keyword: field

message: linkClicked, mouseDoubleDown, mouseDown, mouseStillDown, mouseDoubleUp, mouseUp

object: field

property: cursor, cantModify, listBehavior, allowInlineInput, properties, selected, traversalOn

command: select, focus, disable, put

function: mouseCharChunk

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?