From: Adam Dickmeiss Date: Mon, 12 Jun 1995 15:18:10 +0000 (+0000) Subject: Work on presentation formats. These are used in the main window as well X-Git-Tag: IRTCL.1.4~280 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;ds=sidebyside;h=a9e94b1c52d13b2a95330b3df5c009b767ebcb36;p=ir-tcl-moved-to-github.git Work on presentation formats. These are used in the main window as well as popup windows. --- 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]