Livecode Wiki
Advertisement

A Field object is used for many purposes in LiveCode, it has many options that can be used for text, scrolling fields, and much more. One type of Field can be changed into another type by changing its properties. However, its usually easier to just pick the type you want in the first place.

A Field is a container, just like a variable. As a result, you can store a value in a Field. The difference is that in a Field, that value is displayed. You can also use a Field as the source of a value.

Pay attention to the basic table object option, since it creates "phantom fields", one per cell like field "revCell-2,3" (row,column); this way you can intercept messages easily when working with cells.


Basic Properties[]

  • Name
  • tool tip
  • Style (see slide-show on the right):
    • Disabled: it becomes gray and not editable
    • Visible: if it's false, object is invisible
    • share text: if you set it as a group, you decide if it's the same on all cards or not.
    • Don't wrap
    • Lock text: if a text is focusable, you can also specify if user can change it or not.
    • Opaque: it means that background is not transparent
    • Focusable: it's mandatory if user has to edit field
    • Focus border: Displays a border around the active control.
    • Tab on Return: pressing return is the same as pressing tab on this object, so it will move to the next cell.
    • Three dimensional: graphic effect
    • Show border: a box border visible
  • Scrollbars
  • Hilites
  • Line height
  • Layer mode
  • Behavior

Contents[]

A field is a large area where you can add text, see it with the wrap line on, transform it into a table, or load text from a file. For example:

set the text of field "myfield" to "Hello world"
put "Hello world" into field "myfield"

Both statements above do the same thing, display "Hello world" in the field "myfield".

Creating a tabbed TABLE is easy. For example:

put 11 & tab & 12 & tab & 13 & return into field "myVat"
put 21 & tab & 22 & tab & 23 & return after field "myVat"
put 31 & tab & 32 & tab & 33 & return after field "myVat"

The above will be shown in the field "myVat" as:

11	12	13
21	22	23
31	32	33

In a scrolling list, every line is a line list.

You can edit the text in a field when LiveCode is in Run Mode. Then you can put the contents of a field into a variable. For example:

put field "myVat" into yourVar

The variable "yourVar" now contains everything that is in field "myVat".

Table[]

Here you can transform the object in a table, setting if editable or not, formatting or not, tab stop size, and many other option.

  • basic table object: this option activates table capabilities
    • cell editing: user can edit text cell by cell
    • maximum editable column: last column user can edit
    • cell formatting:
  • text baseline: show dotted horizontal lines
  • horizontal grid: activate table horizontal lines
  • vertical grid: activate table vertical lines
  • tab stops: number of pixels of column width

In a single field, you can put both normal text and tables. Here you can find a guide

Icons & Border[]

  • Icon
  • Hilite Icon: icon when the button is pressed
  • Disabled Icon: icon when the button is disabled
  • Visited Icon: icon when the button was pressed at least one time. You can reset a visited button setting the visited property to false
  • Armed Icon
  • Hover Icon: when mouse is on the object
  • Three D: effect of the button
  • Border: border of the button
  • Hilite border: special border when pressed
  • Border width
  • Shadow: shadow effect of the button
  • Shadow offset: distance of the shadow from the button

Colors & patterns[]

Here you can set the color of various elements of the button. You can choose a pattern instead of a color.

Custom properties[]

Custom properties are the best replacement for global variables in LiveCode. You can use local variables in LiveCode, but they are temporary. The custom properties are containers for your data, the same as any variable. They are easy to retrieve and to check.

Geometry[]

See Geometry manager

Graphic effects[]

GraphicEffects
  • drop shadow
  • inner shadow
  • outer glow
  • inner glow
  • color overlay

If you activate the drop shadow, you can manipulate all aspects of it (color, opacity, position, etc.) with the sub-menu.

Blending[]

The blending effect is a way to make the object transparent, you can choose between many ways to render the resulting object (arithmetic, subpin, etc.). You can choose the percentage of blending your object with the background.

Property profiles[]

All the properties of an object are inherited from a master profile, however you can add and change profiles. This way all objects will have the same properties, will look the same or act the same.

Size & Position[]

Here you can

  • specify the size of the object
  • fit it to text content
  • set location using the center of the object or its borders
  • lock size and position
  • choose which element is above the others, by specifying object layer

Text formatting[]

Here you can change:

  • font type
  • font size (you can enter the size directly, you are not restricted to the few shown)
  • font style:
    • plain
    • bold
    • italic
    • underlined
    • boxed
    • boxed 3D
    • link
    • stroked
  • alignment
  • margins

You can also change all letters to uppercase, lowercase, or else using the last button.

All Field Properties[]

If there is a missing property, please add.

See also[]

Advertisement