/* htmTree.c                           2009-04-23 RF

Program htmTree creates a HTMl-Treeview (JavaScript) for a frame.

The left frame display the tree (books and pages), in the right
  frame the selected pages are displayed.
You have to provide a list of branches and leafs (books and pages)
  and for each leaf the file to be displayed.


How to proceed:
 - Provide a html-rootfile for 2 Frames (a treeFrame (left)
   and a sourceFrame (right)).
   See "Example for a rootfile index.htm" below.
   The frameName for the sourceFrame should be "frmr"
 - Provide a html-file for the treeFrame;
 - Add a menu-block in the treeFrame-file (with a editor)
   set the filetype to ".htm.htm".
 - Start program htmTree;
   give the filename (without filetype) as parameter;
     ("./htmTree index_tree")
   the menu-block will be replaced by the treeview-code;
   the outputfiletype will be .htm (the program removes the last ".htm")



-----------------------------------------------------
Menu-block:
  the first line must be: <menu>
  add as many menulines as necessary;
  the last line must be: </menu>

  There are 4 types of menulines:
  - Branchlines (have only title); icon is a book
  - Leaflines (consist of title & source); icon is a sheet of paper
  - Horizontal ruler ("---")
  - Commentline  (starts with"//")

    A branch has has one or more childrens (leafs and branches)); 
      a leaf cannot have children.

    Title:  the text displayed on the right of the icon;
    Source: the filename of the file to be activated on selection.

The indentation gives the level !
  A leave must have exactly one blank more thans ist parent-branch !
  The primary level has 0 blanks.



-----------------------------------------------------
Example of a menu-block:
-----------------------------------------------------
<menu>
"MAN" base.htm
"using CAD"
 "Point" point.htm
 "Line"  line.htm
 "Circle"
  "Circle" circle.htm
  "Arc"    arc.htm
---
// ruler also inside blocks; comments not.
</menu>




-----------------------------------------------------
Example for a rootfile index.htm:
-----------------------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>gCAD3D - user documentation</title>
</head>
<frameset cols="250,*">
  <frame src="index_tree.htm" name="tree">
  <frame name="frmr">
</frameset>
</html>



-----------------------------------------------------
Example for a treeFrame index_tree.htm.htm:
-----------------------------------------------------
<html>
<head>
<title>JavaScript Tree Control</title>

<style>
body{ font: 10pt Verdana,sans-serif; color: navy; }
.sHdr{ cursor: pointer; cursor: hand; }
.sOn{ TEXT-DECORATION: none; color: navy; }
.sOff{ display: none; margin-left: 16px; }
</style>

<SCRIPT src="htmTree.js"></SCRIPT>

</head>

<body>
<FONT FACE="Verdana, Arial, Helvetica, sans-serif", SIZE=4>
<B><I>
CADCAM-Services
</I></B>
</FONT>
<HR>

<menu>
"MAN" t1.htm
"CAD1"
 "Point" t1.htm
 "CAD-sub1"
  "sub-Point" t1.htm
  "sub-Line" t2.htm
 "Line" t2.htm
 "Kreis" t2.htm
"CAD2"
 "Point" t1.htm
 "Line" t2.htm
</menu>

</body>
</html>


// EOF
