#NoticeServer off
on *:snotice:*: {
  window @Server-Notice -1 -1 -1 -1
  echo @Server-Notice 4 $Server 14um4 $time 12Nachricht:14 $1-
}
#NoticeServer End

#NoticeNick off
on 1:notice:*:?: {
  { if ($nick == $me) halt }
  elseif
  window @Notice -1 -1 -1 -1
  echo @Notice 11,1 $nick um $time Nachricht: $1-
}
#NoticeNick End

menu @lv {
  -
  Clear:Clear @lv
}
Alias -l mdxlog_fullpath { return $+(",$mircdirdll\mdx.dll,") }
Alias -l mdxlog { dll $mdxlog_fullpath $1- }
Alias -l mdxloginit { dll $mdxlog_fullpath SetMircVersion $version | dll $mdxlog_fullpath MarkDialog $dname }
Alias -l read.log { if ($isfile($1-) == $true) { clear @lv | loadbuf $+(1,-,$lines($1-)) -pi @lv $1- } }
Alias logs { did -ra lv 1 0 3 %lg.file | did -i lv 1 1 headertext 0 - $+ $findfile(%lg.file,*.*,0,did -a lv 1 0 2 $nopath($1-)) $+ - Log Dateien } 
Alias lg.seek { did -ra lv 1 0 3 %lg.file | did -i lv 1 1 headertext 0 - $+ $findfile(%lg.file,$+(*,$did($dname,7).text,*),0,did -a lv 1 0 2 $nopath($1-)) $+ - Datei(en) gefunden }
dialog lv {
  title "Loganzeige"
  size 58 55 338 196
  option dbu
  icon $scriptdiricons\sbar.icl, 2
  list 1, 205 0 132 154, size
  button "Button", 2, 2 1 201 193
  button "Zeigen", 3, 206 157 32 10
  button "Leeren", 11, 272 157 32 10
  button "Edit", 4, 239 157 32 10
  button "Senden", 5, 305 170 32 12
  button "Löschen", 6, 305 157 32 10
  edit "Finde Log", 7, 205 183 99 12, return autohs center
  button "Suche", 8, 305 183 32 12
  edit "Sende an", 12, 205 170 99 12, return autohs center
  menu "Pfad", 9
  item "Wechseln", 10, 9
  item "Öffnen", 18, 9
  menu "Refresh", 16
  item "Log Liste", 17, 16
  menu "Ende", 14
  item "Ja", 15, 14, ok
}
On *:dialog:lv:init:0:{
  mdxloginit | mdxlog SetControlMDX $dname 2 Window > $mircdirdll\dialog.mdx | mdxlog SetControlMDX $dname 1 ListView report rowselect single grid > $mircdirdll\views.mdx
  mdxlog SetBorderStyle $dname 3,4,5,6,8,11 staticedge 
  mdxlog SetFont $dname 3,4,5,6,7,8,11,12 ANSI 15 900 Arial
  window -ehk[0] @lv | did -a $dname 2 grab $window(@lv).hwnd @lv
  if (!%lg.file) { set %lg.file $+(",$mircdirlogs\,") }
  did -i $dname 1 1 headerdims 250
  did -i $dname 1 1 headertext 3 Logs
  did -i $dname 1 1 iconsize normal small
  did -i $dname 1 1 seticon normal 8, $+ $scriptdiricons\sbar.icl
  did -i $dname 1 1 seticon normal 8, $+ $scriptdiricons\sbar.icl
  did -i $dname 1 1 seticon normal 13, $+ $scriptdiricons\sbar.icl
  logs | editbox @lv $chr(9) Suchwort eintragen und dann Enter drücken.
}
On *:dialog:lv:sclick:1:{ 
  if ($isfile($+(",$remove(%lg.file,") $+ $gettok($did($dname,1).seltext,6-,32),")) == $true) {
    dialog -t $dname Loganzeige - $gettok($did($dname,1).seltext,6-,32) - $round($calc($file($+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),")).size / 975),0) $+ kb - | halt 
  }
  if ($isdir($+(",$gettok($did($dname,1).seltext,6-,32),")) == $true) { dialog -t lv Loganzeige - Pfad $gettok($did($dname,1).seltext,6-,32) | halt }
  else { dialog -t $dname Loganzeige }
}
On *:dialog:lv:dclick:1:{ read.log $+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),") }
On *:dialog:lv:sclick:3:{ read.log $+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),") }
On *:dialog:lv:sclick:4:{ var %log = $+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),"),%l = 1 | if ($isfile(%log) == $true) { echo 4 @lv ::Öffne LOG15 $nopath(%log) | run %log } }
On *:dialog:lv:sclick:5:{ var %log = $+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),"),%l = 1 | if ($isfile(%log) == $true) { echo 4 @lv ::Sende15 $nopath(%log) zu $did($dname,12).text | dcc send -c $did($dname,12).text %log } }
On *:dialog:lv:sclick:6:{ var %log = $+(",$remove(%lg.file,"),$gettok($did($dname,1).seltext,6-,32),"),%l = 1 | if ($isfile(%log) == $true) { echo 4 @lv ::Verschiebe15 $nopath(%log) in den Mülleimer | .remove -b %log | logs | did -cf $dname 1 3 } }
On *:dialog:lv:sclick:8:{ lg.seek }
On *:dialog:lv:sclick:11:{ clear @lv }
On *:dialog:lv:menu:10:{ set %lg.file $+(",$sdir($mircdir),") | logs }
On *:dialog:lv:menu:17:{ logs }
On *:dialog:lv:menu:18:{ run %lg.file }
On *:input:@lv:{ var %f = $1- | findtext %f | editbox @lv %f }
