<< Prev | - Up - | Next >> |
As shown in the example, the default configuration defines a text parser and tags behaviour. The default text parser loads a text file and split them into pages. The first line of a page defines its reference name, the following lines define its descrition. Pages are separated in the text file by two empty lines. A text file can contain an arbitrary amount of pages. If several files are parsed with the same HelpClass
object, they are all stored in the object. Beware that if a page has a reference already used, it will overwrite the old definition.
The default tags bindings are :
<b>
...</b>
: Sets the text in bold.
<i>
...</i>
: Sets the text in italic.
<bi>
...</bi>
: Sets the text in bold and italic.
<u>
...</u>
: Underlines the text.
<o>
...</o>
: Overstrikes the text.
<f>
...</f|...>
: Sets the text in the font specified by the </f|..>
tag parameter. Valid fonts have the form : family ?size where family is the font family and size is an integer representing the desired font size.
<p>
: Inserts a new line. With <p>
, pages with two blank lines can be created.
<right>
...</right>
: Right justify the text.
<center>
...</center>
: Center justify the text.
<left>
...</left>
: Left justify the text.
<fg>
...</fg>
: Sets the foreground color of that part of the text. See below for valid colors.
<bg>
...</bg>
: Sets the background color of that part of the text. See below for valid colors.
<bitmap|....>
: displays a built-in bitmap. Built-in bitmaps are : error, gray75, gray50, gray25, gray12, hourglass, info, questhead, question, warning, document, stationery, edition, application, accessory, folder, pfolder, trash, floppy, ramdisk, cdrom, preferences, querydoc, stop, note, caution.
<blink>
...</blink>
: Sets the text to blink.
<foreground|...>
: Sets the foreground of the help window to the specified color.
<background|...>
: Sets the background of the help window to the specified color.
<title|...>
: Specifies a title to set for the help window. It is a good habit to always start a page definition by this tag.
<image|...>
: Inserts a .gif image from the specified url.
<link>
...</link|...>
: Defines a link. The text included by the tags will be displayed in blue and underlined and the mouse cursor is changed to a finger when placed over it. Clicking on the text does the following actions, depending on the parameter given to the </link|...>
tag :
parameter of the form http://... : a web browser is started, displaying the specified url
parameter of the form file://... : a web browser is started, displaying the specified file
other forms : the specified help page is displayed
<oz|...>
: The tag parameter defines an Oz procedure (see below) to compile and execute when this tag is reached.
<toz>
...</toz|...>
: The tag parameter defines an Oz procedure to compile and execute. The procedure must be a one parameter procedure. This parameter is bound to a record providing the following informations :
widget
: a handle to the QTk text widget displaying the help text (see QTk documentation).
toplevel
: a handle to the QTk toplevel window where the help text is displayed (see QTk documentqtion).
id
: a unique identifier that can be specified when opening the text window (see global reference).
ctags
: a list of all currently appliable tags.
tag
: a QTk text tag for the text between the tags (see QTk documentation).
X
: where X
is an integer. The X
th specified parameter of the tag, if any.
When a color is needed, it can be specified in one of those two forms :
color_name
: like red
or blue
. This works for most usual colors.
#RRGGBB
: where RR
, GG
and BB
are hexadecimal value for respectively the red, green and blue components of the color.
When parsing file, or displaying it, no behaviour is defined in case of errors. Most of the time, the HelpClass
object will just stop its process in case of error, however any other unexpected behaviour can occur. Please try and assure to use correct datas.
<< Prev | - Up - | Next >> |