WP Get style sheet
WP Get style sheet ( wpDoc : Object ; styleSheetName : Text {; listLevelIndex : Integer } ) : Object
| Parámetros | Tipo | Descripción | |
|---|---|---|---|
| wpDoc | Object | → | Documento 4D Write Pro |
| styleSheetName | Text | → | Style sheet name |
| listLevelIndex | Integer | → | Nivel de la hoja de estilo en la jerarquía |
| Resultado | Object | ← | Objeto hoja de estilo |
Historia
| Lanzamiento | Modificaciones |
|---|---|
| 4D 18 | Created |
| 4D 21 R3 | *Se ha añadido el parámetro listLevelIndex |
Descripción
The WP Get style sheet command returns the style sheet object designated by the styleSheetName or by the style sheet name and the listLevelIndex in the case of a hierarchical list style sheet.
En wpDoc, pase el documento 4D Write Pro que contiene la hoja de estilo.
El parámetro styleSheetName permite especificar el nombre de la hoja de estilo a devolver. If the style sheet name does not exist in wpDoc, an null object is returned.
If the style sheet is part of a hierarchical list style sheet, you can optionally specify the listLevelIndex parameter to retrieve a specific level of the hierarchy.
- listLevelIndex representa el nivel de la hoja de estilo en la jerarquía (1 = nivel raíz, 2 = primer subnivel, etc.).
- Si se omite el parámetro y la hoja de estilo es jerárquica, se devuelve la hoja de estilo del nivel raíz.
- Si el nivel solicitado no existe, se devuelve un objeto null.
- If the style sheet is not a hierarchical list style sheet and listLevelIndex is greater than 1, a null object is returned.
Ejemplo 1
Para recuperar la hoja de estilo "Main title":
var $styleSheet : Object
$styleSheet:=WP Get style sheet(wpArea;"Main title")
If($styleSheet=Null) // comprobar si la hoja de estilo existe//si no crearla
$styleSheet:=WP New style sheet(wpArea;wk type paragraph;"Main title")
End if
Ejemplo 2
Para recuperar un nivel específico de una hoja de estilo de lista jerárquica:
var $rootStyle : Object
var $subLevelStyle : Object
// Retrieve root-level style sheet
$rootStyle:=WP Get style sheet(wpArea;"MainList")
// Retrieve second level (first sub-level)
$subLevelStyle:=WP Get style sheet(wpArea;"MainList";2)
If($subLevelStyle=Null)
ALERT("Requested level does not exist.")
End if
Ver también
Style sheets
WP DELETE STYLE SHEET
WP Get style sheets
WP IMPORT STYLE SHEETS
WP New style sheet