|
Class: HTMLDocumentView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--HTMLDocumentFrame
|
+--HTMLDocumentView
- Package:
- stx:libhtml
- Category:
- System-Documentation
- Version:
- rev:
1.226
date: 2019/03/13 20:43:34
- user: cg
- file: HTMLDocumentView.st directory: libhtml
- module: stx stc-classLibrary: libhtml
- Author:
- Claus Gittinger
displays HTML documents.
Can be used as a widget or
(using startup-protocol found in the class protocol) as a topView.
Please read the documentation in HTMLDocumentPainter for its limitations.
If you want to include an html-view in your UI application,
and want embedded anchor links which call back into your application,
use the following scheme:
1) set the htmlVIew's linkActionPerformer (in your postBuild:-method)
2) generate anchors of the form:
<A action='doIt: linkActionPerformer doSomething'>
or, alternatively, create anchors of the form:
<A action='doIt: self application doSomething'>
DO NOT add private protocol to this class or the superclass (as was done with quickFix)
defaults
-
defaultIcon
-
return the browsers default window icon
-
fullButtonSpec
-
('hardcopy' #menu_printPage )
-
helpFileFor: helpFilePath
-
given a relataive path in the helpFile hierarchy,
find the file's absolute path - first trying the current language,
if not found, try an english version
-
helpViewButtonSpec
-
startup
-
open
-
open a documentView on the ST/X top page.
Returns the htmlView.
usage example(s):
-
openDocumentation: aFilename
-
-
openFull
-
open a full documentation view on the top documentation page.
Returns the htmlView.
The actual page displayed depends on the language setting;
i.e. it is 'doc/online/<language>/TOP.html'.
usage example(s):
usage example(s):
Language := #de.
self openFull
|
usage example(s):
Language := #en.
self openFull
|
-
openFullOnDocumentationFile: relativePath
-
open a full documentation view on a file, given its relative
path in the documentation hierachy.
The actual page displayed depends on the language setting;
i.e. it is 'doc/online/<language>/relativePath'.
If the file is not found, a warnBox is shown and nil is returned;
otherwise, the htmlView is returned.
usage example(s):
self openFullOnDocumentationFile:'TOP.html'
self openFullOnDocumentationFile:'programming/TOP.html'
self openFullOnDocumentationFile:'tools/uipainter/TOP.html#ADDINGMENUBAR'
self openFullOnDocumentationFile:'foobar'
|
usage example(s):
Language := #de.
self openFullOnDocumentationFile:'TOP.html'
|
usage example(s):
Language := #en.
self openFullOnDocumentationFile:'TOP.html'
|
-
openFullOnDocumentationFile: relativePath searchIn: pathesOrNil
-
open a full documentation view on a file, given its relative
path in the documentation hierachy.
The actual page displayed depends on the language setting;
i.e. it is 'doc/online/<language>/relativePath'.
If the file is not found, a warnBox is shown and nil is returned;
otherwise, the htmlView is returned.
usage example(s):
self openFullOnDocumentationFile:'TOP.html'
self openFullOnDocumentationFile:'programming/TOP.html'
self openFullOnDocumentationFile:'tools/uipainter/TOP.html#ADDINGMENUBAR'
self openFullOnDocumentationFile:'foobar'
|
usage example(s):
Language := #de.
self openFullOnDocumentationFile:'TOP.html'
|
usage example(s):
Language := #en.
self openFullOnDocumentationFile:'TOP.html'
|
-
openFullOnFile: aDocumentName
-
open a full documentation view on a file, given its pathName.
Returns the htmlView.
usage example(s):
self openFullOnFile:'../../doc/online/english/TOP.html'
self openFullOnFile:'http://localhost:8001/'
self openFullOnFile:nil
self openFullOnFile:'http://www.exept.de'
|
-
openFullOnFile: aDocumentName extent: extent title: title
-
open a full documentation view with extent and title,
on a file, given its pathName. Returns the htmlView.
Add a standard button panel.
-
openFullOnFile: aDocumentName extent: extent title: title uriDisplay: uriDisplay infoDisplay: infoDisplay
-
open a full documentation view with extent and title,
on a file, given its pathName. Returns the htmlView.
Add a standard button panel.
-
openFullOnFile: aDocumentName text: htmlText top: topDirectory extent: extent title: title buttonSpec: buttonSpec info: info
-
open a full documentation view with extent and title,
on a file, given its pathName. Returns the htmlView.
The buttonSpec argument specifies which buttons should be added to
the panel - for a help viewer, only a subset of the complete set
is usually passed.
-
openFullOnFile: aDocumentName text: htmlText top: topDirectory extent: extent title: title buttonSpec: buttonSpec uriDisplay: showUri infoDisplay: showInfo
-
open a full documentation view with extent and title,
on a file, given its pathName. Returns the htmlView.
The buttonSpec argument specifies which buttons should be added to
the panel - for a help viewer, only a subset of the complete set
is usually passed.
-
openFullOnHelpFile: relativePath
-
open a full documentationView as helpView (not all buttons are
present) on relativePath, which is the path relative to the
doc/online/help directory. If aRelativePath ends in '.html',
that filename is taken; otherwise, it is interpreted as a directory
name and a file named 'TOP.html' is tried there.
If the file does not exist, a warnBox is shown and nil is returned;
otherwise, the htmlView is returned.
usage example(s):
self openFullOnHelpFile:'Launcher/compilerSettings.html'
|
usage example(s):
Language := #de.
self openFullOnHelpFile:'Launcher/compilerSettings.html'
|
usage example(s):
Language := #en.
self openFullOnHelpFile:'Launcher/compilerSettings.html'
|
-
openFullOnText: htmlText
-
open a full documentation view on some html-text.
Returns the htmlView.
usage example(s):
self
openFullOnText:'
chapter 1
sub chapter 1.1
chapter 2
sub chapter 2.1
sub chapter 2.2
sub chapter 2.3
'
|
-
openFullOnText: htmlText inDirectory: topDirectory
-
open a full documentation view on some html-text.
For file-HREFS, use aTopDirectory as starting point.
Returns the htmlView.
usage example(s):
self
openFullOnText:'
chapter 1
sub chapter 1.1
chapter 2
sub chapter 2.1
sub chapter 2.2
sub chapter 2.3
'
|
-
openFullOnText: htmlText top: topDirectory extent: extent title: title
-
open a full documentation view with extent and title,
on a file, given its pathName. Returns the htmlView.
Add a standard button panel.
-
openFullOnURL: anURL
-
open a full documentation view on an url, given its pathName.
Returns the htmlView.
usage example(s):
self openFullOnURL:'http://www.exept.de'
self openFullOnURL:'http://localhost:8080/'
self openFullOnURL:'http://localhost:80/'
self openFullOnURL:'http://wvnvaxa.wvnet.edu/vmswww/bmp.html'
self openFullOnURL:'http://www.w3.org/Graphics/PNG/inline-alpha.html'
self openFullOnURL:'http://www.schaik.com/pngsuite/pngsuite_bas_png.html'
self openFullOnURL:'http://www.schaik.com/pngsuite/pngsuite_trn_png.html'
self openFullOnURL:'http://www.schaik.com/pngsuite/pngsuite.html'
|
-
openOn: aDocumentName
-
open a full sized documentationView on aDocumentName.
Return the htmlView.
usage example(s):
self openOn:'../../doc/online/english/TOP.html'
self openOn:'http://pxd.me/dompdf/www/test/image_bmp.html'
|
-
openOnFile: aDocumentName
-
open a small documentationView on aDocumentName.
Return the htmlView.
usage example(s):
self openOnFile:'../../doc/online/english/TOP.html'
|
-
openOnText: aString
-
open a small documentationView on some html-text.
Return the htmlView.
usage example(s):
HTMLDocumentView openOnText:'Hello world'
HTMLDocumentView openFullOnText:'Hello world'
|
startup-basic
-
new_openFullOnFile: aFilenameOrString anchor: localAnchor text: htmlText top: topDirectory extent: extent title: title buttonSpec: buttonSpec uriDisplay: showUri infoDisplay: showInfo
-
open a full documentation view with extent and title,
on a file, given its pathName. Returns the htmlView.
The buttonSpec argument specifies which buttons should be added to
the panel - for a help viewer, only a subset of the complete set
is usually passed.
-
old_openFullOnFile: aFilenameOrString anchor: localAnchor text: htmlText top: topDirectory extent: extent title: title buttonSpec: buttonSpec uriDisplay: showUri infoDisplay: showInfo
-
open a full documentation view with extent and title,
on a file, given its pathName. Returns the htmlView.
The buttonSpec argument specifies which buttons should be added to
the panel - for a help viewer, only a subset of the complete set
is usually passed.
-
openFullOnFile: aFilenameOrString anchor: localAnchor text: htmlText top: topDirectory extent: extent title: title buttonSpec: buttonSpec uriDisplay: showUri infoDisplay: showInfo
-
backward compatibility entry
accessing
-
heightOfContentsDependsOnWidth
-
yes, I rearrange the text depending on the width,
and therefore, it is a bad idea to hide/show scrollbars dynamically
-
helpDocumentPath: aPathNameString
-
allow change of the document which is displayed by the
views help button
-
linkButtonPanel: aView
-
-
scrollWhenUpdating
-
return the scroll behavior, when I get a new text
via the model.
Possible returnValues are:
#keep / nil -> no change
#endOfText -> scroll to the end
#beginOfText -> scroll to the top
The default is #beginOfText.
This is useful for synchronized text+htmlText,
where new text comes from editing
-
scrollWhenUpdating: aSymbolOrNil
-
define how to scroll, when I get a new text
via the model.
Allowed arguments are:
#keep / nil -> no change
#endOfText -> scroll to the end
#beginOfText -> scroll to the top
The default is #beginOfText.
This is useful for synchronized text+htmlText,
where new text comes from editing
button actions
-
currentDocumentSource
-
-
fileBrowserOnPageSource
-
open a file browser on the html file.
But only iff the text being shown comes from a file
-
fileNameOfPageSource
-
return the filename of the html file.
But only iff the text being shown comes from a file;
otherwise return nil
-
menu_back
-
-
menu_help
-
-
menu_home
-
-
menu_print
-
-
menu_printPage
-
postscript
-
menu_quit
-
-
menu_reload
-
self sensor ctrlDown ifTrue:[
-
menu_settings
-
group add:(box addCheckBox:(resources string:'tiny font') on:nil) toggleView.
-
menu_source
-
-
showPageSource
-
change & update
-
updateFromModel
-
defaults
-
helpDocumentName
-
focus control
-
wantsFocusWithPointerEnter
-
views which like to take the keyboard focus
when the pointer enters can do so by redefining this
to return true
initialization & release
-
destroy
-
-
initialize
-
-
realize
-
opening an HTML view on some document:
HTMLDocumentView openOn:'../../doc/online/english/TOP.html'
|
opening an HTML view on some document with initial local anchor:
HTMLDocumentView openOn:'../../doc/online/english/getstart/tut_3.html#REDEFINING_PRINT'
|
on a directory:
HTMLDocumentView openOn:'.'
|
setup an HTML view in some other view:
|top v document|
top := StandardSystemView extent:200@500.
v := HVScrollableView for:HTMLDocumentView miniScrollerH:true in:top.
v origin:0.0@ 0.0 corner:1.0@1.0.
top openAndWait.
v homeDocument:'../../doc/online/english/TOP.html'.
|
the same, with different contents:
|top v document|
top := StandardSystemView extent:200@500.
v := HVScrollableView for:HTMLDocumentView miniScrollerH:true in:top.
v origin:0.0@ 0.0 corner:1.0@1.0.
top openAndWait.
v homeDocument:'test.html'.
|
how about something like this for your applications help:
|top panel list bottom htmlView|
top := StandardSystemView new.
top extent:(Display extent // 2).
panel := VariableVerticalPanel origin:0.0@0.0 corner:1.0@1.0 in:top.
list := ScrollableView for:FileSelectionList origin:0.0@0.0 corner:1.0@0.25 in:panel.
list directory:'../../doc/online/english'.
list action:[:arg |
htmlView setTopDirectoryName:(list directory pathName).
htmlView showFileDocument:(list selectedPathname)
].
list matchBlock:[:name | '*.html' match:name].
bottom := View origin:0.0@0.25 corner:1.0@1.0 in:panel.
htmlView := HTMLDocumentView
onFile:'../../doc/online/english/TOP.html'
in:bottom.
top open
|
it is also possible, to stuff HTML source into the view:
HTMLDocumentView
openFullOnText:'
<html>
<body>
<h1>chapter 1</h1>
<h2>sub chapter 1.1</h2>
<h1>chapter 2</h1>
<h2>sub chapter 2.1</h2>
<h2>sub chapter 2.2</h2>
<h2>sub chapter 2.3</h2>
</body>
</html>
'
|
and, the same in a subview:
|top panel list bottom htmlView|
top := StandardSystemView new.
top extent:(Display extent // 2).
panel := VariableVerticalPanel origin:0.0@0.0 corner:1.0@1.0 in:top.
list := ScrollableView for:FileSelectionList origin:0.0@0.0 corner:1.0@0.25 in:panel.
list directory:'../../doc/online/english'.
list action:[:arg |
htmlView setTopDirectoryName:(list directory pathName).
htmlView showFileDocument:(list selectedPathname)
].
list matchBlock:[:name | '*.html' match:name].
bottom := View origin:0.0@0.25 corner:1.0@1.0 in:panel.
htmlView := HTMLDocumentView
onText:'
<html>
<body>
<h1>chapter 1</h1>
<h2>sub chapter 1.1</h2>
<h1>chapter 2</h1>
<h2>sub chapter 2.1</h2>
<h2>sub chapter 2.2</h2>
<h2>sub chapter 2.3</h2>
</body>
</html>
'
in:bottom.
top open
|
|