Stringscan

Check-in [c7f9249bd0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Code cleanup
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:c7f9249bd0353180c3868f485105da556361373d79ab0c7ce0b81c7c74f28fcc
User & Date: kevin 2017-09-18 02:25:10
Context
2017-09-19
03:13
Update file for 1.1 check-in: d9d50ad502 user: kevin tags: trunk
2017-09-18
02:25
Code cleanup check-in: c7f9249bd0 user: kevin tags: trunk
02:17
More tweaks for version 1.1 check-in: 3d2ce95654 user: kevin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to stringscan.rb.

    12     12   require 'mime/types'
    13     13   require 'tkextlib/tkDND'
    14     14   require 'tkextlib/tkimg'
    15     15   
    16     16   $platform = Tk.windowingsystem
    17     17   
    18     18   if $platform == 'aqua'
    19         -	TkPackage.require('windowlist')
    20         -	TkPackage.require('fullscreen')
    21         -	require 'tk/tk_mac'
           19  +    TkPackage.require('windowlist')
           20  +    TkPackage.require('fullscreen')
           21  +    require 'tk/tk_mac'
    22     22   end
    23     23   TkPackage.require('regproc')
    24     24   TkPackage.require('machelp')
    25     25   TkPackage.require('softwareupdate')
    26     26   TkPackage.require('xplat')
    27     27   
    28     28   if $platform == 'aqua'
    29         -	$accelkey = 'Command'
           29  +    $accelkey = 'Command'
    30     30   else 
    31         -	$accelkey = 'Control'
           31  +    $accelkey = 'Control'
    32     32   end
    33     33   
    34     34   
    35     35   class StringscanApp
    36     36   
    37         -#here we initialize our app class
    38         -def initialize
    39         -
    40         -	$dirname = ""
    41         -	$searchterm = ""
    42         -	$appname = 'Stringscan'
    43         -	$appversion = '1.0'
    44         -	Tk.tk_call('machelp::setAppName', $appname, $appversion)
    45         -	Tk.tk_call('softwareupdate::setAppName', $appname)
    46         -	Tk.tk_call('softwareupdate::setVersion', $appname, $appversion)
    47         -
    48         -	bgerror = Tk.install_cmd(proc{
    49         -		|*args|
    50         -		puts args
    51         -	})
    52         -	Tk.ip_eval("proc bgerror {args} {#{bgerror} $args}")
    53         -
    54         -	if $platform == 'aqua'
    55         -		##map ruby proc to "odoc" Apple Event
    56         -		setDir = Tk.install_cmd(proc{
    57         -			|*args|
    58         -			filename=(args[0]).delete('{}')
    59         -			begin
    60         -			        if File.directory?(filename)
    61         -                                        $tbox.configure('state'=>'normal')
    62         -	                                $tbox.delete('1.0', 'end')
    63         -                                        $tbox.configure('state'=>'disabled')
    64         -                                        $lbox.delete(0, 'end')
    65         -					$dirname = filename
    66         -					$direntry.value = filename
    67         -				end
    68         -			rescue
    69         -				raise
    70         -			end
    71         -		})    
    72         -		Tk.ip_eval("proc ::tk::mac::OpenDocument {args} {#{setDir} $args}")
    73         -		Tk.ip_eval("proc ::tk::mac::ShowHelp {} {#{Tk.install_cmd(proc{showHelp})}}")
    74         -	end        
    75         -	drawgui
    76         -	Tk.tk_call('regproc::readLic', $appname, $appversion)
    77         -end  
    78         -
    79         -#core method; here we search for a string in text files within a directory and  display a list of matching files in the listbox 
    80         -def stringgrep
           37  +    #here we initialize our app class
           38  +    def initialize
           39  +
           40  +        $dirname = ""
           41  +        $searchterm = ""
           42  +        $appname = 'Stringscan'
           43  +        $appversion = '1.0'
           44  +        Tk.tk_call('machelp::setAppName', $appname, $appversion)
           45  +        Tk.tk_call('softwareupdate::setAppName', $appname)
           46  +        Tk.tk_call('softwareupdate::setVersion', $appname, $appversion)
           47  +
           48  +        bgerror = Tk.install_cmd(proc{
           49  +            |*args|
           50  +            puts args
           51  +        })
           52  +        Tk.ip_eval("proc bgerror {args} {#{bgerror} $args}")
           53  +
           54  +        if $platform == 'aqua'
           55  +            ##map ruby proc to "odoc" Apple Event
           56  +            setDir = Tk.install_cmd(proc{
           57  +                |*args|
           58  +                filename=(args[0]).delete('{}')
           59  +                begin
           60  +                    if File.directory?(filename)
           61  +                        $tbox.configure('state'=>'normal')
           62  +                        $tbox.delete('1.0', 'end')
           63  +                        $tbox.configure('state'=>'disabled')
           64  +                        $lbox.delete(0, 'end')
           65  +                        $dirname = filename
           66  +                        $direntry.value = filename
           67  +                    end
           68  +                rescue
           69  +                    raise
           70  +                end
           71  +            })    
           72  +            Tk.ip_eval("proc ::tk::mac::OpenDocument {args} {#{setDir} $args}")
           73  +            Tk.ip_eval("proc ::tk::mac::ShowHelp {} {#{Tk.install_cmd(proc{showHelp})}}")
           74  +        end        
           75  +        drawgui
           76  +        Tk.tk_call('regproc::readLic', $appname, $appversion)
           77  +    end  
           78  +
           79  +    #core method; here we search for a string in text files within a directory and  display a list of matching files in the listbox 
           80  +    def stringgrep
    81     81           $root.update
    82         -	$file_list = []
    83         -	$grep_list = []
           82  +        $file_list = []
           83  +        $grep_list = []
    84     84           $p.start
    85     85           $bottomlabel.configure('text' => "Searching for \"#{$searchterm}\" in #{$dirname}")
    86         -	$lbox.delete(0, 'end')
           86  +        $lbox.delete(0, 'end')
    87     87           $root.update
    88         -	Find.find("#{$dirname}") do |path|
    89         -		$file_list << path unless FileTest.directory?(path)
    90         -	end
    91         -	for i in $file_list
    92         -	begin
    93         -		#we are only reading text files here, not binary. 
    94         -		text =  MIME::Types.type_for(i).first.to_s
    95         -		type =  text.split('/')[0]
    96         -		if type  =~ /text/
    97         -			f = File.open(i, "r:iso-8859-1:utf-8")
    98         -			result = f.read
    99         -			if result =~ /#{$searchterm}/ then
   100         -				$lbox.insert('end', "#{i}")
   101         -				f.close
   102         -			end
   103         -		end
   104         -	rescue
   105         -		#puts "Search term not found.\n"
   106         -	end
           88  +        Find.find("#{$dirname}") do |path|
           89  +            $file_list << path unless FileTest.directory?(path)
           90  +        end
           91  +        for i in $file_list
           92  +        begin
           93  +            #we are only reading text files here, not binary. 
           94  +            text =  MIME::Types.type_for(i).first.to_s
           95  +            type =  text.split('/')[0]
           96  +            if type  =~ /text/
           97  +                f = File.open(i, "r:iso-8859-1:utf-8")
           98  +                result = f.read
           99  +                if result =~ /#{$searchterm}/ then
          100  +                    $lbox.insert('end', "#{i}")
          101  +                    f.close
          102  +                end
          103  +            end
          104  +        rescue
          105  +            #puts "Search term not found.\n"
          106  +        end
   107    107           $p.stop
   108    108           $grep_list = $lbox.get(0, 'end')
   109    109           num = $grep_list.count.to_s
   110    110           $bottomlabel.configure('text' => "Found #{num} matches for \"#{$searchterm}\" in #{$dirname}")
   111         -end
          111  +    end
   112    112   rescue
   113         -puts "Directory not found.\n"
   114         -puts "Search complete.\n"
          113  +    puts "Directory not found.\n"
          114  +    puts "Search complete.\n"
   115    115   end
   116    116   
   117    117   def drawgui 
   118         -	begin
   119         -		Tk.ip_eval("console hide")
   120         -	rescue
   121         -		puts "could not hide console.\n"
   122         -	end
   123         -
   124         -	#image data
   125         -	$folderdata = 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAMAAADzapwJAAAADFBMVEUEBwcEBwcEBwcEBwcNzGmPAAAAAXRSTlMAQObYZgAAAC1JREFUeAFjYEYABgQgXRhCowAyhNEAfmFMQFiYsJX0F6aa5xmxiTIygMQxRQEtWAMvBVlMnAAAAABJRU5ErkJggg=='
   126         -
   127         -	$glassdata = 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AcSAg8sJGRWZAAAAXhJREFUOMutlL9LQlEUxz+WGRHllGNEPyAUWnLWsVYhXNpd+ldC6B/QPyDnoMXNtbnFIRAarLAn+bDU13IuHC/vPm/agQuXy/d93veec+4Bv9gGKkAbGAORrAHQBPLAOn+MAtBVMNdqARlfaEk+minAJ/AOvAEjC973gWeAnvpoCNSAfWAX2AKKQN36eWtRWhoK+grkErRXlvO8S7hjuah6pK2uwE2X6BKYiujFsx5FlfPBmkO0B6Rkf+8JfgZC2Wdd4EjtNzzBcwVzgccKfuIJzgJp2X+7RIfAjyrGkQe4pvTtpIcxUcLOgt7MSZ8bfcUFDWOebMfhvCp9btqzK7NlLspW/36ptjPrAbgDbqUVbQOFOKh++wFwLfCk4WNM9OS2scPGrA/gQODmbCIFnQpspm7TsIdPWqCPIkgJ9AZ4Uk97DFyIq3NgU7R9yf0wrliB5fZMxqI+K7FEnIpLe+5GkvMyK8SxoyArQTXcOA+XvX5SWoL/gP4Cdj2n/+OJ36AAAAAASUVORK5CYII='
   128         -
   129         -	$folderimage = TkPhotoImage.new(:data => $folderdata)
   130         -	$glassimage = TkPhotoImage.new(:data => $glassdata)
   131         -
   132         -	$icondata = 'iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAABuvAAAbrwFeGpEcAAAAB3RJTUUH4QcKAhkVOQjHbgAAF1lJREFUeNrNW2l0nNV5fu693zL7opE02uUVLNuSN1kKJhBTKBgTl5QU6pICLQ3tSU+a07RpFuD0pIHDadOVpElP6iyHkzQlKacQ0gCNjUkBEyzkbYwsC9uyFo+kGc2m2edb7u2PmZFGsjZkZbnn3HNn+ea7933uc9/7vO/9hmAZpaNzNwK971S87wKAKgBeAE4ADUKIjQJYAyGaANQKgWpAeADYAVgByAAEgAKADIAECIkQIAhgiBBynhByDkAUQCTQ2xOt7C/Q24NfRCGLGz7TcUdnlwzgnlLtFEI4OOd2zrmNc0GsVguqfVXwej3wuN1wOh1w2OywWG1QVRmSxCAEYBgG8vkCstkskqkU4rE4JiNRTITDKBQ0UEbzjNIkpXQSwPMAvhro7QkDwLbdXTjzTs8vFYAdAPZyLj4mBN8lSRJcTgecTieqfVVoamxAQ10d/H4/nA47uODQNQOGacA0TZimCc4FAAEhBAACSgkopWCMQWIMkixDURQwShGNxTE8OoJLl4YwOjaGeDyOZDINQvA2pfQfABwN9PbEV5MRZBHjGwAMcs7V1uZGbGvfipbmZiiqAouqQpZlTE1NIRKNIBaLIR6PIZ/PQwgBzjmEENMVQkAAIKTYHSFkulJKQQiBzWZDTU0t6uvqUF/fANMUyOWzCIcn8X9vHMPFw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746tG/fPrzyyiu/UgBIxa4wX0sA0LvuukvZtm2bWl1drQghSCKRMM+dO1d4+eWXC9lsVlSKsJtvvvmO+vr6H37sYx9DMBiE0+mEqqoIhUJIp9Pw+/14/vnnE9lsdteRI0cGf1UMIBVB1Lz14Ycftn/0ox9tWrNmzVq3292sqmq9LMteANQwjFQulwtPTU0Fh4eHh1555ZUrhw4dSuTzeQ4g193dffP69eufufvuu33ZbBaUUlgsxThhx44dEELg0UcfvfDcc89dd60AsGswnlW0sxSj3W6XHnrooboNGzasc7vd62w220aLxbJJVdUtsiyvJYQ4ACimaZLS/wuN06dPZ6ampggAORgMjmua9l8jIyMPbd++XS4/Ntfd3Q0AsFqtOH36tE9V1W+MjIykf9m7AF2E+gQAzWQy5POf/3zonnvuye/evXu8paXlvMvl8iqKYhNCsFwup8VisfTo6Gj0zJkz0cOHDyfGx8dFhd8wBwYGQolEYgsh5Af79u3ramtrm378jhACTdPQ398fm5vh+WUAwEsD5RWM4HMYIlKpFJ555pn4M888kwRweQ5Yc50jn6PiOACEQqH0T37yk1sNw3jR5XLdsm7dumJ0evYsRkdHvxqJRLRf5S5Al6hkAaPJPLGHqAB3FiCEECGEyO/Zs+fPtm7d+ruMMXb27NnnU6nU3zHGjJMnTwr8ikvZD8gAFAAWFJ8Ot5eqE8UHmN2l6pmnukvXuAA4Sr+zle6jlu47y18dPHjw108IzRM4YZ5Ey6ylskCmZq7O/4XN8v8D9yIPOOfsZU4AAAAASUVORK5CYII='
   133         -	$icon = TkPhotoImage.new(:data => $icondata)
   134         -	
   135         -	#initialize variables for entry
   136         -	$dirname = TkVariable.new
   137         -	$searchterm = TkVariable.new
   138         -	
   139         -	#top window and frame
   140         -	Tk::TkDND::DND
   141         -	$root = TkRoot.new {
   142         -		title "Stringscan"
   143         -	}
   144         -	
   145         -	$root.iconphoto_default($icon)
   146         -	
   147         -	if $platform == 'aqua'
   148         -		Tk.tk_call('fullscreen::fullscreen', $root)
   149         -	end
   150         -	
   151         -	#menu
   152         -	$menubar = TkMenu.new($root)
   153         -	TkOption.add '*tearOff', 0
   154         -	if $platform == 'aqua'
   155         -		$appmenu = TkSysMenu_Apple.new($menubar)
   156         -		$menubar.add :cascade, :menu => $appmenu
   157         -		$appmenu.add :command, :label => 'About Stringscan', :command=> proc{aboutWindow}
   158         -		$appmenu.add :command, :label => 'License', :command=>proc{getReg}
   159         -		$appmenu.add :command, :label=>'Check for Updates', :command=>proc{checkUpdate}
   160         -		$appmenu.add :separator
   161         -	end
   162         -	$searchmenu = TkMenu.new($menubar)
   163         -	$menubar.add :cascade, :menu => $searchmenu, :label => 'Search'
   164         -	$searchmenu.add :command, :label => 'Choose Directory...', 'accelerator' => "#{$accelkey}+O", :command => proc{choosedir}
   165         -	$searchmenu.add :command, :label => 'Run Search', 'accelerator' => "#{$accelkey}+R", :command => proc{stringgrep}
   166         -	if $platform == 'win32'
   167         -		$searchmenu.add :command, :label => "Exit", :command=>proc{exit}, 'accelerator' => "#{$accelkey}+Q"
   168         -	end
   169         -	if $platform == 'aqua'
   170         -		Tk.tk_call("windowlist::windowMenu",  $menubar)
   171         -	end
   172         -	$helpmenu = TkSysMenu_Help.new($menubar)
   173         -	$menubar.add :cascade, :menu => $helpmenu, :label => 'Help'
   174         -	if $platform != 'aqua'
   175         -		$helpmenu.add :command, :label=>'Stringscan Help', :command=>proc{
   176         -			Tk.tk_call('machelp::userhelp')
   177         -		}
   178         -	end
   179         -	$helpmenu.add :command, :label=>'Contact Code by Kevin', :command=>proc{
   180         -		Tk.tk_call('xplat::launch', 'mailto:kw@codebykevin.com?subject=Stringscan')
   181         -	}
   182         -	$helpmenu.add :command, :label=>'Web Site', :command=>proc{
   183         -		Tk.tk_call('xplat::launch', 'https://www.codebykevin.com/stringscan.html')
   184         -	}
   185         -
   186         -	if $platform != 'aqua'
   187         -		$helpmenu.add :command, :label => 'About Stringscan', :command=> proc{aboutWindow}
   188         -		$helpmenu.add :command, :label => 'License', :command=>proc{getReg}
   189         -		$helpmenu.add :command, :label=>'Check for Updates', :command=>proc{checkUpdate}
   190         -			end
   191         -	$root['menu'] = $menubar
   192         -	$mainframe = Tk::Tile::Frame.new($root).pack('side' => 'top','fill' => 'both','expand' => 'yes')
   193         -	
   194         -	#button frame and buttons
   195         -	$buttonframe = Tk::Tile::Frame.new($mainframe){padding 2}.pack('side' => 'top','fill' => 'both','expand' => 'no')
   196         -	choosedirproc = proc{choosedir}
   197         -	$choosebutton = Tk::Tile::Button.new($buttonframe) {
   198         -		image $folderimage
   199         -		takefocus 0
   200         -		padding 5
   201         -		command  choosedirproc
   202         -	}.pack('side' => 'left','fill' => 'both','expand' => 'no')
   203         -	Tk::RbWidget::BalloonHelp.new($choosebutton, 'text'=>'Select Directory', 'background'=>'lightyellow', 'relief'=>'solid', 'borderwidth'=>1)
   204         -	stringgrepProc = proc {stringgrep}
   205         -	$runbutton = Tk::Tile::Button.new($buttonframe) {
   206         -		image $glassimage
   207         -		takefocus 0
   208         -		padding 5
   209         -		command stringgrepProc
   210         -	}.pack('side' => 'left','fill' => 'both','expand' => 'no')
   211         -	Tk::RbWidget::BalloonHelp.new($runbutton, 'text'=>'Run Search', 'background'=>'lightyellow', 'relief'=>'solid', 'borderwidth'=>1)
   212         -	$sep = Tk::Tile::Separator.new($mainframe) { orient 'horizontal' }.pack('side'=> 'top', 'fill'=>'both')
   213         -	
   214         -	#labels and entries
   215         -	$topframe = Tk::Tile::Frame.new($mainframe){padding 5}.pack('side' => 'top','fill' => 'both','expand' => 'no')
   216         -	$chooselabel = Tk::Tile::Label.new($topframe) {text "Directory:"}.pack('side' => 'left','fill' => 'both','expand' => 'no')
   217         -	$direntry = Tk::Tile::Entry.new($topframe) {textvariable $dirname }.pack('side' => 'left','fill' => 'both','expand' => 'no')
   218         -	$termlabel = Tk::Tile::Label.new($topframe) {text "Search Term:"}.pack('side' => 'left','fill' => 'both','expand' => 'no')
   219         -	$termentry = Tk::Tile::Entry.new($topframe) {textvariable $searchterm}.pack('side' => 'left','fill' => 'both','expand' => 'no')
   220         -	$termentry.bind('Return', proc {stringgrep})
   221         -	$nextsep = Tk::Tile::Separator.new($mainframe) {orient 'horizontal'}.pack('side'=>'top', 'fill'=>'both')
   222         -	
   223         -	#listbox, textbox, scrollbars
   224         -	$bottomframe = Tk::Frame.new($mainframe).pack('side'=>'bottom','fill' => 'both', 'expand' => 'yes')
   225         -	$bottomleftframe = Tk::Tile::Frame.new($bottomframe).pack('side'=>'left','fill' => 'both', 'expand' => 'yes')
   226         -	$listlabel = Tk::Tile::Label.new($bottomleftframe) {
   227         -		text 'File Name'
   228         -		style 'TablelistHeader.TLabel'
   229         -		padding 1
   230         -	}.pack('side'=>'top', 'fill'=>'both', 'expand' => 'no')
   231         -	$lbox = Tk::Listbox.new($bottomleftframe){
   232         -		width 50
   233         -		height 30
   234         -		borderwidth 0
   235         -		takefocus 0
   236         -		activestyle "none"
   237         -		exportselection 0
   238         -		selectbackground "RoyalBlue1"
   239         -		selectforeground "white"
   240         -		dnd_bindtarget('text/uri-list', '<Drop>', '%D') {|d|
   241         -			filename=d.join(' ')
   242         -			begin
   243         -			  if File.directory?(filename)
   244         -                            $tbox.configure('state'=>'normal')
   245         -	                    $tbox.delete('1.0', 'end')
   246         -                            $tbox.configure('state'=>'disabled')
   247         -                            $lbox.delete(0, 'end')
   248         -					$dirname = filename
   249         -					$direntry.value = filename
   250         -				end
   251         -			rescue
   252         -				raise
   253         -			end
   254         -		}
   255         -	}.pack('side'=>'left','fill' => 'both', 'expand' => 'yes')
   256         -	$lbox.bind '<ListboxSelect>', proc {
   257         -		begin
   258         -			if $lbox.curselection.empty?
   259         -				puts "No selection in listbox."
   260         -			else
   261         -				highlighttext  $lbox.get($lbox.curselection[0])
   262         -			end
   263         -		rescue
   264         -			puts "Cannot get selection in listbox."
   265         -		end
   266         -	}
   267         -	$scrollframe = Tk::Frame.new($bottomleftframe).pack('side'=>'right','fill' => 'y', 'expand' => 'no')
   268         -	$listscroll = Tk::Tile::Scrollbar.new($scrollframe).pack('side'=>'right','fill' => 'y', 'expand' => 'no')
   269         -	$lbox.yscrollbar($listscroll)
   270         -	$bottomrightframe  =Tk::Tile::Frame.new($bottomframe).pack('side'=>'right','fill' => 'both', 'expand' => 'yes')
   271         -	$tbox = Tk::Text::new($bottomrightframe){
   272         -		borderwidth 0.1
   273         -		relief 'sunken'
   274         -		wrap 'word'
   275         -		highlightcolor 'SlateGray3'
   276         -		bg 'white'
   277         -		state 'disabled'
   278         -	}.pack('side'=>'left','fill' => 'both', 'expand' => 'yes')
   279         -	$tscrollframe = Tk::Frame.new($bottomrightframe).pack('side'=>'right','fill' => 'y', 'expand' => 'no')
   280         -	$tscroll = Tk::Tile::Scrollbar.new($tscrollframe).pack('side'=>'right','fill' => 'y', 'expand' => 'no')
   281         -	$tbox.yscrollbar($tscroll)
   282         -	
   283         -	
   284         -	$labelframe = Tk::Tile::Frame.new($root).pack('side'=>'bottom', 'fill'=>'both', 'expand' => 'no')
   285         -	$bottomlabel = Tk::Tile::Label.new($labelframe) {text "No data displayed"}.pack('side' => 'left','fill' => 'both','expand' => 'no')
   286         -        $p = Tk::Tile::Progressbar.new($labelframe) {orient 'horizontal'; length 200; mode 'indeterminate'}.pack('side' => 'left','fill' => 'both','expand' => 'no')
   287         -	$bottomsep = Tk::Tile::Separator.new($root) { orient 'horizontal' }.pack('side'=> 'bottom', 'fill'=>'both')
   288         -	
   289         -  	$root.bind("#{$accelkey}-Q", proc{exit})
   290         -	$root.bind("#{$accelkey}-q", proc{exit})
   291         -	$root.bind("#{$accelkey}-O", proc{choosedir})
   292         -	$root.bind("#{$accelkey}-o", proc{choosedir})
   293         -	$root.bind("#{$accelkey}-R", proc{stringgrep})
   294         -	$root.bind("#{$accelkey}-r", proc{stringgrep})
          118  +    begin
          119  +        Tk.ip_eval("console hide")
          120  +    rescue
          121  +        puts "could not hide console.\n"
          122  +    end
          123  +
          124  +    #image data
          125  +    $folderdata = 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAMAAADzapwJAAAADFBMVEUEBwcEBwcEBwcEBwcNzGmPAAAAAXRSTlMAQObYZgAAAC1JREFUeAFjYEYABgQgXRhCowAyhNEAfmFMQFiYsJX0F6aa5xmxiTIygMQxRQEtWAMvBVlMnAAAAABJRU5ErkJggg=='
          126  +
          127  +    $glassdata = 'iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AcSAg8sJGRWZAAAAXhJREFUOMutlL9LQlEUxz+WGRHllGNEPyAUWnLWsVYhXNpd+ldC6B/QPyDnoMXNtbnFIRAarLAn+bDU13IuHC/vPm/agQuXy/d93veec+4Bv9gGKkAbGAORrAHQBPLAOn+MAtBVMNdqARlfaEk+minAJ/AOvAEjC973gWeAnvpoCNSAfWAX2AKKQN36eWtRWhoK+grkErRXlvO8S7hjuah6pK2uwE2X6BKYiujFsx5FlfPBmkO0B6Rkf+8JfgZC2Wdd4EjtNzzBcwVzgccKfuIJzgJp2X+7RIfAjyrGkQe4pvTtpIcxUcLOgt7MSZ8bfcUFDWOebMfhvCp9btqzK7NlLspW/36ptjPrAbgDbqUVbQOFOKh++wFwLfCk4WNM9OS2scPGrA/gQODmbCIFnQpspm7TsIdPWqCPIkgJ9AZ4Uk97DFyIq3NgU7R9yf0wrliB5fZMxqI+K7FEnIpLe+5GkvMyK8SxoyArQTXcOA+XvX5SWoL/gP4Cdj2n/+OJ36AAAAAASUVORK5CYII='
          128  +
          129  +    $folderimage = TkPhotoImage.new(:data => $folderdata)
          130  +    $glassimage = TkPhotoImage.new(:data => $glassdata)
          131  +
          132  +    $icondata = 'iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAABuvAAAbrwFeGpEcAAAAB3RJTUUH4QcKAhkVOQjHbgAAF1lJREFUeNrNW2l0nNV5fu693zL7opE02uUVLNuSN1kKJhBTKBg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kz0cOHDyfGx8dFhd8wBwYGQolEYgsh5Af79u3ramtrm378jhACTdPQ398fm5vh+WUAwEsD5RWM4HMYIlKpFJ555pn4M888kwRweQ5Yc50jn6PiOACEQqH0T37yk1sNw3jR5XLdsm7dumJ0evYsRkdHvxqJRLRf5S5Al6hkAaPJPLGHqAB3FiCEECGEyO/Zs+fPtm7d+ruMMXb27NnnU6nU3zHGjJMnTwr8ikvZD8gAFAAWFJ8Ot5eqE8UHmN2l6pmnukvXuAA4Sr+zle6jlu47y18dPHjw108IzRM4YZ5Ey6ylskCmZq7O/4XN8v8D9yIPOOfsZU4AAAAASUVORK5CYII='
          133  +    $icon = TkPhotoImage.new(:data => $icondata)
          134  +        #initialize variables for entry
          135  +    $dirname = TkVariable.new
          136  +    $searchterm = TkVariable.new
          137  +        #top window and frame
          138  +    Tk::TkDND::DND
          139  +    $root = TkRoot.new {
          140  +        title "Stringscan"
          141  +    }
          142  +        $root.iconphoto_default($icon)
          143  +        if $platform == 'aqua'
          144  +        Tk.tk_call('fullscreen::fullscreen', $root)
          145  +    end
          146  +        #menu
          147  +    $menubar = TkMenu.new($root)
          148  +    TkOption.add '*tearOff', 0
          149  +    if $platform == 'aqua'
          150  +        $appmenu = TkSysMenu_Apple.new($menubar)
          151  +        $menubar.add :cascade, :menu => $appmenu
          152  +        $appmenu.add :command, :label => 'About Stringscan', :command=> proc{aboutWindow}
          153  +        $appmenu.add :command, :label => 'License', :command=>proc{getReg}
          154  +        $appmenu.add :command, :label=>'Check for Updates', :command=>proc{checkUpdate}
          155  +        $appmenu.add :separator
          156  +    end
          157  +    $searchmenu = TkMenu.new($menubar)
          158  +    $menubar.add :cascade, :menu => $searchmenu, :label => 'Search'
          159  +    $searchmenu.add :command, :label => 'Choose Directory...', 'accelerator' => "#{$accelkey}+O", :command => proc{choosedir}
          160  +    $searchmenu.add :command, :label => 'Run Search', 'accelerator' => "#{$accelkey}+R", :command => proc{stringgrep}
          161  +    if $platform == 'win32'
          162  +        $searchmenu.add :command, :label => "Exit", :command=>proc{exit}, 'accelerator' => "#{$accelkey}+Q"
          163  +    end
          164  +    if $platform == 'aqua'
          165  +        Tk.tk_call("windowlist::windowMenu",  $menubar)
          166  +    end
          167  +    $helpmenu = TkSysMenu_Help.new($menubar)
          168  +    $menubar.add :cascade, :menu => $helpmenu, :label => 'Help'
          169  +    if $platform != 'aqua'
          170  +        $helpmenu.add :command, :label=>'Stringscan Help', :command=>proc{
          171  +            Tk.tk_call('machelp::userhelp')
          172  +        }
          173  +    end
          174  +    $helpmenu.add :command, :label=>'Contact Code by Kevin', :command=>proc{
          175  +        Tk.tk_call('xplat::launch', 'mailto:kw@codebykevin.com?subject=Stringscan')
          176  +    }
          177  +    $helpmenu.add :command, :label=>'Web Site', :command=>proc{
          178  +        Tk.tk_call('xplat::launch', 'https://www.codebykevin.com/stringscan.html')
          179  +    }
          180  +
          181  +    if $platform != 'aqua'
          182  +        $helpmenu.add :command, :label => 'About Stringscan', :command=> proc{aboutWindow}
          183  +        $helpmenu.add :command, :label => 'License', :command=>proc{getReg}
          184  +        $helpmenu.add :command, :label=>'Check for Updates', :command=>proc{checkUpdate}
          185  +    end
          186  +    $root['menu'] = $menubar
          187  +    $mainframe = Tk::Tile::Frame.new($root).pack('side' => 'top','fill' => 'both','expand' => 'yes')
          188  +        #button frame and buttons
          189  +    $buttonframe = Tk::Tile::Frame.new($mainframe){padding 2}.pack('side' => 'top','fill' => 'both','expand' => 'no')
          190  +    choosedirproc = proc{choosedir}
          191  +    $choosebutton = Tk::Tile::Button.new($buttonframe) {
          192  +        image $folderimage
          193  +        takefocus 0
          194  +        padding 5
          195  +        command  choosedirproc
          196  +    }.pack('side' => 'left','fill' => 'both','expand' => 'no')
          197  +    Tk::RbWidget::BalloonHelp.new($choosebutton, 'text'=>'Select Directory', 'background'=>'lightyellow', 'relief'=>'solid', 'borderwidth'=>1)
          198  +    stringgrepProc = proc {stringgrep}
          199  +    $runbutton = Tk::Tile::Button.new($buttonframe) {
          200  +        image $glassimage
          201  +        takefocus 0
          202  +        padding 5
          203  +        command stringgrepProc
          204  +    }.pack('side' => 'left','fill' => 'both','expand' => 'no')
          205  +    Tk::RbWidget::BalloonHelp.new($runbutton, 'text'=>'Run Search', 'background'=>'lightyellow', 'relief'=>'solid', 'borderwidth'=>1)
          206  +    $sep = Tk::Tile::Separator.new($mainframe) { orient 'horizontal' }.pack('side'=> 'top', 'fill'=>'both')
          207  +        #labels and entries
          208  +    $topframe = Tk::Tile::Frame.new($mainframe){padding 5}.pack('side' => 'top','fill' => 'both','expand' => 'no')
          209  +    $chooselabel = Tk::Tile::Label.new($topframe) {text "Directory:"}.pack('side' => 'left','fill' => 'both','expand' => 'no')
          210  +    $direntry = Tk::Tile::Entry.new($topframe) {textvariable $dirname }.pack('side' => 'left','fill' => 'both','expand' => 'no')
          211  +    $termlabel = Tk::Tile::Label.new($topframe) {text "Search Term:"}.pack('side' => 'left','fill' => 'both','expand' => 'no')
          212  +    $termentry = Tk::Tile::Entry.new($topframe) {textvariable $searchterm}.pack('side' => 'left','fill' => 'both','expand' => 'no')
          213  +    $termentry.bind('Return', proc {stringgrep})
          214  +    $nextsep = Tk::Tile::Separator.new($mainframe) {orient 'horizontal'}.pack('side'=>'top', 'fill'=>'both')
          215  +        #listbox, textbox, scrollbars
          216  +    $bottomframe = Tk::Frame.new($mainframe).pack('side'=>'bottom','fill' => 'both', 'expand' => 'yes')
          217  +    $bottomleftframe = Tk::Tile::Frame.new($bottomframe).pack('side'=>'left','fill' => 'both', 'expand' => 'yes')
          218  +    $listlabel = Tk::Tile::Label.new($bottomleftframe) {
          219  +        text 'File Name'
          220  +        style 'TablelistHeader.TLabel'
          221  +        padding 1
          222  +    }.pack('side'=>'top', 'fill'=>'both', 'expand' => 'no')
          223  +    $lbox = Tk::Listbox.new($bottomleftframe){
          224  +        width 50
          225  +        height 30
          226  +        borderwidth 0
          227  +        takefocus 0
          228  +        activestyle "none"
          229  +        exportselection 0
          230  +        selectbackground "RoyalBlue1"
          231  +        selectforeground "white"
          232  +        dnd_bindtarget('text/uri-list', '<Drop>', '%D') {|d|
          233  +            filename=d.join(' ')
          234  +            begin
          235  +                if File.directory?(filename)
          236  +                    $tbox.configure('state'=>'normal')
          237  +                    $tbox.delete('1.0', 'end')
          238  +                    $tbox.configure('state'=>'disabled')
          239  +                    $lbox.delete(0, 'end')
          240  +                    $dirname = filename
          241  +                    $direntry.value = filename
          242  +                end
          243  +            rescue
          244  +                raise
          245  +            end
          246  +        }
          247  +    }.pack('side'=>'left','fill' => 'both', 'expand' => 'yes')
          248  +    $lbox.bind '<ListboxSelect>', proc {
          249  +        begin
          250  +            if $lbox.curselection.empty?
          251  +                puts "No selection in listbox."
          252  +            else
          253  +                highlighttext  $lbox.get($lbox.curselection[0])
          254  +            end
          255  +        rescue
          256  +            puts "Cannot get selection in listbox."
          257  +        end
          258  +    }
          259  +    $scrollframe = Tk::Frame.new($bottomleftframe).pack('side'=>'right','fill' => 'y', 'expand' => 'no')
          260  +    $listscroll = Tk::Tile::Scrollbar.new($scrollframe).pack('side'=>'right','fill' => 'y', 'expand' => 'no')
          261  +    $lbox.yscrollbar($listscroll)
          262  +    $bottomrightframe  =Tk::Tile::Frame.new($bottomframe).pack('side'=>'right','fill' => 'both', 'expand' => 'yes')
          263  +    $tbox = Tk::Text::new($bottomrightframe){
          264  +        borderwidth 0.1
          265  +        relief 'sunken'
          266  +        wrap 'word'
          267  +        highlightcolor 'SlateGray3'
          268  +        bg 'white'
          269  +        state 'disabled'
          270  +    }.pack('side'=>'left','fill' => 'both', 'expand' => 'yes')
          271  +    $tscrollframe = Tk::Frame.new($bottomrightframe).pack('side'=>'right','fill' => 'y', 'expand' => 'no')
          272  +    $tscroll = Tk::Tile::Scrollbar.new($tscrollframe).pack('side'=>'right','fill' => 'y', 'expand' => 'no')
          273  +    $tbox.yscrollbar($tscroll)
          274  +            $labelframe = Tk::Tile::Frame.new($root).pack('side'=>'bottom', 'fill'=>'both', 'expand' => 'no')
          275  +    $bottomlabel = Tk::Tile::Label.new($labelframe) {text "No data displayed"}.pack('side' => 'left','fill' => 'both','expand' => 'no')
          276  +    $p = Tk::Tile::Progressbar.new($labelframe) {orient 'horizontal'; length 200; mode 'indeterminate'}.pack('side' => 'left','fill' => 'both','expand' => 'no')
          277  +    $bottomsep = Tk::Tile::Separator.new($root) { orient 'horizontal' }.pack('side'=> 'bottom', 'fill'=>'both')
          278  +        $root.bind("#{$accelkey}-Q", proc{exit})
          279  +    $root.bind("#{$accelkey}-q", proc{exit})
          280  +    $root.bind("#{$accelkey}-O", proc{choosedir})
          281  +    $root.bind("#{$accelkey}-o", proc{choosedir})
          282  +    $root.bind("#{$accelkey}-R", proc{stringgrep})
          283  +    $root.bind("#{$accelkey}-r", proc{stringgrep})
   295    284   
   296         -        $lbox.focus
          285  +    $lbox.focus
   297    286   
   298    287   end
   299    288   
   300    289   
   301    290   #select search directory
   302    291   def choosedir
   303         -  	$tbox.configure('state'=>'normal')
   304         -	$tbox.delete('1.0', 'end')
   305         -        $tbox.configure('state'=>'disabled')
   306         -        $lbox.delete(0, 'end')
   307         -	$dirname = Tk::chooseDirectory('initialdir'=>Dir.home, 'parent'=>$root)
   308         -	$direntry.value = $dirname
          292  +    $tbox.configure('state'=>'normal')
          293  +    $tbox.delete('1.0', 'end')
          294  +    $tbox.configure('state'=>'disabled')
          295  +    $lbox.delete(0, 'end')
          296  +    $dirname = Tk::chooseDirectory('initialdir'=>Dir.home, 'parent'=>$root)
          297  +    $direntry.value = $dirname
   309    298   end
   310    299   
   311    300   #read file for display in text widget
   312    301   def highlighttext(file)
   313         -	$tbox.configure('state'=>'normal')
   314         -	$tbox.delete('1.0', 'end') 
   315         -	f = open(file, 'rb')
   316         -	while(!f.eof?)
   317         -		$tbox.insert('end', f.read(1000))
   318         -	end
   319         -	f.close
   320         -	$tbox.configure('state'=>'disabled')
   321         -	$tbox.tag_configure('search', :background=>'yellow')
   322         -	sethighlight
          302  +    $tbox.configure('state'=>'normal')
          303  +    $tbox.delete('1.0', 'end') 
          304  +    f = open(file, 'rb')
          305  +    while(!f.eof?)
          306  +        $tbox.insert('end', f.read(1000))
          307  +    end
          308  +    f.close
          309  +    $tbox.configure('state'=>'disabled')
          310  +    $tbox.tag_configure('search', :background=>'yellow')
          311  +    sethighlight
   323    312   end
   324    313   
   325    314   #set highlight color for search term
   326    315   def sethighlight
   327         -	$tbox.configure('state'=>'normal')
   328         -	$tbox.tag_remove('search', '0.0', 'end')
   329         -	return if $searchterm == ""
   330         -	cur = '1.0'
   331         -	loop {
   332         -		cur, len = $tbox.search_with_length("#{$searchterm}", cur, 'end')
   333         -		break if cur == ""
   334         -		$tbox.tag_add('search', cur, "#{cur} + #{len} char")
   335         -		cur = $tbox.index("#{cur} + #{len} char")
   336         -	}
   337         -	$tbox.configure('state'=>'disabled')
          316  +    $tbox.configure('state'=>'normal')
          317  +    $tbox.tag_remove('search', '0.0', 'end')
          318  +    return if $searchterm == ""
          319  +    cur = '1.0'
          320  +    loop {
          321  +        cur, len = $tbox.search_with_length("#{$searchterm}", cur, 'end')
          322  +        break if cur == ""
          323  +        $tbox.tag_add('search', cur, "#{cur} + #{len} char")
          324  +        cur = $tbox.index("#{cur} + #{len} char")
          325  +    }
          326  +    $tbox.configure('state'=>'disabled')
   338    327   end
   339    328   
   340    329   #about window for app
   341    330   def aboutWindow
   342         -	Tk::messageBox :type => 'ok',
   343         -	:message => 'Stringscan: Text Search Tool',
   344         -	:icon => 'info', :title => 'About Stringscan',
   345         -	:detail  => "Version 1.1\n(c) 2017 WordTech Communications LLC",
   346         -	:parent => $root
          331  +    Tk::messageBox :type => 'ok',
          332  +    :message => 'Stringscan: Text Search Tool',
          333  +    :icon => 'info', :title => 'About Stringscan',
          334  +    :detail  => "Version 1.1\n(c) 2017 WordTech Communications LLC",
          335  +    :parent => $root
   347    336   end
   348    337   
   349    338   #check version of installed software
   350    339   def checkUpdate 
   351         -	Tk.tk_call('softwareupdate::setIcon', $icon)
   352         -	Tk.tk_call('softwareupdate::checkVersion', $appname, $appversion)
          340  +    Tk.tk_call('softwareupdate::setIcon', $icon)
          341  +    Tk.tk_call('softwareupdate::checkVersion', $appname, $appversion)
   353    342   end
   354    343   
   355    344   #check version of installed software
   356    345   def getReg
   357         -	Tk.tk_call('regproc::getReg')
          346  +    Tk.tk_call('regproc::getReg')
   358    347   end
   359    348   
   360    349   #user help
   361    350   def showHelp
   362         -	Tk.tk_call('machelp::userhelp')
          351  +    Tk.tk_call('machelp::userhelp')
   363    352   end
   364         - 
   365         -          
   366    353   #end of app class
   367    354   end
   368    355   
   369    356   #run app
   370    357   app = StringscanApp.new
   371    358   Tk.mainloop
   372    359