Saltar al contenido principal
Versión: Siguiente

Texto multiestilo

ST COMPUTE EXPRESSIONS ( * ; objeto : Text {; inicioSel : Integer {; finSel : Integer}} )
ST COMPUTE EXPRESSIONS ( objeto : Variable, Field {; inicioSel : Integer {; finSel : Integer}} )

ST FREEZE EXPRESSIONS ( * ; objeto : Text {; inicioSel : Integer {; finSel : Integer}}{; *} )
ST FREEZE EXPRESSIONS ( objeto : Variable, Field {; inicioSel : Integer {; finSel : Integer}}{; *} )

ST GET ATTRIBUTES ( * ; objeto : Text ; inicioSel : Integer ; finSel : Integer ; nomAtrib : Integer ; valorAtrib : Variable {; ...(nomAtrib : Integer ; valorAtrib : Variable)} )
ST GET ATTRIBUTES ( objeto : Variable, Field ; inicioSel : Integer ; finSel : Integer ; nomAtrib : Integer ; valorAtrib : Variable {; ...(nomAtrib : Integer ; valorAtrib : Variable)} )

ST Get content type ( * ; object : Text {; inicioSel : Integer {; finSel : Integer {; inicioBloq : Integer {; finBloq : Integer}}}} ) : Integer
ST Get content type ( object : Variable, Field {; inicioSel : Integer {; finSel : Integer {; inicioBloq : Integer {; finBloq : Integer}}}} ) : Integer

ST Get expression ( * ; objeto : Text {; inicioSel : Integer {; finSel : Integer}} ) : Text
ST Get expression ( objeto : Variable, Field {; inicioSel : Integer {; finSel : Integer}} ) : Text

ST GET OPTIONS ( * ; objeto : Text ; opcion : Integer ; valor : Integer {; ...(opcion : Integer ; valor : Integer)} )
ST GET OPTIONS ( objeto : Variable, Field ; opcion : Integer ; valor : Integer {; ...(opcion : Integer ; valor : Integer)} )

ST Get plain text ( * ; objeto : Text {; refMode : Integer} ) : Text
ST Get plain text ( objeto : Variable, Field {; refMode : Integer} ) : Text

ST Get text ( * ; objeto : Text {; inicioSel : Integer {; finSel : Integer}} ) : Text
ST Get text ( objeto : Variable, Field {; inicioSel : Integer {; finSel : Integer}} ) : Text

ST GET URL ( * ; objeto : Text ; textoURL : Text ; direccionURL : Text {; inicioSel : Integer {; finSel : Integer}} )
ST GET URL ( objeto : Variable, Field ; textoURL : Text ; direccionURL : Text {; inicioSel : Integer {; finSel : Integer}} )

ST INSERT EXPRESSION ( {* ;} objeto : Object ; expresion : Text {; inicioSel : Integer {; finSel : Integer}} )
ST INSERT URL ( * ; objeto : Text ; textoURL : Text ; direccionURL : Text {; inicioSel : Integer {; finSel : Integer}} )
ST INSERT URL ( objeto : Variable, Field ; textoURL : Text ; direccionURL : Text {; inicioSel : Integer {; finSel : Integer}} )

ST SET ATTRIBUTES ( * ; objeto : Text ; inicioSel : Integer ; finSel : Integer ; nomAtrib : Integer ; valorAtrib : Text, Integer {; ...(nomAtrib : Integer ; valorAtrib : Text, Integer)} )
ST SET ATTRIBUTES ( objeto : Variable, Field ; inicioSel : Integer ; finSel : Integer ; nomAtrib : Integer ; valorAtrib : Text, Integer {; ...(nomAtrib : Integer ; valorAtrib : Text, Integer)} )

ST SET OPTIONS ( * ; objeto : Text ; opcion : Integer ; valor : Integer {; ...(opcion : Integer ; valor : Integer)} )
ST SET OPTIONS ( objeto : Variable, Field ; opcion : Integer ; valor : Integer {; ...(opcion : Integer ; valor : Integer)} )

ST SET PLAIN TEXT ( * ; objeto : Text ; nuevTexto : Text {; inicioSel : Integer {; finSel : Integer}} )
ST SET PLAIN TEXT ( objeto : Variable, Field ; nuevTexto : Text {; inicioSel : Integer {; finSel : Integer}} )

ST SET TEXT ( * ; objeto : Text ; nuevTexto : Text {; inicioSel : Integer {; finSel : Integer}} )
ST SET TEXT ( objeto : Variable, Field ; nuevTexto : Text {; inicioSel : Integer {; finSel : Integer}} )

Trabajando con comandos de manejo de texto

Interfaz de usuario

Los comandos que pueden utilizarse para manipular objetos de texto por programación no tienen en cuenta ninguna etiqueta de estilo integrada en el texto. Sólo actúan sobre el texto visualizado. Esto afecta a los siguientes comandos:

Cuando se utilizan estos comandos con comandos que manipulan cadenas de caracteres, es necesario filtrar los caracteres de formato utilizando el comando ST Get plain text:

 HIGHLIGHT TEXT([Products]Notes;1;Length(ST Get plain text([Products]Notes))+1)

Objetos (formularios)

Los comandos que se pueden utilizar para modificar el estilo de los objetos (por ejemplo, OBJECT SET FONT) se aplican a todo el objeto y no a la selección.

Si el objeto no tiene el foco cuando se ejecuta el comando, la modificación se aplica simultáneamente al objeto (el área de texto) y a su variable asociada. Si el objeto tiene el foco, la modificación se aplica al objeto, pero no a la variable asociada. La modificación solo se aplica a la variable cuando el objeto pierde el foco. Tenga presente este principio a la hora de programar áreas de texto.

nota

Si la opción Guardar con etiquetas de estilo predeterminadas está marcada para el objeto, el uso de estos comandos provocará una modificación de las etiquetas guardadas con cada objeto.

Tenga en cuenta también que sólo las propiedades por defecto son afectadas por estos comandos (así como las propiedades guardadas por medio de las etiquetas predeterminadas). Las etiquetas de estilo personalizadas se mantienen tal y como están. Por ejemplo, se da un área de estilo múltiple donde se guardaron las etiquetas predeterminadas:

El texto sin formato del área es el siguiente:

<span style="text-align:left;font-family:'Segoe UI';font-size:9pt;color:#009900">This is the word <span style="color:#D81E05">red</span></span>

Si ejecuta el siguiente código:

OBJECT SET COLOR(*;"myArea";-(Blue+(256*Yellow)))

El color rojo permanece:

y el código es:

<span style="text-align:left;font-family:'Segoe UI';font-size:9pt;color:#0000FF">This is the word <span style="color:#D81E05">red</span></span>

Se trata de los siguientes comandos:

En el contexto de las áreas multiestilo, estos comandos sólo deben utilizarse para definir estilos por defecto. Para gestionar los estilos durante la ejecución de la base de datos, recomendamos utilizar los comandos del tema "Texto con estilo".

Get edited text

Cuando se utiliza con un área de texto enriquecido, el comando Get edited text devuelve el texto del área actual, incluidas las etiquetas de estilo.

Para recuperar el texto "sin formato" (texto sin etiquetas) que se está editando, debe utilizar el comando ST Get plain text:

ST Get plain text(Get edited text)

Consulta y orden por comandos

Las consultas y ordenaciones realizadas entre objetos con varios estilos tienen en cuenta las etiquetas de estilo guardadas en el objeto. Si se ha modificado el estilo de una palabra, la búsqueda de esa palabra no dará resultado.

Para poder realizar búsquedas y ordenaciones válidas, debe utilizar el comando ST Get plain text. Por ejemplo:

QUERY BY FORMULA([MyTable];ST Get plain text([MyTable]MyFieldStyle)="very well")

Normalización automática de los finales de línea

Para garantizar la compatibilidad multiplataforma de los textos gestionados en la base de datos, 4D normaliza automáticamente los finales de línea de modo que ocupen un solo carácter: \r (retorno de carro). Esta normalización se lleva a cabo a nivel de los objetos del formulario (variables o campos) que contienen texto sin formato o de varios estilos. Los finales de línea que no sean nativos, o que utilicen una combinación de varios caracteres (por ejemplo, \r\n), se consideran como un único \r.

Tenga en cuenta que de conformidad con el estándar XML (formato de texto multiestilo), los comandos de texto de estilo múltiple también normalizan los finales de línea para variables de texto que no están asociadas con objetos.

Este principio facilita el uso de comandos de texto con múltiples estilos o de comandos como HIGHLIGHT TEXT en un contexto multiplataforma. Sin embargo, debe tenerlo en cuenta en su procesamiento cuando trabaje con textos de fuentes heterogénicas.