Saltar para o conteúdo principal
Version: v20 BETA

Text


Permitir a selecção de tipo de letra/cor

When this property is enabled, the OPEN FONT PICKER and OPEN COLOR PICKER commands can be called to display the system font and color picker windows. Using these windows, the users can change the font or color of a form object that has the focus directly by clicking. When this property is disabled (default), the open picker commands have no effect.

Gramática JSON

PropriedadeTipo de dadosValores possíveis
allowFontColorPickerbooleanfalse (padrão), true

Objectos suportados

Entrada


Negrito

Sets the selected text to appear darker and heavier.

You can set this property using the OBJECT SET FONT STYLE command.

This is normal text.
This is bold text.

Gramática JSON

PropriedadeTipo de dadosValores possíveis
fontWeighttext"normal", "bold"

Objectos suportados

Button - Check Box - Combo Box - Drop-down List - Group Box - Hierarchical List - Input - List Box - List Box Column - List Box Footer - List Box Header - Radio Button - Text Area


Itálico

Sets the selected text to slant slightly to the right.

You can also set this property via the OBJECT SET FONT STYLE command.

This is normal text.
This is text in italics.

Gramática JSON

NomeTipo de dadosValores possíveis
fontStylestring"normal", "italic"

Objectos suportados

Button - Check Box - Combo Box - Drop-down List - Group Box - Hierarchical List - Input - List Box - List Box Column - List Box Footer - List Box Header - Radio Button - Text Area


Sublinhado

Sets the text to have a line running beneath it.

Gramática JSON

NomeTipo de dadosValores possíveis
textDecorationstring"normal", "underline"

Objectos suportados

Button - Check Box - Combo Box - Drop-down List - Group Box - Hierarchical List - Input - List Box - List Box Column - List Box Footer - List Box Header - Radio Button - Text Area


Fonte

This property allows you to specify either the font theme or the font family used in the object.

Font theme and font family properties are mutually exclusive. A font theme takes hold of font attributes, including size. A font family allows you to define font name, font size and font color.

Tema Fonte

The font theme property designates an automatic style name. Automatic styles determine the font family, font size and font color to be used for the object dynamically according to system parameters. These parameters depend on:

  • a plataforma,
  • a língua do sistema,
  • and the type of form object.

With the font theme, you are guaranteed that titles are always displayed in accordance with the current interface standards of the system. However, their size may vary from one machine to another.

Three font themes are available:

  • normal: automatic style, applied by default to any new object created in the Form editor.
  • main and additional font themes are only supported by text areas and inputs. These themes are primarily intended for designing dialog boxes. They refer to font styles used, respectively, for main text and additional information in your interface windows. Here are typical dialog boxes (macOS and Windows) using these font themes:

Font themes manage the font as well as its size and color. Entretanto, pode aplicar propriedades de estilo personalizadas (Negrito, Itálico ou Subscrito) sem alterar seu funcionamento.

Gramática JSON

NomeTipo de dadosValores possíveis
fontThemestring"normal", "main", "additional"

Objectos suportados

Button - Check Box - Combo Box - Drop-down List - Group Box - Hierarchical List - Input - List Box - List Box Column - List Box Footer - List Box Header - Radio Button - Text Area

Família de letras

There are two types of font family names:

  • family-name: The name of a font-family, like "times", "courier", "arial", etc.
  • generic-family: The name of a generic-family, like "serif", "sans-serif", "cursive", "fantasy", "monospace".

You can set this using the OBJECT SET FONT command.

Gramática JSON

NomeTipo de dadosValores possíveis
fontFamilystringNome da família de fontes CSS

4D recommends using only web safe fonts.

Objectos suportados

Button - Check Box - Combo Box - Drop-down List - Group Box - Hierarchical List - Input - List Box - List Box Column - List Box Footer - List Box Header - Radio Button - Text Area


Tamanho fonte

Allows defining the object's font size in points.

Gramática JSON

NomeTipo de dadosValores possíveis
fontSizeintegerTamanho da letra em pontos. Valor mínimo: 0

Objectos suportados

Button - Check Box - Combo Box - Drop-down List - Group Box - Hierarchical List - Input - List Box - List Box Column - List Box Footer - List Box Header - Radio Button - Text Area


Cor fonte

Designates the font color.

This property also sets the color of object's border (if any) when "plain" or "dotted" style is used.

The color can be specified by:

  • a color name - like "red"
  • a HEX value - like "#ff0000"
  • an RGB value - like "rgb(255,0,0)"

You can also set this property using the OBJECT SET RGB COLORS command.

Gramática JSON

NomeTipo de dadosValores possíveis
strokestringany css value, "transparent", "automatic"

Objectos suportados

Button - Check Box - Combo Box - Drop-down List - Group Box - Hierarchical List - Input - List Box - List Box Column - List Box Footer - List Box Header - Progress Indicators - Ruler - Radio Button - Text Area


Expressão cor fonte

Selection and collection/entity selection type list boxes

Used to apply a custom font color to each row of the list box. You must use RGB color values. For more information about this, refer to the description of the OBJECT SET RGB COLORS command in the 4D Language Reference manual.

You must enter an expression or a variable (array type variables cannot be used). The expression or variable will be evaluated for each row displayed. You can use the constants of the SET RGB COLORS theme.

You can also set this property using the LISTBOX SET PROPERTY command with lk font color expression constant.

This property can also be set using a Meta Info Expression.

The following example uses a variable name: enter CompanyColor for the Font Color Expression and, in the form method, write the following code:

CompanyColor:=Choose([Companies]ID;Background color;Light shadow color; Foreground color;Dark shadow color)

Gramática JSON

NomeTipo de dadosValores possíveis
rowStrokeSourcestringExpressão cor fonte

Objectos suportados

List Box


Expressão estilo

Selection and collection/entity selection type list boxes

Used to apply a custom character style to each row of the list box or each cell of the column.

You must enter an expression or a variable (array type variables cannot be used). The expression or variable will be evaluated for each row displayed (if applied to the list box) or each cell displayed (if applied to a column). You can use the constants of the Font Styles theme.

Exemplo:

Choose([Companies]ID;Bold;Plain;Italic;Underline)

You can also set this property using the LISTBOX SET PROPERTY command with lk font style expression constant.

This property can also be set using a Meta Info Expression.

Gramática JSON

NomeTipo de dadosValores possíveis
rowStyleSourcestringStyle expression to evaluate for each row/cell.

Objectos suportados

List Box - List Box Column


Alihamento horizontal

Horizontal location of text within the area that contains it.

Gramática JSON

NomeTipo de dadosValores possíveis
textAlignstring"automatic", "right", "center", "justify", "left"
nota

Objectos suportados

Group Box - List Box - List Box Column - List Box Header - List Box Footer - Text Area


Cor linha vertical

Vertical location of text within the area that contains it.

The Default option (automatic JSON value) sets the alignment according to the type of data found in each column:

  • bottom for all data (except pictures) and
  • top for picture type data.

This property can also be handled by the OBJECT Get vertical alignment and OBJECT SET VERTICAL ALIGNMENT commands.

Gramática JSON

NomeTipo de dadosValores possíveis
verticalAlignstring"automatic", "top", "middle", "bottom"

Objectos suportados

List Box - List Box Column - List Box Footer - List Box Header


Meta Info expression

Collection or entity selection type list boxes

Specifies an expression or a variable which will be evaluated for each row displayed. It allows defining a whole set of row text attributes. You must pass an object variable or an expression that returns an object. As propriedades abaixo são compatíveis:

Nome da propriedadeTipoDescrição
strokestringBackground color. Any CSS color (ex: "#F00FFF"), "automatic", "transparent"
fillstringCor de fundo. Any CSS color (ex: "#FF00FF"), "automatic", "transparent"
fontStylestring"normal","italic"
fontWeightstring"normal","bold"
textDecorationstring"normal","underline"
unselectablebooleanDesignates the corresponding row as not being selectable (i.e., highlighting is not possible). Enterable areas are no longer enterable if this option is enabled unless the "Single-Click Edit" option is also enabled. Controls such as checkboxes and lists remain functional. This setting is ignored if the list box selection mode is "None". This setting is ignored if the list box selection mode is "None".
disabledbooleanDisables the corresponding row. Enterable areas are no longer enterable if this option is enabled. Text and controls (checkboxes, lists, etc.) appear dimmed or grayed out. This setting is ignored if the list box selection mode is "None".

The special "cell" property allows you to apply a set of properties to a single column:

Nome da propriedadeTipoDescrição
cellobjectAllows applying the property to a single column.
columnNameobjectPass in \<columnName> the object name of the list box column.
Esta propriedade só está disponível quando não estiver selecionado tema de fonte.string"stroke", "fill", "fontStyle", "fontWeight", or "textDecoration" property (see above). Note: "unselectable" and "disabled" properties can only be defined at row level. They are ignored if passed in the "cell" object

Style settings made with this property are ignored if other style settings are already defined through expressions (i.e., Style Expression, Font Color Expression, Background Color Expression).

Exemplos

No método de projeto Color, entre o código abaixo:

//Color method
//Sets font color for certain rows and the background color for a specific column: C_OBJECT($0)
Form.meta:=New object If(This.ID>5) //ID is an attribute of collection objects/entities
Form.meta.stroke:="purple"
Form.meta.cell:=New object("Column2";New object("fill";"black"))
Else
Form.meta.stroke:="orange" End if
$0:=Form.meta

Melhores práticas: Por razões de otimização, é recomendado nesse caso criar o objeto meta.cell uma vez no método formulário:

  //método de formulário
Case of
:(Form event code=On Load)
Form.colStyle:=New object("Column2";New object("fill";"black"))
End case

O método Color iria conter :

  //Método Color 
...
If(This.ID>5)
Form.meta.stroke:="purple"
Form.meta.cell:=Form.colStyle //reusa o mesmo objeto para melhor performance
...

Gramática JSON

NomeTipo de dadosValores possíveis
metaSourcestringObject expression to evaluate for each row/cell.

Objectos suportados

List Box


Multistyle

Esta propriedade ativa a possibilidade de usar estilos específicos na área selecionada. When this option is checked, 4D interprets any <SPAN> HTML tags found in the area.

By default, this option is not enabled.

Gramática JSON

NomeTipo de dadosValores possíveis
styledTextbooleantrue, false

Objectos suportados

Coluna da List Box


Orientação

Modifica a orientação (rotação) de uma área texto. Áreas texto pode ser rodadas por incrementos de 90°. Cada valor de orientação é aplicado enquanto mantém o mesmo ponto inferior esquerdo para o objeto:

Valor de orientaçãoResultados
0 (o padrão)
90
180
270

Além de áreas de texto estáticas, input os objetos de texto podem ser girados quando forem não-digitáveis. Quando uma propriedade rotação for aplicada a um objeto input, a propriedade digitável é removida (se houver). Esse objeto é então excluído da ordem de entrada.

Gramática JSON

NomeTipo de dadosValores possíveis
textAnglenumber0, 90, 180, 270

Objectos suportados

Input (não-digitável) - Área Texto


Array cores de Fonte

List box de tipo array

Permite estabelecer uma cor de fonte personalizada para cada linha do list box ou cada célula da coluna.

O nome do array LongInt deve ser usado. Each element of this array corresponds to a row of the list box (if applied to the list box) or to a cell of the column (if applied to a column), so the array must be the same size as the array associated with the column. You can use the constants of the SET RGB COLORS theme. If you want the cell to inherit the background color defined at the higher level, pass the value -255 to the corresponding array element.

Gramática JSON

NomeTipo de dadosValores possíveis
rowStrokeSourcestringO nome de um array longint

Objectos suportados

List Box - List Box Column


Array estilo linha

List box de tipo array

Permite estabelecer um estilo de fonte personalizado para cada linha do list box ou cada célula da coluna.

O nome do array LongInt deve ser usado. Each element of this array corresponds to a row of the list box (if applied to the list box) or to a cell of the column (if applied to a column), so the array must be the same size as the array associated with the column. Para preencher esse array (usando um método) use as constantes do tema Estillos de Fonte. Pode acionar constantes juntas para combinar estilos. Se quiser que a célula herde o estilo definido no nível mais alto, passe o valor -255 para o elemento array correspondente.

Gramática JSON

NomeTipo de dadosValores possíveis
rowStyleSourcestringO nome de um array longint.

Objectos suportados

List Box - Coluna List Box


Store with default style tags

Essa propriedade só está disponível para a área input Multiestilo. Quando essa propriedade for ativada, a área armazena as tags de estilo com o texto, mesmo se nenhuma modificação for feita. Nesse caso, as tags correspondem ao estilo padrão. Quando essa propriedade for desativada, só as tags de estilo modificadas são armazenadas.

Por exemplo, aqui está um texto que inclui uma modificação de estilo:

Quando a propriedade for desativada, a área só armazena a modificação. Os conteúdos armazenados são entretanto:

Que <SPAN STYLE="font-size:13.5pt">lindo</SPAN> dia!

Quando a propriedade for ativada, a área armazena todas as informações de formatação. A primeira tag genérica descreve o estilo padrão quando cada variação no sujeito for um par de tags aninhadas. Os conteúdos armazenados na área são portanto:

<SPAN STYLE="font-family:'Arial';font-size:9pt;text-align:left;font-weight:normal;font-style:normal;text-decoration:none;color:#000000;background-color:#FFFFFF">Que <SPAN STYLE="font-size:13.5pt">lindo</SPAN> dia!</SPAN>

Gramática JSON

NomeTipo de dadosValores possíveis
storeDefaultStylebooleantrue, false (padrão).

Objectos suportados

Entrada