HTMLViewer
From REALbasicWiki
| This article is a stub. You can help the REALbasicWiki community by expanding it. |
| |||||
|---|---|---|---|---|---|
| Available on | | ||||
| General | |||||
| Superclass | RectControl | ||||
| Interfaces | |||||
| Constants | |||||
| Methods | |||||
| |||||
| Properties | |||||
|
You must check this for being true before using HTMLViewer | |||||
| Events | |||||
On Windows, you can use the URL passed to the DocumentComplete(URL) event to delete the file created when you use the LoadPage(s,FolderItem) version.
| |||||
|
NOTE: You can get descriptions of the items above from the REALbasic documentation. | |||||
HTMLViewer is a control to display some HTML content. The HTML content can come from:
- An external website, so you should use ShowURL method
- A local file which is accompanied by all its linked files, so you would use the HTMLViewer.LoadPage f (as FolderItem). Note: the parent of f must contain all the linked files.
- A local file but you also give a folder where the HTML code can find all the linked files.
[edit] Miscellaneous Information
When you use the LoadPage(s,FolderItem) form of LoadPage, the documentation is ambiguous regarding FolderItem. FolderItem must point to a file. The file can be empty. The following code pattern has worked:
Code Example
dim f as folderitem
f = SpecialFolder.CurrentWorkingDir
f = f.child("t.html")
f.CreateTextFile("")
LoadPage(s,f)
[edit] The HTMLViewer Control works differently on different platforms
Windows
1) Creates a file in the FolderItem directory when using LoadPage(s,FolderItem). You must delete this file.
2) CSS and JavaScript are supported
Macintosh
1) Does not create any files when using LoadPage(s,FolderItem). However, the FolderItem directory must be writeable.
2) CSS and JavaScript are supported
Linux
1) Does not use the Mozilla engine as the documentation says. Uses a gtk html library that supports very primitive HTML
2) Creates a file in the FolderItem directory when using LoadPage(s,FolderItem)
3) CSS, DOM, JavaScript NOT SUPPORTED!!!
