From a9e94b1c52d13b2a95330b3df5c009b767ebcb36 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 12 Jun 1995 15:18:10 +0000 Subject: [PATCH] Work on presentation formats. These are used in the main window as well as popup windows. --- formats/line.tcl | 37 +++++++++++++++++++++++++++++++++++++ formats/medium.tcl | 19 +++++++++++++++++-- formats/raw.tcl | 19 +++++++++++++++++-- 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 formats/line.tcl diff --git a/formats/line.tcl b/formats/line.tcl new file mode 100644 index 0000000..d82e812 --- /dev/null +++ b/formats/line.tcl @@ -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 + } +} diff --git a/formats/medium.tcl b/formats/medium.tcl index 83d9244..2e2b68e 100644 --- a/formats/medium.tcl +++ b/formats/medium.tcl @@ -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] diff --git a/formats/raw.tcl b/formats/raw.tcl index ec0e710..29534db 100644 --- a/formats/raw.tcl +++ b/formats/raw.tcl @@ -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] -- 1.7.10.4