type Formated_string =
{
mutable f_type : Font_Type;
mutable f_att : Font_Attributes;
mutable f_size : Font_Size;
mutable f_color : color;
mutable f_string : string
};;
type Formated_line =
{
mutable l_indent : int;
mutable l_line : bool;
mutable l_content : Formated_string list
};;
type gr_extext =
{ extx_window : gr_window
; mutable extx_name : string
; mutable extx_left : int
; mutable extx_top : int
; mutable extx_width : int
; mutable extx_height : int
; mutable extx_first : int
; mutable extx_anchors : (AnchorType * int) list
; mutable extx_content : Formated_line vect
}
;;
The extended text objects are used to display hyper texts and manage
navigation. The basic utility of extended text is to manage help
under Camlwin. The help files must be typed in html format, compiled
with gr_html_interpreter and
then added to the extended text with gr_HtmlList_to_Formated.
The extended text content is:
- the attached window (extx_window),
- the upper left corner coordinates (extx_left, extx_top),
- the dimensions (extx_width, extx_height),
- the first display line (extx_first),
- the list of anchors and references (extx_anchors),
- the vector of all the line of the text (extx_content).
gr_HtmlList_to_Formated :
HTML_type list -> int ->
Formated_line vect * ((AnchorType * int) list)
- gr_HtmlList_to_Formated Html Width translate the html code into a
type useable by extended text.
gr_draw_extext : gr_extext ->
unit
- gr_draw_extext ExText draws the extended text object ExText.
gr_html_extext : gr_extext ->
event -> bool
-
gr_extext_width : gr_extext ->
int
- gr_extext_width ExText returns the width of.
gr_extext_goto_anchor :
gr_extext -> string -> unit
- gr_extext_goto_anchor ExText anchor move the cursor to the
anchor Anchor.
gr_extext_load : gr_extext ->
string -> unit
- gr_extext_load ExText "file_name" try to open the file
"file_name.hlp". If the file doesn't exist, the function try to open
"file_name.html". If needed, the file is computed, and the result is
puted inExText.
gr_extext_save : gr_extext ->
string -> unit
- gr_extext_save ExText "out_name" writes the contents of Extext in
the file "out_name.hlp". The file can be read with gr_extext_load.