4D v16.3

OBJECT SET STYLE SHEET

Home

 
4D v16.3
OBJECT SET STYLE SHEET

OBJECT SET STYLE SHEET 


 

OBJECT SET STYLE SHEET ( {* ;} object ; styleSheetName ) 
Parameter Type   Description
Operator in If specified, object is an object name (string) If omitted, object is a field or variable
object  Form object in Object name (if * is specified) or
Field or variable (if * is omitted)
styleSheetName  Text in Name of style sheet

The OBJECT SET STYLE SHEET command modifies, for the current process, the style sheet associated with the object(s) designated by the object and * parameters. A style sheet modifies the font, font size and (except for automatic style sheets) font style.

Passing the optional * parameter indicates that the object parameter is an object name (string). If you do not pass this parameter, it indicates that the object parameter is a field or variable. In this case, you pass a field or variable reference instead of a string (field or variable object only). 

In the styleSheetName parameter, you pass the name of the style sheet to be applied to the object. You can also pass either:

  • the name of an existing style sheet (if the style sheet does not exist, an error is returned, that you can intercept using a method installed by the ON ERR CALL command),
  • an empty string ("") so as to not apply the style sheet to the object, or
  • one of the following constants found in the "Font Styles" theme in order to apply an automatic style sheet:
    Constant Type Value Comment
    Automatic style sheet String __automatic__ Used by default for all objects
    Automatic style sheet_additional String __automatic_additional_text__ Supported by static text, fields and variables only. Used for additional text in dialog boxes.
    Automatic style sheet_main String __automatic_main_text__ Supported by static text, fields and variables only. Used for main text in dialog boxes.

If a style sheet was already associated with the object in Design mode, calling this command replaces it for the current process. 

During the session, if you use the ST SET ATTRIBUTES, ST SET TEXT or OBJECT SET FONT commands on the object in order to modify its font or font size, the reference to the style sheet is automatically deleted from the object -- even if you assign the same attributes as those of the style sheet. However, if you modify the style (bold, italic, etc.), for example using the ST SET ATTRIBUTES or OBJECT SET FONT STYLE commands, these new properties are added to the style sheet for the duration of the session.



See also 

Font Styles
GET STYLE SHEET INFO
LIST OF STYLE SHEETS
OBJECT Get style sheet

 
PROPERTIES 

Product: 4D
Theme: Objects (Forms)
Number: 1257

 
HISTORY 

Created: 4D v14
Modified: 4D v15 R3

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)