home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 14 / MA_Cover_14.iso / internet / htmlext / gui / func.mfind < prev    next >
Encoding:
Text File  |  2000-02-03  |  5.2 KB  |  168 lines

  1. G4C
  2. ; $VER: func.mfind Rev.016 by Juan Manuel Wehrli 1999 - 2000
  3. WINBIG -1 -1 350 130 "Durchsuchen"
  4. WinType 11010000
  5. WinBackground IMAGE BG 0
  6. Winout "NIL:"
  7.  
  8. xOnLoad
  9.     SetGad #This 100 HIDE
  10.     SetGad #This 101 HIDE
  11.     if $*was = 1
  12.         SetGad #This 2 OFF
  13.     elseif $*was = 0
  14.         SetGad #This 2 ON
  15.     endif
  16.     GuiOpen #This
  17.  
  18. xOnOpen
  19.     if $*suchstr != ""
  20.         SetVar suchstr $*suchstr
  21.         Update #This 1 $*suchstr
  22.     endif
  23.     if $*filestr != ""
  24.         SetVar filestr $*filestr
  25.         Update #This 4 $*filestr
  26.     endif
  27.     if $*art != ""
  28.         SetVar art $*art
  29.         Update #This 2 $*art
  30.     endif
  31.     if $*was != ""
  32.         SetVar was $*was
  33.         Update #This 3 $*was
  34.     endif
  35.  
  36. xOnQuit
  37.     SetVar *suchstr $suchstr
  38.     SetVar *filestr $filestr
  39.     SetVar *art $art
  40.     SetVar *was $was
  41.  
  42. ;Hintergrund Listview
  43.     XLISTVIEW 1300 1000 50 55 "" "liste" "" 0 "Multi"
  44.     GadID 100
  45.  
  46. XLISTVIEW 1300 1000 50 55 "" "liste2" "" 0 "Multi"
  47.     GadID 101
  48.  
  49. xTextIn 125 5 200 20 "Namensmuster:" filestr "#?" 255
  50.     GadID 4
  51.     GadFont "xHelvetica.font" "11" 000
  52.     SetVar *filestr $filestr
  53.  
  54. xTextIn 125 25 200 20 "Suche in Datei nach:" suchstr "" 255
  55.     GadID 1
  56.     GadFont "xHelvetica.font" "11" 000
  57.     SetVar *suchstr $suchstr
  58.  
  59. xRadio 125 60 12 12 art 5
  60.     GadFont "xHelvetica.font" "11" 000
  61.     GadID 2
  62.     RSTR "Auflisten" "0"
  63.     RSTR "Öffnen" "1"
  64.  
  65. xRadio 312 60 12 12 was 5
  66.     GadFont "xHelvetica.font" "11" 000
  67.     GadID 3
  68.     RSTR "Selektierte Dateien" "0"
  69.     RSTR "Verzeichnis sammt Unterverz." "1"
  70.     if $was = 1
  71.         SetGad #This 2 OFF
  72.     elseif $was = 0
  73.         SetGad #This 2 ON
  74.     endif
  75.     PartRedraw #This 125 60 20 50
  76.  
  77.  
  78. xButton 5 105 85 18 "_1 Starten"
  79.     GadKey "1"
  80.     GadFont "xHelvetica.font" "11" 000
  81.     GuiClose #This
  82.     Update "Infobar" 1 "Suche ... Bitte haben Sie Geduld, kann eine Weile dauern ..."
  83.     if $was = "0"
  84.         if $art = "0"
  85.             LVUSE HTMLEXT 3
  86.             LVMulti First
  87.             while $$lv.line > ""
  88.                 JoinFile $$lv.dir $$lv.rec file
  89.                 Update "Infobar" 1 "Durchsuche $file nach $suchstr ..."
  90.                 CLI 'search FROM $file SEARCH $suchstr QUIET PATTERN >t:HTMLEXT/find.list'
  91.                 CLI 'LIST LFORMAT="%L" t:HTMLEXT/find.list >env:.htmlext.tmp'
  92.                 if $.htmlext.tmp = "empty"
  93.                     CLI 'delete t:HTMLEXT/find.list'
  94.                     Update "Infobar" 1 "Durchsuche ... Nichts gefunden!"
  95.                 else
  96.                     LVUSE #This 100
  97.                     LVGO FIRST
  98.                     LVADD "$file"
  99.                     Update "Infobar" 1 "Füge Eintrag $file hinzu ..."
  100.                     LVUSE HTMLEXT 3
  101.                 endif
  102.                 LVMulti OFF
  103.                 LVMulti Show
  104.                 LVMulti First
  105.             EndWhile
  106.             LVUSE #This 100
  107.             LVSave "t:htmlext/find.list2"
  108.             GuiLoad "htmlext:gui/func.mfindlv"
  109.             Update "Infobar" 1 "Komplett!"
  110.             LVUSE func.mfindlv 1
  111.             LVChange "t:htmlext/find.list2"
  112.         elseif $art = "1"
  113.             LVUSE HTMLEXT 3
  114.             LVMulti First
  115.             while $$lv.line > ""
  116.                 JoinFile $$lv.dir $$lv.rec file
  117.                 Update "Infobar" 1 "Durchsuche $file nach $suchstr ..."
  118.                 CLI 'search FROM $file SEARCH "$suchstr" QUIET >t:HTMLEXT/find.list'
  119.                 CLI 'LIST LFORMAT="%L" t:HTMLEXT/find.list >env:.htmlext.tmp'
  120.                 if $.htmlext.tmp = "empty"
  121.                     CLI 'delete t:HTMLEXT/find.list'
  122.                     Update "Infobar" 1 "Durchsuche ... Nichts gefunden!"
  123.                 else
  124.                     Update "Infobar" 1 "Öffne $file mit Editor ..."
  125.                     CLI 'rx $*EDITOR OPENNEW "$file"'
  126.                     CLI 'rx $*EDITOR FIND "$suchstr"'
  127.                 endif
  128.                 LVMulti OFF
  129.                 LVMulti Show
  130.                 LVMulti First
  131.             EndWhile
  132.         endif
  133.     elseif $was = "1"
  134.         LVUSE HTMLEXT 3
  135.         Update "Infobar" 1 "Suche alle Dateien im Verzeichnis $$LV.DIR die dem Pattern $filestr entsprechen."
  136.         FailAt 21
  137.         CLI 'LIST $$LV.DIR PAT="$filestr" LFORMAT="%P%N" ALL >t:HTMLEXT/find.list'
  138.         LVUSE #This 100
  139.         LVChange "t:htmlext/find.list"
  140.         LVMulti ALL
  141.         LVMulti First
  142.         Update "Infobar" 1 "Durchsuche herausgefilterte Dateien ...  anz.: $$LV.TOTAL"
  143.         while $$lv.line > ""
  144.             Update "Infobar" 1 "Durchsuche Datei $$LV.REC ...  $$LV.LINE / $$LV.TOTAL"
  145.             CLI 'search FROM "$$LV.REC" SEARCH "$suchstr" QUIET PATTERN >env:.htmlext.tmp'
  146.             if $.htmlext.tmp != ""
  147.                 LVUSE #This 101
  148.                 LVADD $.htmlext.tmp
  149.                 Update "Infobar" 1 "Suchmuster gefunden ... bisher $$LV.TOTAL Einträge gefunden."
  150.                 LVUSE #This 100
  151.             endif
  152.             LVMulti OFF
  153.             LVMulti First
  154.         endwhile
  155.         LVUSE #This 101
  156.         Update "Infobar" 1 "Suche abgeschlossen ... Suchmuster $$LV.TOTAL gefunden ..."
  157.         LVSave "t:htmlext/find.list2"
  158.         GuiLoad "htmlext:gui/func.mfindlv"
  159.         CLI 'delete t:HTMLEXT/find.list'
  160.     endif
  161.     GuiQuit #This
  162.  
  163. xButton 260 105 85 18 "[_x] Abbrechen"
  164.     GadKey "x"
  165.     GadFont "xHelvetica.font" "11" 000
  166.     GuiQuit #This
  167.  
  168.