!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! SIC part of the Help menu of all GILDAS packages
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
begin procedure help-task
  define character*256 file
  let file "gag_task:"'pro%arg[1]'
  !
  define integer nlines
  sic\compute nlines lines 'file' /blank  ! Ignore blank lines
  if nlines.le.1  return
  let nlines nlines-1  ! Skip first line
  !
  ! Get the names (1st column)
  define character name*16[nlines]
  sic\accept name /line 3 /column 'file'
  ! Get the whole line (name+description)
  define character description*256[nlines]
  sic\accept description /line 3 /column 'file' /format "(A)"
  ! Sort in alphabetical order
  sic\sort name description
  !
  ! BUild the submenu. Drop "-task-list.hlp" = 14 last chars (by
  ! construction we are processing only files with these extensions)
  define integer nc
  let nc len_trim(pro%arg[1])-14
  gui\submenu 'pro%arg[1][1:nc]'
  for i 1 to nlines
    let name[i] 'name[i]' /lower
    gui\button "SIC\HELP "'name[i]' 'description[i]'
  next i
  gui\submenu /close
end procedure help-task
!
gui\submenu "SIC"
  @ gui-button-help  gag_doc:pdf/sic.pdf            "Documentation"
  @ gui-button-help  gag_doc:pdf/gildas-python.pdf  "GILDAS-Python binding"
  @ gui-button-help  gag_doc:pdf/sic-gdfv2.pdf      "GILDAS Data Format Version 2"
gui\submenu /close
!
gui\submenu "GILDAS"
  gui\uri            "http://www.iram.fr/IRAMFR/GILDAS/"  "Web Page"
  @ gui-button-help  gag_doc:pdf/gildas-intro.pdf         "Introduction"
  @ gui-button-help  gag_doc:pdf/gildas-prog.pdf          "Programmers Documentation"
gui\submenu /close
!
sic\sic find  "*-task-list.hlp"  "gag_task:"
if dir%nfile.eq.0 return
! Sort in alphabetical order
define character*256 myfiles /like dir%file
!
for ifile 1 to dir%nfile
  let myfiles[ifile] 'dir%file[ifile]'
next ifile
sic\sort myfiles
! Build menu
gui\submenu "TASKS"
  for ifile 1 to dir%nfile
    @ help-task 'myfiles[ifile]'
  next ifile
gui\submenu /close
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
