4D Write v16

WR SET STYLESHEET INFO

Home

 
4D Write v16
WR SET STYLESHEET INFO

WR SET STYLESHEET INFO 


 

WR SET STYLESHEET INFO ( area ; stylesheetNumber ; name ; applyTo ; shortCut ) 
Parameter Type   Description
area  Longint in 4D Write area
stylesheetNumber  Longint in Style sheet number
name  Alpha in Name of the style sheet
applyTo  Integer in 0=characters 1=paragraphs
shortCut  Alpha in one character "" if no shortcut

The WR SET STYLESHEET INFO command allows you to modify the properties of the style sheet whose reference number is passed in styleSheetNumber and which is contained in the 4D Write document with the reference number area. The style sheet number corresponds to the order of apperance the style sheet when it is either displayed in the Style sheet drop-down list or in the list in the Style sheets dialog.

name: If name is an empty string, the original name of the style sheet will not be modified. The name of a style sheet must not exceed 31 characters.

Warning: two style sheets can both have the same name, however they will always have different reference numbers.

applyTo: If applyTo equals -1, the current value will remain the same.You can also pass one of the following constants, found in the WR Parameters theme:

Constant Type Value Comment
wr apply to characters Longint 0 The style sheet will be a character stylesheet
wr apply to paragraphs Longint 1 The style sheet will be a paragraph stylesheet

A paragraph style sheet always apply to all the paragraphs of the selection, even if the first or last paragraphs are partially selected. By default a newly created style sheet is a character style sheet.

shortCut: The shortCut optional parameter allows you to assign a keyboard shortcut to the style sheet. It only accepts one character. To use the shortcut you will need to press the key passed in this parameter with the Ctrl key (on Windows) or the Command key (on Mac OS). It is recommended that you use a number in order to avoid any conflict with the standard 4D Write keyboard shortcuts.

If shortCut is omitted or if it is an empty character string no shortcut will be assigned to the style sheet.

styleSheetNumber: If you want the style sheet number to remain identical, you need to call the WR GET STYLESHEET INFO command and use the reference number returned by that command .

Example  

You want to modify the definition of the “Title” style sheet: its name is changed to “Title 14”, its font should be set to Times 14 with the Bold style attribute selected as well as the blue color.

 NbStyles:=WR Count(Area;12)
 For($i;1;NbStyles)
    WR GET STYLESHEET INFO(Area;$i;$Name;$ApplyTo;$Protected;$Shortcut)
    If($Name="Title")
       WR SET STYLESHEET INFO(Area;$i;"Title 14";$ApplyTo;$Shortcut)
       WR SET STYLESHEET FONT(Area;$i;"Times")
       WR SET STYLESHEET TEXT PROP(Area;$i;wr font size;14;1)
       WR SET STYLESHEET TEXT PROP(Area;$i;wr bold;1;1)
       WR SET STYLESHEET TEXT PROP(Area;$i;wr text color;212;1)
    End if
 End for



See also 

WR GET STYLESHEET INFO

 
PROPERTIES 

Product: 4D Write
Theme: WR Style Sheet
Number: 89487

 
HISTORY 

Created: 4D Write 6.5

 
ARTICLE USAGE

4D Write Language ( 4D Write v16)