|
|
|
|
|
- The HTML format
- HTML Edit control
- Overview
- Control characteristics
- WLanguage events associated with the control
- Defining the content of an HTML Edit control
- Saving a text in an HTML file
- Example
- Saving HTML text to an HFSQL data file item
Handling HTML text in an Edit control
HyperText Markup Language (HTML) is a markup language intended for the web. WEBDEV allows you to manipulate text in HTML via the "HTML format" option of the Edit controls and the HTML control. - If the HTML text is displayed in a control that does not support HTML, the tags will be displayed.
- If the HTML text is displayed in a control that supports HTML, the tags will be automatically interpreted and the text will be formatted accordingly.
Overview The HTML Edit control is used to: - display HTML content,
- enter HTML content.
The control automatically stores entered text as HTML. This text will contain all the necessary formatting tags. Control characteristics The HTML Edit control has several options ("General" tab in the description window): - HTML toolbar: A formatting bar can be displayed above the Edit control.. This toolbar allows the user to easily format the text entered. For more details, see HTML formatting toolbar.
- Action on the Enter key: Defines the function of the Enter key used in the HTML Edit control..
- Email editing: Offers an "email" input mode that limits HTML functionalities to those recognized by the majority of email readers.
- Content independent of page style: Applies only the style defined for the input part of the Edit control.. No other style will be applied to the text in the input field.
Remark: If you enter the same text in a classic edit control and in an HTML edit control, the size of the string in the edit control will be larger than in the HTML edit control (because HTML tags are added). WLanguage events associated with the control The optional "Key down" event, available in browser code, allows you to create shortcuts using F keys, etc. Defining the content of an HTML Edit control To define the content of an HTML Edit control, simply specify the Value property (in the initialization code of the control, for example). For example:
PageHTML is string
PageHTML = fLoadText(SysDir(srMyDocuments) + ["\"] + "index.html")
SAI_ChampHTML = PageHTML
Saving a text in an HTML file HTML formatting is automatically applied to the text entered in an HTML Edit control. To save the content of an HTML Edit control to an HTML file, simply use fSaveText on the control. Example The example below creates an "index.html" file. This file contains the text entered in the Edit control field SAI_TexteHTML.
Nomfic is string
Nomfic = fSelect("", "", "Sélectionnez un fichier...", ...
"Fichiers HTML" + TAB + "*.html" + CR + "Tous fichiers (*.*)" + TAB + "*.*", ...
"HTML", fselCreate + fselExist)
fSaveText(Nomfic, SAI_TexteHTML)
Saving HTML text to an HFSQL data file item To save HTML text to a data file item, it is recommended to bind the Edit control to a Text Memo item. As HTML includes many tags, "Character string" items are often too small.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|