home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Help / HTML Help.tcl < prev    next >
Encoding:
Text File  |  2000-11-30  |  2.4 KB  |  77 lines

  1. ## -*-Tcl-*-
  2.  # ==========================================================================
  3.  #  Help files for Alpha
  4.  # 
  5.  #  FILE: "HTML Help.tcl"
  6.  #                                    created: 10/17/00 {02:18:43 pm} 
  7.  #                                last update: 11/30/00 {08:44:51 pm} 
  8.  #  Description: 
  9.  #  
  10.  #  Script to view the local HTML .html manual, either in one's web browser
  11.  #  or using Alpha's parser.  This script does not assume that HTML mode
  12.  #  has been loaded, or that the variable "manualFolder" is available.
  13.  # 
  14.  #  Author: Craig Barton Upright
  15.  #  E-mail: <cupright@princeton.edu>
  16.  #    mail: Princeton University, Department of Sociology
  17.  #          Princeton, New Jersey 08544
  18.  #     www: <http://www.princeton.edu/~cupright>
  19.  #  
  20.  # ==========================================================================
  21.  ##
  22.  
  23. catch {unset option}
  24.  
  25. set helpDir   [file join $HOME "HTML mode manual"]
  26. set helpIntro [file join $HOME Help "HTML Help"]
  27.  
  28. # Is the "HTML manual" properly installed?
  29. if {![file isdirectory $helpDir]} {
  30.     if {[file isfile $helpIntro]} {
  31.         help::openDirect $helpIntro
  32.     } else {
  33.         alertnote "The HTML Help file documents are not properly installed."
  34.     } 
  35.     unset helpDir helpIntro
  36.     return
  37. }
  38.  
  39. # If "helpMenuOptions" is not 0, then the user wants to view the .html
  40. # manual.  (If the preference is 2 there could be more options, but there
  41. # is no .pdf help file yet.)
  42.  
  43. if {$helpMenuOptions == 0} {
  44.     set options [list \
  45.       "Open HTML Help introduction" \
  46.       "View .html version of manual" \
  47.       "Open manual's .html file in HTML mode" \
  48.       "(Set WWW preferences to avoid this dialog …)" \
  49.       ]
  50. } elseif {$helpMenuOptions == 1 || $helpMenuOptions == 2} {
  51.     set option "View .html version of manual" \
  52.  
  53. if {![info exists option]} {
  54.     # We still have options.
  55.     set option [listpick \
  56.       -p "HTML manual options …" \
  57.       -L "View .html version of manual" $options]
  58.  
  59. if {$option == "(Set WWW preferences to avoid this dialog …)"} {
  60.     dialog::preferences preferences "WWW"
  61.     helpMenu "HTML Help"
  62. } elseif {$option == "Open HTML Help introduction"} {
  63.     help::openDirect $helpIntro
  64. } elseif {$option == "View .html version of manual"} {
  65.     help::openDirect [file join $helpDir HTMLmanual.html]
  66. } elseif {$option == "Open manual's .html file in HTML mode"} {
  67.     edit -r -c [file join $helpDir HTMLmanual.html]
  68.  
  69. unset helpDir helpIntro
  70. catch {
  71.     unset options 
  72.     unset option
  73. }
  74.