|
|
|
|
|
- Table column
- rtfColor attribute
RTFSelection (Function) In french: RTFSelection Modify or list attributes of text currently selected in an control RTF (from a window or report WINDEV). This function can also be used on a character string containing text in RTF. In this case, it is only possible to modify the text attributes. Remark: In a window, the text can be selected by the user or through programming with Cursor and CursorEnd.
RTFSélection(SAI_Saisie1,rtfFontName, "Arial")
RTFSélection(SAI_Saisie1, rtfFontSize, 12)
RTFSélection(SAI_Saisie1, rtfBold, True)
RTFSélection(SAI_Saisie1, rtfColor, RGB(134, 345, 255))
IF RTFSélection(SAI_Saisie1, rtfBold) = "" THEN
RTFSélection(SAI_Saisie1, rtfBold, True)
ELSE
bGras is boolean = RTFSélection(SAI_Saisie1, rtfBold)
RTFSélection(SAI_Saisie1, rtfBold, NOT bGras)
END
I is int
I = RTFSearch(SAI_Saisie1, "WINDEV")
WHILE I > 0
RTFSélection(SAI_Saisie1, rtfColor, LightRed, I, 6)
RTFSélection(SAI_Saisie1, rtfUnderlined, True, I, 6)
I = RTFSearch(SAI_Saisie1, "WINDEV", rtfCaseSensitive, I + 1)
END
MonTexte is string
MonTexteRTF is string
MonTexte = "Texte sans mise en forme provenant d'une chaîne de caractères du WLangage"
MonTexteRTF = RTFSélection(MonTexte, rtfBold, True, 1, Length(MonTexte))
SAI_SaisieRTF = MonTexteRTF
Syntax
Selection in an RTF control Hide the details
<Result> = RTFSelection(<RTF control> , <Attribute> [, <New value> [, <Start> [, <Size>]]])
<Result>: Character string, integer, boolean - Former attribute value. The type depends on the specified attribute.
- Empty string ("") if the selection contains different versions of the same attribute (selection in bold and non-bold for example).
<RTF control>: Control name Name of RTF control. <Attribute>: Constant Attribute to retrieve or to modify: | | rtfAlignment | Alignment of selected paragraphs. Possible values:- haLeft: left.
- haRight: right.
- haCenter: centered.
- haJustified: justified.
| rtfBackgroundColor | Background color of the text (type of attribute: Integer). | rtfBold | Bold characters (type of the attribute: Boolean). | rtfColor | Color of the text (type of the attribute: Integer). | rtfFontName | Name of the font used (type of the attribute: Character string). | rtfFontSize | Size of the font (in pixels) (type of the attribute: Integer). | rtfItalic | Italic characters (type of the attribute: Boolean). | rtfStrikethrough | Struck out characters (type of the attribute: Boolean). | rtfUnderlined | Underlined characters (type of the attribute: Boolean). |
<New value>: Character string, integer, boolean (optional) For a modification, new value of the specified attribute. <Start>: Optional integer Position of the character from which the type of the attribute must be retrieved or changed. If this parameter is not specified, the attribute of the text currently selected in the edit control is retrieved or changed. <Size>: Optional integer Number of characters whose type of attribute must be retrieved or modified. If this parameter is not specified, the attribute of the text currently selected in the edit control is retrieved or changed.
Selection in an RTF string Hide the details
<Result> = RTFSelection(<RTF string> , <Attribute> , <New value> , <Start> , <Size>)
<Result>: Character string New character string where the different changes have been performed. The initial string is not modified. <RTF string>: Character string Character string in RTF. <Attribute>: Constant Attribute to modify: | | rtfAlignment | Alignment of selected paragraphs. Possible values:- haLeft: left.
- haRight: right.
- haCenter: centered.
- haJustified: justified.
| rtfBackgroundColor | Background color of the text (type of attribute: Integer). | rtfBold | Bold characters (type of the attribute: Boolean). | rtfColor | Color of the text (type of the attribute: Integer). | rtfFontName | Name of the font used (type of the attribute: Character string). | rtfFontSize | Size of the font (in pixels) (type of the attribute: Integer). | rtfItalic | Italic characters (type of the attribute: Boolean) | rtfStrikethrough | Struck out characters (type of the attribute: Boolean). | rtfUnderlined | Underlined characters (type of the attribute: Boolean). |
<New value>: Character string, integer, boolean New value for the specified attribute. <Start>: entier Position of the character from which the attribute type is to be changed. Caution: This position ignores the RTF tags. <Size>: entier Number of characters for which you want to change the attribute type. Remarks Table column RTFSelection allows you to change the selection of the active cell. No other cell can be modified. The following code triggers an error:
RTFSélection({ControlCurrent()}[TableSelect(TABLE_Table1)], rtfColor, LightGray)
The following code must be used:
RTFSélection({ControlCurrent()}, rtfColor, LightGray)
rtfColor attribute The rtfColor attribute can return or receive the DefaultColor value: the color of the text depends on the color parameters defined in the control panel of Windows.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|