Work on presentation formats. These are used in the main window as well
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 12 Jun 1995 15:18:10 +0000 (15:18 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 12 Jun 1995 15:18:10 +0000 (15:18 +0000)
as popup windows.

formats/line.tcl [new file with mode: 0644]
formats/medium.tcl
formats/raw.tcl

diff --git a/formats/line.tcl b/formats/line.tcl
new file mode 100644 (file)
index 0000000..d82e812
--- /dev/null
@@ -0,0 +1,37 @@
+# IR toolkit for tcl/tk
+# (c) Index Data 1995
+# See the file LICENSE for details.
+# Sebastian Hammer, Adam Dickmeiss
+#
+# $Log: line.tcl,v $
+# Revision 1.1  1995-06-12 15:18:10  adam
+# Work on presentation formats. These are used in the main window as well
+# as popup windows.
+#
+#
+
+proc display-line {sno no w hflag} {
+    set type [z39.$sno type $no]
+    if {! $hflag} {
+        $w delete 0.0 end
+    }
+    if {$type == "DB"} {
+        if {$hflag} {
+            set nostr [format "%5d " $no]
+            insertWithTags $w $nostr marc-tag
+        }
+        set title [lindex [z39.$sno getMarc $no field 245 * a] 0]
+        set year  [lindex [z39.$sno getMarc $no field 260 * c] 0]
+        insertWithTags $w "$title - $year\n" marc-data
+        $w tag bind marc-data 
+    } elseif {$type == "SD"} {
+        set err [lindex [z39.$sno diag $no] 1]
+        set add [lindex [z39.$sno diag $no] 2]
+        if {$add != {}} {
+            set add " :${add}"
+        }
+        $w insert end "Error ${err}${add}\n"
+    } elseif {$type == ""} {
+        return
+    }
+}
index 83d9244..2e2b68e 100644 (file)
@@ -1,6 +1,21 @@
+# IR toolkit for tcl/tk
+# (c) Index Data 1995
+# See the file LICENSE for details.
+# Sebastian Hammer, Adam Dickmeiss
+#
+# $Log: medium.tcl,v $
+# Revision 1.2  1995-06-12 15:18:10  adam
+# Work on presentation formats. These are used in the main window as well
+# as popup windows.
+#
+#
 
-proc display-nice {sno no w} {
-    $w delete 0.0 end
+proc display-medium {sno no w hflag} {
+    if {$hflag} {
+        insertWithTags $w "\n$no\n" marc-data
+    } else {
+        $w delete 0.0 end
+    }
     set i [z39.$sno getMarc $no field 245 * a]
     if {$i != ""} {
         set i [lindex $i 0]
index ec0e710..29534db 100644 (file)
@@ -1,6 +1,21 @@
+# IR toolkit for tcl/tk
+# (c) Index Data 1995
+# See the file LICENSE for details.
+# Sebastian Hammer, Adam Dickmeiss
+#
+# $Log: raw.tcl,v $
+# Revision 1.2  1995-06-12 15:18:10  adam
+# Work on presentation formats. These are used in the main window as well
+# as popup windows.
+#
+#
 
-proc display-raw {sno no w} {
-    $w delete 0.0 end
+proc display-raw {sno no w hflag} {
+    if {$hflag} {
+        insertWithTags $w "\n$no\n" {}
+    } else {
+        $w delete 0.0 end
+    }
     set r [z39.$sno getMarc $no list * * *]
     foreach line $r {
         set tag [lindex $line 0]