ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / HTML Editor functions
  • Properties specific to edtHTMLSelection variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The edtHTMLSelection type is used to identify all the advanced characteristics of a selection in an HTML Editor control. The characteristics of this selection are returned by several WLanguage properties.
edtHTMLSelection variables are used in the following cases:
  • "Modify selection" event associated with the HTML Editor control.
  • HTMLEditorGetSelection function. This function is used to retrieve the current selection in an HTML Editor control.
  • WINDEV Selection property used on an HTML Editor control.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// Gray out the "Open" button (or not) according to the selection
HTMLEditorGetSelection(HTMEDT_MyHTMLEditor, HTMLEditorGetSelection_Callback)
INTERNAL PROCÉDURE HTMLEditorGetSelection_Callback(Selection is edtHTMLSélection)
  BTN_Open.Grayed = NOT Left(Selection.Text, "https:\\")
END
Remarks

Properties specific to edtHTMLSelection variables

The following properties can be used to handle edtHTMLSelection variables:
Name Type usedEffect
StartIntegerFirst character selected in a "text without tags" unit (starts at 1).
EndIntegerLast character selected in a "text without tags" unit.
FragmentArrayArray of the selected HTML elements and start and end indices of the selection. The following properties can be used for each element:
htmlNodehtmlNodeHTML node in the selection.
StartIntegerIndex of the first character selected in htmlNode.
EndIntegerIndex of the last character selected in htmlNode.
HTMLCharacter stringValue of the entire node with HTML tags.
TextCharacter stringValue of the entire node without HTML tags. To get this fragment, use the Middle function with the Start and End properties.
HTMLCharacter stringValue of the selection in HTML format.
StyleStyle of the selection.
Name Character string Name of CSS style.
Font
AlignmentInteger constantHorizontal alignment of the selection:
  • haCenter: The selection is centered.
  • haRight: The selection is aligned to the right.
  • haLeft: The selection is aligned to the left.
StrikeOutBoolean
  • True if the selection is struck through,
  • False otherwise.
ColorInteger constantFont color.
BackgroundColorInteger constantBackground color of the selection.
SuperscriptBoolean
  • True if the selection is in superscript mode,
  • False otherwise.
BoldBoolean
  • True if the selection is bold,
  • False otherwise.
SubscriptBoolean
  • True if the selection is in subscript mode,
  • False otherwise.
ItalicBoolean
  • True if the selection is in italics,
  • False otherwise.
Name Character stringName of the font family used for selection.
BackgroundColorOpacityIntegerPercentage of background color opacity.
UnderlineBoolean
  • True if the selection is underlined,
  • False otherwise.
SizeIntegerFont size of the selection.
TextCharacter stringValue of the selection without HTML tags.
TypeInteger constantType of the selection:
  • edthtmlSelEmpty: No selection is performed.
  • edthtmlSelSingle: Only one HTML element is selected.
  • edthtmlSelMultiple: Multiple HTML elements are selected.
URLCharacter stringIf a link is selected, URL of that link.
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/29/2023

Send a report | Local help