alias print.ico { return $+($shortfn($+($officedir,icons\be printer.ico))) }
alias bebox.ico { return $+($shortfn($+($officedir,icons\bebox.ico))) }
alias back.bmp { return $+($shortfn($+($officedir,icons\back.bmp))) }
alias bebullet.ico { return $+($shortfn($+($officedir,icons\be bullet.ico))) }
alias befilm.ico { return $+($shortfn($+($officedir,icons\be film.ico))) }
alias beentertainment.ico { return $+($shortfn($+($officedir,icons\be entertainment.ico))) }
alias langlobe.ico { return $+($shortfn($+($officedir,icons\lan globe.ico))) }
alias lanbulb.ico { return $+($shortfn($+($officedir,icons\lan bulb.ico))) }
alias lanhdd.ico { return $+($shortfn($+($officedir,icons\lan hdd.ico))) }
alias lanapp.ico { return $+($shortfn($+($officedir,icons\lan application.ico))) }
alias lanapple.ico { return $+($shortfn($+($officedir,icons\lan apple.ico))) }
alias lanp2.ico { return $+($shortfn($+($officedir,icons\lan pii system.ico))) }
alias beusers.ico { return $+($shortfn($+($officedir,icons\be users.ico))) }
alias lanwarning.ico { return $+($shortfn($+($officedir,icons\lan warning.ico))) }
alias lantag.ico { return $+($shortfn($+($officedir,icons\lan tag.ico))) }
alias lanserver.ico { return $+($shortfn($+($officedir,icons\lan server.ico))) }
alias popups.dll { return $file($+($officedir,popups\popups.dll)).shortfn }
alias lancoffeecup.ico { return $+($shortfn($+($officedir,icons\lan coffeecup.ico))) }
alias bewave.ico { return $+($shortfn($+($officedir,icons\be wave.ico))) }
alias lancd1.ico { return $+($shortfn($+($officedir,icons\lan cd01.ico))) }
alias beconfigfiles.ico { return $+($shortfn($+($officedir,icons\be config files.ico))) }
alias beappbuilder.ico { return $+($shortfn($+($officedir,icons\be app builder.ico))) }
alias beapp.ico { return $+($shortfn($+($officedir,icons\beapp.ico))) }
alias lanword.ico { return $+($shortfn($+($officedir,icons\lan word.ico))) }
alias lanart.ico { return $+($shortfn($+($officedir,icons\lan art.ico))) }
alias beiconeditor.ico { return $+($shortfn($+($officedir,icons\be icon editor.ico))) }
alias officedir { return %hobo-office.directory }
alias color.dll { return $+($shortfn($+($scriptdir,\color.dll))) }
alias irc2html.dll { return $+($shortfn($+($scriptdir,\irc2html.dll))) }
alias tab { return $chr(9) }
alias font.dll { return $file($+($scriptdir,\font.dll)).shortfn }
alias file.dll { return $file($+($scriptdir,\edialogs\edialogs.dll)).shortfn }
alias mdx.dll { return $file($+($officedir,\mdx\mdx.dll)).shortfn }
alias mdx.ctl { return $file($+($officedir,\mdx\ctl_gen.mdx)).shortfn }
alias mdx.views { return $file($+($officedir,\mdx\views.mdx)).shortfn }
alias mdx.bars { return $file($+($officedir,\mdx\bars.mdx)).shortfn }
alias mdx.dialog { return $file($+($officedir,\mdx\dialog.mdx)).shortfn }
alias mdx.page {  
  var %dname, %did  
  if ($0 = 1) {    
    set %dname $dname    
    set %did $1  
  }  
  else {    
    set %dname $1   
    set %did $2  
  }  
  did -i %dname %did 1 page $prop  
  return $gettok($did(%dname, %did, 1), 3-, 32)
}
alias Characters.load {
  did -r hobo 30
  did -io hobo 30 1 headerdims 40:1 53:2
  did -io hobo 30 1 headertext +l 0 Ascii # $tab Character
  var %1 1
  while ( %1 <= 255 ) {
    did -a hobo 30 0 + 0 0 0 %1 $tab $chr(%1)
    inc %1
  }
}
alias closenotes.execute {
  unloadagents
  if ( $dialog(print).hwnd != $null ) { dialog -x print print }
  if ( $dialog(auto-text).hwnd != $null ) { dialog -x auto-text auto-text }
  if ( $dialog(hobo-notes).hwnd != $null ) { dialog -x hobo-notes settings }
  if ( $dialog(clipboard).hwnd != $null ) { dialog -x clipboard clipboard }
  if ( $dialog(about).hwnd != $null ) { dialog -x about about }
  if ( $dialog(statistics).hwnd != $null ) { dialog -x statistics word }
  if ( $did(hobo,19).text != $null ) {
    if ( $did(hobo,19).edited = $true ) {
      set %hobonotes.input.exit $input(Save File Before Exiting?,anvwd,File Changed,File Changed)
      if ( %hobonotes.input.exit = $yes ) {
        save.execute
        dialog -k hobo hobo
        goto end
      }
      if ( %hobonotes.input.exit = $no ) {
        dialog -k hobo hobo
        goto end
      }
      if ( %hobonotes.input.exit = $cancel ) { goto end }
    }
    if ( $did(hobo,19).edited != $true ) {
      dialog -k hobo hobo 
      goto end
    }
  }
  else {
    dialog -kc hobo hobo
    goto end
  }
  :end
  .timeragent off
}
alias new.execute {
  did -h hobo 109
  did -v hobo 19
  unset %file.name
  if ( $did($dname,19).text != $null ) {
    set %new.execute.decision $input(Save File Before Starting A New Document?,nvqd,File Changed,File Changed)
    if ( %new.execute.decision = $no ) {
      did -r $dname 19
      did -j $dname 19
      hobonotes.stats.refresh
      hobonotes.settitle
    }
    if ( %new.execute.decision = $yes ) {
      set %file.name $shortfn($gettok($dll($file.dll,EDlg,S>Save As...>|Mirc Files|*.ini;*.mrc|Text Files|*.txt|Hobo-Notes Files|*.hbn|All Files|*.*||>N),1-,32))
      savebuf -o $did($dname,19).lines $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
      did -r $dname 19
      did -j $dname 19
      hobonotes.stats.refresh
      hobonotes.settitle
    }
    if ( %new.execute.decision = $cancel ) { halt }
  }
}
alias save.execute {
  if ( %file.name != $null ) {
    if ( $did(hobo,19).text != $null ) {
      if ( $gettok($nopath(%file.name),2,46) != hbn ) {
        savebuf -o $did($dname,19).lines $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
        did -j $dname 19
        hobonotes.stats.refresh
      }
      if ( $gettok($nopath(%file.name),2,46) = hbn ) {
        write -c %file.name
        write -l1 %file.name $fullname
        savebuf -ao $did($dname,19).lines $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
        did -j $dname 19
        hobonotes.stats.refresh
      }
      hobonotes.settitle
    }
  }
  if ( %file.name = $null ) { saveas.execute }
  ;hobonotes.addrecent
}
alias saveas.execute {
  if ( $did(hobo,19).text != $null ) {
    set %file.name $shortfn($gettok($dll($file.dll,EDlg,S>Save As...>|Mirc Files|*.ini;*.mrc|Text Files|*.txt|Log Files|*.log|Hobo-Notes Files|*.hbn|All Files|*.*||>N),1-,32))
    if ( $gettok($nopath(%file.name),2,46) != hbn ) {
      savebuf -o $did($dname,19).lines $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
      did -j $dname 19
      hobonotes.stats.refresh
    }
    if ( $gettok($nopath(%file.name),2,46) = hbn ) {
      write -c %file.name
      write -l1 %file.name $fullname
      savebuf -ao $did($dname,19).lines $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
      did -j $dname 19
      hobonotes.stats.refresh
    }
    hobonotes.settitle
  }
  ;hobonotes.addrecent
}
alias hobonotes.opencmd {
  if ( $dialog(hobo).hwnd = $null ) { dialog.hobonotes }
  if ( $gettok($nopath(%file.name),2,46) != hbn ) {
    if ( $hsettings.read(settings,indent) == 0 ) {
      did -r hobo 19
      loadbuf $lines(%file.name) -op hobo 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
    }
    if ( $hsettings.read(settings,indent) == 1 ) {
      did -r hobo 19
      loadbuf $lines(%file.name) -opi hobo 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
    }
  }
  if ( $gettok($nopath(%file.name),2,46) = hbn ) {
    if ( $hsettings.read(settings,indent) == 0 ) {
      did -r hobo 19
      loadbuf $+(2-,$lines(%file.name)) -op hobo 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
    }
    if ( $hsettings.read(settings,indent) == 1 ) {
      did -r hobo 19
      loadbuf $+(2-,$lines(%file.name)) -opi hobo 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
    }
  }
  did -j hobo 19
  hobonotes.stats.refresh
  hobonotes.settitle
}
alias Hobonotes.open.Nohbn {
  if ( $hsettings.read(settings,indent) == 0 ) {
    loadbuf $lines(%file.name.2) -op hobo 19 $+($shortfn($nofile(%file.name.2)),$nopath(%file.name.2))
    goto end
  }
  if ( $hsettings.read(settings,indent) == 1 ) {
    loadbuf $lines(%file.name.2) -opi hobo 19 $+($shortfn($nofile(%file.name.2)),$nopath(%file.name.2))
    goto end
  }
  :end
}
alias hobonotes.open.nohbn.1 {
  if ( $hsettings.read(settings,indent) == 0 ) { loadbuf $lines(%file.name) -op $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name)) }
  if ( $hsettings.read(settings,indent) == 1 ) { loadbuf $lines(%file.name) -opi $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name)) }
}
alias hobonotes.open.log {
  loadbuf $lines(%file.name) -op $dname 19 %file.name
  did -j hobo 19
}
alias hobonotes.open.yeshbn.1 {
  if ( $hsettings.read(settings,indent) == 0 ) { loadbuf $+(2-,$lines(%file.name)) -op $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name)) }
  if ( $hsettings.read(settings,indent) == 1 ) { loadbuf $+(2-,$lines(%file.name)) -opi $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name)) }
}
alias hobonotes.open.yeshbn {
  if ( $hsettings.read(settings,indent) == 0 ) {
    loadbuf $+(2-,$lines(%file.name.2)) -op hobo 19 $+($shortfn($nofile(%file.name.2)),$nopath(%file.name.2))
    goto end
  }
  if ( $hsettings.read(settings,indent) == 1 ) {
    loadbuf $+(2-,$lines(%file.name.2)) -opi hobo 19 $+($shortfn($nofile(%file.name.2)),$nopath(%file.name.2))
    goto end
  }
  :end
}
alias hobonotes.dragopen.execute {  
  if ( $dialog(hobo).hwnd = $null ) {
    dialog.hobonotes
    if ( $gettok($nopath(%file.name.2),2,46) != hbn ) {
      Hobonotes.open.Nohbn
    }
    if ( $gettok($nopath(%file.name.2),2,46) = hbn ) {
      hobonotes.open.yeshbn
    }
    did -h hobo 109
    did -v hobo 19
    goto end
  }
  if ( $did(hobo,19).text != $null ) {
    if ( $did(hobo,19).edited = $true ) {
      set %new.execute.decision $input(Save File Before Opening A Document?,nvqd,File Changed,File Changed)
      if ( %new.execute.decision = $no ) {
        did -r hobo 19
        if ( $gettok($nopath(%file.name.2),2,46) != hbn ) {
          Hobonotes.open.Nohbn
        }
        if ( $gettok($nopath(%file.name.2),2,46) = hbn ) {
          hobonotes.open.yeshbn
        }
        did -j hobo 19
        goto end
      }
      if ( %new.execute.decision = $yes ) {
        set %file.name $shortfn($gettok($dll($file.dll,EDlg,S>Save As...>|Mirc Files|*.ini;*.mrc|Text Files|*.txt|Log Files|*.log|Hobo-Notes Files|*.hbn|All Files|*.*||>N),1-,32))
        savebuf -o $did(hobo,19).lines $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
        did -r hobo 19
        if ( $gettok($nopath(%file.name.2),2,46) != hbn ) {
          Hobonotes.open.Nohbn
        }
        if ( $gettok($nopath(%file.name.2),2,46) = hbn ) {
          hobonotes.open.yeshbn
        }
        did  -j hobo19
        goto end
      }
    }
    if ( $did(hobo,19).edited != $true ) {
      did -r hobo 19
      if ( $gettok($nopath(%file.name.2),2,46) != hbn ) {
        Hobonotes.open.Nohbn
      }
      if ( $gettok($nopath(%file.name.2),2,46) = hbn ) {
        hobonotes.open.yeshbn
      }
    }
  }
  if ( $did(hobo,19).text = $null ) {
    if ( $gettok($nopath(%file.name.2),2,46) != hbn ) {
      Hobonotes.open.Nohbn
    }
    if ( $gettok($nopath(%file.name.2),2,46) = hbn ) {
      hobonotes.open.yeshbn
    }
  }
  :end
  hobonotes.stats.refresh
  hobonotes.settitle
}
alias open.execute.logs {
  did -h hobo 109
  did -v hobo 19
  if ( $did($dname,19).text = $null ) {
    hobonotes.open.log
    goto end
    did -j $dname 19
  }
  if ( $did($dname,19).text != $null ) {
    if ( $did($dname,19).edited = $true ) {
      set %new.execute.decision $input(Save File Before Opening A Document?,nvqd,File Changed,File Changed)
      if ( %new.execute.decision = $no ) {
        did -r $dname 19
        hobonotes.open.log
      }
      did -j $dname 19
      goto end
    }
    if ( %new.execute.decision = $yes ) {
      set %file.name $shortfn($gettok($dll($file.dll,EDlg,S>Save As...>|Mirc Files|*.ini;*.mrc|Text Files|*.txt|Log Files|*.log|Hobo-Notes Files|*.hbn|All Files|*.*||>N),1-,32))
      savebuf -o $did($dname,19).lines $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
      did -r $dname 19
      hobonotes.open.log
      -j $dname 19
      goto end
    }
    if ( $did($dname,19).edited != $true ) {
      did -r $dname 19
      hobonotes.open.log
      did -j $dname 19
      goto end
    }
    :end
    hobonotes.stats.refresh
    hobonotes.settitle
    ;hobonotes.addrecent
  }
}
alias open.execute {
  did -h hobo 109
  did -v hobo 19
  if ( $did($dname,19).text = $null ) {
    set %file.name $shortfn($gettok($dll($file.dll,EDlg,O>Open...>|Mirc Files|*.ini;*.mrc|Text Files|*.txt|Log Files|*.log|Hobo-Notes Files|*.hbn|All Files|*.*||>N),1-,32))
    if ( $gettok($nopath(%file.name),2,46) != hbn ) {
      hobonotes.open.nohbn.1
    }
    if ( $gettok($nopath(%file.name),2,46) = hbn ) {
      hobonotes.open.yeshbn.1
    }
    goto end
    did -j $dname 19
  }
  if ( $did($dname,19).text != $null ) {
    if ( $did($dname,19).edited = $true ) {
      set %new.execute.decision $input(Save File Before Opening A Document?,nvqd,File Changed,File Changed)
      if ( %new.execute.decision = $no ) {
        set %file.name $shortfn($gettok($dll($file.dll,EDlg,O>Open...>|Mirc Files|*.ini;*.mrc|Text Files|*.txt|Log Files|*.log|Hobo-Notes Files|*.hbn|All Files|*.*||>N),1-,32))
        did -r $dname 19
        if ( $gettok($nopath(%file.name),2,46) != hbn ) {
          hobonotes.open.nohbn.1
        }
        if ( $gettok($nopath(%file.name),2,46) = hbn ) {
          hobonotes.open.yeshbn.1
        }
        did -j $dname 19
        goto end
      }
      if ( %new.execute.decision = $yes ) {
        set %file.name $shortfn($gettok($dll($file.dll,EDlg,S>Save As...>|Mirc Files|*.ini;*.mrc|Text Files|*.txt|Log Files|*.log|Hobo-Notes Files|*.hbn|All Files|*.*||>N),1-,32))
        savebuf -o $did($dname,19).lines $dname 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
        did -r $dname 19
        set %file.name $shortfn($gettok($dll($file.dll,EDlg,O>Open...>|Mirc Files|*.ini;*.mrc|Text Files|*.txt|Log Files|*.log|Hobo-Notes Files|*.hbn|All Files|*.*||>N),1-,32))
        if ( $gettok($nopath(%file.name),2,46) != hbn ) {
          hobonotes.open.nohbn.1
        }
        if ( $gettok($nopath(%file.name),2,46) = hbn ) {
          hobonotes.open.yeshbn.1
        }
        -j $dname 19
        goto end
      }
    }
    if ( $did($dname,19).edited != $true ) {
      set %file.name $shortfn($gettok($dll($file.dll,EDlg,O>Open...>|Mirc Files|*.ini;*.mrc|Text Files|*.txt|Log Files|*.log|Hobo-Notes Files|*.hbn|All Files|*.*||>N),1-,32))
      did -r $dname 19
      if ( $gettok($nopath(%file.name),2,46) != hbn ) {
        hobonotes.open.nohbn.1
      }
      if ( $gettok($nopath(%file.name),2,46) = hbn ) {
        hobonotes.open.yeshbn.1
      }
      did -j $dname 19
      goto end
    }
  }
  :end
  hobonotes.stats.refresh
  hobonotes.settitle
  ;hobonotes.addrecent
}
alias toolbar.start.load {
  did -r hobo 101
  did -r hobo 100
  did -r hobo 15
  echo $gettok($dll($mdx.dll,SetControlMDX,hobo 15 ToolBar flat nodivider > $mdx.bars),$9,45)
  echo $gettok($dll($mdx.dll,SetControlMDX,hobo 100 ToolBar flat nodivider > $mdx.bars),$9,45)
  echo $gettok($dll($mdx.dll,SetControlMDX,hobo 101 ToolBar flat nodivider > $mdx.bars),$9,45)
  did -i hobo 101 1 bmpsize 16 16
  did -i hobo 101 1 pad 2 2
  did -i hobo 101 1 bwidth 15 16
  toolbar.load.images
  if ( $isfile($themes.toolimage) = $false ) {
    did -i hobo 101 1 setbkg none
  }
  if ( $isfile($themes.toolimage) = $true ) {
    did -i hobo 101 1 setbkg tile $themes.toolimage
  }
  did -i hobo 101 1 setscheme $rgb(255,255,255) $rgb(128,128,128)
  did -a hobo 101 +a 1 New $tab New
  did -a hobo 101 +a 2 Open $tab Open
  did -a hobo 101 +a 3 Save $tab Save
  did -a hobo 101 +a -
  did -a hobo 101 +a 4 Print $tab Print
  did -a hobo 101 +a -
  did -a hobo 101 +a 6 Copy $tab Copy
  did -a hobo 101 +a 7 Paste $tab Paste
  did -a hobo 101 +a -
  did -a hobo 101 +av 10 Tools $tab Tools
  did -a hobo 101 +a -
  did -a hobo 101 +a 12 About $tab About
  did -i hobo 100 1 bmpsize 1 1
  did -i hobo 100 1 pad 7 7
  did -i hobo 100 1 bwidth 16 16
  if ( $isfile($themes.toolimage) = $false ) {
    did -i hobo 100 1 setbkg none
  }
  if ( $isfile($themes.toolimage) = $true ) {
    did -i hobo 100 1 setbkg tile $themes.toolimage
  }
  did -i hobo 100 1 setscheme $rgb(255,255,255) $rgb(128,128,128)
  did -a hobo 100 +a New $tab New
  did -a hobo 100 +a Open $tab Open
  did -a hobo 100 +a Save $tab Save
  did -a hobo 100 +a -
  did -a hobo 100 +a Print $tab Print
  did -a hobo 100 +a -
  did -a hobo 100 +a Copy $tab Copy
  did -a hobo 100 +a Paste $tab Paste
  did -a hobo 100 +a -
  did -a hobo 100 +av Tools $tab Tools
  did -a hobo 100 +a -
  did -a hobo 100 +a About $tab About
  did -i hobo 15 1 bmpsize 32 32
  did -i hobo 15 1 pad 0 0
  did -i hobo 15 1 bwidth 32 32
  toolbar.load.images
  if ( $isfile($themes.toolimage) = $false ) {
    did -i hobo 15 1 setbkg none
  }
  if ( $isfile($themes.toolimage) = $true ) {
    did -i hobo 15 1 setbkg tile $themes.toolimage
  }
  did -i hobo 15 1 setscheme $rgb(255,255,255) $rgb(128,128,128)
  did -a hobo 15 +a 1 $tab New
  did -a hobo 15 +a 2 $tab Open
  did -a hobo 15 +a 3 $tab Save
  did -a hobo 15 +a -
  did -a hobo 15 +a 4 $tab Print
  did -a hobo 15 +a -
  did -a hobo 15 +a 6 $tab Copy
  did -a hobo 15 +a 7 $tab Paste
  did -a hobo 15 +a -
  did -a hobo 15 +av 10 $tab Tools
  did -a hobo 15 +a -
  did -a hobo 15 +a 12 $tab About
}
alias toolbar.load {
  if ( $hsettings.read(Settings,toolbar) == 0 ) {
    did -h hobo 100,101
    did -v hobo 15
    goto end
  }
  if ( $hsettings.read(Settings,toolbar) == 1 ) {
    did -h hobo 15,101
    did -v hobo 100
    goto end
  }
  if ( $hsettings.read(Settings,toolbar) == 2 ) {
    did -h hobo 100,15
    did -v hobo 101
    goto end
  }
  :end
}
alias toolbar.load.images {
  did -i hobo 15 1 setimage +nhd icon normal, $themeicons(New)
  did -i hobo 15 1 setimage +nhd icon normal, $themeicons(open)
  did -i hobo 15 1 setimage +nhd icon normal, $themeicons(save)
  did -i hobo 15 1 setimage +nhd icon normal, $themeicons(print)
  did -i hobo 15 1 setimage +nhd icon normal, $+($shortfn($+($officedir,icons\cut.ico)))
  did -i hobo 15 1 setimage +nhd icon normal, $themeicons(copy)
  did -i hobo 15 1 setimage +nhd icon normal, $themeicons(paste)
  did -i hobo 15 1 setimage +nhd icon normal, $+($shortfn($+($officedir,icons\undo.ico)))
  did -i hobo 15 1 setimage +nhd icon normal, $+($shortfn($+($officedir,icons\redo.ico)))
  did -i hobo 15 1 setimage +nhd icon normal, $themeicons(tools)
  did -i hobo 15 1 setimage +nhd icon normal, $themeicons(settings)
  did -i hobo 15 1 setimage +nhd icon normal, $themeicons(about)
  did -i hobo 101 1 setimage +nhd icon normal, $themeicons(New)
  did -i hobo 101 1 setimage +nhd icon normal, $themeicons(open)
  did -i hobo 101 1 setimage +nhd icon normal, $themeicons(save)
  did -i hobo 101 1 setimage +nhd icon normal, $themeicons(print)
  did -i hobo 101 1 setimage +nhd icon normal, $+($shortfn($+($officedir,icons\cut.ico)))
  did -i hobo 101 1 setimage +nhd icon normal, $themeicons(copy)
  did -i hobo 101 1 setimage +nhd icon normal, $themeicons(paste)
  did -i hobo 101 1 setimage +nhd icon normal, $+($shortfn($+($officedir,icons\undo.ico)))
  did -i hobo 101 1 setimage +nhd icon normal, $+($shortfn($+($officedir,icons\redo.ico)))
  did -i hobo 101 1 setimage +nhd icon normal, $themeicons(tools)
  did -i hobo 101 1 setimage +nhd icon normal, $themeicons(settings)
  did -i hobo 101 1 setimage +nhd icon normal, $themeicons(about)
}
alias editbox.settings {
  if ( $hsettings.read(Settings,colors) == 1 ) {
    dll $mdx.dll SetColor hobo 19 text $hsettings.read(colors,text)
    dll $mdx.dll SetColor hobo 19 textbg $hsettings.read(colors,textbg)
    dll $mdx.dll SetColor hobo 19 background $hsettings.read(colors,editbg)
  }
}
alias paste.execute {
  if ( $cb != $null ) {
    if ( $cb(0) > 1 ) {
      var %cb.1 $cb(0)
      var %cb.2 1
      while ( %cb.2 <= %cb.1 ) {
        did -a hobo 19 $cb(%cb.2) $crlf
        inc %cb.line1
        inc %cb.2
      }
    }
    if ( $cb(0) == 1 ) { did -a hobo 19 $cb(1) }
  }
}
alias copy.execute { clipboard $did(hobo,19).seltext }
alias goto.execute {
  dialog -v hobo hobo
  did -f hobo 19
  did -c hobo 19 %goto.line 1 $calc($did(hobo,19,%goto.line).len + 1)  
}
alias hobonotes.selnick.execute {
  var %selnick $snicks
  if ( $dialog(hobo).hwnd = $null ) { dialog.hobonotes }
  did -a hobo 19 %selnick
}
alias hobonotes.channel.execute {
  var %channelname $chan
  if ( $dialog(hobo).hwnd = $null ) { dialog.hobonotes }
  did -a hobo 19 %channelname
}
alias hobonotes.openfilemenu.execute {
  set %file.name $shortfn($gettok($dll($file.dll,EDlg,O>Open...>|Mirc Files|*.ini;*.mrc|Text Files|*.txt|Log Files|*.log|Hobo-Notes Files|*.hbn|All Files|*.*||>N),1-,32))
  if ( $dialog(hobo).hwnd = $null ) { dialog.hobonotes }
  loadbuf $lines(%file.name) -op hobo 19 $+($shortfn($nofile(%file.name)),$nopath(%file.name))
  did -j hobo 19
}
alias hobonotes.setfont.execute {
  set %font.type.1 $dll($font.dll,Font,Set Font)
  set %font.format $gettok(%font.type.1,3,44)
  if ( $replace(%font.format,-,+) = $null ) {
    dll $mdx.dll SetFont hobo 19 $replace(%font.format,-,+) $gettok(%font.type.1,1,44) 500 $gettok(%font.type.1,4,44)
    dll $mdx.dll SetFont hobo 30 + 14 500 $gettok(%font.type.1,4,44)
  }
  if ( $gettok(%font.type.1,3,44) = $null ) {
    dll $mdx.dll SetFont hobo 19 $replace(%font.format,-,+) 12 500 $gettok(%font.type.1,4,44)
    dll $mdx.dll SetFont hobo 30 + 14 500 $gettok(%font.type.1,4,44)
  }
  if ( $gettok(%font.type.1,3,44) != $null ) {
    dll $mdx.dll SetFont hobo 19 $replace(%font.format,-,+) $gettok(%font.type.1,1,44) 500 $gettok(%font.type.1,4,44)
    dll $mdx.dll SetFont hobo 30 + 14 500 $gettok(%font.type.1,4,44)
  }
}
alias hobonotes.cboard.load {
  var %cb.1 $cb(0)
  var %cb.2 1
  while ( %cb.2 <= %cb.1 ) {
    did -i $dname 5 %cb.2 $cb(%cb.2)
    inc %cb.2
  }
}
alias hobonotes.networkname.execute {
  var %hobonotes.networkname $network
  if ( $dialog(hobo).hwnd = $null ) { dialog.hobonotes }
  did -a hobo 19 %hobonotes.networkname
}
alias hobonotes.servername.execute {
  var %hobonotes.servername $server
  if ( $dialog(hobo).hwnd = $null ) { dialog.hobonotes }
  did -a hobo 19 %hobonotes.servername
}
alias hobonotes.querynick.execute {
  var %hobonotes.querynick $active
  if ( $dialog(hobo).hwnd = $null ) { dialog.hobonotes }
  did -a hobo 19 %hobonotes.querynick
}
alias hobonotes.charactermap.close {
  did -h hobo 31
  hsettings.write settings sidebar 0
  set %hobonotes.111 130
  set %hobonotes.112 130
  .timercmap -hm 10 1 hobonotes.cmap.close
}
alias hobonotes.charactermap.open {
  did -v hobo 31
  hsettings.write settings sidebar 1
  hobonotes.cmap.open
}
alias hobonotes.cmap.close {
  dll $mdx.dll MoveControl Hobo 19 $calc(%hobonotes.112 + 4) * * *
  dll $mdx.dll MoveControl Hobo 19 * * $calc($dialog(hobo).cw + 4) *
  dll $mdx.dll MoveControl Hobo 109 $calc(%hobonotes.112 + 4) * * *
  dll $mdx.dll MoveControl Hobo 109 * * $calc($dialog(hobo).cw + 4) *
  dec %hobonotes.111 15
  dec %hobonotes.112 15
  if ( %hobonotes.112 < 2 ) {
    did -h hobo 30
    did -h hobo 27
    did -h hobo 26
  }
}
alias hobonotes.cmap.open {
  if ( $hsettings.read(settings,cmap) = 1 ) {
    did -h hobo 27
    did -v hobo 30
    did -v hobo 26
  }
  if ( $hsettings.read(settings,cmap) = 0 ) {
    did -h hobo 30
    did -v hobo 27
    did -v hobo 26
  }
  dll $mdx.dll MoveControl Hobo 31 108 * * *
  dll $mdx.dll MoveControl Hobo 19 115 * $calc($dialog(hobo).cw - $calc( $divren - 2)) $calc($dialog(hobo).ch - 33)
  dll $mdx.dll MoveControl Hobo 109 115 * $calc($dialog(hobo).cw - $calc( $divren - 2)) $calc($dialog(hobo).ch - 33)
  dll $mdx.dll MoveControl Hobo 30 * * $calc( $divlen) $calc($dialog(hobo).ch - 68)
  dll $mdx.dll MoveControl Hobo 15 * * $calc($dialog(hobo).cw + 20) *
  dll $mdx.dll MoveControl Hobo 100 * * $calc($dialog(hobo).cw + 20) *
  dll $mdx.dll MoveControl Hobo 101 * * $calc($dialog(hobo).cw + 20) *
  dll $mdx.dll MoveControl Hobo 27 * * $calc( $divlen) $calc($dialog(hobo).ch - 68)
  dll $mdx.dll MoveControl Hobo 26 * $calc($dialog(hobo).ch - 35) $calc( $divlen) *
}
alias hobonotes.printall.execute {
  savebuf -o $did(hobo,19).lines hobo 19 $+($shortfn($+($scriptdir\,Temp.txt)))
  run print $+($shortfn($+($scriptdir\,Temp.txt)))
}
alias hobonotes.printsel.execute {  
  write -c $+($shortfn($+($scriptdir\,Temp.txt)))
  window -h @print 
  clear @print
  set %hobonotes.p1 $numtok($did(hobo,19).seltext,13)
  set %hobonotes.p2 1
  while ( %hobonotes.p2 <= %hobonotes.p1 ) {
    echo @print $gettok($did(hobo,19).seltext,%hobonotes.p2,13)
    inc %hobonotes.p2
  }
  run print $+($shortfn($+($scriptdir\,Temp.txt)))
}
alias hobonotes.print.preview {
  set %hobonotes.p1 $numtok($did(hobo,19).seltext,13)
  set %hobonotes.p2 1
  while ( %hobonotes.p2 <= %hobonotes.p1 ) {
    did -i print 6 %hobonotes.p2 $gettok($did(hobo,19).seltext,%hobonotes.p2,13)
    inc %hobonotes.p2
  }
}
alias hobonotes.wordcount.execute {
  set %hobonotes.textarea.words 0
  set %hobonotes.textarea.lines $did(hobo,19).lines
  set %hobonotes.textarea.lines2 1
  while ( %hobonotes.textarea.lines2 <= %hobonotes.textarea.lines ) {
    inc %hobonotes.textarea.words $numtok($did(hobo,19,%hobonotes.textarea.lines2),32)
    inc %hobonotes.textarea.lines2
  }
  hobonotes.wordcount.display
}
alias hobonotes.wordcount.display { sidebar.stats }
alias hobonotes.lines.display { sidebar.stats }
alias hobonotes.characters.execute {
  set %hobonotes.textarea.chars 0
  set %hobonotes.textarea.lines $did(hobo,19).lines
  set %hobonotes.textarea.lines2 1
  while ( %hobonotes.textarea.lines2 <= %hobonotes.textarea.lines ) {
    inc %hobonotes.textarea.chars $did(hobo,19,%hobonotes.textarea.lines2).len
    inc %hobonotes.textarea.lines2
  }
  hobonotes.chars.display
}
alias hobonotes.chars.display {
  if ( $hsettings.read(settings,stats) = 1 ) { sidebar.stats }
}
alias hobonotes.filename.display {
  if ( $hsettings.read(settings,stats) = 1 ) { sidebar.stats }
}
alias hobonotes.filepath.display {
  if ( $hsettings.read(settings,stats) = 1 ) { sidebar.stats }
}
alias hobonotes.fileowner.display {
  if ( $hsettings.read(settings,stats) = 1 ) { sidebar.stats }
}
alias hobonotes.filesize.display {
  if ( $hsettings.read(settings,stats) = 1 ) { sidebar.stats }
}
alias hobonotes.stats.refresh {
  if ( $hsettings.read(settings,stats) = 1 ) {
    hobonotes.wordcount.execute
    hobonotes.lines.display
    hobonotes.characters.execute
    hobonotes.filename.display
    hobonotes.filepath.display
    hobonotes.fileowner.display
    hobonotes.filesize.display
  }
}
alias hobonotes.counts.refresh {
  hobonotes.wordcount.execute
  hobonotes.characters.execute
  did -i hobo 27 1 replaceitem 2 3 $+(Words:,%hobonotes.textarea.words)
  did -i hobo 27 1 replaceitem 3 3 $+(Lines:,$did(hobo,19).lines)
  did -i hobo 27 1 replaceitem 4 3 $+(Characters:,%hobonotes.textarea.chars)
}
alias hobonotes.settitle {
  if ( %file.name = $null ) { dialog -t Hobo Hobo Notes - Untitled }
  if ( %file.name != $null ) { dialog -t Hobo Hobo-Notes - %file.name }
}
alias hobonotes.colorthemes.add {
  set %hobonotes.themename.temp $$?="Theme Name"
  writeini -n $+($shortfn($+($scriptdir,\themes.ini))) $+(%hobonotes.themename.temp) Text $hsettings.read(colors,text)
  writeini -n $+($shortfn($+($scriptdir,\themes.ini))) $+(%hobonotes.themename.temp) Textbg $hsettings.read(colors,textbg)
  writeini -n $+($shortfn($+($scriptdir,\themes.ini))) $+(%hobonotes.themename.temp) editbg $hsettings.read(colors,editbg)
  did -a hobo-notes 28 %hobonotes.themename.temp
  write -c $+($shortfn($+($scriptdir,\themes.txt))) $didtok(hobo-notes,28,59)
  unset %hobonotes.themename.temp
}
alias hobonotes.colorthemes.remove {
  if ( $did(hobo-notes,28).seltext != $null ) {
    remini $+($shortfn($+($scriptdir,\themes.ini))) $did(hobo-notes,28).seltext
    did -d hobo-notes 28 $did(hobo-notes,28).sel
    write -c $+($shortfn($+($scriptdir,\themes.txt))) $didtok(hobo-notes,28,59)
  }
}
alias hobonotes.colorthemes.refresh {
  if ( $did(hobo-notes,28).seltext != $null ) {
    hsettings.write colors text $readini($+($shortfn($+($scriptdir,\themes.ini))),$did(hobo-notes,28).seltext,text)
    hsettings.write colors textbg $readini($+($shortfn($+($scriptdir,\themes.ini))),$did(hobo-notes,28).seltext,textbg)
    hsettings.write colors editbg $readini($+($shortfn($+($scriptdir,\themes.ini))),$did(hobo-notes,28).seltext,editbg)
    color-select.load
  }
}
