WR SET TEXT PROPERTY
version 2004.3 (Modified)
WR SET TEXT PROPERTY (area; property; value)
Parameter | Type | Description | |
area | Longint | 4D Write area | |
property | Integer | Number of the text property to set | |
value | Number | Value for the selected property |
Description
The WR SET TEXT PROPERTY command allows you to modify the text properties of the current selection in the 4D Write area referenced by area.
property and value are to be used jointly.
Tip: We advise you to use the WR SET FONT command instead of WR SET TEXT PROPERTY (Area;wr font number;Value), because font numbers are managed dynamically and may be different between operating systems.
If you pass an illegal property number, the error 1075 will be generated.
If you pass an illegal value for the selected property, the error 1076 will be generated.
Notes:
• property and value can be set using constants. A list of text properties and a list of values for text properties values are available in the "WR Text properties" and "WR Text properties values" constants themes. You can either pass the value or the constant name.
•The list of error codes is available in Appendix C: Error Codes.
The following constants and values can be used with the WR SET TEXT PROPERTY and WR Get text property commands:
property (WR Text properties) | used to set or get (value or WR Text |
properties values): | |
wr bold (0) | the bold style on the text (false=0, true=1) |
wr italic (1) | the italic style on the text (false=0, true=1) |
wr shadow (2) | the shadow style on the text (false=0, true=1) |
wr strikethrough (3) | the strikethrough style on the text (false=0, true=1) |
wr underline (4) | the underline style on the text: no underline=0, |
wr single underline (1), wr word underline (2), wr double | |
underline (3), wr hatched underline (4) | |
wr superscript or subscript (5) | text in superscript or subscript: none=0, wr superscript (1), |
wr subscript (2) | |
wr capital case (6) | text in small capitals, capitals or lower case: lower |
case=0, wr capitals (1), wr small capitals (2) | |
wr font number (7) | the value passed is an internal number. 4D Write assigns |
font numbers gradually as they are used. It is generally | |
advisable to use the WR Get font and WR SET FONT | |
commands that work with font names. | |
wr font size (8) | the size of the text (value between 9 and 255) |
wr text color (9) | the value must be passed in the form 0x00RRGGBB |
wr text back color (10) | as in 4D (or in the previous version of 4D Write). |
wr strikethrough color (11) | You can use the constants of the WR Standard colors theme. |
wr underline color (12) | |
wr shadow color (13) |
wr links appearance (14) | the appearance of the links: wr no links appearance (0), |
wr unvisited links appearance (1), wr visited links | |
appearance (2) | |
wr stylesheet number (15) | pass the index of the stylesheet in the list. Keep in mind that |
if you pass a stylesheet index, the text will be assigned a | |
stylesheet, but the properties of this stylesheet will not | |
be applied to it. The WR APPLY STYLESHEET command | |
both sets the property and applies the properties of the | |
stylesheet. | |
wr user property (16) | its value can be set freely. You can set and get any |
customized value for this property. For example, if you | |
want to keep a hierarchical list in parallel with a text, | |
you can use this property to store an element reference | |
for the hierarchical list. Each time you click on the text, | |
you get the property and select the corresponding element | |
in the hierarchical list. | |
wr justification (32) | text justification: wr left justified (0), wr centered (1), wr right |
justified (2), wr full justified (3) | |
wr line spacing (33) | the line spacing, the value varies from 1 to 10 in steps of 0.5: |
1=single spacing, 1.5=1.5 spacing, 2=double spacing | |
wr bullet (34) | the bullet style: wr black square bullet (110), wr white square |
bullet (111), wr black circle bullet (108), wr white circle | |
bullet (109), wr diamonds bullet (117), wr clubs bullet (118), | |
wr no bullet (0) | |
wr left margin (35) | the distance with respect to the left dead margin. The value |
is expressed in the current unit of the document. | |
wr first indent (36) | the distance with respect to the right margin. <0 = to the left |
of the right margin, >0 = to the right of the right margin. | |
The value is expressed in the current unit of the document. | |
wr right margin (37) | the distance with respect to the right dead margin. The value |
is expressed in the current unit of the document. | |
wr border back color (38) | the value must be passed in the form 0x00RRGGBB |
wr border line color (39) | as in 4D (or in the previous version of 4D Write). |
You can use the constants of the WR Standard colors theme. | |
wr border line style (40) | the style and size of the border line: wr 1 pt line (0), |
wr 2 pts line (1), wr 3 pts line (2), wr dotted line (3), | |
wr double dotted line (4), wr triple dotted line (5), wr double 1 pt line (6), | |
wr double inside 2 pts line (7), wr triple center 2 pts line (8), | |
wr double outside 2 pts line (9), wr half pt line (10), | |
wr quarter pt linet (11). | |
Setting the border line style directly affects the borders of the | |
selection, or lets you set the type of border before | |
putting it in place. It is better to set the type of border | |
first and then to place them. That way, you avoid having to | |
redraw. Keep in mind that the border style is the same | |
for the all the sides (left/right and top/bottom) of a selection. | |
wr left border (41) | setting of the border (false=0, true=1) |
wr right border (42) | setting of the border (false=0, true=1) |
wr inside top border (43) | setting of the inside border (false=0, true=1). A space is added |
above and below the paragraph. | |
wr inside bottom border (44) | setting of the inside border (false=0, true=1). A space is added |
above and below the paragraph. | |
wr border spacing (45) | the distance between the border and text. The value is |
expressed in the current unit of the document. | |
wr top border (46) | setting of the border (false=0, true=1). A space is added |
above the paragraph. | |
wr bottom border (47) | setting of the border (false=0, true=1). A space is added |
below the paragraph. | |
wr tab (64) | the number of tabs in the last paragraph of the |
selection. Property not valid with | |
WR SET TEXT PROPERTY — to be used only with | |
WR Get text property. |
Examples
1. You want to apply to the current selection the following properties: Times font, 12 points, Violet color, no italic, bold.
Violet:=WR RGB to color(61952;2048;33792)
WR SET FONT(Area;"Times")
WR SET TEXT PROPERTY(Area;wr font size;12)
WR SET TEXT PROPERTY(Area;wr text color;wr violet)
WR SET TEXT PROPERTY(Area;wr bold;1)
WR SET TEXT PROPERTY(Area;wr italic;0)
2. You want to set the margins to a predefined value:
WR GET SELECTION(Area;StartSel;EndSel) `Storing the current text selection
WR UPDATE MODE(Area;0) `Disabling screen updating
WR EXECUTE COMMAND(Area;wr cmd select all) `Selecting all
`Setting the document unit to centimeters
WR SET DOC PROPERTY(Area;wr unit;0)
`Setting the document margins in centimeters
WR SET TEXT PROPERTY(Area;wr right margin;1,8)
WR SET TEXT PROPERTY(Area;wr left margin;1,3)
WR SET SELECTION(Area;StartSel;EndSel) `Setting back the selection
WR UPDATE MODE(Area;1) `Enables screen updating
See Also