Book logo mirrored.
[ir-tcl-moved-to-github.git] / client.tcl
index a207c34..5f7fb28 100644 (file)
@@ -4,7 +4,13 @@
 # Sebastian Hammer, Adam Dickmeiss
 #
 # $Log: client.tcl,v $
-# Revision 1.42  1995-06-16 12:28:13  adam
+# Revision 1.44  1995-06-16 14:55:18  adam
+# Book logo mirrored.
+#
+# Revision 1.43  1995/06/16  14:41:05  adam
+# Scan line entries can be copied to a search entry.
+#
+# Revision 1.42  1995/06/16  12:28:13  adam
 # Implemented preferredRecordSyntax.
 # Minor changes in diagnostic handling.
 # Record list deleted when connection closes.
@@ -337,12 +343,12 @@ proc show-target {target} {
 proc show-logo {v1} {
     global busy
     if {$busy != 0} {
-        incr v1 -1
-        if {$v1==0} {
-            set v1 9
+        incr v1
+        if {$v1==10} {
+            set v1 1
         }
         .bot.logo configure -bitmap @book${v1}
-        after 140 [list show-logo $v1]
+        after 120 [list show-logo $v1]
         return
     }
     while {1} {
@@ -481,12 +487,12 @@ proc about-origin-logo {n} {
     if {![winfo exists $w]} {
         return
     }
-    incr n -1
-    if {$n==0} {
-        set n 9
+    incr n
+    if {$n==10} {
+        set n 1
     }
     $w.top.a.logo configure -bitmap @book$n
-    after 140 [list about-origin-logo $n]
+    after 120 [list about-origin-logo $n]
 }
 
 proc about-origin {} {
@@ -848,6 +854,14 @@ proc search-request {} {
     show-status {Searching} 1 0
 }
 
+proc scan-copy {y entry} {
+    set w .scan-window
+    set no [$w.top.list nearest $y]
+    puts "no=$no"
+    .lines.$entry.e delete 0 end
+    .lines.$entry.e insert 0 [string range [$w.top.list get $no] 8 end]
+}
+
 proc scan-request {} {
     set w .scan-window
 
@@ -899,6 +913,7 @@ proc scan-request {} {
         bind $w.top.list <Up> [list scan-up $attr]
         bind $w.top.list <Down> [list scan-down $attr]
     }
+    bind $w.top.list <Double-Button-1> [list scan-copy %y $curIndexEntry]
     wm title $w "Scan $title"
         
     z39 callback [list scan-response $attr 0 35]
@@ -2396,7 +2411,26 @@ proc index-query {} {
         if {$term != ""} {
             set attr [lrange [lindex $queryInfoFind [lindex $b 1]] 1 end]
 
+            set len [string length $term]
+            incr len -1
+            set left 0
+            set right 0
+            if {[string index $term $len] == "?"} {
+                set right 1
+                set term [string range $term 0 [expr $len - 1]]
+            }
+            if {[string index $term 0] == "?"} {
+                set left 1
+                set term [string range $term 1 end]
+            }
             set term "\{${term}\}"
+            if {$right && $left} {
+                set term "@attr 5=3 ${term}"
+            } elseif {$right} {
+                set term "@attr 5=1 ${term}"
+            } elseif {$left} {
+                set term "@attr 5=2 ${term}"
+            }
             foreach a $attr {
                 set term "@attr $a ${term}"
             }